Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Overholt2010-05-12 20:57:19 +0000
committerAndrew Overholt2010-05-12 20:57:19 +0000
commit3a08332a11441e9fb064a13f5bfce17e6060b843 (patch)
tree6e5728959bc5b7d3acf095d54ad5e4137ba0ca85
parente1a585a89c0fab0d0bdee466bc1c1145db928716 (diff)
downloadorg.eclipse.linuxtools-3a08332a11441e9fb064a13f5bfce17e6060b843.tar.gz
org.eclipse.linuxtools-3a08332a11441e9fb064a13f5bfce17e6060b843.tar.xz
org.eclipse.linuxtools-3a08332a11441e9fb064a13f5bfce17e6060b843.zip
Tag 0.5.1
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/.classpath7
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/.project28
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/ChangeLog157
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/META-INF/MANIFEST.MF11
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/about.html33
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/build-helper.xml136
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/build.properties12
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/cheatsheets/autotools.xml108
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/doc/notices.html22
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/extract-markup.xsl9
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/plugin.properties12
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/plugin.xml25
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/src/org/eclipse/linuxtools/internal/cdt/autotools/doc/anttask/MediaWikiImageFetcher.java150
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/src/org/eclipse/linuxtools/internal/cdt/autotools/doc/anttask/tasks.properties1
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/toc.xml11
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/Autotools Plugin-in User Guide-toc.xml12
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/Autotools Plugin-in User Guide.html61
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/Building.html112
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/Configuration.html125
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/Creating-an-Autotools-Project.html87
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/Invoking-Autotools.html121
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/Make-Targets.html102
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/Special-Editors.html78
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/Supported-Environments.html60
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/Updating-This-Document.html54
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtool-AutotoolsMakeTargetsMenu.pngbin0 -> 102235 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsAclocal.pngbin0 -> 23927 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsAutoconfEditor.pngbin0 -> 138864 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsAutoconfEditorPrefs.pngbin0 -> 44442 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsAutoheader.pngbin0 -> 19658 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsAutomake.pngbin0 -> 28010 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsAutomakeEditor.pngbin0 -> 117419 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsAutoreconf.pngbin0 -> 19100 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsAutotools.pngbin0 -> 57177 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsAutotoolsConsole.pngbin0 -> 83321 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsBuildLocation.pngbin0 -> 92584 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsBuilders.pngbin0 -> 55700 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsCProjectWizard.pngbin0 -> 63270 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsCheckout.pngbin0 -> 67446 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsConfsettings.pngbin0 -> 42694 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsConsolePrefs.pngbin0 -> 68815 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsConsoleSelect.pngbin0 -> 102597 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsConvAutotoolsWizard.pngbin0 -> 60383 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsConvertWizard.pngbin0 -> 69004 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsCreateConf.pngbin0 -> 53458 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsEditorsTab.pngbin0 -> 52209 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsLibtoolize.pngbin0 -> 19291 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsMakeTargetBuild.pngbin0 -> 36302 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsMakeTargetCreate.pngbin0 -> 38730 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsMakeTargetEdit.pngbin0 -> 39725 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsManageConfs.pngbin0 -> 23339 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsNewOther.pngbin0 -> 42608 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsToolSettings.pngbin0 -> 54115 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-feature/.project17
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-feature/ChangeLog96
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-feature/about.html33
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-feature/build.properties4
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-feature/epl-v10.html320
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-feature/feature.properties112
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-feature/feature.xml74
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/.classpath7
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/.cvsignore4
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/.project28
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/.settings/org.eclipse.jdt.ui.prefs3
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/ChangeLog4082
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/META-INF/MANIFEST.MF32
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/about.html33
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/build.properties7
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/html/maintopic.html13
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/html/subtopic.html13
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/html/toc.html13
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/plugin.properties177
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/plugin.xml517
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/cdt/autotools/core/AutotoolsNewProjectNature.java219
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/cdt/autotools/core/AutotoolsPlugin.java291
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/cdt/autotools/core/Resources.properties106
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/AutotoolsConfigurationBuilder.java159
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/AutotoolsNewMakeGenerator.java1273
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/AutotoolsPropertyConstants.java52
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/DefaultNoDependencyCalculator.java51
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/IConfigurationCloneListener.java12
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/MakeMessages.java57
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/MarkerGenerator.java155
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/AbstractConfigurationOption.java65
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/AutotoolsConfiguration.java320
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/AutotoolsConfigurationManager.java486
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/AutotoolsOptionValueHandler.java124
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/BinConfigureOption.java62
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/ConfigureMessages.java60
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/ConfigureMessages.properties91
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/ConfigureOptionCategory.java70
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/ConfigureTool.java64
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/IAConfiguration.java30
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/IConfigureOption.java35
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/InternalConfigureOption.java59
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/MultiArgConfigureOption.java119
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/StringConfigureOption.java62
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/wizards/NewAutotoolsProject.java143
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/.classpath7
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/.project28
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/.settings/org.eclipse.jdt.ui.prefs3
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/ChangeLog242
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/META-INF/MANIFEST.MF25
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/about.html33
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/build.properties7
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/plugin.properties12
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/AllAutotoolsTests.java30
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/AutotoolsProjectNatureTest.java27
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/AutotoolsProjectTest0.java68
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/AutotoolsProjectTest1.java71
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/AutotoolsProjectTest2.java85
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/AutotoolsTestsPlugin.java103
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/CoreUtility.java108
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/ProjectTools.java418
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/Resources.properties2
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/autoconf/AutoconfTests.java29
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/autoconf/BaseParserTest.java268
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/autoconf/TestMacroParser.java266
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/autoconf/TestShellParser.java437
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/autoconf/TestTokenizer.java486
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/editors/AutomakeColourizationTests.java215
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/editors/AutomakeEditorTests.java57
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/editors/AutomakeTextHoverTest.java210
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/editors/EditorTests.java29
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/test.xml75
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/zip/project1.zipbin0 -> 95370 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/zip/project2.zipbin0 -> 95172 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui.tests/.classpath7
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui.tests/.project28
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui.tests/.settings/org.eclipse.jdt.core.prefs8
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui.tests/ChangeLog60
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui.tests/META-INF/MANIFEST.MF30
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui.tests/build.properties9
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui.tests/plugin.properties12
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui.tests/src/org/eclipse/linuxtools/cdt/autotools/ui/tests/Activator.java60
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui.tests/src/org/eclipse/linuxtools/cdt/autotools/ui/tests/AllTests.java23
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui.tests/src/org/eclipse/linuxtools/cdt/autotools/ui/tests/SetConfigurationParameter.java515
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui.tests/src/org/eclipse/linuxtools/cdt/autotools/ui/tests/TestToolActions.java449
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/.classpath7
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/.project28
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/.settings/org.eclipse.jdt.core.prefs8
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/ChangeLog543
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/META-INF/MANIFEST.MF38
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/build.properties8
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/ac16/acmacro_arg_obj.gifbin0 -> 362 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/ac16/acmacro_obj.gifbin0 -> 161 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/ac16/ammacro_obj.gifbin0 -> 206 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/ac16/case_obj.gifbin0 -> 223 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/ac16/condition_obj.gifbin0 -> 69 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/ac16/convert_normal.gifbin0 -> 618 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/ac16/elif_obj.gifbin0 -> 588 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/ac16/else_obj.gifbin0 -> 361 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/ac16/for_obj.gifbin0 -> 183 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/ac16/if_obj.gifbin0 -> 618 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/ac16/while_obj.gifbin0 -> 117 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/autoconf.gifbin0 -> 1053 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/automake.gifbin0 -> 1050 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dlcl16/build_configs.gifbin0 -> 544 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dlcl16/config_category.gifbin0 -> 576 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dlcl16/config_tool.gifbin0 -> 353 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dlcl16/newc_app.gifbin0 -> 572 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dlcl16/newcc_app.gifbin0 -> 586 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dlcl16/open_include.gifbin0 -> 353 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dtool16/alphab_sort_co.gifbin0 -> 137 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dtool16/build_menu.gifbin0 -> 231 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dtool16/convert-normal.gifbin0 -> 572 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dtool16/make.gifbin0 -> 355 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dtool16/makefile.gifbin0 -> 352 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dtool16/newc_app.gifbin0 -> 572 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dtool16/newcc_app.gifbin0 -> 586 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dtool16/segment_edit.gifbin0 -> 563 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dtool16/target_add.gifbin0 -> 561 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dtool16/target_build.gifbin0 -> 571 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dtool16/target_delete.gifbin0 -> 572 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dtool16/target_edit.gifbin0 -> 568 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dtool16/update_old.gifbin0 -> 315 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/elcl16/build_configs.gifbin0 -> 565 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/elcl16/config_category.gifbin0 -> 599 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/elcl16/config_tool.gifbin0 -> 368 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/elcl16/newc_app.gifbin0 -> 612 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/elcl16/newcc_app.gifbin0 -> 630 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/elcl16/open_include.gifbin0 -> 353 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/etool16/alphab_sort_co.gifbin0 -> 157 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/etool16/build_menu.gifbin0 -> 236 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/etool16/convert_normal.gifbin0 -> 618 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/etool16/make.gifbin0 -> 374 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/etool16/makefile.gifbin0 -> 367 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/etool16/newc_app.gifbin0 -> 612 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/etool16/newcc_app.gifbin0 -> 630 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/etool16/segment_edit.gifbin0 -> 590 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/etool16/target_add.gifbin0 -> 580 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/etool16/target_build.gifbin0 -> 592 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/etool16/target_delete.gifbin0 -> 596 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/etool16/target_edit.gifbin0 -> 590 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/etool16/target_filter.gifbin0 -> 345 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/etool16/update_old.gifbin0 -> 332 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/acmacro_obj.gifbin0 -> 1053 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/command_obj.gifbin0 -> 527 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/define_obj.gifbin0 -> 154 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/environment_obj.gifbin0 -> 615 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/envvar_obj.gifbin0 -> 207 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/error_obj.gifbin0 -> 339 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/fatalerror_obj.gifbin0 -> 333 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/hfolder_obj.gifbin0 -> 579 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/include_obj.gifbin0 -> 324 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/info_obj.gifbin0 -> 120 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/irule_obj.gifbin0 -> 79 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/lib_obj.gifbin0 -> 338 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/macro_obj.gifbin0 -> 359 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/relation_obj.gifbin0 -> 215 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/target_obj.gifbin0 -> 374 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/trule_obj.gifbin0 -> 205 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/warning_obj.gifbin0 -> 337 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/sample.gifbin0 -> 983 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/plugin.properties174
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/plugin.xml740
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/AutotoolsUIPlugin.java257
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/Resources.properties105
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfAnnotationHover.java202
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfCodeScanner.java256
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfDocumentProvider.java42
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfDocumentSetupParticipant.java52
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfEditor.java787
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfEditorMacroValidator.java101
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfEditorMessages.java117
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfEditorMessages.properties47
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfErrorHandler.java213
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfIdentifierRule.java56
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfKeywordDetector.java32
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfM4WordDetector.java28
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacro.java37
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroCodeScanner.java277
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroContentAssistProcessor.java120
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroDamagerRepairer.java59
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroParameterListValidator.java215
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroPartitionRule.java148
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroProposalContextInformation.java104
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroRule.java88
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroWordDetector.java26
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfPKGWordDetector.java26
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfPartitionScanner.java57
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfPartitioner.java64
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfReconcilingStrategy.java57
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfSourceViewerConfiguration.java119
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfWhitespaceDetector.java20
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfWordDetector.java34
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/IAutotoolEditorActionDefinitionIds.java17
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/IAutotoolHelpContextIds.java20
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/IAutotoolsEditor.java18
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/InlineDataRule.java165
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/MultilineRuleDamagerRepairer.java44
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/ParseException.java60
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/RecursiveSingleLineRule.java196
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/RestrictedEndOfLineRule.java130
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/outline/AutoconfContentOutlinePage.java128
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/outline/AutoconfContentProvider.java94
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/outline/AutoconfLabelProvider.java100
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfCaseConditionElement.java22
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfCaseElement.java18
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfElement.java138
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfElifElement.java18
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfElseElement.java18
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfForElement.java18
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfIfElement.java18
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfMacroArgumentElement.java32
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfMacroDetector.java31
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfMacroElement.java39
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfOutlineErrorHandler.java136
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfParser.java1042
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfRootElement.java18
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfSelectElement.java18
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfTokenizer.java435
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfUntilElement.java18
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfWhileElement.java18
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/IAutoconfErrorHandler.java28
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/IAutoconfMacroDetector.java30
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/IAutoconfMacroValidator.java28
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/IMacroDetector.java22
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/ITokenConstants.java87
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/ParseException.java72
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/Token.java84
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/AbstractAutotoolsCPropertyTab.java22
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/AutotoolsConsole.java27
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/AutotoolsUIPluginImages.java133
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/CBuildStepsConsole.java27
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/CConfigureConsole.java26
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/CWordFinder.java283
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/Console.java57
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/ConsoleMessages.java32
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/ConsoleMessages.properties25
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/ErrorParserBlock.java119
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/FileRelevance.java67
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/HTML2TextReader.java260
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/HTMLPrinter.java116
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/HTMLTextPresenter.java190
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/LineBreakingReader.java111
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/LocationAdapter.java97
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/MakeUIImages.java140
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/MakeUIMessages.java40
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/MakeUIMessages.properties283
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/MessageLine.java75
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/OptionalMessageDialog.java144
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/ResourceLookup.java159
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/ResourceLookupTree.java861
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/SingleCharReader.java62
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/SubstitutionTextReader.java138
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/AbstractAutotoolsHandler.java57
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/AbstractTargetAction.java92
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/AclocalHandler.java37
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/AutoconfHandler.java33
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/AutoheaderHandler.java37
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/AutomakeHandler.java33
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/AutoreconfHandler.java37
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeAclocalAction.java104
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeAction.java442
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeAutoconfAction.java57
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeAutoheaderAction.java79
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeAutomakeAction.java98
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeAutoreconfAction.java78
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeLibtoolizeAction.java78
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeMessages.java53
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeMessages.properties56
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/LibtoolizeHandler.java37
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/ReconfigureAction.java77
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/ReconfigureHandler.java37
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/SingleInputDialog.java63
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/TwoInputDialog.java111
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/autoconf/ProjectionFileUpdater.java424
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AbstractElementListSelectionDialog.java283
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AbstractMakefile.java294
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AbstractMakefileCodeScanner.java172
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AddBuildTargetAction.java155
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ArchiveTarget.java33
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutoconfSubstRule.java92
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeCompletionProcessor.java241
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeConfigMacro.java31
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeDocumentProvider.java121
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeEditor.java132
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeEditorFactory.java60
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeErrorHandler.java229
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeIfElse.java42
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeMacroDefinitionRule.java206
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeMacroReferenceRule.java70
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeTextHover.java187
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeWordDetector.java27
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Automakefile.java57
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakefileCodeScanner.java150
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakefileContentOutlinePage.java322
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakefileReconcilingStrategy.java108
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakefileSourceConfiguration.java148
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakefileUtil.java43
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/BadDirective.java28
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Command.java115
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Comment.java37
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/CompletionProposalComparator.java35
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Conditional.java170
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/DefaultRule.java26
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/DefineVariable.java31
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/DeleteOnErrorRule.java28
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Directive.java100
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/EditorUtility.java561
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ElementListSelectionDialog.java120
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Else.java69
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/EmptyLine.java32
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Endef.java27
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Endif.java27
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ExportAllVariablesRule.java26
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ExportVariable.java23
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ExternalEditorInput.java169
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ExternalEditorInputFactory.java92
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/GNUAutomakefile.java948
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/GNUMakefileConstants.java44
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/GNUMakefileUtil.java233
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/GNUTargetRule.java66
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/GNUVariableDef.java132
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/IAutomakeConditional.java19
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/IMakefileDocumentProvider.java35
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/IMakefileEditorActionDefinitionIds.java26
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/IReconcilingParticipant.java24
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ISelectionValidator.java16
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ITranslationUnitEditorInput.java25
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/If.java79
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Ifdef.java35
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Ifeq.java30
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Ifndef.java35
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Ifneq.java30
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/IgnoreRule.java27
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Include.java67
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/InferenceRule.java42
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/IntermediateRule.java27
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/LexicalSortingAction.java89
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/LowResolutionTimeRule.java28
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MacroDefinition.java112
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MacroDefinitionRule.java164
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MacroReferenceRule.java67
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakeFileConstants.java24
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakeFileMessages.properties27
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileAnnotationHover.java73
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileCodeScanner.java114
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileCompletionProcessor.java242
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileContentOutlinePage.java335
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileDocumentProvider.java148
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileDocumentSetupParticipant.java50
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileEditor.java462
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileEditorActionContributor.java111
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileEditorPreferenceConstants.java66
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileEditorTogglePresentationAction.java52
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileMessages.java54
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefilePartitionScanner.java96
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileReader.java86
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileReconcilingStrategy.java104
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileSourceConfiguration.java191
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileStorageDocumentProvider.java47
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileTextHover.java105
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileWordDetector.java34
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MessageLine.java132
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/NotParallelRule.java30
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/NullMakefile.java69
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/OpenDeclarationAction.java130
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/OpenIncludeAction.java303
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/OverrideDefine.java32
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/OverrideVariable.java24
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Parent.java75
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/PhonyRule.java28
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/PosixMakefileUtil.java159
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/PosixRule.java25
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/PreciousRule.java26
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ProjectionMakefileUpdater.java397
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Rule.java57
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/SccsGetRule.java28
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/SecondaryRule.java30
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/SelectionList.java252
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/SelectionStatusDialog.java195
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/SilentRule.java27
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/SpecialRule.java47
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/StaticTargetRule.java72
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/StatusInfo.java148
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/StatusTool.java77
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/StringMatcher.java389
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/SuffixesRule.java27
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Target.java36
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/TargetRule.java75
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/TargetVariable.java33
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Terminal.java32
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/TwoArrayQuickSort.java74
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/UnExport.java34
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Util.java86
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/VPath.java44
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/VariableDefinition.java131
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/WordPartDetector.java99
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/WorkingCopyManager.java106
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/AbstractEditorPreferencePage.java328
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/AutoconfEditorPreferencePage.java591
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/AutomakeEditorPreferencePage.java468
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/AutotoolsEditorPreferenceConstants.java76
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/AutotoolsPreferencePage.java61
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/AutotoolsPreferencesMessages.java40
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/AutotoolsPreferencesMessages.properties108
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/ColorEditor.java122
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/ColorManager.java91
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/OverlayPreferenceStore.java455
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/StatusInfo.java173
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/TabFolderLayout.java54
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AbstractConfigurePropertyOptionsPage.java69
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsBuildPropertyPage.java241
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsCategoryPropertyOptionPage.java139
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsConfigurePrefStore.java283
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsConfigurePropertyPage.java59
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsConfigurePropertyTab.java390
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsEditorPropertyTab.java276
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsGeneralPropertyPage.java15
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsHeadPropertyPage.java15
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsPropertyManager.java61
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsPropertyMessages.java40
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsPropertyMessages.properties44
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsToolPropertyOptionPage.java142
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsToolsPropertyTab.java346
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/IProjectPropertyListener.java25
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/IPropertyChangeManager.java40
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/ToolListContentProvider.java71
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/ToolListElement.java57
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/ToolListLabelProvider.java92
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/text/hover/AutoconfPrototype.java82
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/text/hover/AutoconfTextHover.java596
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/text/hover/HoverMessages.java91
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/text/hover/HoverMessages.properties11
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/AutotoolsBuildWizard.java86
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/AutotoolsBuildWizardHandler.java42
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/AutotoolsNewCCProjectWizardV2.java340
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/AutotoolsNewCProjectWizardV2.java340
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/AutotoolsWizardMessages.java56
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/AutotoolsWizardMessages.properties364
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/CProjectPlatformPage.java319
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/ConfigurationContentProvider.java33
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/ConfigurationLabelProvider.java43
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/ConvertToAutotoolsProjectWizard.java218
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/ConvertToAutotoolsProjectWizardPage.java224
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/ManagedProjectOptionBlock.java80
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/NewAutotoolsProjectOptionPage.java156
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/EmptyProject/template.properties14
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/EmptyProject/template.xml14
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCAutotoolsProject/src/AUTHORS1
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCAutotoolsProject/src/Basename.c17
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCAutotoolsProject/src/COPYING1
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCAutotoolsProject/src/ChangeLog0
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCAutotoolsProject/src/Makefile.am.src3
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCAutotoolsProject/src/Makefile.am.top1
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCAutotoolsProject/src/NEWS1
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCAutotoolsProject/src/README1
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCAutotoolsProject/src/configure.ac.top14
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCAutotoolsProject/template.properties30
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCAutotoolsProject/template.xml105
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/AUTHORS1
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/Basename.cpp18
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/COPYING1
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/ChangeLog0
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/Makefile.am.src3
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/Makefile.am.top1
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/NEWS1
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/README1
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/configure.ac.top14
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCPPAutotoolsProject/template.properties30
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCPPAutotoolsProject/template.xml105
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/.classpath7
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/.cvsignore4
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/.project28
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/.settings/org.eclipse.jdt.ui.prefs3
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/ChangeLog4046
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/META-INF/MANIFEST.MF34
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/about.html33
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/build.properties8
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/icons/autoconf.gifbin0 -> 1053 bytes
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/plugin.properties170
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/plugin.xml1031
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/AutotoolsBuilder.java79
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/AutotoolsDefaultBuildDirHandler.java155
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/AutotoolsMakefileBuilder.java512
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/AutotoolsPlugin.java324
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/AutotoolsProjectNature.java175
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/AutotoolsProjectPropertyTester.java31
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/AutotoolsScannerInfo.java431
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/AutotoolsScannerInfoProvider.java112
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/MakeGenerator.java1374
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/Resources.properties95
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/AbstractAutotoolsHandler.java57
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/AbstractTargetAction.java93
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/AclocalHandler.java37
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/AutoconfHandler.java33
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/AutoheaderHandler.java37
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/AutomakeHandler.java33
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/AutoreconfHandler.java37
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAclocalAction.java104
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAction.java442
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAutoconfAction.java57
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAutoheaderAction.java79
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAutomakeAction.java98
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAutoreconfAction.java78
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeLibtoolizeAction.java78
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeMessages.java53
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeMessages.properties56
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/LibtoolizeHandler.java37
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/ReconfigureAction.java78
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/ReconfigureHandler.java37
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/SingleInputDialog.java63
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/TwoInputDialog.java111
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfCaseConditionElement.java22
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfCaseElement.java18
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfEditorMessages.java117
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfEditorMessages.properties47
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfElement.java138
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfElifElement.java18
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfElseElement.java18
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfForElement.java18
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfIfElement.java18
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfMacroArgumentElement.java32
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfMacroDetector.java31
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfMacroElement.java39
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfOutlineErrorHandler.java136
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfParser.java1041
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfRootElement.java18
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfSelectElement.java18
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfTokenizer.java434
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfUntilElement.java18
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfWhileElement.java18
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/IAutoconfErrorHandler.java28
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/IAutoconfMacroDetector.java30
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/IAutoconfMacroValidator.java28
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/IMacroDetector.java22
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/ITokenConstants.java87
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/ParseException.java72
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/Token.java84
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsBuildPropertyPage.java243
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsEditorPropertyPage.java278
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsPropertyConstants.java47
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsPropertyManager.java61
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsPropertyMessages.java40
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsPropertyMessages.properties41
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsPropertyPage.java376
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsToolsPropertyPage.java343
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/properties/IProjectPropertyListener.java25
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/properties/IPropertyChangeManager.java40
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/MarkerGenerator.java155
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/AutotoolsConsole.java27
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/CBuildStepsConsole.java27
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/CConfigureConsole.java26
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/CWordFinder.java283
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/Console.java57
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/ConsoleMessages.java32
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/ConsoleMessages.properties25
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/HTMLPrinter.java116
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/LineBreakingReader.java111
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/SingleCharReader.java62
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/SubstitutionTextReader.java138
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/AutotoolsEditorPreferenceConstants.java80
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/OverlayPreferenceStore.java455
-rw-r--r--autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/StatusInfo.java173
619 files changed, 67988 insertions, 0 deletions
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/.classpath b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/.classpath
new file mode 100644
index 0000000000..64c5e31b7a
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/.project b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/.project
new file mode 100644
index 0000000000..76fdbef06b
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.linuxtools.cdt.autotools-docs</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/ChangeLog b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/ChangeLog
new file mode 100644
index 0000000000..c7a15ae01c
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/ChangeLog
@@ -0,0 +1,157 @@
+2010-04-17 Jeff Johnston <jjohnstn@redhat.com>
+
+ * META-INF/MANIFEST.MF: Change J2SE level to 1.5.
+
+2010-04-14 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #309117
+ * .classpath: New file.
+ * build-helper.xml: New file.
+ * doc/notices.html: New file.
+ * extract-markup.xsl: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/doc/anttask/MediaWikiImageFetcher.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/doc/anttask/tasks.properties: New file.
+ * userguide/Autotools\ Plugin-in\ User\ Guide-toc.xml: New file.
+ * userguide/Autotools\ Plugin-in\ User\ Guide.html: New file.
+ * userguide/Building.html: New file.
+ * userguide/Configuration.html: New file.
+ * userguide/Creating-an-Autotools-Project.html: New file.
+ * userguide/images/Linuxtool-AutotoolsMakeTargetsMenu.png: New file.
+ * userguide/images/Linuxtools-AutotoolsAclocal.png: New file.
+ * userguide/images/Linuxtools-AutotoolsAutoconfEditor.png: New file.
+ * userguide/images/Linuxtools-AutotoolsAutoconfEditorPrefs.png: New file.
+ * userguide/images/Linuxtools-AutotoolsAutoheader.png: New file.
+ * userguide/images/Linuxtools-AutotoolsAutomake.png: New file.
+ * userguide/images/Linuxtools-AutotoolsAutomakeEditor.png: New file.
+ * userguide/images/Linuxtools-AutotoolsAutoreconf.png: New file.
+ * userguide/images/Linuxtools-AutotoolsAutotools.png: New file.
+ * userguide/images/Linuxtools-AutotoolsAutotoolsConsole.png: New file.
+ * userguide/images/Linuxtools-AutotoolsBuilders.png: New file.
+ * userguide/images/Linuxtools-AutotoolsBuildLocation.png: New file.
+ * userguide/images/Linuxtools-AutotoolsCheckout.png: New file.
+ * userguide/images/Linuxtools-AutotoolsConfsettings.png: New file.
+ * userguide/images/Linuxtools-AutotoolsConsolePrefs.png: New file.
+ * userguide/images/Linuxtools-AutotoolsConsoleSelect.png: New file.
+ * userguide/images/Linuxtools-AutotoolsConvAutotoolsWizard.png: New file.
+ * userguide/images/Linuxtools-AutotoolsConvertWizard.png: New file.
+ * userguide/images/Linuxtools-AutotoolsCProjectWizard.png: New file.
+ * userguide/images/Linuxtools-AutotoolsCreateConf.png: New file.
+ * userguide/images/Linuxtools-AutotoolsEditorsTab.png: New file.
+ * userguide/images/Linuxtools-AutotoolsLibtoolize.png: New file.
+ * userguide/images/Linuxtools-AutotoolsMakeTargetBuild.png: New file.
+ * userguide/images/Linuxtools-AutotoolsMakeTargetCreate.png: New file.
+ * userguide/images/Linuxtools-AutotoolsMakeTargetEdit.png: New file.
+ * userguide/images/Linuxtools-AutotoolsManageConfs.png: New file.
+ * userguide/images/Linuxtools-AutotoolsNewOther.png: New file.
+ * userguide/images/Linuxtools-AutotoolsToolSettings.png: New file.
+ * userguide/Invoking-Autotools.html: New file.
+ * userguide/Make-Targets.html: New file.
+ * userguide/Special-Editors.html: New file.
+ * userguide/Supported-Environments.html: New file.
+ * userguide/Updating-This-Document.html: New file.
+ * .project: Change to be Java project.
+ * build.properties: Add new binary files.
+ * META-INF/MANIFEST.MF: Dependency added.
+ * plugin.xml: Add additional toc for Autotools User Guide.
+
+2009-11-16 Andrew Overholt <overholt@redhat.com>
+
+ * plugin.properties: Fix bundle name. Fix provider.
+
+2009-10-20 Jeff Johnston <jjohnstn@redhat.com>
+
+ * cheatsheets/autotools.xml: Revised for Autotools rewrite.
+
+2009-10-13 Jeff Johnston <jjohnstn@redhat.com>
+
+ * build.properties: Add build.properties to bin list.
+ * META-INF/MANIFEST.MF: Bump up version to 2.0.0.
+
+2009-01-15 Jeff Johnston <jjohnstn@redhat.com>
+
+ * META-INF/MANIFEST.MF: Add .qualifier to id.
+
+2008-11-03 Jeff Johnston <jjohnstn@redhat.com>
+
+ * build.properties: Add cheatsheets directory to binary list and remove
+ doc.zip which no longer exists in project.
+
+2008-10-31 Andrew Overholt <overholt@redhat.com>
+
+ * META-INF/MANIFEST.MF: Use translated BundleName and provider. Add
+ "(Incubation)".
+ * plugin.properties: Initial import.
+
+2008-10-01 Jeff Johnston <jjohnstn@redhat.com>
+
+ * toc.xml: Add anchor id so other gnu tools can be added to Gnu Tools list.
+
+2008-09-19 Jeff Johnston <jjohnstn@redhat.com>
+
+ * META-INF/MANIFEST.MF: Update version number to 1.0.0.
+
+2008-09-16 Jeff Johnston <jjohnstn@redhat.com>
+
+ * toc.xml: Add http references for all of the GNU tools documentation.
+
+2007-10-04 jjohnstn <jjohnstn@vermillion>
+
+ * META-INF/MANIFEST.MF: Update release to 0.0.5.
+ * cheatsheets/autotools.xml: Add sub-step after pushing finish for GNU Autotools
+ project wizard to handle the possibility of the workspace asking to go to the
+ C/C++ perspective. Remove separate "changing to C/C++ perspective" step.
+
+2007-10-03 Jeff Johnston <jjohnstn@redhat.com>
+
+ * cheatsheets/autotools.xml: New File.
+ * plugin.xml: Add cheatsheets extension for autotools project.
+ * META-INF/MANIFEST.MF: Add dependency on org.eclipse.ui.cheatsheets.
+
+2007-08-15 Jeff Johnston <jjohnstn@redhat.com>
+
+ * META-INF/MANIFEST.MF: Change release to 0.0.4 and specify minimum java runtime
+ as 1.4.
+ * build.xml: Removed.
+
+2007-02-02 Andrew Overholt <overholt@redhat.com>
+
+ * toc.xml: Add "and Other" to the toc entry.
+ * doc.zip: Add pkg-config/index.html (created using PolyglotMan
+ <http://polyglotman.sourceforge.net/>).
+
+2007-01-22 Andrew Overholt <overholt@redhat.com>
+
+ * toc.xml: Gnu -> GNU.
+
+2007-01-12 Jeff Johnston <jjohnstn@redhat.com>
+
+ * about.html: New license file.
+
+2006-08-29 Jeff Johnston <jjohnstn@redhat.com>
+
+ * build.xml: Update release to 0.0.3.
+
+2006-07-24 Jeff Johnston <jjohnstn@redhat.com>
+
+ * Manifest.MF: Change release to 0.0.3.
+ * getdocs.sh: Update to current FC6 releases of tools help.
+ * doc.zip: Updated.
+
+2006-07-14 Jeff Johnston <jjohnstn@redhat.com>
+
+ * Manifest.MF: Change release to 0.0.2.
+ * build.properties: Add doc.zip and toc.xml to bin files.
+
+2006-06-08 Jeff Johnston <jjohnstn@redhat.com>
+
+ * plugin.xml: Make provider Red Hat.
+
+2006-04-18 Jeff Johnston <jjohnstn@redhat.com>
+
+ * getdocs.sh: New file to generate doc.zip.
+
+2006-04-18 Jeff Johnston <jjohnstn@redhat.com>
+
+ * toc.xml: New file.
+ * doc.zip: Ditto.
+ * plugin.xml: Ditto. \ No newline at end of file
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/META-INF/MANIFEST.MF b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..27ed55b507
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/META-INF/MANIFEST.MF
@@ -0,0 +1,11 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %bundleName
+Bundle-SymbolicName: org.eclipse.linuxtools.cdt.autotools_docs;singleton:=true
+Bundle-Version: 2.0.1.qualifier
+Bundle-Vendor: %provider
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.help,
+ org.eclipse.ui.cheatsheets,
+ org.apache.ant;bundle-version="1.7.1"
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/about.html b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/about.html
new file mode 100644
index 0000000000..44e229003e
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/about.html
@@ -0,0 +1,33 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html>
+<head>
+<title>About</title>
+<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>8th September, 2004</p>
+<h3>License</h3>
+<p>The Eclipse Software Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<h3>Contributions</h3>
+
+<p>If this Content is licensed to you under the terms and conditions of the EPL, any Contributions, as defined in the EPL, uploaded, submitted, or otherwise
+made available to the Eclipse Foundation, its members and/or the host of the Eclipse Foundation web site, by you that relate to such
+Content are provided under the terms and conditions of the <a href="http://www.eclipse.org/legal/termsofuse.html">Terms of Use</a>
+for the Eclipse Foundation web site and can be made available to others under the terms of the licenses as set out in the
+<a href="http://www.eclipse.org/legal/termsofuse.html">Terms of Use</a>.</p>
+
+<p>If this Content is licensed to you under license terms and conditions other than the EPL (&quot;Other License&quot;), any modifications, enhancements and/or
+other code and/or documentation (&quot;Modifications&quot;) uploaded, submitted, or otherwise made available to the Eclipse Foundation, its members and/or the
+host of the Eclipse Foundation web site, 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 <a href="http://www.eclipse.org/legal/termsofuse.html">Terms of Use</a>
+for the Eclipse Foundation web site and such Modifications can be made available to others under the terms of the licenses as set out in the
+<a href="http://www.eclipse.org/legal/termsofuse.html">Terms of Use</a>.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/build-helper.xml b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/build-helper.xml
new file mode 100644
index 0000000000..3a53e29b91
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/build-helper.xml
@@ -0,0 +1,136 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="org.eclipse.linuxtools.autotools.docs" default="all">
+ <description>
+ Generate Eclipse help content for the Linux Tools autotools user guide
+ </description>
+
+ <property name="autotools.help.doc.url.base" value="http://wiki.eclipse.org"/>
+ <property name="autotools.wiki.url.base" value="${autotools.help.doc.url.base}/Linux_Tools_Project/Autotools"/>
+ <property name="imageFolder" value="images"/>
+
+ <path id="tasks.classpath" path="bin"/>
+ <path id="wikitext.tasks.classpath">
+ <pathelement location="../org.eclipse.mylyn.wikitext.core/@dot"/>
+ <pathelement location="../org.eclipse.mylyn.wikitext.core/bin"/>
+ <pathelement location="../org.eclipse.mylyn.wikitext.mediawiki.core/@dot"/>
+ <pathelement location="../org.eclipse.mylyn.wikitext.mediawiki.core/bin"/>
+ </path>
+
+ <taskdef classpathref="tasks.classpath" resource="org/eclipse/linuxtools/internal/cdt/autotools/doc/anttask/tasks.properties"/>
+ <taskdef classpathref="wikitext.tasks.classpath" resource="org/eclipse/mylyn/wikitext/core/util/anttask/tasks.properties"/>
+
+ <target name="init">
+ <mkdir dir="tmp"/>
+ </target>
+
+ <target name="clean" depends="init">
+ <delete includeemptydirs="true" failonerror="false">
+ <fileset dir="tmp"/>
+ </delete>
+ </target>
+
+ <target name="all" depends="init" description="Generate Eclipse help content for the Linux Tools autotools user guide">
+ <eclipse-wiki-to-help
+ help.doc.filenamenoextension="Autotools Plugin-in User Guide"
+ help.doc.url.base="${autotools.help.doc.url.base}"
+ help.doc.url.html="${autotools.wiki.url.base}/User_Guide"
+ help.doc.url.xml="${autotools.help.doc.url.base}/Special:Export/Linux_Tools_Project/Autotools/User_Guide"
+ help.imagefolder="${imageFolder}"
+ targetfolder="userguide"
+ wiki.url.base="${autotools.help.doc.url.base}/Linux_Tools_Project"/>
+ </target>
+
+ <macrodef name="eclipse-wiki-to-help">
+ <attribute name="help.doc.url.base"/>
+ <attribute name="wiki.url.base"/>
+ <attribute name="help.doc.url.html"/>
+ <attribute name="help.doc.url.xml"/>
+ <attribute name="help.doc.filenameNoExtension"/>
+ <attribute name="help.imageFolder"/>
+ <attribute name="targetFolder"/>
+ <sequential>
+ <get dest="tmp/help.doc.xml" src="@{help.doc.url.xml}"/>
+ <get dest="tmp/help.doc.html" src="@{help.doc.url.html}"/>
+
+ <!--
+ <copy todir="tmp">
+ <fileset dir="images"/>
+ </copy>
+ -->
+ <mediawiki-fetch-images src="tmp/help.doc.html" dest="tmp" base="@{help.doc.url.base}"/>
+
+ <xslt style="extract-markup.xsl" in="tmp/help.doc.xml" out="tmp/@{help.doc.filenameNoExtension}.mediawiki"/>
+ <echo append="true" file="tmp/@{help.doc.filenameNoExtension}.mediawiki">
+
+= Updating This Document =
+
+This document is maintained in a collaborative wiki. If you wish to update or modify this document please visit
+@{help.doc.url.html}
+ </echo>
+
+ <!-- Removing Phoenix extensions -->
+ <replaceregexp match="\{\{\#eclipseproject.*" replace="" flags="g" byline="true">
+ <fileset dir="tmp" includes="**/*.mediawiki"/>
+ </replaceregexp>
+
+ <wikitext-to-eclipse-help markupLanguage="org.eclipse.mylyn.wikitext.mediawiki.core.MediaWikiLanguage"
+ multipleOutputFiles="true"
+ navigationImages="true"
+ helpPrefix="@{targetFolder}"
+ internallinkpattern="@{wiki.url.base}/{0}"
+ validate="true"
+ failonvalidationerror="true"
+ prependImagePrefix="${imageFolder}"
+ formatoutput="true">
+ <fileset dir="tmp" includes="**/*.mediawiki"/>
+ <stylesheet url="book.css"/>
+ </wikitext-to-eclipse-help>
+
+ <mkdir dir="@{targetFolder}/${imageFolder}"/>
+ <copy todir="@{targetFolder}/${imageFolder}" overwrite="true">
+ <fileset dir="tmp">
+ <include name="*.gif"/>
+ <include name="*.png"/>
+ </fileset>
+ </copy>
+ <copy todir="@{targetFolder}" overwrite="true">
+ <fileset dir="tmp">
+ <include name="*.html"/>
+ <include name="*toc.xml"/>
+ <exclude name="help.doc.html"/>
+ </fileset>
+ </copy>
+ <antcall target="test"/>
+ </sequential>
+ </macrodef>
+
+
+ <target name="test" depends="init" description="verify that all of the HTML files are well-formed XML">
+ <echo level="info">
+Validating help content XML and HTML files: The Eclipse help system expects well-formed XML
+
+If validation fails it is because either:
+
+* the userguide source code is poorly formed, or
+* the WikiText MediaWiki parser has a bug
+
+Problems with userguide source are usually caused by improper use of HTML markup in the MediaWiki source,
+or inadvertently starting a line with a space character (in MediaWiki this starts a preformatted block)
+ </echo>
+
+ <!--
+ Don't bother with DTD validation: we only care if the files are well-formed.
+ We therefore provide an empty DTD
+ -->
+ <echo file="tmp/__empty.dtd" message=""/>
+ <xmlvalidate lenient="true">
+ <fileset dir="userguide">
+ <include name="**/*.xml"/>
+ </fileset>
+ <fileset dir="userguide">
+ <include name="**/*.html"/>
+ </fileset>
+ <dtd publicid="-//W3C//DTD XHTML 1.0 Transitional//EN" location="${basedir}/tmp/__empty.dtd"/>
+ </xmlvalidate>
+ </target>
+</project>
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/build.properties b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/build.properties
new file mode 100644
index 0000000000..7f286fb4c3
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/build.properties
@@ -0,0 +1,12 @@
+bin.includes = META-INF/,\
+ plugin.xml,\
+ toc.xml,\
+ cheatsheets/,\
+ about.html,\
+ plugin.properties,\
+ doc/,\
+ userguide/
+jars.compile.order = .
+source.. = src/
+output.. = bin/
+source.. = src/
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/cheatsheets/autotools.xml b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/cheatsheets/autotools.xml
new file mode 100644
index 0000000000..f7d9c001ec
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/cheatsheets/autotools.xml
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<cheatsheet title="GNU Autotools Project">
+ <intro>
+ <description>
+ This cheatsheet will introduce the GNU Autotools plugin by importing an existing project that uses Autotools.
+ </description>
+ </intro>
+ <item title="Check out the test project" dialog="true" skip="false">
+ <description>
+ </description>
+ <subitem label="From the main menu, select File -&gt; Import ... -&gt; Projects from CVS." skip="false">
+ <command serialization="org.eclipse.ui.file.import(importWizardId=org.eclipse.team.cvs.ui.newProjectCheckout)" confirm="false">
+ </command>
+ </subitem>
+ <subitem label="If the following repository does not already exist, create it by selecting &quot;Create a new repository location&quot;, pressing &quot;Next&quot;, and filling in the following information: Host: sourceware.org Repository path: /cvs/eclipse User: &lt;anonymous&gt; Connection type: pserver" skip="true">
+ </subitem>
+ <subitem label="Press Next to advance to CVS module selection." skip="false">
+ </subitem>
+ <subitem label="Choose &quot;Use an existing module&quot; and open &quot;autotools&quot; and select &quot;sources&quot; in the populated list of projects." skip="false">
+ </subitem>
+ <subitem label="Press Next." skip="false">
+ </subitem>
+ <subitem label="Ensure &quot;Check out as a project configured using the New Project wizard&quot; is selected." skip="false">
+ </subitem>
+ <subitem label="Press Finish." skip="false">
+ </subitem>
+ <subitem label="Select C/C++ -&gt; C Project" skip="false">
+ </subitem>
+ <subitem
+ label="Within the C Project dialog, open the GNU Autotools category in the tree view and select &quot;Empty Project&quot;">
+ </subitem>
+ <subitem label="Give the project a name. For this example, choose &quot;sources&quot;." skip="false">
+ </subitem>
+ <subitem label="Press Next." skip="false">
+ </subitem>
+ <subitem label="Press Finish." skip="false">
+ </subitem>
+ <subitem label="If asked to switch to C/C++ Perspective, select ok and choose to default this behavior" skip="false">
+ </subitem>
+ </item>
+ <item title="Build Project">
+ <description>
+ </description>
+ <subitem
+ label="Navigate to the project in the Project Explorer view by selecting the &quot;sources&quot; project you just created.">
+ </subitem>
+ <subitem
+ label="Open the Project pull-down from the main menu">
+ </subitem>
+ <subitem
+ label="If &quot;Build Automatically&quot; is not checked, select &quot;Build Project&quot;">
+ </subitem>
+ </item>
+ <item title="View build output" dialog="true" skip="false">
+ <description>
+ In the Console view, there is a button entitled &quot;Display Selected Console&quot;. Its icon depicts a monitor with two lines of text on it. Pressing this button will drop down to show all available consoles. At this point, you should have three consoles: one for configure output (&quot;Configure&quot;), one for build output (&quot;C-Build&quot;), and one for the binary output that you just ran (&quot;&lt;terminated&gt; sources ...&quot;).
+ </description>
+ <subitem label="View configure output by selecting the Configure console in the drop-down list. The configure console" skip="false">
+ </subitem>
+ <subitem label="View build output by selecting the &quot;C-Build&quot; console in the drop-down list." skip="false">
+ </subitem>
+ </item>
+ <item title="Run the Hello World binary" dialog="true" skip="false">
+ <description>
+ </description>
+ <subitem label="Navigate to the project in the Project Explorer view by selecting the &quot;sources&quot; project you just created." skip="false">
+ </subitem>
+ <subitem label="Open the project by toggling the arrow to the left of the project name if it is not already open." skip="true">
+ </subitem>
+ <subitem label="Expand the &quot;Binaries&quot; virtual folder under the project." skip="false">
+ </subitem>
+ <subitem label="Select the binary itself. This will be called &quot;a.out&quot; if you followed the example." skip="false">
+ </subitem>
+ <subitem label="Right-click on the binary itself and select &quot;Run As&quot; -&gt; &quot;Local C/C++ Application&quot;." skip="false">
+ </subitem>
+ <subitem label="Select &quot;gdb Debugger&quot; (the default) in the &quot;Launch Debug Configuration Selection&quot; dialog." skip="false">
+ </subitem>
+ <subitem label="Press OK." skip="false">
+ </subitem>
+ </item>
+ <item title="View output" dialog="true" skip="false">
+ <description>
+ The output of the program should be displayed in the Console view which should be one of the tabs visible in the bottom of the IDE. If you made no modifications, it should read &quot;hello world&quot;.
+ </description>
+ </item>
+ <item title="Modify configure options" dialog="true" skip="false">
+ <description>
+ </description>
+ <subitem label="Select the project &quot;sources&quot; if it is not already selected in the Project Explorer." skip="false">
+ </subitem>
+ <subitem label="From the main menu, select Project -&gt; Properties." skip="false">
+ </subitem>
+ <subitem label="Expand &quot;Autotools&quot; and select &quot;Configure Settings&quot;." skip="false">
+ </subitem>
+ <subitem label="Under &quot;configure&quot;, select &quot;Advanced&quot;." skip="false">
+ </subitem>
+ <subitem label="In the &quot;Additional command-line options&quot; text box, enter &quot;--enable-option-x&quot;." skip="false">
+ </subitem>
+ <subitem label="Press OK." skip="false">
+ </subitem>
+ </item>
+ <item title="Finished!" dialog="true" skip="false">
+ <description>
+ <b>Congratulations!</b>
+You now have a simple GNU autotools project.
+ </description>
+ </item>
+</cheatsheet>
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/doc/notices.html b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/doc/notices.html
new file mode 100644
index 0000000000..5773de52c8
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/doc/notices.html
@@ -0,0 +1,22 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+
+<meta name="copyright" content="&#169; Copyright 2010 Eclipse Linux Tools project committers and others. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
+
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <LINK REL="STYLESHEET" HREF="book.css" CHARSET="ISO-8859-1" TYPE="text/css">
+ <title>Legal Notices</title>
+</head>
+<body>
+
+<h3>
+<a NAME="Notices"></a>Notices</h3>
+<p>
+The material in this guide is &#169; Copyright 2010 Eclipse Linux Tools project committers and others.
+</p>
+<p>
+<a href="../about.html">Terms and conditions regarding the use of this guide.</a>
+</p>
+</body>
+</html>
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/extract-markup.xsl b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/extract-markup.xsl
new file mode 100644
index 0000000000..4c4e731948
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/extract-markup.xsl
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:mw="http://www.mediawiki.org/xml/export-0.3/">
+ <xsl:output method="text"/>
+
+ <xsl:template match="/">
+ <xsl:value-of select="//mw:text"/>
+ </xsl:template>
+</xsl:stylesheet>
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/plugin.properties b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/plugin.properties
new file mode 100644
index 0000000000..bdc76a68d3
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/plugin.properties
@@ -0,0 +1,12 @@
+#################################################################################
+# Copyright (c) 2008 Red Hat, Inc.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Red Hat Incorporated - initial API and implementation
+#################################################################################
+bundleName=Autotools Documentation (Incubation)
+provider=Eclipse \ No newline at end of file
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/plugin.xml b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/plugin.xml
new file mode 100644
index 0000000000..57f82d80e7
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/plugin.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+ <extension
+ point="org.eclipse.help.toc">
+ <toc
+ file="toc.xml"
+ primary="true"/>
+ <toc
+ file="userguide/Autotools Plugin-in User Guide-toc.xml"
+ primary="true">
+ </toc>
+ </extension>
+ <extension
+ id="com.redhat.eclipse.cdt.autotools.docs.cheatsheets"
+ point="org.eclipse.ui.cheatsheets.cheatSheetContent">
+ <cheatsheet
+ category="org.eclipse.cdt-doc.category.tutorials"
+ contentFile="cheatsheets/autotools.xml"
+ id="com.redhat.eclipse.cdt.autotools-docs.cheatsheet3"
+ name="Creating a GNU Autotools Project">
+ </cheatsheet>
+ </extension>
+
+</plugin>
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/src/org/eclipse/linuxtools/internal/cdt/autotools/doc/anttask/MediaWikiImageFetcher.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/src/org/eclipse/linuxtools/internal/cdt/autotools/doc/anttask/MediaWikiImageFetcher.java
new file mode 100644
index 0000000000..36e99652ed
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/src/org/eclipse/linuxtools/internal/cdt/autotools/doc/anttask/MediaWikiImageFetcher.java
@@ -0,0 +1,150 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2008 David Green and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * David Green - initial API and implementation
+ *
+ * Re-namespaced 2009-04-14 without changes from org.eclipse.mylyn.help.ui.
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.cdt.autotools.doc.anttask;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.Reader;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.Task;
+import org.apache.tools.ant.taskdefs.Get;
+
+
+/**
+ * Fetch images from a MediaWiki-generated HTML page source
+ *
+ * @author David Green
+ */
+public class MediaWikiImageFetcher extends Task {
+
+ private String base;
+
+ private File dest;
+
+ private File src;
+
+ @Override
+ public void execute() throws BuildException {
+ if (dest == null) {
+ throw new BuildException("Must specify @dest"); //$NON-NLS-1$
+ }
+ if (!dest.exists()) {
+ throw new BuildException("@dest does not exist: " + dest); //$NON-NLS-1$
+ }
+ if (!dest.isDirectory()) {
+ throw new BuildException("@dest is not a directory: " + dest); //$NON-NLS-1$
+ }
+ if (src == null) {
+ throw new BuildException("Must specify @src"); //$NON-NLS-1$
+ }
+ if (!src.exists()) {
+ throw new BuildException("@src does not exist: " + src); //$NON-NLS-1$
+ }
+ if (!src.isFile()) {
+ throw new BuildException("@src is not a file: " + src); //$NON-NLS-1$
+ }
+ if (base == null) {
+ throw new BuildException("Must specify @base"); //$NON-NLS-1$
+ }
+ if (base.endsWith("/")) { //$NON-NLS-1$
+ base = base.substring(0, base.length() - 1);
+ }
+ Pattern fragmentUrlPattern = Pattern.compile("src=\"([^\"]+)\""); //$NON-NLS-1$
+ Pattern imagePattern = Pattern.compile("alt=\"Image:([^\"]*)\"([^>]+)", Pattern.MULTILINE); //$NON-NLS-1$
+ String htmlSrc;
+ try {
+ htmlSrc = readSrc();
+ } catch (IOException e) {
+ throw new BuildException("Cannot read src: " + src + ": " + e.getMessage(), e); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ log("Parsing " + src, Project.MSG_INFO); //$NON-NLS-1$
+ int fileCount = 0;
+ Matcher imagePatternMatcher = imagePattern.matcher(htmlSrc);
+ while (imagePatternMatcher.find()) {
+ String alt = imagePatternMatcher.group(1);
+ String imageFragment = imagePatternMatcher.group(2);
+ if (imageFragment != null) {
+ Matcher fragmentUrlMatcher = fragmentUrlPattern.matcher(imageFragment);
+ if (fragmentUrlMatcher.find()) {
+ String url = fragmentUrlMatcher.group(1);
+ String qualifiedUrl = base + url;
+ log("Fetching " + qualifiedUrl, Project.MSG_INFO); //$NON-NLS-1$
+ Get get = new Get();
+ get.setProject(getProject());
+ get.setLocation(getLocation());
+ try {
+ get.setSrc(new URL(qualifiedUrl));
+ } catch (MalformedURLException e) {
+ log("Skipping " + url + ": " + e.getMessage(), Project.MSG_WARN); //$NON-NLS-1$ //$NON-NLS-2$
+ continue;
+ }
+ // note: we use the alt text for the name since for some files there is a case-difference between
+ // the server URL and the text used in the image src of the markup
+ String name = alt == null ? url.substring(url.lastIndexOf('/')) : alt;
+ get.setDest(new File(dest, name));
+ get.execute();
+ ++fileCount;
+ }
+ }
+ }
+ log("Fetched " + fileCount + " image files for " + src, Project.MSG_INFO); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ public String getBase() {
+ return base;
+ }
+
+ public File getDest() {
+ return dest;
+ }
+
+ public File getSrc() {
+ return src;
+ }
+
+ private String readSrc() throws IOException {
+ StringBuilder buf = new StringBuilder((int) src.length());
+ Reader reader = new BufferedReader(new FileReader(src));
+ try {
+ int i;
+ while ((i = reader.read()) != -1) {
+ buf.append((char) i);
+ }
+ } finally {
+ reader.close();
+ }
+ return buf.toString();
+ }
+
+ public void setBase(String base) {
+ this.base = base;
+ }
+
+ public void setDest(File dest) {
+ this.dest = dest;
+ }
+
+ public void setSrc(File src) {
+ this.src = src;
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/src/org/eclipse/linuxtools/internal/cdt/autotools/doc/anttask/tasks.properties b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/src/org/eclipse/linuxtools/internal/cdt/autotools/doc/anttask/tasks.properties
new file mode 100644
index 0000000000..82f303b73d
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/src/org/eclipse/linuxtools/internal/cdt/autotools/doc/anttask/tasks.properties
@@ -0,0 +1 @@
+mediawiki-fetch-images=org.eclipse.linuxtools.internal.cdt.autotools.doc.anttask.MediaWikiImageFetcher
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/toc.xml b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/toc.xml
new file mode 100644
index 0000000000..7fc15cfa43
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/toc.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?NLS TYPE="org.eclipse.help.toc"?>
+
+<toc label="GNU Tools">
+ <topic label="gcc" href="http://gcc.gnu.org/onlinedocs/gcc-4.3.2/gcc/"/>
+ <topic label="binutils" href="http://sourceware.org/binutils/docs/"/>
+ <topic label="autoconf" href="http://www.gnu.org/software/autoconf/manual/html_node/index.html"/>
+ <topic label="automake" href="http://www.gnu.org/software/automake/manual/html_node/index.html"/>
+ <topic label="pkg-config" href="http://hpux.ewi.tudelft.nl/ftp/hpux/Development/Tools/pkgconfig-0.23/pkgconfig-0.23.man.html"/>
+ <anchor id="moregnutools"/>
+</toc>
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/Autotools Plugin-in User Guide-toc.xml b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/Autotools Plugin-in User Guide-toc.xml
new file mode 100644
index 0000000000..8e59f9dc35
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/Autotools Plugin-in User Guide-toc.xml
@@ -0,0 +1,12 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<toc topic="userguide/Autotools Plugin-in User Guide.html" label="Autotools Plugin-in User Guide">
+ <topic href="userguide/Autotools Plugin-in User Guide.html" label="Introduction"></topic>
+ <topic href="userguide/Supported-Environments.html" label="Supported Environments"></topic>
+ <topic href="userguide/Creating-an-Autotools-Project.html" label="Creating an Autotools Project"></topic>
+ <topic href="userguide/Configuration.html" label="Configuration"></topic>
+ <topic href="userguide/Invoking-Autotools.html" label="Invoking Autotools"></topic>
+ <topic href="userguide/Special-Editors.html" label="Special Editors"></topic>
+ <topic href="userguide/Building.html" label="Building"></topic>
+ <topic href="userguide/Make-Targets.html" label="Make Targets"></topic>
+ <topic href="userguide/Updating-This-Document.html" label="Updating This Document"></topic>
+</toc> \ No newline at end of file
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/Autotools Plugin-in User Guide.html b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/Autotools Plugin-in User Guide.html
new file mode 100644
index 0000000000..22fb5a3d15
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/Autotools Plugin-in User Guide.html
@@ -0,0 +1,61 @@
+<?xml version='1.0' encoding='utf-8' ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+ <title>Autotools Plugin-in User Guide</title>
+ <link type="text/css" rel="stylesheet" href="book.css"/>
+ </head>
+ <body>
+ <table class="navigation" style="width: 100%;" border="0" summary="navigation">
+ <tr>
+ <th style="width: 100%" align="center" colspan="3">Autotools Plugin-in User Guide</th>
+ </tr>
+ <tr>
+ <td style="width: 20%" align="left"></td>
+ <td style="width: 60%" align="center"></td>
+ <td style="width: 20%" align="right">
+ <a href="Supported-Environments.html" title="Supported Environments">
+ <img alt="Next" border="0" src="images/images/next.gif"/>
+ </a>
+ </td>
+ </tr>
+ <tr>
+ <td style="width: 20%" align="left" valign="top"></td>
+ <td style="width: 60%" align="center"></td>
+ <td style="width: 20%" align="right" valign="top">Supported Environments</td>
+ </tr>
+ </table><hr/>
+ <h1 id="Introduction">Introduction</h1>
+ <p>The Autotools plug-in for Eclipse extends the CDT (C/C++ Development Tools) to add support for maintaining and
+ building C/C++ projects that use GNU Autotools.</p>
+ <p>The GNU Autotools are a set of tools used to make a project portable to multiple systems or build environments. The tools aid the developer to create
+ a configure script which is meant to be invoked prior to performing the build. The configure script may perform tests such as testing the current platform, the OS, what is locally installed, or any number of things. Parameters can be passed as well to provide information that is not calculable (e.g. what will be the target platform the project will be run on). Results of tests and parameters are used to create the Makefiles for the build or in some cases, additional files such as header files or code sequences. </p>
+ <p>What gets tested is fully controllable by the developer by way of special input files which
+ are fed to the Autotools. Typically, the most commonly used Autotools are 'autoconf', 'automake', and 'aclocal'. The 'autoconf' tool takes a 'configure.in' or 'configure.ac' input file and creates the 'configure' script previously discussed. It is possible to have multiple configure scripts in various subdirectories, but a project should be designed so there is one top-level configure script that calls any lower-level ones automatically.</p>
+ <p>The 'automake' tool takes a 'Makefile.am' input file and creates a 'Makefile.in' file which is used at configuration time by the configure script as a template for creating a Makefile. Each Makefile will have its own corresponding Makefile.in file. There may be if/else logic used to determine what ends up in the Makefile or there may be requests to directly substitute variables calculated in the configure step.</p>
+ <p>The 'aclocal' tool creates a repository of macros that are specified directly or indirectly in the 'autoconf' input files. Such macros are provided to perform commonly used tests or actions (e.g. test that a certain header file
+ exists or find the C compiler). The macros are written in a language called m4 and the developer is free to create their own macros to add to the repository. </p>
+ <p>The Autotools plug-in adds support for running the configure script prior to the build. As well, support is added for invoking the Autotools themselves as well as maintaining the files they use. An Autotools project extends a CDT Makefile project. Therefore, functionality in the CDT for supporting such a project applies to an Autotools project as well (e.g. C/C++ Property pages).</p>
+ <p>For more details on the GNU Autotools, see
+ <a href="http://www.gnu.org/software/autoconf/">http://www.gnu.org/software/autoconf/</a> and
+
+ <a href="http://www.gnu.org/software/automake/">http://www.gnu.org/software/automake/</a>
+ </p><hr/>
+ <table class="navigation" style="width: 100%;" border="0" summary="navigation">
+ <tr>
+ <td style="width: 20%" align="left"></td>
+ <td style="width: 60%" align="center"></td>
+ <td style="width: 20%" align="right">
+ <a href="Supported-Environments.html" title="Supported Environments">
+ <img alt="Next" border="0" src="images/images/next.gif"/>
+ </a>
+ </td>
+ </tr>
+ <tr>
+ <td style="width: 20%" align="left" valign="top"></td>
+ <td style="width: 60%" align="center"></td>
+ <td style="width: 20%" align="right" valign="top">Supported Environments</td>
+ </tr>
+ </table>
+ </body>
+</html> \ No newline at end of file
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/Building.html b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/Building.html
new file mode 100644
index 0000000000..057bab0980
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/Building.html
@@ -0,0 +1,112 @@
+<?xml version='1.0' encoding='utf-8' ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+ <title>Autotools Plugin-in User Guide - Building</title>
+ <link type="text/css" rel="stylesheet" href="book.css"/>
+ </head>
+ <body>
+ <table class="navigation" style="width: 100%;" border="0" summary="navigation">
+ <tr>
+ <th style="width: 100%" align="center" colspan="3">Building</th>
+ </tr>
+ <tr>
+ <td style="width: 20%" align="left">
+ <a href="Special-Editors.html" title="Special Editors">
+ <img alt="Previous" border="0" src="images/images/prev.gif"/>
+ </a>
+ </td>
+ <td style="width: 60%" align="center"></td>
+ <td style="width: 20%" align="right">
+ <a href="Make-Targets.html" title="Make Targets">
+ <img alt="Next" border="0" src="images/images/next.gif"/>
+ </a>
+ </td>
+ </tr>
+ <tr>
+ <td style="width: 20%" align="left" valign="top">Special Editors</td>
+ <td style="width: 60%" align="center"></td>
+ <td style="width: 20%" align="right" valign="top">Make Targets</td>
+ </tr>
+ </table><hr/>
+ <h1 id="Building">Building</h1>
+ <p>As mentioned, an Autotools project is an extended CDT Makefile project. Building the project is done the same as for any Makefile project. You can kick off a build manually by clicking on the Project -> Build Project menu item or if you choose, you can set up builds to occur automatically when resources are changed by checking off the Project -> Build Automatically menu item. The former build option is disabled when automatic builds are selected. By default, a
+ <b>make all</b> is performed following the Autotools configure step.
+ </p>
+ <p>The build is performed on the active build configuration. A build configuration is a CDT construct which is a group of settings for a particular build. This is not to be confused with an Autotools configuration which is just the settings passed to the configure script. The CDT build configuration is saved across Eclipse sessions and includes environment variable settings, build macros, build location, tool settings, etc... used to perform a build. A project may have multiple build configurations. For example, a build with debugging info and a regular optimized build. As such, one configuration is designated the active configuration and as previously stated, is the one used for the build.</p>
+ <p>The Autotools configure script parameters and the autogen.sh script parameters are treated as part of the CDT build configuration. While CDT settings are stored in the .cproject file within the project, the Autotools parameters are stored in a special file: .autotools. There is a one-to-one mapping of Autotools configuration parameters to a build configuration. By default, each Autotools project starts with a base build configuration named
+ <b>Build (GNU)</b> which configures and builds in the top-level project directory. This is common for Autotools projects to have the user configure and build directly in the top-level source directory. The location of the build can be changed in the C/C++ Build properties:
+ </p>
+ <p>
+ <img border="0" src="images/Linuxtools-AutotoolsBuildLocation.png"/>
+ </p>
+ <p>Notice how the default is ${workspace_loc:/xxxx} where xxxx is the project name. This represents the project's location which may or may not be physically under the workspace root directory. To change the build location, it is recommended that you add a directory following the project location: e.g. ${workspace_loc:/xxxx}/yyyy. </p>
+ <p>It should be noted that the configure script automatically checks to see if a configuration has been performed in the source directory. It does so by looking for the
+ <b>config.status</b> file existing in the same directory as the configure script. If configuring in a different directory and the configure script finds
+ <b>config.status</b> in the source directories, it will stop and report a failure. Such is the case if you originally configure and build the default configuration and either change the build location or add a new configuration later and try to build it. The second configuration fails and recommends running
+ <b>make distclean</b> first. A
+ <b>make distclean</b> performs a clean and in addition removes configuration files such as
+ <b>config.status</b>. The Autotools plug-in recognizes when this situation is about to occur during the configure step and will automatically issue a
+ <b>make distclean</b> on your behalf to avoid the failure. The cleaning operation is recorded in the Configure console. Since it also removes build artefacts for the default configuration, these may have to be regenerated by a future configure/build with the default configuration marked active. If you know you will be creating multiple configurations for the project, you can either specify the default build location to something other than the top-level project directory or else you can avoid using the default configuration and only build configurations you have added yourself.
+ </p>
+ <p>CDT build configurations are managed via the Managed Configurations dialog. The dialog is accessed via a button that can be found on any property page that alters data that is part of the build configuration. This includes the Project -> Properties -> Autotools -> Configure Settings page. Pressing the button results in the Manage Configurations dialog:</p>
+ <p>
+ <img border="0" src="images/Linuxtools-AutotoolsManageConfs.png"/>
+ </p>
+ <p>From the dialog, it is possible to create a new configuration, rename a configuration, delete a configuration, or set a particular configuration as being the active one. Deletion is disabled when there is only one configuration. Likewise, if there is only one configuration, it is active by default. When you choose to create a new configuration (hit the New... button), you are given a number of choices. You can:</p>
+ <ol>
+ <li>create a new one based on the default configuration
+ <ul>
+ <li>In the case of Autotools this is the default Build (GNU) configuration before any modifications were made.</li>
+ </ul>
+ </li>
+ <li>copy from an existing configuration
+ <ul>
+ <li>This copies all settings made.</li>
+ </ul>
+ </li>
+ <li>import from an existing project
+ <ul>
+ <li>This is unsupported if the project is not also an Autotools project in which case undefined behavior occurs.</li>
+ </ul>
+ </li>
+ <li>import a predefined configuration
+ <ul>
+ <li>This is not supported as it offers non-Autotools configurations. Undefined behavior will result if one of these are chosen.</li>
+ </ul>
+ </li>
+ </ol>
+ <p>
+ <img border="0" src="images/Linuxtools-AutotoolsCreateConf.png"/>
+ </p>
+ <p>Copying a configuration copies all of its settings, including the Autotools configuration parameters. Copying all settings would normally include the build location (the directory where the build will be performed), but the Autotools plug-in, by default, intercedes and for every new configuration subsequent to the initial one, it sets the build location to build-xxxx where xxxx is the unique configuration name. The Autotools plug-in replaces any white-space in the configuration name with underscores so it is possible if you have named two configurations similarly with different white-space characters or one with underscores that you might result in a build location collision. The replacement of white-space is done because the build directory will get placed in the generated Makefile where white-space is used as delimiters and undefined behaviour would therefore occur. The automatic build directory naming behaviour can be turned off from the Project -> Properties -> Autotools page, but it is discouraged since switching between different configurations and building in the same directory can cause undefined behaviour.</p>
+ <p>
+ <img border="0" src="images/Linuxtools-AutotoolsAutotools.png"/>
+ </p>
+ <p>Note: changes to configurations are not performed unless the Ok or Apply buttons are pressed from a Property page with the Manage Configurations button on it. That is, pressing Ok from the Manage Configurations dialog does not make the changes permanent. You could add new configurations, delete others, and then hit the Cancel button from the corresponding property page and the changes would be reverted.</p><hr/>
+ <table class="navigation" style="width: 100%;" border="0" summary="navigation">
+ <tr>
+ <td style="width: 20%" align="left">
+ <a href="Special-Editors.html" title="Special Editors">
+ <img alt="Previous" border="0" src="images/images/prev.gif"/>
+ </a>
+ </td>
+ <td style="width: 60%" align="center">
+ <a href="Autotools Plugin-in User Guide.html" title="Autotools Plugin-in User Guide">
+ <img alt="Autotools Plugin-in User Guide" border="0" src="images/images/home.gif"/>
+ </a>
+ </td>
+ <td style="width: 20%" align="right">
+ <a href="Make-Targets.html" title="Make Targets">
+ <img alt="Next" border="0" src="images/images/next.gif"/>
+ </a>
+ </td>
+ </tr>
+ <tr>
+ <td style="width: 20%" align="left" valign="top">Special Editors</td>
+ <td style="width: 60%" align="center"></td>
+ <td style="width: 20%" align="right" valign="top">Make Targets</td>
+ </tr>
+ </table>
+ </body>
+</html> \ No newline at end of file
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/Configuration.html b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/Configuration.html
new file mode 100644
index 0000000000..8a4b1d911b
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/Configuration.html
@@ -0,0 +1,125 @@
+<?xml version='1.0' encoding='utf-8' ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+ <title>Autotools Plugin-in User Guide - Configuration</title>
+ <link type="text/css" rel="stylesheet" href="book.css"/>
+ </head>
+ <body>
+ <table class="navigation" style="width: 100%;" border="0" summary="navigation">
+ <tr>
+ <th style="width: 100%" align="center" colspan="3">Configuration</th>
+ </tr>
+ <tr>
+ <td style="width: 20%" align="left">
+ <a href="Creating-an-Autotools-Project.html" title="Creating an Autotools Project">
+ <img alt="Previous" border="0" src="images/images/prev.gif"/>
+ </a>
+ </td>
+ <td style="width: 60%" align="center"></td>
+ <td style="width: 20%" align="right">
+ <a href="Invoking-Autotools.html" title="Invoking Autotools">
+ <img alt="Next" border="0" src="images/images/next.gif"/>
+ </a>
+ </td>
+ </tr>
+ <tr>
+ <td style="width: 20%" align="left" valign="top">Creating an Autotools Project</td>
+ <td style="width: 60%" align="center"></td>
+ <td style="width: 20%" align="right" valign="top">Invoking Autotools</td>
+ </tr>
+ </table><hr/>
+ <h1 id="Configuration">Configuration</h1>
+ <p>Prior to running a build, the Autotools plug-in runs the configure script. Parameters to be passed to configure may be
+ entered via the Project -> Properties -> Autotools -> Configure Settings UI shown below:</p>
+ <p>
+ <img border="0" src="images/Linuxtools-AutotoolsConfsettings.png"/>
+ </p>
+ <p>You will notice how the actual configure script name is editable. It is not recommended you change the name of the configure script as this is standard for Autotool projects. However, one use of this text input is to add environment variables to set prior to invoking the configure script. For example, you might want to set the command to:
+ <b>CFLAGS="-g -debug" configure</b> to have the CFLAGS environment variable overridden while configuring. The same applies to the autogen.sh script settings.
+ </p>
+ <p>For configure, there are a number of standard parameters that apply to generated configure scripts. Each parameter has its command line name presented so you can look it up in Autotools documentation. In addition, tool-tip hover help is provided.</p>
+ <p>Under the Advanced category, there is a free-form line called "Additional command-line options" where you may enter any options in their command-line format. This is useful for entering custom options that your configure script supports (e.g. --enable-feature-x or --with-lib-y). It can also be used for any of the standard parameters as well if that is more familiar tor you. Parameters in this list are appended to the end of parameters derived from the standard option entries (i.e. you could get two specifications of a parameter). In the case of multiple specification, behaviour is the same as it is on the command line. You can optionally check off the "Display help contents (--help)" option under the General category to see all the standard and custom options the configure script accepts. As the configure script help is a product of how it is written, it is sometimes possible that the help is out of date with regards to added features.</p>
+ <p>In some cases, a project may choose not to invoke the Autotools ahead of time and instead
+ require this be done prior to configuration. The input files that are fed to the Autotools are provided, but the output of
+ the Autotools are not. This may be
+ done to lower the download size and additionally to avoid having to constantly regenerate the output files as the Autotools are
+ updated. In such cases, an autogen.sh script may be provided which is simply a script that runs the various Autotools
+ required. This script may or may not run the configure script at the end. Alternatively, there is also the
+ <i>autoreconf</i>
+ tool which can be invoked to recursively run through the source tree and run all Autotools where the input files are newer than
+ the output files (this includes the case where no output file is present). Any options required when invoking the Autotools
+ can be encoded within the input files themselves.
+ </p>
+ <p>The following defines a priority list of scenarios that the Autotools plug-in checks for when performing the configure step and how each one is handled.</p>
+ <ol>
+ <li>A config.status file exists and configure script options have not changed since the last configuration
+ <ul>
+ <li>The config.status file is created as part of running a generated configure script. It itself is a script file and indicates a configuration has already been performed. If the configure options have not changed since that configuration, there is no need to do a full reconfigure. A simple check is performed by calling the config.status script with the --recheck option. This will verify that the generated Makefile exists and is up to date.</li>
+ </ul>
+ </li>
+ <li>A configure script exists
+ <ul>
+ <li>In this case, the configure script is run with any configuration options specified in the project properties.</li>
+ </ul>
+ </li>
+ <li>An autogen script exists
+ <ul>
+ <li>In this case, the autogen.sh script is run and following that, a check is made to see if config.status has been created, indicating that the configure script was run. If has not configured, the configure script is run automatically if it was successfully created.</li>
+ </ul>
+ </li>
+ <li>A Makefile.cvs file exists
+ <ul>
+ <li>A Makefile.cvs is an alternate form of autogen.sh/configure script. In this case, the file is fed to the make command. If a configure script is created and not run as part of this process, it is run automatically.</li>
+ </ul>
+ </li>
+ <li>default case
+ <ul>
+ <li>At this point, there is no configure script or autogen.sh script and configure has not been run previously. A last resort is to run the autoreconf command with -i to recursively search the source tree and invoke Autotools for any input file that is older than its output target (or if the target is missing). If this generates a configure script, it is run automatically.</li>
+ </ul>
+ </li>
+ </ol>
+ <p>If after all of this, the top-level Makefile is not created, an error is generated and building stops. </p>
+ <p>The configure process can be manually forced for a project via the Project -> Reconfigure Project menu item. A reconfigure runs the configure script even if a config.status file is found indicating a prior configuration was successful.</p>
+ <p>The entire configuration step is performed by a special builder that is added when an Autotools project is created or converted from another project. The special builder runs the configure step and is positioned to run prior to the Makefile builder.</p>
+ <p>From the Project -> Properties -> Builders tab for a project you will see:</p>
+ <p>
+ <img border="0" src="images/Linuxtools-AutotoolsBuilders.png"/>
+ </p>
+ <p>Do not un-check the Autotools Makefile builder nor change the order of the builders. Modifying this will result in undefined behaviour.</p>
+ <p>The configure step is run in a special Configuration console added by the Autotools plug-in. This console is separate from the C-Build console which is used to display the results of the make command invocation.</p>
+ <p>To see the Configure console, click on the console selector button (icon looks like a T.V.) found in the Console View as follows:</p>
+ <p>
+ <img border="0" src="images/Linuxtools-AutotoolsConsoleSelect.png"/>
+ </p>
+ <p>Note that the configure console output is per project and shows configuration output for the last build of the project. It is not saved between Eclipse sessions.</p>
+ <p>The Autotools console is an instance of a CDT Build console so the console preferences set in Window -> Preferences -> C/C++ -> Build Console apply as well.</p>
+ <p>
+ <img border="0" src="images/Linuxtools-AutotoolsConsolePrefs.png"/>
+ </p><hr/>
+ <table class="navigation" style="width: 100%;" border="0" summary="navigation">
+ <tr>
+ <td style="width: 20%" align="left">
+ <a href="Creating-an-Autotools-Project.html" title="Creating an Autotools Project">
+ <img alt="Previous" border="0" src="images/images/prev.gif"/>
+ </a>
+ </td>
+ <td style="width: 60%" align="center">
+ <a href="Autotools Plugin-in User Guide.html" title="Autotools Plugin-in User Guide">
+ <img alt="Autotools Plugin-in User Guide" border="0" src="images/images/home.gif"/>
+ </a>
+ </td>
+ <td style="width: 20%" align="right">
+ <a href="Invoking-Autotools.html" title="Invoking Autotools">
+ <img alt="Next" border="0" src="images/images/next.gif"/>
+ </a>
+ </td>
+ </tr>
+ <tr>
+ <td style="width: 20%" align="left" valign="top">Creating an Autotools Project</td>
+ <td style="width: 60%" align="center"></td>
+ <td style="width: 20%" align="right" valign="top">Invoking Autotools</td>
+ </tr>
+ </table>
+ </body>
+</html> \ No newline at end of file
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/Creating-an-Autotools-Project.html b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/Creating-an-Autotools-Project.html
new file mode 100644
index 0000000000..04fec390f9
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/Creating-an-Autotools-Project.html
@@ -0,0 +1,87 @@
+<?xml version='1.0' encoding='utf-8' ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+ <title>Autotools Plugin-in User Guide - Creating an Autotools Project</title>
+ <link type="text/css" rel="stylesheet" href="book.css"/>
+ </head>
+ <body>
+ <table class="navigation" style="width: 100%;" border="0" summary="navigation">
+ <tr>
+ <th style="width: 100%" align="center" colspan="3">Creating an Autotools Project</th>
+ </tr>
+ <tr>
+ <td style="width: 20%" align="left">
+ <a href="Supported-Environments.html" title="Supported Environments">
+ <img alt="Previous" border="0" src="images/images/prev.gif"/>
+ </a>
+ </td>
+ <td style="width: 60%" align="center"></td>
+ <td style="width: 20%" align="right">
+ <a href="Configuration.html" title="Configuration">
+ <img alt="Next" border="0" src="images/images/next.gif"/>
+ </a>
+ </td>
+ </tr>
+ <tr>
+ <td style="width: 20%" align="left" valign="top">Supported Environments</td>
+ <td style="width: 60%" align="center"></td>
+ <td style="width: 20%" align="right" valign="top">Configuration</td>
+ </tr>
+ </table><hr/>
+ <h1 id="Creating_an_Autotools_Project">Creating an Autotools Project</h1>
+ <p>There a number of ways to create an Autotools project. The first method is through the CDT C and C++ Project wizards which can be activated from the File -> New -> C Project and File -> New -> C++ Project menu items, respectively, which are available while in the C/C++ Perspective. These two wizards can also be located by clicking on the File -> New -> Project... menu item and then opening the C/C++ folder found there.</p>
+ <p>Looking at the C Wizard, we see that there is a GNU Autotools category.</p>
+ <p>
+ <img border="0" src="images/Linuxtools-AutotoolsCProjectWizard.png"/>
+ </p>
+ <p>Opening the category, there are two choices: Empty Project or Hello World Ansi C Autotools Project. The Empty Project template means that no files will be supplied to the new project while the Hello World project will supply a sample hello world program that uses Autotools for configuring the build. The C++ Project Wizard also has the same GNU Autotools category and two project templates: an Empty Project and a Hello World C++ Autotools sample program. If you are creating a project from scratch, it is recommended that you use the Hello World sample project and make modifications. Otherwise, you will need to create a configure script for the Autotools plug-in to invoke at build time or provide a Makefile so the configuration step does not fail.</p>
+ <p>The C and C++ Wizards can also be used when importing an existing Autotools project. For example, when importing a project from CVS using File -> Import... -> CVS -> you are given the choice to "Check out as a project configured by the new project wizard".</p>
+ <p>
+ <img border="0" src="images/Linuxtools-AutotoolsCheckout.png"/>
+ </p>
+ <p>From the New Project menu, open the C/C++ category and choose either a C Project or C++ Project, depending on the type of project being imported. If the code is both C and C++, choose C++ Project.</p>
+ <p>Let's say you have a C application using Autotools and select C Project. This will bring up the C Project Wizard as displayed earlier. In this case, choose the Empty Project from the GNU Autotools category as you already have all the configuration files in place.</p>
+ <p>Another method to create an Autotools project is to convert an existing project. For example, if we import a project from SVN or CVS and do not configure using the new project wizard, the project will simply be downloaded into the workspace. At this point, it cannot be built or access various tools from the CDT.</p>
+ <p>To convert it, select the project in the Project Explorer and open the File -> New -> Convert to C/C++ Project menu item as found in the C/C++ Perspective. If in another perspective, this same wizard can be found by selecting File -> New -> Other... -> C/C++ -> Convert to a C/C++ Project. This brings up the C/C++ Conversion wizard.</p>
+ <p>
+ <img border="0" src="images/Linuxtools-AutotoolsConvertWizard.png"/>
+ </p>
+ <p>Note how there is a set of projects that are candidates for conversion. This list contains any projects that are not already C or C++ projects. A C or C++ project includes regular CDT Managed Make and Makefile projects. Also note that the project you selected is automatically selected when the wizard opens.</p>
+ <p>There is a choice of C or C++ project and a set of project types to choose from. For Autotools, select the GNU Autotools category and this will convert to an Autotools project. Once converted, this project will not show up as a candidate project in the conversion wizard.</p>
+ <p>The final way to create an Autotools project is to use the Autotools Conversion wizard. This wizard allows one to convert from any form of project to an Autotools project. Obviously, converting a project that isn't actually C or C++ and using Autotools will result in undefined behaviour. You need to first select the project you wish to convert. After selecting, go to File -> New -> Other... -> C/C++, open the category, select "Convert to a C/C++ Autotools Project" and hit the Next button. </p>
+ <p>
+ <img border="0" src="images/Linuxtools-AutotoolsNewOther.png"/>
+ </p>
+ <p>This brings up the following dialog:</p>
+ <p>
+ <img border="0" src="images/Linuxtools-AutotoolsConvAutotoolsWizard.png"/>
+ </p>
+ <p>Again, there are candidates for conversion. This list contains all projects that are not currently C or C++ Autotool projects. You are given the choice of C or C++ as with the standard C/C++ conversion wizard. Hitting the Finish button is all that is needed, but if you hit the Next button and continue on you can select referenced projects, if desired. </p>
+ <p>Once converted to an Autotools project, there is no UI method to convert back to a regular C/C++ project. If this is desired, you need to manually remove the .project, .cproject, and .autotools files from the project directory. This will effectively remove the natures and CDT settings for the project, allowing you to convert it again however you want.</p><hr/>
+ <table class="navigation" style="width: 100%;" border="0" summary="navigation">
+ <tr>
+ <td style="width: 20%" align="left">
+ <a href="Supported-Environments.html" title="Supported Environments">
+ <img alt="Previous" border="0" src="images/images/prev.gif"/>
+ </a>
+ </td>
+ <td style="width: 60%" align="center">
+ <a href="Autotools Plugin-in User Guide.html" title="Autotools Plugin-in User Guide">
+ <img alt="Autotools Plugin-in User Guide" border="0" src="images/images/home.gif"/>
+ </a>
+ </td>
+ <td style="width: 20%" align="right">
+ <a href="Configuration.html" title="Configuration">
+ <img alt="Next" border="0" src="images/images/next.gif"/>
+ </a>
+ </td>
+ </tr>
+ <tr>
+ <td style="width: 20%" align="left" valign="top">Supported Environments</td>
+ <td style="width: 60%" align="center"></td>
+ <td style="width: 20%" align="right" valign="top">Configuration</td>
+ </tr>
+ </table>
+ </body>
+</html> \ No newline at end of file
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/Invoking-Autotools.html b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/Invoking-Autotools.html
new file mode 100644
index 0000000000..1200a00e4f
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/Invoking-Autotools.html
@@ -0,0 +1,121 @@
+<?xml version='1.0' encoding='utf-8' ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+ <title>Autotools Plugin-in User Guide - Invoking Autotools</title>
+ <link type="text/css" rel="stylesheet" href="book.css"/>
+ </head>
+ <body>
+ <table class="navigation" style="width: 100%;" border="0" summary="navigation">
+ <tr>
+ <th style="width: 100%" align="center" colspan="3">Invoking Autotools</th>
+ </tr>
+ <tr>
+ <td style="width: 20%" align="left">
+ <a href="Configuration.html" title="Configuration">
+ <img alt="Previous" border="0" src="images/images/prev.gif"/>
+ </a>
+ </td>
+ <td style="width: 60%" align="center"></td>
+ <td style="width: 20%" align="right">
+ <a href="Special-Editors.html" title="Special Editors">
+ <img alt="Next" border="0" src="images/images/next.gif"/>
+ </a>
+ </td>
+ </tr>
+ <tr>
+ <td style="width: 20%" align="left" valign="top">Configuration</td>
+ <td style="width: 60%" align="center"></td>
+ <td style="width: 20%" align="right" valign="top">Special Editors</td>
+ </tr>
+ </table><hr/>
+ <h1 id="Invoking_Autotools">Invoking Autotools</h1>
+ <p>To invoke the Autotools, a special menu item has been added to the Project menu. Under Project -> Invoke Autotools there are a set of menu items to invoke the various Autotools for your project. The output of the tool invocation is presented in a special Autotools Console. Like the Configure and C-Build Consoles, the Autotools console is per-project and is not saved across Eclipse sessions. The console, if present, can be accessed via the "Display Selected Console" button in the Console View.</p>
+ <p>
+ <img border="0" src="images/Linuxtools-AutotoolsAutotoolsConsole.png"/>
+ </p>
+ <p>The tools provided are:</p>
+ <ol>
+ <li>Invoke Autoconf
+ <ul>
+ <li>The autoconf tool is run in the current directory for the current file or folder selected for the project. There are no parameters. Autoconf can also be run by right-clicking a configure.in or configure.ac file and selected Invoke Autoconf.
+ <br/>
+ </li>
+ </ul>
+ </li>
+ <li>Invoke Automake
+ <ul>
+ <li>The automake tool is run from the current directory for the file or folder selected in the project. A dialog is presented to allow specification of options.
+ <img border="0" src="images/Linuxtools-AutotoolsAutomake.png"/>
+ <br/>The first text entry is for options while the 2nd text window is for Makefiles targets to generate. The automake tool should be invoked where the configure script is found that will generate the Makefile(s). There may be multiple Makefiles to generate in the current directory or lower. Each target location should be a Makefile and should have a corresponding Makefile.am file at the relative location specified. For example, automake x/Makefile y/Makefile Makefile specifies three targets. It is expected that there is an x/Makefile.am, y/Makefile.am, and a Makefile.am relative to the current directory. For details on automake, enter --help as an option.
+ <br/>
+ </li>
+ </ul>
+ </li>
+ <li>Invoke Aclocal
+ <ul>
+ <li>The aclocal tool is run from the current directory for the file or folder selected in the project. A dialog is presented to allow specification of options.
+ <img border="0" src="images/Linuxtools-AutotoolsAclocal.png"/>
+ <br/>The first text entry is for options while the 2nd text window is for directories to search for m4 macros. The directories can also be specified directly in the options parameters using the -I option. For details, enter --help as an option.
+ <br/>
+ </li>
+ </ul>
+ </li>
+ <li>Invoke Autoheader
+ <ul>
+ <li>The autoheader tool is run from the current directory for the file or folder selected in the project. A dialog is presented to allow specification of options.
+ <img border="0" src="images/Linuxtools-AutotoolsAutoheader.png"/>
+ <br/>The tool is used to create a template for generated header files. It should be run in a directory containing a configure script as it gets its information from there. For details, enter --help as an option.
+ <br/>
+ </li>
+ </ul>
+ </li>
+ <li>Invoke Autoreconf
+ <ul>
+ <li>The autoreconf tool is run from the current directory for the file or folder selected in the project. A dialog is presented to allow specification of options.
+ <img border="0" src="images/Linuxtools-AutotoolsAutoreconf.png"/>
+ <br/>The most useful option is the -i option to recursively call Autotools for all input files out of date with respect to their outputs. For details, enter --help as an option.
+ <br/>
+ </li>
+ </ul>
+ </li>
+ <li>Invoke Libtoolize
+ <ul>
+ <li>The libtoolize tool is run from the current directory for the file or folder selected in the project. The tool is used to add libtool support to a package. Libtool provides macros to allow a package to create a shared library without having to know all the details required for the current platform. This might include special compiler flags or linker options or special tools. A dialog is presented to allow specification of options.
+ <img border="0" src="images/Linuxtools-AutotoolsLibtoolize.png"/>
+ <br/>For details on libtoolize, enter --help as an option.
+ <br/>
+ </li>
+ </ul>
+ </li>
+ </ol>
+ <p>By default, the autotools are invoked simply by their names; expecting that the path has been set up appropriately. In some instances, you might want to specify a specific location for the autotools. For example, your project may require old versions of the tools which you have installed locally, but do not wish to be on your path. To set these for your project, select your project or a file/folder within it and go to Project -> Properties -> Autotools -> General and select the Tool Settings tab.</p>
+ <p>
+ <img border="0" src="images/Linuxtools-AutotoolsToolSettings.png"/>
+ </p><hr/>
+ <table class="navigation" style="width: 100%;" border="0" summary="navigation">
+ <tr>
+ <td style="width: 20%" align="left">
+ <a href="Configuration.html" title="Configuration">
+ <img alt="Previous" border="0" src="images/images/prev.gif"/>
+ </a>
+ </td>
+ <td style="width: 60%" align="center">
+ <a href="Autotools Plugin-in User Guide.html" title="Autotools Plugin-in User Guide">
+ <img alt="Autotools Plugin-in User Guide" border="0" src="images/images/home.gif"/>
+ </a>
+ </td>
+ <td style="width: 20%" align="right">
+ <a href="Special-Editors.html" title="Special Editors">
+ <img alt="Next" border="0" src="images/images/next.gif"/>
+ </a>
+ </td>
+ </tr>
+ <tr>
+ <td style="width: 20%" align="left" valign="top">Configuration</td>
+ <td style="width: 60%" align="center"></td>
+ <td style="width: 20%" align="right" valign="top">Special Editors</td>
+ </tr>
+ </table>
+ </body>
+</html> \ No newline at end of file
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/Make-Targets.html b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/Make-Targets.html
new file mode 100644
index 0000000000..9339475c5d
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/Make-Targets.html
@@ -0,0 +1,102 @@
+<?xml version='1.0' encoding='utf-8' ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+ <title>Autotools Plugin-in User Guide - Make Targets</title>
+ <link type="text/css" rel="stylesheet" href="book.css"/>
+ </head>
+ <body>
+ <table class="navigation" style="width: 100%;" border="0" summary="navigation">
+ <tr>
+ <th style="width: 100%" align="center" colspan="3">Make Targets</th>
+ </tr>
+ <tr>
+ <td style="width: 20%" align="left">
+ <a href="Building.html" title="Building">
+ <img alt="Previous" border="0" src="images/images/prev.gif"/>
+ </a>
+ </td>
+ <td style="width: 60%" align="center"></td>
+ <td style="width: 20%" align="right">
+ <a href="Updating-This-Document.html" title="Updating This Document">
+ <img alt="Next" border="0" src="images/images/next.gif"/>
+ </a>
+ </td>
+ </tr>
+ <tr>
+ <td style="width: 20%" align="left" valign="top">Building</td>
+ <td style="width: 60%" align="center"></td>
+ <td style="width: 20%" align="right" valign="top">Updating This Document</td>
+ </tr>
+ </table><hr/>
+ <h1 id="Make_Targets">Make Targets</h1>
+ <p>A Makefile has a set of targets that can be built. Typically, every Makefile has an
+ <b>all</b> target which builds all targets, but there may be optional targets as well. A CDT Makefile project enables one to invoke the various make targets via the Make Targets dialog. Since an Autotools project is a form of Makefile project, it too supports the Make Targets dialog.
+ Make Targets are important for an Autotool project because there are a large number of make targets added to the Makefile automatically by configuration. Typically, a project is built by running
+ <b>make all</b>, but it is installed by invoking
+ <b>make install</b>. The install target places files in standard locations; usually system directories on a Linux system. For example, header files would be installed in /usr/include and made available to all users of the system. The install prefix (/usr) can be overridden using the configure --prefix parameter or else by specifying prefix=xxxx on the call to make (e.g. make install prefix=/my/local/directory) so that testing can be performed without modifying the whole system.
+ </p>
+ <p>A regular CDT Makefile project requires users to add their own Make Targets, however, the Autotools plug-in analyzes the top-level Makefile for you and creates top-level Make Targets for the project. As mentioned, these automatically added targets can be numerous. If you wish to create targets to run in sub-directories of the main build directory, you must add these manually. For example, you might wish to build docs in a lower-level sub-directory, but not for the entire project.</p>
+ <p>The Make Targets dialog can be displayed in two ways:</p>
+ <ol>
+ <li>Selecting a file or folder in a project and clicking on the Project -> Make Target menu item</li>
+ <li>Right clicking on a file or folder in a project and selecting Make Target</li>
+ </ol>
+ <p>This brings up a sub-menu containing Create... and Build.... to either create a new Make Target or build an existing Make Target, respectively.</p>
+ <p>
+ <img border="0" src="images/Linuxtool-AutotoolsMakeTargetsMenu.png"/>
+ </p>
+ <p>Creating a Make Target is relatively straight-forward:</p>
+ <p>
+ <img border="0" src="images/Linuxtools-AutotoolsMakeTargetCreate.png"/>
+ </p>
+ <p>There is nothing different in the Make Target dialog for Autotools, however, a few concepts need to be clarified.</p>
+ <p>For Make Targets added as part of the Project -> Make Target menu item, the target is for the top-level Makefile for the current build. This means that if you add a Make Target this way, it will persist across configurations and will try and run the
+ <b>make</b> command in the top-level build location specified for the active configuration.
+ </p>
+ <p>Make Targets added by using the right-click Make Target menu are location sensitive. This means that the
+ <b>make</b> command will attempt to run in that directory where the right-click was performed, regardless of whether there is a Makefile present there. Let's say you want to add your own Make Target that performed a
+ <b>make all install</b> (i.e. you want to group multiple targets together into one). If you are in configuration X with build directory build-X, you want to right-click in a directory that is build-X or a sub-directory of build-X. This target will issue a
+ <b>make all install</b> in that particular directory. If you wanted the same target for another configuration, you would have to right-click in its build directory or lower and add another Make Target. Obviously, for top-level Make Targets, using the Project -> Make Target menu item makes the most sense since it applies to all configurations. If you add a Make Target to a source directory, it will likely fail when run because it will try and run
+ <b>make</b> in that directory which will probably only contain a Makefile.in or Makefile.am file and not a Makefile which is only generated at configure time.
+ </p>
+ <p>The Make Target dialog can be used to override various flags within the Makefile. For example, to perform a
+ <b>make install</b> and reset the prefix to /my/local/directory, you would first select the
+ <b>install</b> target from the Build... dialog.
+ </p>
+ <p>
+ <img border="0" src="images/Linuxtools-AutotoolsMakeTargetBuild.png"/>
+ </p>
+ <p>Then, you would click the Edit button to edit the Make Target. You can then override the prefix by specifying its value after the
+ <b>make</b> command. You edit the build command by first un-checking "Use Builder Settings" which enables text entry.
+ </p>
+ <p>
+ <img border="0" src="images/Linuxtools-AutotoolsMakeTargetEdit.png"/>
+ </p>
+ <p>The check-box that says "Run all project builders" should be left un-checked. By default, we only want the CDT Makefile builder to run and not the Autotools configure builder or any other builder.</p><hr/>
+ <table class="navigation" style="width: 100%;" border="0" summary="navigation">
+ <tr>
+ <td style="width: 20%" align="left">
+ <a href="Building.html" title="Building">
+ <img alt="Previous" border="0" src="images/images/prev.gif"/>
+ </a>
+ </td>
+ <td style="width: 60%" align="center">
+ <a href="Autotools Plugin-in User Guide.html" title="Autotools Plugin-in User Guide">
+ <img alt="Autotools Plugin-in User Guide" border="0" src="images/images/home.gif"/>
+ </a>
+ </td>
+ <td style="width: 20%" align="right">
+ <a href="Updating-This-Document.html" title="Updating This Document">
+ <img alt="Next" border="0" src="images/images/next.gif"/>
+ </a>
+ </td>
+ </tr>
+ <tr>
+ <td style="width: 20%" align="left" valign="top">Building</td>
+ <td style="width: 60%" align="center"></td>
+ <td style="width: 20%" align="right" valign="top">Updating This Document</td>
+ </tr>
+ </table>
+ </body>
+</html> \ No newline at end of file
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/Special-Editors.html b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/Special-Editors.html
new file mode 100644
index 0000000000..0938d6bc33
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/Special-Editors.html
@@ -0,0 +1,78 @@
+<?xml version='1.0' encoding='utf-8' ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+ <title>Autotools Plugin-in User Guide - Special Editors</title>
+ <link type="text/css" rel="stylesheet" href="book.css"/>
+ </head>
+ <body>
+ <table class="navigation" style="width: 100%;" border="0" summary="navigation">
+ <tr>
+ <th style="width: 100%" align="center" colspan="3">Special Editors</th>
+ </tr>
+ <tr>
+ <td style="width: 20%" align="left">
+ <a href="Invoking-Autotools.html" title="Invoking Autotools">
+ <img alt="Previous" border="0" src="images/images/prev.gif"/>
+ </a>
+ </td>
+ <td style="width: 60%" align="center"></td>
+ <td style="width: 20%" align="right">
+ <a href="Building.html" title="Building">
+ <img alt="Next" border="0" src="images/images/next.gif"/>
+ </a>
+ </td>
+ </tr>
+ <tr>
+ <td style="width: 20%" align="left" valign="top">Invoking Autotools</td>
+ <td style="width: 60%" align="center"></td>
+ <td style="width: 20%" align="right" valign="top">Building</td>
+ </tr>
+ </table><hr/>
+ <h1 id="Special_Editors">Special Editors</h1>
+ <p>The Autotools plug-in provides two special editors for editing Autotool input files. The first is the Autoconf Editor. This editor is invoked when opening configure.in, configure.ac files as well as the resultant configure scripts that autoconf creates. Support includes full colourization, outline view, rudimentary error parsing, and hover help/completion.</p>
+ <p>
+ <img border="0" src="images/Linuxtools-AutotoolsAutoconfEditor.png"/>
+ </p>
+ <p>The outline view shows macro references and program control statements such as if, else, for, etc... Hover help with text completion is provided for the various AC-prefixed and AM-prefixed macros that are provided as standard. As the macros vary from release to release of autoconf and automake, the editor uses an autoconf and automake version property to determine which set of macros it should adhere to. The versions selected affect the parsing which will issue warnings for macros that do not have enough parameters or too many parameters. To set the autoconf and automake versions for the Autoconf Editor, go to the Project -> Properties -> Autotools -> General page and select the Editors tab.</p>
+ <p>
+ <img border="0" src="images/Linuxtools-AutotoolsEditorsTab.png"/>
+ </p>
+ <p>There you will find a pull-down of the various versions supported. Future releases may add new versions.</p>
+ <p>The default autoconf and automake versions to use for editing can be set as a preference. Go to Window -> Preferences -> C/C++ -> Autotools -> Autoconf Editor and click on the Versions tab.</p>
+ <p>
+ <img border="0" src="images/Linuxtools-AutotoolsAutoconfEditorPrefs.png"/>
+ </p>
+ <p>Under the Syntax tab of the same preference page, you can change the colours used for the various elements shown in the editor.</p>
+ <p>A second editor, the Automake Editor is also provided by the Autotools plug-in. This editor is invoked when opening a Makefile.am or Makefile.in file. Support includes full colourization, outline view, rudimentary error parsing, and hover help.</p>
+ <p>
+ <img border="0" src="images/Linuxtools-AutotoolsAutomakeEditor.png"/>
+ </p>
+ <p>In the example shown, one can see the $ variable references are displayed when hovered over. This is particularly useful for $&lt; and $@ in make targets to understand what is being referenced. In some instances, you will see reference to variables surrounded by the @ symbol (e.g. @srcdir@). This represents a variable that is to be substituted by the configure script.</p>
+ <p>Rudimentary error parsing looks for syntax errors. As with the Autoconf editor, colourization can be controlled by preferences. Go to Window -> Preferences -> C/C++ -> Autotools -> Automake Editor and click on the Syntax tab.</p><hr/>
+ <table class="navigation" style="width: 100%;" border="0" summary="navigation">
+ <tr>
+ <td style="width: 20%" align="left">
+ <a href="Invoking-Autotools.html" title="Invoking Autotools">
+ <img alt="Previous" border="0" src="images/images/prev.gif"/>
+ </a>
+ </td>
+ <td style="width: 60%" align="center">
+ <a href="Autotools Plugin-in User Guide.html" title="Autotools Plugin-in User Guide">
+ <img alt="Autotools Plugin-in User Guide" border="0" src="images/images/home.gif"/>
+ </a>
+ </td>
+ <td style="width: 20%" align="right">
+ <a href="Building.html" title="Building">
+ <img alt="Next" border="0" src="images/images/next.gif"/>
+ </a>
+ </td>
+ </tr>
+ <tr>
+ <td style="width: 20%" align="left" valign="top">Invoking Autotools</td>
+ <td style="width: 60%" align="center"></td>
+ <td style="width: 20%" align="right" valign="top">Building</td>
+ </tr>
+ </table>
+ </body>
+</html> \ No newline at end of file
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/Supported-Environments.html b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/Supported-Environments.html
new file mode 100644
index 0000000000..b3ac3556a1
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/Supported-Environments.html
@@ -0,0 +1,60 @@
+<?xml version='1.0' encoding='utf-8' ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+ <title>Autotools Plugin-in User Guide - Supported Environments</title>
+ <link type="text/css" rel="stylesheet" href="book.css"/>
+ </head>
+ <body>
+ <table class="navigation" style="width: 100%;" border="0" summary="navigation">
+ <tr>
+ <th style="width: 100%" align="center" colspan="3">Supported Environments</th>
+ </tr>
+ <tr>
+ <td style="width: 20%" align="left">
+ <a href="Autotools Plugin-in User Guide.html" title="Introduction">
+ <img alt="Previous" border="0" src="images/images/prev.gif"/>
+ </a>
+ </td>
+ <td style="width: 60%" align="center"></td>
+ <td style="width: 20%" align="right">
+ <a href="Creating-an-Autotools-Project.html" title="Creating an Autotools Project">
+ <img alt="Next" border="0" src="images/images/next.gif"/>
+ </a>
+ </td>
+ </tr>
+ <tr>
+ <td style="width: 20%" align="left" valign="top">Introduction</td>
+ <td style="width: 60%" align="center"></td>
+ <td style="width: 20%" align="right" valign="top">Creating an Autotools Project</td>
+ </tr>
+ </table><hr/>
+ <h1 id="Supported_Environments">Supported Environments</h1>
+ <p>While the Autotools should work on any Unix-based system, it has only been tested on Linux (note that it is part of the Linux Tools project). OS-specific bugs or problems that are not reproducible on Linux may require a user work-around. For example, users of Cygwin or MinGW may require setting modifications to get the plug-in working for their project. The Autotools plug-in is not supported under a regular Windows environment (i.e. without Cygwin or MinGW).</p>
+ <p>To use the Autotools plug-in, it is required that you have the CDT (C/C++ Development Tools) already installed in Eclipse, the GNU Autotools installed on your system, and the "sh" (shell) command must be available. The "sh" command is required to invoke the configure script.</p><hr/>
+ <table class="navigation" style="width: 100%;" border="0" summary="navigation">
+ <tr>
+ <td style="width: 20%" align="left">
+ <a href="Autotools Plugin-in User Guide.html" title="Introduction">
+ <img alt="Previous" border="0" src="images/images/prev.gif"/>
+ </a>
+ </td>
+ <td style="width: 60%" align="center">
+ <a href="Autotools Plugin-in User Guide.html" title="Autotools Plugin-in User Guide">
+ <img alt="Autotools Plugin-in User Guide" border="0" src="images/images/home.gif"/>
+ </a>
+ </td>
+ <td style="width: 20%" align="right">
+ <a href="Creating-an-Autotools-Project.html" title="Creating an Autotools Project">
+ <img alt="Next" border="0" src="images/images/next.gif"/>
+ </a>
+ </td>
+ </tr>
+ <tr>
+ <td style="width: 20%" align="left" valign="top">Introduction</td>
+ <td style="width: 60%" align="center"></td>
+ <td style="width: 20%" align="right" valign="top">Creating an Autotools Project</td>
+ </tr>
+ </table>
+ </body>
+</html> \ No newline at end of file
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/Updating-This-Document.html b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/Updating-This-Document.html
new file mode 100644
index 0000000000..67acc85014
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/Updating-This-Document.html
@@ -0,0 +1,54 @@
+<?xml version='1.0' encoding='utf-8' ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+ <title>Autotools Plugin-in User Guide - Updating This Document</title>
+ <link type="text/css" rel="stylesheet" href="book.css"/>
+ </head>
+ <body>
+ <table class="navigation" style="width: 100%;" border="0" summary="navigation">
+ <tr>
+ <th style="width: 100%" align="center" colspan="3">Updating This Document</th>
+ </tr>
+ <tr>
+ <td style="width: 20%" align="left">
+ <a href="Make-Targets.html" title="Make Targets">
+ <img alt="Previous" border="0" src="images/images/prev.gif"/>
+ </a>
+ </td>
+ <td style="width: 60%" align="center"></td>
+ <td style="width: 20%" align="right"></td>
+ </tr>
+ <tr>
+ <td style="width: 20%" align="left" valign="top">Make Targets</td>
+ <td style="width: 60%" align="center"></td>
+ <td style="width: 20%" align="right" valign="top"></td>
+ </tr>
+ </table><hr/>
+ <h1 id="Updating_This_Document">Updating This Document</h1>
+ <p>This document is maintained in a collaborative wiki. If you wish to update or modify this document please visit
+
+ <a href="http://wiki.eclipse.org/Linux_Tools_Project/Autotools/User_Guide">http://wiki.eclipse.org/Linux_Tools_Project/Autotools/User_Guide</a>
+ </p><hr/>
+ <table class="navigation" style="width: 100%;" border="0" summary="navigation">
+ <tr>
+ <td style="width: 20%" align="left">
+ <a href="Make-Targets.html" title="Make Targets">
+ <img alt="Previous" border="0" src="images/images/prev.gif"/>
+ </a>
+ </td>
+ <td style="width: 60%" align="center">
+ <a href="Autotools Plugin-in User Guide.html" title="Autotools Plugin-in User Guide">
+ <img alt="Autotools Plugin-in User Guide" border="0" src="images/images/home.gif"/>
+ </a>
+ </td>
+ <td style="width: 20%" align="right"></td>
+ </tr>
+ <tr>
+ <td style="width: 20%" align="left" valign="top">Make Targets</td>
+ <td style="width: 60%" align="center"></td>
+ <td style="width: 20%" align="right" valign="top"></td>
+ </tr>
+ </table>
+ </body>
+</html> \ No newline at end of file
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtool-AutotoolsMakeTargetsMenu.png b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtool-AutotoolsMakeTargetsMenu.png
new file mode 100644
index 0000000000..92cff7e874
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtool-AutotoolsMakeTargetsMenu.png
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsAclocal.png b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsAclocal.png
new file mode 100644
index 0000000000..97c80f2dbd
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsAclocal.png
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsAutoconfEditor.png b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsAutoconfEditor.png
new file mode 100644
index 0000000000..fa9b65040a
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsAutoconfEditor.png
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsAutoconfEditorPrefs.png b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsAutoconfEditorPrefs.png
new file mode 100644
index 0000000000..ae132b13b2
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsAutoconfEditorPrefs.png
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsAutoheader.png b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsAutoheader.png
new file mode 100644
index 0000000000..151d88b376
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsAutoheader.png
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsAutomake.png b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsAutomake.png
new file mode 100644
index 0000000000..7b293bf75f
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsAutomake.png
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsAutomakeEditor.png b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsAutomakeEditor.png
new file mode 100644
index 0000000000..e47af3b226
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsAutomakeEditor.png
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsAutoreconf.png b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsAutoreconf.png
new file mode 100644
index 0000000000..6c540608de
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsAutoreconf.png
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsAutotools.png b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsAutotools.png
new file mode 100644
index 0000000000..b5d6ee7cc9
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsAutotools.png
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsAutotoolsConsole.png b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsAutotoolsConsole.png
new file mode 100644
index 0000000000..ee0ae5906f
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsAutotoolsConsole.png
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsBuildLocation.png b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsBuildLocation.png
new file mode 100644
index 0000000000..e64cd4cf44
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsBuildLocation.png
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsBuilders.png b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsBuilders.png
new file mode 100644
index 0000000000..de96459fd3
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsBuilders.png
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsCProjectWizard.png b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsCProjectWizard.png
new file mode 100644
index 0000000000..622690c8dc
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsCProjectWizard.png
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsCheckout.png b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsCheckout.png
new file mode 100644
index 0000000000..d502223df4
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsCheckout.png
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsConfsettings.png b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsConfsettings.png
new file mode 100644
index 0000000000..70065fe2c6
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsConfsettings.png
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsConsolePrefs.png b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsConsolePrefs.png
new file mode 100644
index 0000000000..2534bd1c3a
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsConsolePrefs.png
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsConsoleSelect.png b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsConsoleSelect.png
new file mode 100644
index 0000000000..8b6df0d1e8
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsConsoleSelect.png
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsConvAutotoolsWizard.png b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsConvAutotoolsWizard.png
new file mode 100644
index 0000000000..fe8c69de17
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsConvAutotoolsWizard.png
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsConvertWizard.png b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsConvertWizard.png
new file mode 100644
index 0000000000..c7ad60ead5
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsConvertWizard.png
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsCreateConf.png b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsCreateConf.png
new file mode 100644
index 0000000000..5e26d74b6a
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsCreateConf.png
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsEditorsTab.png b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsEditorsTab.png
new file mode 100644
index 0000000000..40dd5a0ec2
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsEditorsTab.png
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsLibtoolize.png b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsLibtoolize.png
new file mode 100644
index 0000000000..75b932bbb6
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsLibtoolize.png
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsMakeTargetBuild.png b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsMakeTargetBuild.png
new file mode 100644
index 0000000000..befd0a2b39
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsMakeTargetBuild.png
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsMakeTargetCreate.png b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsMakeTargetCreate.png
new file mode 100644
index 0000000000..25913c9c38
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsMakeTargetCreate.png
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsMakeTargetEdit.png b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsMakeTargetEdit.png
new file mode 100644
index 0000000000..1f2de55374
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsMakeTargetEdit.png
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsManageConfs.png b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsManageConfs.png
new file mode 100644
index 0000000000..c66cc3d91c
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsManageConfs.png
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsNewOther.png b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsNewOther.png
new file mode 100644
index 0000000000..b7865b2f95
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsNewOther.png
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsToolSettings.png b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsToolSettings.png
new file mode 100644
index 0000000000..0e4bdb4080
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-docs/userguide/images/Linuxtools-AutotoolsToolSettings.png
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-feature/.project b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-feature/.project
new file mode 100644
index 0000000000..9418b456b2
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-feature/.project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.linuxtools.cdt.autotools-feature</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
+</projectDescription>
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-feature/ChangeLog b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-feature/ChangeLog
new file mode 100644
index 0000000000..7954d04093
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-feature/ChangeLog
@@ -0,0 +1,96 @@
+2009-11-10 Andrew Overholt <overholt@redhat.com>
+
+ * feature.properties: Make featureName a bit more user-friendly.
+
+2009-11-04 Jeff Johnston <jjohnstn@redhat.com>
+
+ * feature.xml: Fix dependencies to support CDT 6.0.0 and up.
+
+2009-11-03 Jeff Johnston <jjohnstn@redhat.com>
+
+ * feature.xml: Fix feature id.
+
+2009-10-21 Jeff Johnston <jjohnstn@redhat.com>
+
+ * feature.xml: Add revised org.eclipse.linuxtools.cdt.autotools plug-in that has been
+ set up for compatbility mode to build older projects.
+
+2009-10-13 Jeff Johnston <jjohnstn@redhat.com>
+
+ * feature.xml: Bump to 2.0.0. Refer to new org.eclipse.linuxtools.cdt.autotools.core and
+ org.eclipse.linuxtools.cdt.autotools.ui plug-ins.
+
+2009-04-24 Jeff Johnston <jjohnstn@redhat.com>
+
+ * feature.xml: Fix dependencies to not require 6.0.0 CDT plugins as they
+ aren't in the CDT Master zip yet for Galileo builds.
+
+2009-04-23 Andrew Overholt <overholt@redhat.com>
+
+ * feature.xml: Use 6.0.0 CDT requirements on Galileo branch.
+
+2009-01-15 Jeff Johnston <jjohnstn@redhat.com>
+
+ * feature.xml: Bump up version to 1.0.2.
+
+2009-01-08 Jeff Johnston <jjohnstn@redhat.com>
+
+ Fixes #260436
+
+ * feature.xml: Add .qualifier to version id.
+
+2009-01-06 Andrew Overholt <overholt@redhat.com>
+
+ * feature.xml: Add update site information.
+ * build.properties: Add feature.properties and epl-v10.html.
+
+2008-10-31 Andrew Overholt <overholt@redhat.com>
+
+ * feature.xml: Use %featureName, %provider, %copyright, and %description from
+ feature.properties. Add "(Incubation)".
+ * feature.properties: Initial import.
+ * epl-v10.html: Likewise.
+
+2008-10-14 Jeff Johnston <jjohnstn@redhat.com>
+
+ * feature.xml: Update release to 1.0.1.
+
+2008-08-08 Jeff Johnston <jjohnstn@redhat.com>
+
+ * feature.xml: Update release to 1.0.0.
+
+2008-01-28 Jeff Johnston <jjohnstn@redhat.com>
+
+ * feature.xml: Update release to 0.9.6.
+
+2007-12-05 Jeff Johnston <jjohnstn@redhat.com>
+
+ * feature.xml: Update release to 0.9.5.3.
+
+2007-11-19 Jeff Johnston <jjohnstn@redhat.com>
+
+ * feature.xml: Update release to 0.9.5.2.
+
+2007-10-23 Jeff Johnston <jjohnstn@redhat.com>
+
+ * feature.xml: Update release to 0.9.5.1.
+
+2007-10-04 jjohnstn <jjohnstn@vermillion>
+
+ * feature.xml: Update release to 0.9.5.
+
+2007-09-24 Jeff Johnston <jjohnstn@redhat.com>
+
+ * feature.xml: Update release to 0.9.4.
+
+2007-09-05 Jeff Johnston <jjohnstn@redhat.com>
+
+ * feature.xml: Update release to 0.9.3.
+
+2007-08-17 Jeff Johnston <jjohnstn@redhat.com>
+
+ * feature.xml: Fix up release number.
+
+2007-07-19 Jeff Johnston <jjohnstn@redhat.com>
+
+ * feature.xml: Fix up description to not reference sample url.
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-feature/about.html b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-feature/about.html
new file mode 100644
index 0000000000..44e229003e
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-feature/about.html
@@ -0,0 +1,33 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html>
+<head>
+<title>About</title>
+<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>8th September, 2004</p>
+<h3>License</h3>
+<p>The Eclipse Software Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<h3>Contributions</h3>
+
+<p>If this Content is licensed to you under the terms and conditions of the EPL, any Contributions, as defined in the EPL, uploaded, submitted, or otherwise
+made available to the Eclipse Foundation, its members and/or the host of the Eclipse Foundation web site, by you that relate to such
+Content are provided under the terms and conditions of the <a href="http://www.eclipse.org/legal/termsofuse.html">Terms of Use</a>
+for the Eclipse Foundation web site and can be made available to others under the terms of the licenses as set out in the
+<a href="http://www.eclipse.org/legal/termsofuse.html">Terms of Use</a>.</p>
+
+<p>If this Content is licensed to you under license terms and conditions other than the EPL (&quot;Other License&quot;), any modifications, enhancements and/or
+other code and/or documentation (&quot;Modifications&quot;) uploaded, submitted, or otherwise made available to the Eclipse Foundation, its members and/or the
+host of the Eclipse Foundation web site, 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 <a href="http://www.eclipse.org/legal/termsofuse.html">Terms of Use</a>
+for the Eclipse Foundation web site and such Modifications can be made available to others under the terms of the licenses as set out in the
+<a href="http://www.eclipse.org/legal/termsofuse.html">Terms of Use</a>.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-feature/build.properties b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-feature/build.properties
new file mode 100644
index 0000000000..d361ddb536
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-feature/build.properties
@@ -0,0 +1,4 @@
+bin.includes = feature.xml,\
+ about.html,\
+ epl-v10.html,\
+ feature.properties
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-feature/epl-v10.html b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-feature/epl-v10.html
new file mode 100644
index 0000000000..9320c9f37c
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-feature/epl-v10.html
@@ -0,0 +1,320 @@
+<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head>
+
+
+<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
+<meta name="ProgId" content="Word.Document">
+<meta name="Generator" content="Microsoft Word 9">
+<meta name="Originator" content="Microsoft Word 9">
+<link rel="File-List" href="http://www.eclipse.org/legal/Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
+<title>Eclipse Public License - Version 1.0</title>
+<!--[if gte mso 9]><xml>
+ <o:DocumentProperties>
+ <o:Revision>2</o:Revision>
+ <o:TotalTime>3</o:TotalTime>
+ <o:Created>2004-03-05T23:03:00Z</o:Created>
+ <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
+ <o:Pages>4</o:Pages>
+ <o:Words>1626</o:Words>
+ <o:Characters>9270</o:Characters>
+ <o:Lines>77</o:Lines>
+ <o:Paragraphs>18</o:Paragraphs>
+ <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
+ <o:Version>9.4402</o:Version>
+ </o:DocumentProperties>
+</xml><![endif]--><!--[if gte mso 9]><xml>
+ <w:WordDocument>
+ <w:TrackRevisions/>
+ </w:WordDocument>
+</xml><![endif]-->
+<style>
+<!--
+ /* Font Definitions */
+@font-face
+ {font-family:Tahoma;
+ panose-1:2 11 6 4 3 5 4 4 2 4;
+ mso-font-charset:0;
+ mso-generic-font-family:swiss;
+ mso-font-pitch:variable;
+ mso-font-signature:553679495 -2147483648 8 0 66047 0;}
+ /* Style Definitions */
+p.MsoNormal, li.MsoNormal, div.MsoNormal
+ {mso-style-parent:"";
+ margin:0in;
+ margin-bottom:.0001pt;
+ mso-pagination:widow-orphan;
+ font-size:12.0pt;
+ font-family:"Times New Roman";
+ mso-fareast-font-family:"Times New Roman";}
+p
+ {margin-right:0in;
+ mso-margin-top-alt:auto;
+ mso-margin-bottom-alt:auto;
+ margin-left:0in;
+ mso-pagination:widow-orphan;
+ font-size:12.0pt;
+ font-family:"Times New Roman";
+ mso-fareast-font-family:"Times New Roman";}
+p.BalloonText, li.BalloonText, div.BalloonText
+ {mso-style-name:"Balloon Text";
+ margin:0in;
+ margin-bottom:.0001pt;
+ mso-pagination:widow-orphan;
+ font-size:8.0pt;
+ font-family:Tahoma;
+ mso-fareast-font-family:"Times New Roman";}
+@page Section1
+ {size:8.5in 11.0in;
+ margin:1.0in 1.25in 1.0in 1.25in;
+ mso-header-margin:.5in;
+ mso-footer-margin:.5in;
+ mso-paper-source:0;}
+div.Section1
+ {page:Section1;}
+-->
+</style>
+</head><body style="" lang="EN-US">
+
+<div class="Section1">
+
+<p style="text-align: center;" align="center"><b>Eclipse Public License - v 1.0</b>
+</p>
+
+<p><span style="font-size: 10pt;">THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
+THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE,
+REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
+OF THIS AGREEMENT.</span> </p>
+
+<p><b><span style="font-size: 10pt;">1. DEFINITIONS</span></b> </p>
+
+<p><span style="font-size: 10pt;">"Contribution" means:</span> </p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a)
+in the case of the initial Contributor, the initial code and documentation
+distributed under this Agreement, and<br clear="left">
+b) in the case of each subsequent Contributor:</span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">i)
+changes to the Program, and</span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">ii)
+additions to the Program;</span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">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. </span></p>
+
+<p><span style="font-size: 10pt;">"Contributor" means any person or
+entity that distributes the Program.</span> </p>
+
+<p><span style="font-size: 10pt;">"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. </span></p>
+
+<p><span style="font-size: 10pt;">"Program" means the Contributions
+distributed in accordance with this Agreement.</span> </p>
+
+<p><span style="font-size: 10pt;">"Recipient" means anyone who
+receives the Program under this Agreement, including all Contributors.</span> </p>
+
+<p><b><span style="font-size: 10pt;">2. GRANT OF RIGHTS</span></b> </p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a)
+Subject to the terms of this Agreement, each Contributor hereby grants Recipient
+a non-exclusive, worldwide, royalty-free copyright license to<span style="color: red;"> </span>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.</span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b)
+Subject to the terms of this Agreement, each Contributor hereby grants
+Recipient a non-exclusive, worldwide,<span style="color: green;"> </span>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. </span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">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.</span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">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. </span></p>
+
+<p><b><span style="font-size: 10pt;">3. REQUIREMENTS</span></b> </p>
+
+<p><span style="font-size: 10pt;">A Contributor may choose to distribute the
+Program in object code form under its own license agreement, provided that:</span>
+</p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a)
+it complies with the terms and conditions of this Agreement; and</span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b)
+its license agreement:</span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">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; </span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">ii)
+effectively excludes on behalf of all Contributors all liability for damages,
+including direct, indirect, special, incidental and consequential damages, such
+as lost profits; </span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">iii)
+states that any provisions which differ from this Agreement are offered by that
+Contributor alone and not by any other party; and</span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">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.<span style="color: blue;"> </span></span></p>
+
+<p><span style="font-size: 10pt;">When the Program is made available in source
+code form:</span> </p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a)
+it must be made available under this Agreement; and </span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b) a
+copy of this Agreement must be included with each copy of the Program. </span></p>
+
+<p><span style="font-size: 10pt;">Contributors may not remove or alter any
+copyright notices contained within the Program. </span></p>
+
+<p><span style="font-size: 10pt;">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. </span></p>
+
+<p><b><span style="font-size: 10pt;">4. COMMERCIAL DISTRIBUTION</span></b> </p>
+
+<p><span style="font-size: 10pt;">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.</span> </p>
+
+<p><span style="font-size: 10pt;">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.</span> </p>
+
+<p><b><span style="font-size: 10pt;">5. NO WARRANTY</span></b> </p>
+
+<p><span style="font-size: 10pt;">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. </span></p>
+
+<p><b><span style="font-size: 10pt;">6. DISCLAIMER OF LIABILITY</span></b> </p>
+
+<p><span style="font-size: 10pt;">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.</span> </p>
+
+<p><b><span style="font-size: 10pt;">7. GENERAL</span></b> </p>
+
+<p><span style="font-size: 10pt;">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.</span> </p>
+
+<p><span style="font-size: 10pt;">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. </span></p>
+
+<p><span style="font-size: 10pt;">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. </span></p>
+
+<p><span style="font-size: 10pt;">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. The Eclipse Foundation is the initial
+Agreement Steward. The Eclipse Foundation 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.</span> </p>
+
+<p><span style="font-size: 10pt;">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.</span> </p>
+
+<p class="MsoNormal"><!--[if !supportEmptyParas]-->&nbsp;<!--[endif]--><o:p></o:p></p>
+
+</div>
+
+</body></html> \ No newline at end of file
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-feature/feature.properties b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-feature/feature.properties
new file mode 100644
index 0000000000..9717e8bfd2
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-feature/feature.properties
@@ -0,0 +1,112 @@
+#################################################################################
+# Copyright (c) 2008 Red Hat, Inc.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Red Hat Incorporated - initial API and implementation
+#################################################################################
+featureName=Autotools support for CDT (Incubation)
+description=Plugins for maintaining C/C++ projects that use Autotools (autoconf and automake).
+provider=Eclipse
+copyright=Copyright 2006, 2007, 2008, 2009 Red Hat, Inc.
+licenseURL=epl-v10.html
+license=\
+ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\n\
+March 17, 2005\n\
+\n\
+Usage Of Content\n\
+\n\
+THE ECLIPSE FOUNDATION 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\
+Applicable Licenses\n\
+\n\
+Unless otherwise indicated, all Content made available by the Eclipse Foundation\n\
+is provided to you under the terms and conditions of the Eclipse Public\n\
+License Version 1.0 ("EPL"). A copy of the EPL is provided with this\n\
+Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
+For purposes of the EPL, "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 structured and packaged into modules to facilitate delivering,\n\
+ extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
+ plug-in fragments ("Fragments"), and features ("Features").\n\
+ - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java? ARchive)\n\
+ in a directory named "plugins".\n\
+ - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
+ Each Feature may be packaged as a sub-directory in a directory named "features".\n\
+ Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
+ numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
+ - Features may also include other Features ("Included Features"). Within a Feature, files\n\
+ named "feature.xml" may contain a list of the names and version numbers of Included 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\
+ - Inside Plug-ins and Fragments packaged as JARs\n\
+ - Sub-directories of the directory named "src" of certain Plug-ins\n\
+ - Feature directories\n\
+\n\
+Note: if a Feature made available by the Eclipse Foundation 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.\n\
+\n\
+THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\n\
+TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
+SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
+\n\
+ - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
+ - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
+ - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
+ - IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html)\n\
+ - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
+ - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
+\n\
+IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
+TO USE OF THE CONTENT. If no About, Feature License or Feature Update License\n\
+is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
+govern that particular Content.\n\
+\n\
+Cryptography\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\
+\n\
+Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n \ No newline at end of file
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-feature/feature.xml b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-feature/feature.xml
new file mode 100644
index 0000000000..8f26e37bdf
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools-feature/feature.xml
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.eclipse.linuxtools.cdt.autotools"
+ label="%featureName"
+ version="2.0.0.qualifier"
+ provider-name="%provider">
+
+ <description>
+ %description
+ </description>
+
+ <copyright>
+ %copyright
+ </copyright>
+
+ <license url="epl-v10.php">
+ %license
+ </license>
+
+ <url>
+ <update label="Linux Tools Update Site" url="http://download.eclipse.org/technology/linuxtools/update"/>
+ </url>
+
+ <requires>
+ <import plugin="org.eclipse.cdt.managedbuilder.core" version="5.0.100" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.cdt.core" version="5.1.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.cdt.ui" version="5.1.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.cdt.managedbuilder.ui" version="5.0.100" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.cdt.managedbuilder.gnu.ui" version="5.0.100" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.ui.cheatsheets"/>
+ <import plugin="org.eclipse.ui" version="3.4.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.core.runtime" version="3.4.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.jface.text" version="3.4.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.ui.editors" version="3.4.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.ui.workbench.texteditor" version="3.4.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.core.resources" version="3.4.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.ui.ide" version="3.4.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.cdt.make.core" version="5.1.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.cdt.make.ui" version="5.0.100" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.ui.console" version="3.3.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.help" version="3.3.100" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.core.variables" version="3.2.100" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.ui.views" version="3.3.0" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.core.filesystem" version="1.2.0" match="greaterOrEqual"/>
+ </requires>
+
+ <plugin
+ id="org.eclipse.linuxtools.cdt.autotools.core"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.linuxtools.cdt.autotools.ui"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.linuxtools.cdt.autotools_docs"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.eclipse.linuxtools.cdt.autotools"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+</feature>
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/.classpath b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/.classpath
new file mode 100644
index 0000000000..64c5e31b7a
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/.cvsignore b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/.cvsignore
new file mode 100644
index 0000000000..50c1b30a80
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/.cvsignore
@@ -0,0 +1,4 @@
+bin
+@dot
+javaCompiler...args
+build.xml
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/.project b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/.project
new file mode 100644
index 0000000000..3cb23d3fe8
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.linuxtools.cdt.autotools.core</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/.settings/org.eclipse.jdt.core.prefs b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000000..43deb750f8
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,12 @@
+#Wed Feb 18 16:59:38 EST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/.settings/org.eclipse.jdt.ui.prefs b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 0000000000..4c7131801a
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,3 @@
+#Tue Jan 02 14:11:13 EST 2007
+eclipse.preferences.version=1
+internal.default.compliance=default
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/ChangeLog b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/ChangeLog
new file mode 100644
index 0000000000..2569225a72
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/ChangeLog
@@ -0,0 +1,4082 @@
+2010-04-06 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #308261
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/AutotoolsConfiguration.java (copy): Only set
+ the isDirty flag to true if we are cloning a configuration to a new id. A straight copy should not change the isDirty
+ flag.
+
+2010-03-18 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #306406
+ * src/org/eclipse/linuxtools/cdt/autotools/core/AutotoolsNewProjectNature.java (addAutotoolsBuilder): Don't save
+ project description unless builder list has been modified. To save the project description, use a Job so it is
+ done asynchronously.
+
+2010-03-15 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/core/AutotoolsNewMakeGenerator.java (regenerateMakefiles): Use the
+ id of the IConfiguration not the name to fetch the IAConfiguration for it.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/AutotoolsOptionValueHandler.java (handleValue): Make
+ sure ICConfigurationDescription exists before accessing it.
+
+2010-03-12 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #304005
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/core/AutotoolsConfigurationBuilder.java (build): Add logic to
+ check for dirty configuration.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/core/AutotoolsNewMakeGenerator.java (runScript): Change to use getId
+ instead of getName method for IAConfiguration.
+ (runCommand): Ditto.
+ (regenerateMakefiles): Add call to sync configurations.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/AutotoolsConfiguration.java (getId): New
+ method.
+ (copy): Changed to two separate methods, one which takes an id and the other which takes no parameter
+ and expects the id to be copied.
+ (AutotoolsConfiguration): Changed to accept an id rather than a name.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/AutotoolsConfigurationManager.java: Change to keep
+ track of temporary configuration list for a project. This is needed when performing configuration settings and the
+ user has not yet confirmed. In addition, store all configurations by id and not name since the id does not change.
+ (resourceChanged): Logic changed to rename both saved and temporary configuration lists which are now Map structures.
+ (AutotoolsConfigurationManager): Add hash maps for saved and temporary configuration lists.
+ (syncConfigurations): New method.
+ (applyConfigs): Ditto.
+ (saveConfigs): Changed to take the project as parameter. A second private
+ version of the function also has been added which takes an array of Configuration
+ Descriptions. The option value "Name" for configure tool is resolved for saved configurations.
+ (getConfigs): Renamed to getSavedConfigs.
+ (getSavedConfigs): New method renamed from getConfigs.
+ (getConfigurations): Renamed to getSavedConfigs.
+ (isConfigurationAlreadySaved): Modified calls.
+ (setSyncing): New method.
+ (createDefaultConfiguration): Pass id instead of name to constructor.
+ (isSyncing): New method.
+ (addConfiguration): No longer need to check for existence because we are adding to a Map.
+ (replaceConfiguration): Removed.
+ (saveAllConfigs): Ditto.
+ (replaceProjectConfigurations): Split into two versions. The new version takes an additional
+ parameter which is an array of Configuration descriptions.
+ (getTmpConfigs): New method.
+ (syncNameField): New method.
+ (clearTmpConfigurations): New method.
+ (findCfg): Find by id and not name.
+ (getTmpConfiguration): New method.
+ (getConfiguration): Try and find configuration by id before creating default.
+ (cloneCfg): New method taken out of AutotoolsConfigurationPropertyPage and added here to perform cloning of an Autotools configuration.
+ Logic has been added to not perform cloning if the target configuration already has been saved and to return a boolean regarding this.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/AutotoolsOptionValueHandler.java (handleValue): Changed to
+ call new cloneCfg interface in AutotoolsConfigurationManager. Logic to check for an Autotools Clone listener is removed. The return
+ code of cloneCfg is checked to see if the configuration has already been saved. If not saved and we are not doing a sync
+ then it returns without resolving the Name option field. The Name option field is now the Configuration Description id
+ which does not change on a rename operation.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/IAConfiguration.java: Add new getId method. Remove name methods
+ which are no longer used.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/core/wizards/NewAutotoolsProject.java (process): Modified call to
+ saveConfigs.
+ (process): Ditto.
+
+2010-02-25 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/core/AutotoolsNewMakeGenerator.java (getAutogenPath): Fix typo
+ so we split tokens on white-space, not non-white-space.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/AutotoolsConfigurationManager.java (saveConfigs):
+ Since we base ourselves on hashing by name, do not save multiple configurations with same name.
+ (getConfigs): Do not load multiple configurations with same name, just the first.
+
+2010-02-24 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #303616
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/core/AutotoolsNewMakeGenerator.java (runScript): Use
+ unresolved default if environment variable is uninitialized.
+ (initializeBuildConfigDirs): Ditto.
+ (runCommand): Ditto.
+
+2010-02-24 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #303613
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/ConfigureMessages.properties: Fix tooltip
+ for config tool directory.
+
+2010-02-23 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #303616
+ * src/org/eclipse/inuxtools/internal/cdt/autotools/core/AutotoolsNewMakeGenerator.java (getAutogenArgs):
+ Add additional parameter of arguments found in the command itself.
+ (getConfigArgs): Ditto.
+ (getAutogenPath): Fix to split out additional arguments specified with the command.
+ (getConfigurePath): Ditto.
+ (runScript): Fix to resolve build macros for arguments.
+ (runCommand): Ditto.
+ (regenerateMakefiles): Fix references to functions above to pass additional parms.
+
+2010-02-09 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/core/AutotoolsNewMakeGenerator.java (addMakeTargetsToManager): Add
+ code to use reflection to look for new MakeTargetManager setTargets method which will set the entire list
+ of MakeTargets at one time.
+
+2009-12-01 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #296616
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/core/MakeTarget.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/core/MakeTargetManager.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/core/ProjectTargets.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/core/AutotoolsNewProjectNature.java:
+ (removeOldAutotoolsNature): New Method.
+ (addAutotoolsBuilder): Compensate for case where we are dealing with old Autotools project.
+
+2009-11-16 Andrew Overholt <overholt@redhat.com>
+
+ * plugin.properties: Fix provider name.
+
+2009-11-04 Jeff Johnston <jjohnstn@redhat.com>
+
+ * META-INF/MANIFEST.MF: Change dependencies to handle CDT 6.0.0 and up.
+
+2009-11-02 Jeff Johnston <jjohnstn@redhat.com>
+
+ * plugin.xml: Make special source content types for configure and autogen.sh and have each tool
+ reference their proper input scripts. Add a discovery profile id for the inputs to each tool
+ and have neither support managed build. Add the gcc and g++ compiler directly to the set of
+ tools for the GNU Autotools toolchain.
+ * src/org/eclipse/linuxtools/cdt/autotools/core/Resources.properties: New message for running
+ distclean in top-level directory.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/core/AutotoolsNewMakeGenerator.java (addMakeTargetsToManager):
+ Try and find an old MakeTarget to use instead of always creating one from scratch.
+ (regenerateMakefiles): When a full configure is required and the top-level source directory has
+ already been configured in, a make distclean to the top-level source directory is required before
+ a configuration can be performed in an alternate directory. Do this automatically, but let the
+ user know what happened. In addition, change the console for Autotools configuration so that
+ the console is not cleared within one build.
+
+2009-10-29 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/core/DefaultNoDependencyCalculator.java: New file.
+ * plugin.properties: Add required messages.
+ * plugin.xml: Add gcc and g++ tools to GNU toolchain. Add content types for configure and autogen.sh
+ scripts and make these the source content types for configure and autogen.sh respectively.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/core/AutotoolsPropertyConstants.java: Add
+ compat constants for use with older projects.
+
+2009-10-27 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/core/wizards/NewAutotoolsProject.java: Clean
+ up unused imports.
+ * plugin.xml: Add gcc and g++ to toolchain. Specify GCCStdMakePerFile discovery profile
+ for toolchain and for configure tool inputs.
+
+2009-10-20 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/core/wizards/NewAutotoolsProject.java (process): Add
+ creation of default Autotools configuration.
+
+2009-10-13 Jeff Johnston <jjohnstn@redhat.com>
+
+ * build.properties: Remove icons.
+ * icons/ac16/acmacro_arg_obj.gif: Removed.
+ * icons/ac16/acmacro_obj.gif: Removed.
+ * icons/ac16/ammacro_obj.gif: Removed.
+ * icons/ac16/case_obj.gif: Removed.
+ * icons/ac16/condition_obj.gif: Removed.
+ * icons/ac16/convert_normal.gif: Removed.
+ * icons/ac16/elif_obj.gif: Removed.
+ * icons/ac16/else_obj.gif: Removed.
+ * icons/ac16/for_obj.gif: Removed.
+ * icons/ac16/if_obj.gif: Removed.
+ * icons/ac16/while_obj.gif: Removed.
+ * icons/autoconf.gif: Removed.
+ * icons/automake.gif: Removed.
+ * icons/dlcl16/build_configs.gif: Removed.
+ * icons/dlcl16/config_category.gif: Removed.
+ * icons/dlcl16/config_tool.gif: Removed.
+ * icons/dlcl16/newc_app.gif: Removed.
+ * icons/dlcl16/newcc_app.gif: Removed.
+ * icons/dlcl16/open_include.gif: Removed.
+ * icons/dtool16/alphab_sort_co.gif: Removed.
+ * icons/dtool16/build_menu.gif: Removed.
+ * icons/dtool16/convert-normal.gif: Removed.
+ * icons/dtool16/make.gif: Removed.
+ * icons/dtool16/makefile.gif: Removed.
+ * icons/dtool16/newc_app.gif: Removed.
+ * icons/dtool16/newcc_app.gif: Removed.
+ * icons/dtool16/segment_edit.gif: Removed.
+ * icons/dtool16/target_add.gif: Removed.
+ * icons/dtool16/target_build.gif: Removed.
+ * icons/dtool16/target_delete.gif: Removed.
+ * icons/dtool16/target_edit.gif: Removed.
+ * icons/dtool16/update_old.gif: Removed.
+ * icons/elcl16/build_configs.gif: Removed.
+ * icons/elcl16/config_category.gif: Removed.
+ * icons/elcl16/config_tool.gif: Removed.
+ * icons/elcl16/newc_app.gif: Removed.
+ * icons/elcl16/newcc_app.gif: Removed.
+ * icons/elcl16/open_include.gif: Removed.
+ * icons/etool16/alphab_sort_co.gif: Removed.
+ * icons/etool16/build_menu.gif: Removed.
+ * icons/etool16/convert_normal.gif: Removed.
+ * icons/etool16/make.gif: Removed.
+ * icons/etool16/makefile.gif: Removed.
+ * icons/etool16/newc_app.gif: Removed.
+ * icons/etool16/newcc_app.gif: Removed.
+ * icons/etool16/segment_edit.gif: Removed.
+ * icons/etool16/target_add.gif: Removed.
+ * icons/etool16/target_build.gif: Removed.
+ * icons/etool16/target_delete.gif: Removed.
+ * icons/etool16/target_edit.gif: Removed.
+ * icons/etool16/target_filter.gif: Removed.
+ * icons/etool16/update_old.gif: Removed.
+ * icons/obj16/acmacro_obj.gif: Removed.
+ * icons/obj16/command_obj.gif: Removed.
+ * icons/obj16/define_obj.gif: Removed.
+ * icons/obj16/environment_obj.gif: Removed.
+ * icons/obj16/envvar_obj.gif: Removed.
+ * icons/obj16/error_obj.gif: Removed.
+ * icons/obj16/fatalerror_obj.gif: Removed.
+ * icons/obj16/hfolder_obj.gif: Removed.
+ * icons/obj16/include_obj.gif: Removed.
+ * icons/obj16/info_obj.gif: Removed.
+ * icons/obj16/irule_obj.gif: Removed.
+ * icons/obj16/lib_obj.gif: Removed.
+ * icons/obj16/macro_obj.gif: Removed.
+ * icons/obj16/relation_obj.gif: Removed.
+ * icons/obj16/target_obj.gif: Removed.
+ * icons/obj16/trule_obj.gif: Removed.
+ * icons/obj16/warning_obj.gif: Removed.
+ * icons/sample.gif:
+
+2009-10-09 Jeff Johnston <jjohnstn@redhat.com>
+
+ Refactoring of org.eclipse.linuxtools.cdt.autotools into org.eclipse.linuxtools.cdt.autotools.core
+ and org.eclipse.linuxtools.cdt.autotools.ui.
+
+ * .settings/org.eclipse.core.resources.prefs: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/AbstractAutotoolsHandler.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/AbstractTargetAction.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/AclocalHandler.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/AutoconfHandler.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/AutoheaderHandler.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/AutomakeHandler.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/AutoreconfHandler.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAclocalAction.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAction.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAutoconfAction.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAutoheaderAction.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAutomakeAction.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAutoreconfAction.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeLibtoolizeAction.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeMessages.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeMessages.properties: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/LibtoolizeHandler.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/ReconfigureAction.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/ReconfigureHandler.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/SingleInputDialog.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/TwoInputDialog.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsBuilder.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsConfigurationBuilder.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsMakefileBuilder.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsMakeTargetManager.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsNewMakeGenerator.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsNewProjectNature.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsOptionValueHandler.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsPlugin.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsProjectNature.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsProjectPropertyTester.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsScannerInfo.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsScannerInfoProvider.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutoconfSubstRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakeCompletionProcessor.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakeConfigMacro.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakeDocumentProvider.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakeEditor.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakeEditorFactory.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakeErrorHandler.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/Automakefile.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakefileCodeScanner.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakefileContentOutlinePage.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakefileReconcilingStrategy.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakefileSourceConfiguration.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakefileUtil.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakeIfElse.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakeMacroDefinitionRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakeMacroReferenceRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakeTextHover.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakeWordDetector.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/configure/AbstractConfigurationOption.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/configure/AutotoolsConfiguration.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/configure/AutotoolsConfigurationManager.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/configure/BinConfigureOption.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/configure/ConfigureMessages.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/configure/ConfigureMessages.properties: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/configure/ConfigureOptionCategory.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/configure/ConfigureTool.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/configure/IAConfiguration.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/configure/IConfigureOption.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/configure/InternalConfigureOption.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/configure/MultiArgConfigureOption.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/configure/StringConfigureOption.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/AbstractElementListSelectionDialog.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/AbstractMakefile.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/AbstractMakefileCodeScanner.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/AddBuildTargetAction.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/ArchiveTarget.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/BadDirective.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/Command.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/Comment.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/CompletionProposalComparator.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/Conditional.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/DefaultRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/DefineVariable.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/DeleteOnErrorRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/Directive.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/EditorUtility.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/ElementListSelectionDialog.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/Else.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/EmptyLine.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/Endef.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/Endif.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/ExportAllVariablesRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/ExportVariable.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/ExternalEditorInput.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/ExternalEditorInputFactory.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/GNUAutomakefile.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/GNUMakefileConstants.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/GNUMakefileUtil.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/GNUTargetRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/GNUVariableDef.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/IAutomakeConditional.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/If.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/Ifdef.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/Ifeq.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/Ifndef.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/Ifneq.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/IgnoreRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/IMakefileDocumentProvider.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/IMakefileEditorActionDefinitionIds.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/Include.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/InferenceRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/IntermediateRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/IReconcilingParticipant.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/ISelectionValidator.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/ITranslationUnitEditorInput.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/LexicalSortingAction.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/LowResolutionTimeRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MacroDefinition.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MacroDefinitionRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MacroReferenceRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MakefileAnnotationHover.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MakefileCodeScanner.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MakefileCompletionProcessor.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MakeFileConstants.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MakefileContentOutlinePage.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MakefileDocumentProvider.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MakefileDocumentSetupParticipant.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MakefileEditor.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MakefileEditorActionContributor.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MakefileEditorPreferenceConstants.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MakefileEditorTogglePresentationAction.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MakefileMessages.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MakefilePartitionScanner.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MakefileReader.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MakefileReconcilingStrategy.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MakeFileResources.properties: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MakefileSourceConfiguration.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MakefileStorageDocumentProvider.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MakefileTextHover.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MakefileWordDetector.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MessageLine.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/NotParallelRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/NullMakefile.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/OpenDeclarationAction.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/OpenIncludeAction.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/OverrideDefine.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/OverrideVariable.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/Parent.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/PhonyRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/PosixMakefileUtil.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/PosixRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/PreciousRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/ProjectionMakefileUpdater.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/Rule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/SccsGetRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/SecondaryRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/SelectionList.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/SelectionStatusDialog.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/SilentRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/SpecialRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/StaticTargetRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/StatusInfo.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/StatusTool.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/StringMatcher.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/SuffixesRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/Target.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/TargetRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/TargetVariable.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/Terminal.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/TwoArrayQuickSort.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/UnExport.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/Util.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/VariableDefinition.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/VPath.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/WordPartDetector.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/WorkingCopyManager.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/MakeMessages.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/MakeTarget.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/MakeTargetManager.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/MarkerGenerator.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ProjectTargets.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/text/hover/AutoconfPrototype.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/text/hover/AutoconfTextHover.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/text/hover/HoverMessages.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/text/hover/HoverMessages.properties: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/AbstractAutotoolsCPropertyTab.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/AutotoolsConsole.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/AutotoolsPluginImages.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/CBuildStepsConsole.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/CConfigureConsole.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/Console.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/ConsoleMessages.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/ConsoleMessages.properties: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/CWordFinder.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/editors/autoconf/ProjectionFileUpdater.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/ErrorParserBlock.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/FileRelevance.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/HTML2TextReader.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/HTMLPrinter.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/HTMLTextPresenter.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/LineBreakingReader.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/LocationAdapter.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/MakeResources.properties: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/MakeUIImages.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/MakeUIMessages.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/MessageLine.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/OptionalMessageDialog.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/preferences/AbstractEditorPreferencePage.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/preferences/AutoconfEditorPreferencePage.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/preferences/AutomakeEditorPreferencePage.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/preferences/AutotoolsEditorPreferenceConstants.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/preferences/AutotoolsPreferencePage.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/preferences/AutotoolsPreferencesMessages.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/preferences/AutotoolsPreferencesMessages.properties: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/preferences/ColorEditor.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/preferences/ColorManager.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/preferences/OverlayPreferenceStore.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/preferences/StatusInfo.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/preferences/TabFolderLayout.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AbstractConfigurePropertyOptionsPage.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsBuildPropertyPage.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsCategoryPropertyOptionPage.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsConfigurePrefStore.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsConfigurePropertyPage.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsConfigurePropertyTab.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsEditorPropertyTab.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsGeneralPropertyPage.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsHeadPropertyPage.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsPropertyConstants.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsPropertyManager.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsPropertyMessages.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsPropertyMessages.properties: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsToolPropertyOptionPage.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsToolsPropertyTab.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/IProjectPropertyListener.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/IPropertyChangeManager.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/ToolListContentProvider.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/ToolListElement.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/ToolListLabelProvider.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/ResourceLookup.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/ResourceLookupTree.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/SingleCharReader.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/SubstitutionTextReader.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/wizards/AutotoolsWizardMessages.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/wizards/AutotoolsWizardMessages.properties: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/wizards/ConfigurationContentProvider.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/wizards/ConfigurationLabelProvider.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/wizards/ManagedProjectOptionBlock.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/wizards/NewAutotoolsProject.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/MakeGenerator.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/popup/actions/GetDefinedSymbolsAction.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/popup/actions/GetIncludePathAction.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/Resources.properties: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfAnnotationHover.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfCodeScanner.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfDocumentProvider.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfDocumentSetupParticipant.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfEditor.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfEditorMacroValidator.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfEditorMessages.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfEditorMessages.properties: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfErrorHandler.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfIdentifierRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfKeywordDetector.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfM4WordDetector.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacro.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroCodeScanner.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroContentAssistProcessor.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroDamagerRepairer.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroParameterListValidator.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroPartitionRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroProposalContextInformation.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroWordDetector.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfPartitioner.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfPartitionScanner.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfPKGWordDetector.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfReconcilingStrategy.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfSourceViewerConfiguration.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfWhitespaceDetector.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfWordDetector.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/IAutotoolEditorActionDefinitionIds.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/IAutotoolHelpContextIds.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/IAutotoolsEditor.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/InlineDataRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/MultilineRuleDamagerRepairer.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/outline/AutoconfContentOutlinePage.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/outline/AutoconfContentProvider.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/outline/AutoconfLabelProvider.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/ParseException.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfCaseConditionElement.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfCaseElement.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfElement.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfElifElement.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfElseElement.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfForElement.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfIfElement.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfMacroArgumentElement.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfMacroDetector.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfMacroElement.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfOutlineErrorHandler.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfParser.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfRootElement.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfSelectElement.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfTokenizer.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfUntilElement.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfWhileElement.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/IAutoconfErrorHandler.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/IAutoconfMacroDetector.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/IAutoconfMacroValidator.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/IMacroDetector.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/ITokenConstants.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/ParseException.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/Token.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/RecursiveSingleLineRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/RestrictedEndOfLineRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/wizards/AutotoolsBuildWizard.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/wizards/AutotoolsNewCProjectWizardV2.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/wizards/ConvertToAutotoolsProjectWizard.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/wizards/ConvertToAutotoolsProjectWizardPage.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/wizards/CProjectPlatformPage.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/wizards/NewAutotoolsCCProjectWizard.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/wizards/NewAutotoolsCProjectWizard.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/wizards/NewAutotoolsProjectOptionPage.java: Removed.
+ * templates/projecttemplates/EmptyProject/template.properties: Removed.
+ * templates/projecttemplates/EmptyProject/template.xml: Removed.
+ * templates/projecttemplates/HelloWorldCAutotoolsProject/src/AUTHORS: Removed.
+ * templates/projecttemplates/HelloWorldCAutotoolsProject/src/Basename.c: Removed.
+ * templates/projecttemplates/HelloWorldCAutotoolsProject/src/configure.ac.top: Removed.
+ * templates/projecttemplates/HelloWorldCAutotoolsProject/src/COPYING: Removed.
+ * templates/projecttemplates/HelloWorldCAutotoolsProject/src/Makefile.am.src: Removed.
+ * templates/projecttemplates/HelloWorldCAutotoolsProject/src/Makefile.am.top: Removed.
+ * templates/projecttemplates/HelloWorldCAutotoolsProject/src/NEWS: Removed.
+ * templates/projecttemplates/HelloWorldCAutotoolsProject/src/README: Removed.
+ * templates/projecttemplates/HelloWorldCAutotoolsProject/template.properties: Removed.
+ * templates/projecttemplates/HelloWorldCAutotoolsProject/template.xml: Removed.
+ * templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/AUTHORS: Removed.
+ * templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/Basename.cpp: Removed.
+ * templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/configure.ac.top: Removed.
+ * templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/COPYING: Removed.
+ * templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/Makefile.am.src: Removed.
+ * templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/Makefile.am.top: Removed.
+ * templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/NEWS: Removed.
+ * templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/README: Removed.
+ * templates/projecttemplates/HelloWorldCPPAutotoolsProject/template.properties: Removed.
+ * templates/projecttemplates/HelloWorldCPPAutotoolsProject/template.xml: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/core/AutotoolsNewProjectNature.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/core/AutotoolsPlugin.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/core/Resources.properties: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/core/AutotoolsConfigurationBuilder.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/core/AutotoolsNewMakeGenerator.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/core/AutotoolsPropertyConstants.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/AutotoolsOptionValueHandler.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/core/IConfigurationCloneListener.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/core/MakeMessages.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/core/MakeTarget.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/core/MakeTargetManager.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/core/MarkerGenerator.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/core/ProjectTargets.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/core/wizards/NewAutotoolsProject.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/AbstractConfigurationOption.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/AutotoolsConfiguration.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/AutotoolsConfigurationManager.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/BinConfigureOption.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/ConfigureMessages.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/ConfigureOptionCategory.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/ConfigureTool.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/IAConfiguration.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/IConfigureOption.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/InternalConfigureOption.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/MultiArgConfigureOption.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/StringConfigureOption.java: New file.
+ * .project: Changed due to refactoring.
+ * META-INF/MANIFEST.MF: Refactored.
+ * plugin.xml: Refactored. Moving UI elements to org.eclipse.linuxtools.cdt.autotools.ui plug-in.
+
+2009-10-06 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/configure/AutotoolsConfigurationManager.java (saveConfigs): Store
+ configuration data into .autotools file stored in project rather than using project working location.
+ (getConfigs): Get configs from .autotools file stored in the project rather than using project working
+ location.
+
+2009-10-05 Jeff Johnston <jjohnstn@redhat.com>
+
+ * plugin.xml: Fix category for Autotools C++ wizard.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsOptionValueHandler.java (fixName): New method.
+ (handleValue): Add support to generate build directory if property option is on or defaulted.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsBuildPropertyPage.java (createControls):
+ Add support for automatic build name generation option.
+ (initialize): Ditto.
+ (performDefaults): Ditto.
+ (performOK): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsPropertyConstants.java:
+ Add support for auto build-name generation option.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsPropertyMessages.properties: Add
+ messages for new property for automatically naming the build directory.
+
+2009-09-29 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsEditorPropertyPage.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsPropertyPage.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsToolsPropertyPage.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsConfigurePropertyTab.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsEditorPropertyTab.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsGeneralPropertyPage.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsHeadPropertyPage.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsToolsPropertyTab.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/wizards/NewAutotoolsProject.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/wizards/AutotoolsBuildWizard.java: New file.
+ * templates/projecttemplates/EmptyProject/template.properties: New file.
+ * templates/projecttemplates/EmptyProject/template.xml: New file.
+ * templates/projecttemplates/HelloWorldCAutotoolsProject/src: New file.
+ * templates/projecttemplates/HelloWorldCAutotoolsProject/src/AUTHORS: New file.
+ * templates/projecttemplates/HelloWorldCAutotoolsProject/src/Basename.c: New file.
+ * templates/projecttemplates/HelloWorldCAutotoolsProject/src/configure.ac.top: New file.
+ * templates/projecttemplates/HelloWorldCAutotoolsProject/src/COPYING: New file.
+ * templates/projecttemplates/HelloWorldCAutotoolsProject/src/Makefile.am.src: New file.
+ * templates/projecttemplates/HelloWorldCAutotoolsProject/src/Makefile.am.top: New file.
+ * templates/projecttemplates/HelloWorldCAutotoolsProject/src/NEWS: New file.
+ * templates/projecttemplates/HelloWorldCAutotoolsProject/src/README: New file.
+ * templates/projecttemplates/HelloWorldCAutotoolsProject/template.properties: New file.
+ * templates/projecttemplates/HelloWorldCAutotoolsProject/template.xml: New file.
+ * templates/projecttemplates/HelloWorldCPPAutotoolsProject/src: New file.
+ * templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/AUTHORS: New file.
+ * templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/Basename.cpp: New file.
+ * templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/configure.ac.top: New file.
+ * templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/COPYING: New file.
+ * templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/Makefile.am.src: New file.
+ * templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/Makefile.am.top: New file.
+ * templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/NEWS: New file.
+ * templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/README: New file.
+ * templates/projecttemplates/HelloWorldCPPAutotoolsProject/template.properties: New file.
+ * templates/projecttemplates/HelloWorldCPPAutotoolsProject/template.xml: New file.
+ * plugin.properties: Add strings to support additions to plugin.xml.
+ * plugin.xml: Add a new template process for creating an Autotools project. Add templates for
+ an empty project, a helloworld C project, and a helloworld C++ project. Add a CDT wizard for
+ creating a new Autotools project. Remove project type name from Autotools project type so that
+ it does not get added by MBSWizard and instead is added as part of the new AutotoolsBuildWizard.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsNewMakeGenerator.java (regenerateMakefiles): When forced to
+ autoreconf missing files, do not restart the console for the subsequent configuration.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsOptionValueHandler.java (handleValue): Handle class rename.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/configure/AutotoolsConfiguration.java (setDefaultOptions): New
+ method.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/configure/IAConfiguration.java: Add setDefaultOptions method.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsCategoryPropertyOptionPage.java (updateFields): Add
+ call to set the values.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsConfigurePropertyPage.java:
+ (performSave): Deal with AutotoolsPropertyPage being renamed AutotoolsConfigurePropertyPage.
+ (isSingle): Add override to specify this is a single page.
+ (AutotoolsConfigurePropertyPage): New.
+
+2009-09-21 Jeff Johnston <jjohnstn@redhat.com>
+
+ * plugin.xml: Make configure source tool directory use our shared applicability calculator.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsNewMakeGenerator.java (createDirectory):
+ Change to return boolean and to use Java File logic.
+ (regenerateMakefiles): Fail if createDirectory fails for build directory. Change over to not
+ use Root or Workspace for file management. Use Java File instead.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/ToolListLabelProvider.java:
+ Remove compiler warning.
+ * src/org/eclipse/linuxtools/cdt/autotools/Resources.properties: Add new failure message if the
+ build directory cannot be created.
+
+2009-09-18 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsDefaultBuildDirHandler.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsNewMakefileBuilder.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/AbstractAutotoolsPage.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsOptionValueHandler.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/configure/IAConfiguration.java: New file.
+ * plugin.properties: Add configure name string.
+ * plugin.xml: Add configure name to configure options for build definition and set its option value handler and
+ calculator to be AutotoolsOptionValueHandler. Add back a builder for toolchain to prevent errror when displaying
+ toolChain editor property page. Add new AutotoolsNatureV2.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsConfigurationBuilder.java (performMakefileGeneration): Add
+ multiconfiguration support.
+ (clean): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsNewMakeGenerator.java (addMakeTargetsToManager):
+ (createDirectory): Use Java File interface to perform mkdirs.
+ (regenerateMakefiles): Add configuration parameter to support multiconfiguration.
+ (initializeBuildConfigDirs): Use build location from ManagedBuild.
+ (generateMakefiles): Call new regenerateMakefile interface.
+ (reconfigure): Use new regenerateMakefiles interface.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/configure/AutotoolsConfiguration.java (setConfigToolDirectory):
+ (setActive): Remove.
+ (isActive): Remove.
+ (configOpts): Remove builddir.
+ (copy): Change output to be IAConfiguration.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/configure/AutotoolsConfigurationManager.java: Remove active
+ configuration tracking.
+ (resourceChanged): Remove active configuration logic.
+ (saveConfigs): Fix bug with adding header information in loop.
+ (replaceConfiguration): Use IAConfiguration interface.
+ (getConfigs): Remove active configuration logic.
+ (configurationAlreadyExists): Use IAConfiguration interface.
+ (getConfigurations): Don't add a configuration to project automatically.
+ (AutotoolsConfigurationManager): Remove active configuration management set up.
+ (createDefaultConfiguration): Do not default configuration name now that we are syncing up with build configurations.
+ (addConfiguration): Use IAConfiguration interface. Remove active configuration management.
+ (replaceProjectConfigurations): New method.
+ (findCfg): New method.
+ (getConfiguration): New method.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/AbstractAutotoolsCPropertyTab.java: Extend AbstractCBuildPropertyTab.
+ (isIndexerAffected): New method.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsCategoryPropertyOptionPage.java (AutotoolsCategoryPropertyOptionPage):
+ Use IAConfiguration interface.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsConfigurePrefStore.java (setSelection): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsConfigurePropertyPage.java: Remove configuration
+ tracking. Let AutotoolsPropertyPage do it.
+ (handleOptionSelection): Use AbstractPage cast.
+ (setValues): Disable for multiconfiguration. Get current configuration using getAutotoolsCfg method.
+ (createControls): Don't bother getting current Autotools configuration. Don't call setValues().
+ (canBeVisible): Check for project.
+ (updateData): Get ManagedBuild configuration from input to use later to find syncing AutotoolsConfiguration with
+ same name.
+ (getAutotoolsCfg): New Method.
+ (performCancel): Do nothing.
+ (displayPageForElement): Set selection based on current Autotools configuration from getAutotoolsCfg().
+ (performDefaults): Do nothing.
+ (performOK): Replace Autotools configurations for project.
+ (createSelectionArea): Use a temporary AutotoolsConfiguration for a tree label provider.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsEditorPropertyPage.java (createControls):
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsPropertyPage.java: Rewritten to extend
+ AbstractPage and to replace content with AbstractPage.java as well since the majority of methods in AbstractPage
+ are private and manipulate private data. Add AutotoolsConfiguration tracking and a call-back mechanism for registering
+ cloned configurations from AutotoolsOptionValueHandler. When needed, call the super methods so they may access
+ private methods.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsToolPropertyOptionPage.java (AutotoolsToolPropertyOptionPage):
+ Use IAConfiguration interface.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/ToolListLabelProvider.java (ToolListLabelProvider): Ditto.
+ (getCfg): Ditto.
+ (setCfg): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/wizards/AutotoolsNewCProjectWizardV2.java (doRun): Remove AutotoolsConfiguration
+ logic and defer to when needed.
+
+2009-09-09 Jeff Johnston <jjohnstn@redhat.com>
+
+ Switching to use CommonBuilder.
+
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsConfigurationBuilder.java: New file.
+ * META-INF/MANIFEST.MF: Update dependencies.
+ * plugin.xml: Change build configuration to non-managed-build. Add AutotoolsConfigurationBuilder
+ as separate builder and remove AutotoolsNewMakeGenerator as Managed Build Makefile generator. Make
+ Autotools Nature require Managed Build Nature.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsNewMakeGenerator.java (addMakeTargetsToManager):
+ Specify CDT common builder as target builder and also specify build directory as container.
+ (regenerateMakefiles): Add build directory to console messages. Make full configure default to false.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsNewProjectNature.java (addAutotoolsBuilder): Change
+ to put new Configuration builder ahead of Common Builder.
+ (configure): Remove Std Make bits.
+ * src/org/eclipse/linuxtools/cdt/autotools/Resources.properties: Add new messages and add build directory
+ specification to Makefile generator messages.
+ * src/org/eclipse/linuxtools/cdt/autotools/wizards/AutotoolsNewCProjectWizardV2.java (addNature): Refer
+ to Managed Nature rather than Make Nature.
+
+2009-08-17 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsNewMakeGenerator.java (getPathString): New
+ method.
+ (runScript): Call getPathString method on command path. Use CCorePlugin to get
+ environment variable manager instead of ManagedBuildManager.
+ (runCommand): Ditto.
+ (initializeBuildConfigDirs): Remove code to set build location in builder.
+ (initialize): Get the C Configuration description for the active configuration.
+
+2009-07-29 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/AutotoolsConsole.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/Console.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/CBuildStepsConsole.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/CConfigureConsole.java: Inherit from
+ Console class.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/MakeResources.properties: ADd newline
+ at end of file.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/ConsoleMessages.properties: Add console
+ names.
+ * plugin.xml: Add CBuildConsole extensions for Autotools console and BuildSteps console.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAction.java:
+ (executeConsoleCommand): New method to execute commands in a special console.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAclocalAction.java: (run): Use
+ new executeConsoleCommand method from InvokeAction which this class now inherits from.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAutoconfAction.java (run): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAutoheaderAction.java (run): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAutomakeAction.java (run): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAutoreconfAction.java (run): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeLibtoolizeAction.java (run): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeMessages.properties: Add CWD message.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsNewMakeGenerator.java (stripEnvVars): Make
+ public static.
+
+2009-07-29 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/ReconfigureAction.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/ReconfigureHandler.java: New file.
+ * plugin.properties: Add strings for Reconfigure menu item.
+ * plugin.xml: Add Reconfigure project menu item.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsNewMakeGenerator.java (regenerateMakefiles):
+ (reconfigure): New method.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/configure/AutotoolsConfigurationManager.java (resourceChanged):
+ Now that plugin working area is used, no need to manage the files there for project deletion or
+ renaming.
+ (addConfiguration): If this is first configuration for project, call setActiveConfiguration.
+ (replaceConfiguration): Ditto.
+ (saveConfigs): Use plugin working area for project.
+ (getConfigs): New method which gets configs for single project.
+ (loadConfigs): Removed.
+ (getActiveConfiguration): Call getConfigurations internally.
+ (getConfigurations): Call getconfigs method and create default configuration if needed.
+ (setActiveConfiguration):
+ (getInstance): Remove loadConfigs call.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/configure/ConfigureMessages.properties: Add save
+ config error message.
+
+2009-07-13 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/configure/AutotoolsConfiguration.java (getToolArgs): Add
+ support for caching parameters.
+ (getToolParameters): Clean up warnings.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/configure/BinConfigureOption.java (setValue): Set configuration
+ dirty on value change.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/text/hover/AutoconfPrototype.java: Clean
+ up compiler warnings.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/text/hover/AutoconfTextHover.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/AbstractAutotoolsPage.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsConfigurePropertyPage.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsEditorPropertyPage.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsToolsPropertyPage.java: Ditto.
+
+2009-07-10 Jeff Johnston <jjohnstn@redhat.com>
+
+ * icons/obj16/fatalerror_obj.gif: New file.
+ * icons/obj16/info_obj.gif: New file.
+ * icons/obj16/warning_obj.gif: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/AbstractAutotoolsCPropertyTab.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/AbstractAutotoolsPage.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/FileRelevance.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/LocationAdapter.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/OptionalMessageDialog.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/ResourceLookup.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/ResourceLookupTree.java: New file.
+ * plugin.xml: Fix new MakefileGenerator id and nature references.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsNewMakefileBuilder.java (clean): New override method.
+ (getTargets): New override method.
+ (removeBuildDir): New method.
+ (build): Minor format change.
+ (AutotoolsNewMakefileBuilder):
+ (makeArray): New method.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsNewMakeGenerator.java (getAutogenPath): New method
+ that calls stripEnvVars.
+ (runScript): Add additional enviornment variables specified on command line.
+ (stripEnvVars): New method to strip env vars from a command string.
+ (getConfigurePath): Changed to use stripEnvVars.
+ (regenerateMakefiles): Fix deletion logic to not delete build directory.
+ (makeArray): New method.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsNewProjectNature.java: Change id.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/configure/AbstractConfigurationOption.java (getParameters):
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/configure/AutotoolsConfiguration.java (Option): Add
+ defaultValue field.
+ (Option.getDefaultValue): New method.
+ (Option.Option): Added constructor.
+ (initConfigOptions): Fix autogen to not have id with dot in name.
+ (configOpts): Add default value processing.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/configure/ConfigureMessages.properties: Change name of autogen
+ tool name message.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/MakeResources.properties: Added messages.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/MakeUIImages.java: Add new image.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsConfigurePropertyPage.java (handleOptionSelection):
+ Change cast.
+ (cfgChanged): Add comment.
+ (getProject): Changed to get project from page.
+ (createControls): Remove configuration combo which is no longer used.
+ (updateData): Update comment.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsEditorPropertyPage.java (updateButtons):
+ Update comment.
+ (cfgChanged): Added comment.
+ (getProject): Changed to get project from page.
+ (updateData): Update comment.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsPropertyMessages.java: Added messages.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsPropertyPage.java: Changed to inherit from
+ AbstractAutotoolsPage.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsToolPropertyOptionPage.java (createFieldEditors):
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsToolsPropertyPage.java (updateButtons):
+ Update comment.
+ (cfgChanged): Added comment.
+ (getProject): Changed to get project from page.
+ (updateData): Update comment.
+
+2009-06-26 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #280509
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsNewMakeGenerator.java (regenerateMakefiles): Add
+ logic to use autoreconf if no configure script and no autogen.sh.
+ * src/org/eclipse/linuxtools/cdt/autotools/Resources.properties: Add messages.
+
+2009-06-26 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #280696, #280504, #280505, #280506
+
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAction.java (showSuccess):
+ Changed to issue a information dialog that does not have a cancel button.
+ (executeCommand): Changed to create a ProgressMonitorDialog that is issued
+ until the command completes successfully or with failure.
+ (ExecuteProgressDialog): New private internal class that implements IRunnableWithProgress
+ which is used to run the command for a ProgressMonitorDialog.
+ (simpleParseOptions): New method to parse options and account for quoted strings.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/AutoheaderHandler.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/AutoreconfHandler.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAutoheaderAction.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAutoreconfAction.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeLibtoolizeAction.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/LibtoolizeHandler.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/SingleInputDialog.java: New file.
+ * plugin.properties: Add new messages for additional tools/commands added.
+ * plugin.xml: Change invoking autotools to be a single menu item in Project menu which
+ expands to show all tools available, including aclocal, autoconf, autoheader, automake,
+ autoreconf, and libtoolize.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeMessages.properties: Add support
+ for autoheader, autoreconf, and libtoolize.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsPropertyConstants.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsPropertyMessages.properties: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsToolsPropertyPage.java
+ (createControls): Ditto.
+ (initialize): Ditto.
+ (performDefaults): Ditto.
+ (performOK): Ditto.
+
+2009-06-26 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsNewMakeGenerator.java (toolsCfg):
+ New AutotoolsConfiguration acquired from AutotoolsConfigurationManager.
+ (runScript): Use new toolsCfg instead of cfg.
+ (getConfigArgs): Ditto.
+ (initializeBuildConfigDirs): Ditto.
+ (autogenExists): Ditto.
+ (runCommand): Ditto.
+ (getAutogenArgs): Ditto.
+ (configureExists): Ditto.
+ (regenerateMakefiles): Ditto.
+ (getConfigurePath): Ditto.
+ (getMakefileName): Ditto.
+ (initialize): Initialize toolsCfg to active Autotools configuration for project.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/configure/AbstractConfigurationOption.java (getParameters):
+ New method.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/configure/AutotoolsConfiguration.java (getToolArgs): New
+ method.
+ (getConfigArgs): Removed.
+ (configOpts): Add autogen.sh support.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/configure/ConfigureMessages.properties: Add autogen.sh
+ stuff.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/configure/ConfigureOptionCategory.java (getParameters): New
+ method.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/configure/ConfigureTool.java (getParameters): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/configure/IConfigureOption.java (getParameters): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/configure/MultiArgConfigureOption.java (getParameters): Fix
+ to properly separate options of all kinds and not just for configure.
+
+2009-06-26 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #281582, #281583
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsMakefileBuilder.java (clean): Do not
+ use ManagedBuildManager to get a Makefile generator. Just create a new Autotools Makefile
+ generator.
+ (removeBuildDir): Ditto.
+ (build): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsScannerInfo.java (getCompilationString):
+ Fix to support g++, top-level building, and compilation strings that span multiple lines.
+
+2009-06-15 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #280117
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsScannerInfo.java (buildFile): Fix so we don't
+ leave loop early before finding build directory.
+
+2009-06-11 Jeff Johnston <jjohnstn@redhat.com>
+
+ * icons/ac16/convert-normal.gif: Removed.
+ * icons/etool16/convert-normal.gif: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsBuildPropertyPage.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsEditorPropertyPage.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsPropertyConstants.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsPropertyManager.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsPropertyMessages.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsPropertyMessages.properties: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsPropertyPage.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsToolsPropertyPage.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/properties/IProjectPropertyListener.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/properties/IPropertyChangeManager.java: Removed.
+ * icons/ac16/convert_normal.gif: New file.
+ * icons/dlcl16/config_category.gif: New file.
+ * icons/dlcl16/config_tool.gif: New file.
+ * icons/elcl16/config_category.gif: New file.
+ * icons/elcl16/config_tool.gif: New file.
+ * icons/etool16/convert_normal.gif: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/configure/ConfigureTool.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/configure/InternalConfigureOption.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/configure/MultiArgConfigureOption.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AbstractConfigurePropertyOptionsPage.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsCategoryPropertyOptionPage.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsConfigurePrefStore.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsConfigurePropertyPage.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsToolPropertyOptionPage.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/ToolListContentProvider.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/ToolListElement.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/ToolListLabelProvider.java: New file.
+ * plugin.properties: Change messages.
+ * plugin.xml: Remove warnings.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAclocalAction.java: Changed due to refactoring.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAutoconfAction.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAutomakeAction.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsBuilder.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsMakefileBuilder.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsNewMakeGenerator.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsScannerInfo.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsScannerInfoProvider.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/configure/AbstractConfigurationOption.java (isMultiArg):
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/configure/AutotoolsConfiguration.java (getConfigToolDirectory):
+ Rewritten to use option.
+ (setConfigToolDirectory): Ditto.
+ (setDirty): Rewritten.
+ (Option): Add public methods to get name, description, type, and tooltip.
+ (setBuildDirectory): Rewritten to use option.
+ (getConfigArgs): New method.
+ (initConfigOptions): Set options for everything including tools.
+ (getOption): New method.
+ (getOptionList): Ditto.
+ (AutotoolsConfiguration): Keep track of parms dirty vs config dirty.
+ (getChildOptions): Add support for both categories and tools.
+ (setOption): Alter dirty flag.
+ (getToolParameters): New method.
+ (getTools): Ditto.
+ (configOpts): New internal map.
+ (getBuildDirectory): Rewrite to use simple option.
+ (copy): Copy using option copy methods and add internal variables as well.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/configure/AutotoolsConfigurationManager.java (ConfigureFileFilter):
+ New class to make it easy to find configuration data for project.
+ (resourceChanged): Added internal map changes as well.
+ (addConfigurationHeader): New method.
+ (saveConfigs): Changed to use IFile.
+ (replaceConfiguration): New method.
+ (setActiveConfiguration): Ditto.
+ (getConfigurations): If default configuration created, mark it active.
+ (AutotoolsConfigurationManager): Create active configs map.
+ (getInstance): Fixed to only load configs the one time.
+ (loadConfigs): Fixed to properly load configuration files and use xml parsing.
+ (getActiveConfiguration): New method.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/configure/BinConfigureOption.java (getType):
+ (copy): New method.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/configure/ConfigureMessages.java:
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/configure/ConfigureMessages.properties:
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/configure/ConfigureOptionCategory.java (getValue):
+ (getType): New method.
+ (isMultiArg): Ditto.
+ (copy): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/configure/IConfigureOption.java:
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/configure/StringConfigureOption.java (getType):
+ (copy): New method.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/text/hover/AutoconfTextHover.java: Changed due to
+ refactoring of properties.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/AutotoolsPluginImages.java: Add new images for
+ Autotools configuration property page.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsBuildPropertyPage.java: Changed due to
+ refactoring of properties.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsEditorPropertyPage.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsPropertyConstants.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsPropertyManager.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsPropertyMessages.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsPropertyMessages.properties: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsPropertyPage.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/AutotoolsToolsPropertyPage.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/IProjectPropertyListener.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/properties/IPropertyChangeManager.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/MakeGenerator.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfEditor.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/wizards/AutotoolsNewCProjectWizardV2.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/wizards/ConvertToAutotoolsProjectWizardPage.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/wizards/NewAutotoolsCCProjectWizard.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/wizards/NewAutotoolsCProjectWizard.java: Ditto.
+
+2009-05-29 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/configure/AbstractConfigurationOption.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/configure/AutotoolsConfiguration.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/configure/AutotoolsConfigurationManager.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/configure/BinConfigureOption.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/configure/ConfigureMessages.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/configure/ConfigureMessages.properties: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/configure/ConfigureOptionCategory.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/configure/IConfigureOption.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/configure/StringConfigureOption.java: New file.
+ * .classpath: Checking in.
+ * plugin.xml: Fix compiler warnings.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAclocalAction.java (run): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAction.java (separateTargets): Ditto.
+ (separateOptions): Ditto.
+ (executeCommand): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAutoconfAction.java (run): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAutomakeAction.java (run): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/TwoInputDialog.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsBuilder.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsDefaultBuildDirHandler.java (handleValue): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsMakefileBuilder.java (clean): Ditto.
+ (build): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsNewMakefileBuilder.java (performMakefileGeneration): Ditto.
+ (build): Ditto.
+ (AutotoolsNewMakefileBuilder): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsNewMakeGenerator.java (runScript): Ditto.
+ (saveTargets): Ditto.
+ (runCommand): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsNewProjectNature.java (configure): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsPlugin.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsProjectNature.java (removeNature): Ditto.
+ (addAutotoolsBuilder): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsScannerInfo.java (buildFile): Ditto.
+ (getDefinedSymbols): Ditto.
+ (getIncludePaths): Ditto.
+ (definedSymbols): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsScannerInfoProvider.java (setDirty): Ditto.
+ (getScannerInformation): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutoconfSubstRule.java (DecreasingCharArrayLengthComparator): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakeCompletionProcessor.java (DirectiveComparator): Ditto.
+ (computeContextInformation): Ditto.
+ (computeCompletionProposals): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakeDocumentProvider.java (connect): Ditto.
+ (shutdown): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakeEditor.java (getAdapter): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakeErrorHandler.java (AutomakeMarker): Ditto.
+ (checkChildren): Ditto.
+ (AutomakeMarker.setAttributes): Ditto.
+ (AutomakeMarker.getAttributes): Ditto.
+ (createMarker): Ditto.
+ (AutomakeMarker.AutomakeMarker): Ditto.
+ (AutomakeMarker.getAdapter): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakefileCodeScanner.java (createRules): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakefileContentOutlinePage.java (AutomakefileContentProvider.getElements): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/AbstractElementListSelectionDialog.java (setSelectionListElements): Ditto.
+ (getWidgetSelection): Ditto.
+ (verifyCurrentSelection): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/AbstractMakefile.java (getMacroDefinitions): Ditto.
+ (getBuiltinInferenceRules): Ditto.
+ (getRules): Ditto.
+ (getInferenceRules): Ditto.
+ (getTargetRules): Ditto.
+ (getBuiltinMacroDefinitions): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/AddBuildTargetAction.java (getTargetRules): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/CompletionProposalComparator.java (compare): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/EditorUtility.java (getWorkspaceFileAtLocation): Ditto.
+ (isLinked): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/ElementListSelectionDialog.java (open): Ditto.
+ (setElements): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/ExternalEditorInput.java (getAdapter): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/GNUAutomakefile.java (getBuiltins): Ditto.
+ (addDirective): Ditto.
+ (parseVPath): Ditto.
+ (getDirectives): Ditto.
+ (parse): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/LexicalSortingAction.java (LexicalCSorter.isSorterProperty): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MakefileCompletionProcessor.java (DirectiveComparator): Ditto.
+ (computeContextInformation): Ditto.
+ (computeCompletionProposals): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MakefileContentOutlinePage.java (MakefileContentProvider.getElements): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MakefileDocumentProvider.java (shutdown): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MakefileEditor.java (getAdapter): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MakefileMessages.java (getFormattedString): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MakefilePartitionScanner.java (MakefilePartitionScanner): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/NullMakefile.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/OpenIncludeAction.java (resolveIncludeLink): Ditto.
+ (findFile): Ditto.
+ (getIncludeStatement): Ditto.
+ (chooseFile): Ditto.
+ (run): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/Parent.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/PosixMakefileUtil.java (findTargets): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/ProjectionMakefileUpdater.java (createAnnotationMap): Ditto.
+ (fCollapseConditional): Ditto.
+ (fCollapseRule): Ditto.
+ (fCollapseMacroDef): Ditto.
+ (match): Ditto.
+ (processReconcile): Ditto.
+ (computeAdditions): Ditto.
+ (initialize): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/Rule.java (getCommands): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/SelectionList.java (getSelection): Ditto.
+ (setElements): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/SelectionStatusDialog.java (setInitialSelection): Ditto.
+ (getPrimaryInitialSelection): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/StringMatcher.java (parseWildCards): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/WorkingCopyManager.java (setWorkingCopy): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/MakeTarget.java (getAdapter): Ditto.
+ (getEnvironment): Ditto.
+ (setEnvironment): Ditto.
+ (build): Ditto.
+ (getExpandedEnvironment): Ditto.
+ (getAttributeMap): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/MakeTargetManager.java (initializeBuilders): Ditto.
+ (getTargetBuilders): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ProjectTargets.java (findTarget): Ditto.
+ (remove): Ditto.
+ (get): Ditto.
+ (getAsXML): Ditto.
+ (contains): Ditto.
+ (add): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/editors/autoconf/ProjectionFileUpdater.java (createAnnotationMap): Ditto.
+ (match): Ditto.
+ (processReconcile): Ditto.
+ (computeAdditions): Ditto.
+ (initialize): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/ErrorParserBlock.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/HTML2TextReader.java (static initializer): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/HTMLTextPresenter.java (updatePresentation): Ditto.
+ (adaptTextPresentation): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/preferences/AutoconfEditorPreferencePage.java (ColorListContentProvider.getElements): Ditto.
+ (addTextKeyToCover): Ditto.
+ (createSyntaxPage): Ditto.
+ (createOverlayStore): Ditto.
+ (HighlightingColorListItem): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/preferences/AutomakeEditorPreferencePage.java (ColorListContentProvider.getElements): Ditto.
+ (addTextKeyToCover): Ditto.
+ (createSyntaxPage): Ditto.
+ (createOverlayStore): Ditto.
+ (HighlightingColorListItem): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/preferences/ColorManager.java (dispose): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/preferences/StatusInfo.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/MakeGenerator.java (addMakeTargetsToManager): Ditto.
+ (runScript): Ditto.
+ (regenerateMakefiles): Ditto.
+ (runCommand): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/Resources.properties: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfAnnotationHover.java (getMarkersForLine): Ditto.
+ (select): Ditto.
+ (getHoverInfo): Ditto.
+ (formatMultipleMessages): Ditto.
+ (.createInformationControl): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfCodeScanner.java (AutoconfCodeScanner): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfDocumentProvider.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfEditor.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfErrorHandler.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfIdentifierRule.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacro.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroCodeScanner.java (AutoconfMacroCodeScanner): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroContentAssistProcessor.java (computeCompletionProposals): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroDamagerRepairer.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroParameterListValidator.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfPartitionScanner.java (AutoconfPartitionScanner): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/IAutotoolsEditor.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/InlineDataRule.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/outline/AutoconfContentOutlinePage.java (updateSelection): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfElement.java (AutoconfElement): Ditto.
+ (toString): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfOutlineErrorHandler.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfParser.java (ExprEndCondition): Ditto.
+ (ExprEndCondition.serialVersionUID): Ditto.
+ (BlockEndCondition): Ditto.
+ (checkBlockValidity): Ditto.
+ (BlockEndCondition.serialVersionUID): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/RecursiveSingleLineRule.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/RestrictedEndOfLineRule.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsPropertyManager.java (AutotoolsPropertyManager): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsToolsPropertyPage.java (performOK): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/wizards/AutotoolsNewCProjectWizardV2.java (doRun): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/wizards/ConvertToAutotoolsProjectWizardPage.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/wizards/CProjectPlatformPage.java (handleConfigurationSelectionChange): Ditto.
+ (CProjectPlatformPage): Ditto.
+ (filterSupportedConfigurations): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/wizards/NewAutotoolsCCProjectWizard.java (doRun): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/wizards/NewAutotoolsCProjectWizard.java (doRun): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/wizards/NewAutotoolsProjectOptionPage.java (ManagedWizardOptionBlock.setupHelpContextIds): Ditto.
+
+2009-05-01 Jeff Johnston <jjohnstn@redhat.com>
+
+ * plugin.xml: Add new Autotools nature for time-being. Specify new builder which is based
+ on MakefileBuilder and specify new project wizard.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsMakefileBuilder: Move hastTargetBuilder
+ to AutotoolsPlugin.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsMakeTargetManager: Use AutotoolsPlugin
+ hasTargetBuilder method.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsBuildPropertyPage: Ditto.
+ * src/org/eclipse.linuxtools/cdt/autotools/AutotoolsProjectPropertyTester.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsScannerInfoProvider.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsNewMakefileBuilder: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsNewMakeGenerator: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsNewProjectNature: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsPlugin.java: Move hasTargetBuilder
+ method here.
+ * src/org/eclipse/linuxtools/cdt/autotools/MakeGenerator.java: Apply fix for stopping
+ build on failure to generate Makefile.
+ * src/org/eclipse/linuxtools/cdt/autotools/Resources.properties: Change message for no
+ makefile generated.
+ * src/org/eclipse/linuxtools/cdt/autotools/wizards/AutotoolsNewCProjectWizardV2.java: New file.
+
+2009-04-30 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #249199
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/AbstractAutotoolsHandler.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/AutoconfHandler.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/AutomakeHandler.java: New file.
+ * plugin.properties: Add messages for invoking autotools.
+ * plugin.xml: Change invoke autotools actions from Actions in an ActionSet to instead
+ use org.eclipse.ui.menus, org.eclipse.ui.commands, and org.eclipse.ui.handlers and
+ do not add these actions to project menu if not an Autotools project.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/AclocalHandler.java (execute): Implemented.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAclocalAction.java (run): Add check
+ for null container.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAutoconfAction.java (run): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAutomakeAction.java (run): Ditto.
+
+2009-04-21 Jeff Johnston <jjohnstn@redhat.com>
+2009-05-01 Jeff Johnston <jjohnstn@redhat.com>
+
+ * plugin.xml: Add new Autotools nature for time-being. Specify new builder which is based
+ on MakefileBuilder and specify new project wizard.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsMakefileBuilder: Move hastTargetBuilder
+ to AutotoolsPlugin.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsMakeTargetManager: Use AutotoolsPlugin
+ hasTargetBuilder method.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsBuildPropertyPage: Ditto.
+ * src/org/eclipse.linuxtools/cdt/autotools/AutotoolsProjectPropertyTester.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsScannerInfoProvider.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsNewMakefileBuilder: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsNewMakeGenerator: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsNewProjectNature: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsPlugin.java: Move hasTargetBuilder
+ method here.
+ * src/org/eclipse/linuxtools/cdt/autotools/MakeGenerator.java: Apply fix for stopping
+ build on failure to generate Makefile.
+ * src/org/eclipse/linuxtools/cdt/autotools/Resources.properties: Change message for no
+ makefile generated.
+ * src/org/eclipse/linuxtools/cdt/autotools/wizards/AutotoolsNewCProjectWizardV2.java: New file.
+
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/OpenIncludeAction.java
+ (run): Fix compiler warnings.
+ (getIncludeStatement): Ditto.
+ (chooseFile): Ditto.
+ (.visit): Ditto.
+ (findFile): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MakefileMessages.java
+ (getFormattedString): Fix compiler warnings.
+ * src/org/eclipse/linuxtools/cdt/autotools/MakeGenerator.java
+ (getAutogenArgs): Fix compiler warnings.
+ (runScript): Ditto.
+ (getConfigArgs): Ditto.
+ (MakeTargetComparator): Ditto.
+ (makeArray): Ditto.
+ (runCommand): Ditto.
+ (addMakeTargetsToManager): Ditto plus do not start/stop MakeTargetManager
+ anymore.
+ (saveTargets): New method.
+ (translateDocumenttoCDTProject): Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeMessages.java
+ (getFormattedString): Cast 2nd argument for message fomatting to avoid compile
+ warnings.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/wizards/AutotoolsWizardMessages.java
+ (getFormattedString): Cast 2nd argument for message formatting to avoid compiler
+ warnings.
+ (getFormattedString): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/AutotoolsPluginImages.java
+ (makeIconFileURL): Fix static member reference to avoid compiler warning.
+ 2009-05-01 Jeff Johnston <jjohnstn@redhat.com>
+
+ * plugin.xml: Add new Autotools nature for time-being. Specify new builder which is based
+ on MakefileBuilder and specify new project wizard.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsMakefileBuilder: Move hastTargetBuilder
+ to AutotoolsPlugin.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsMakeTargetManager: Use AutotoolsPlugin
+ hasTargetBuilder method.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsBuildPropertyPage: Ditto.
+ * src/org/eclipse.linuxtools/cdt/autotools/AutotoolsProjectPropertyTester.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsScannerInfoProvider.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsNewMakefileBuilder: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsNewMakeGenerator: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsNewProjectNature: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsPlugin.java: Move hasTargetBuilder
+ method here.
+ * src/org/eclipse/linuxtools/cdt/autotools/MakeGenerator.java: Apply fix for stopping
+ build on failure to generate Makefile.
+ * src/org/eclipse/linuxtools/cdt/autotools/Resources.properties: Change message for no
+ makefile generated.
+ * src/org/eclipse/linuxtools/cdt/autotools/wizards/AutotoolsNewCProjectWizardV2.java: New file.
+ (static initializer): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsPlugin.java
+ (getFormattedString): Cast 2nd argument to avoid compiler warning.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/preferences/AbstractEditorPreferencePage.java
+ (validatePositiveNumber): Properly template containers.
+ (getTextFields): Ditto.
+ (initializeFields): Ditto.
+ (updateStatus): Ditto.
+ (getCheckBoxes): Ditto.
+ (getNumberFields): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakefileCodeScanner.java
+ (createRules): Use templated List.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MakefileCodeScanner.java
+ (createRules): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/AbstractMakefileCodeScanner.java
+ (createTextAttribute): Correctly access static member function.
+ (initializeRules): Use templated List.
+
+2009-04-17 Jeff Johnston <jjohnstn@redhat.com>
+
+ * META-INF/MANIFEST.MF: Allow org.eclipse.cdt.make.core and org.eclipse.cdt.make.ui version numbers
+ to start pre-6.0.0 and exclude 6.1.0.
+
+2009-04-16 Jeff Johnston <jjohnstn@redhat.com>
+
+ * META-INF/MANIFEST.MF: Update dependencies to not put upper sealing for version numbers as 6.0.0.
+
+2009-03-31 Jeff Johnston <jjohnstn@redhat.com>
+
+ * plugin.xml: Set expected value to true for Autotools property page enablement.
+
+2009-02-19 Jeff Johnston <jjohnstn@redhat.com>
+
+ * .settings/org.eclipse.jdt.core.prefs: Specify Java 1.5.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsBuilder.java: Inherit from Builder.
+ (AutotoolsBuilder): Change to take ToolChain parameter and call super constructor.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsMakefileBuilder.java (clean): Change
+ to set the Builder for the ToolChain and call different super.build method that does not
+ take new private MyBoolean argument.
+ (build): Ditto.
+ (getTargets): Fix Java 1.5 warnings.
+ (makeArrayList): Ditto.
+
+2009-01-20 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #261717
+
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/text/hover/AutoconfTextHover.java (getMacroList):
+ Don't bother processing macros if the macro document turns out to be null.
+
+2009-01-15 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #261257
+
+ * META-INF/MANIFEST.MF: Update plug-in to add .qualifier to id and update
+ to 1.0.2.qualifier.
+ * plugin.xml: Update invoke autotools action set to set visible to true.
+
+2009-01-06 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/cdt/autotools/MakeGenerator.java (getConfigArgs): If there
+ are no -- args in the user arguments, still pass them on to configure.
+
+2008-11-26 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #472731
+
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsMakefileBuilder.java (hasTargetBuilder):
+ Add check for ManagedProject being null which is apparently possible.
+
+2008-11-25 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakeDocumentProvider.java: Change
+ Copyright to make Red Hat a contributor to the copyright of the original file modified to make
+ this new class.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakeEditor.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/Automakefile.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakefileCodeScanner.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakefileContentOutlinePage.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakefileReconcilingStrategy.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakefileSourceConfiguration.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakeMacroDefinitionRule.java: Ditto.
+
+2008-11-03 Andrew Overholt <overholt@redhat.com>
+
+ * build.properties: Remove libhoverdocs/.
+
+2008-10-31 Andrew Overholt <overholt@redhat.com>
+
+ * META-INF/MANIFEST.MF: Use plugin.properties for provider.
+ * plugin.properties: Add "(Incubation)" to Bundle-Name.
+
+2008-10-28 Andrew Overholt <overholt@redhat.com>
+
+ * META-INF/MANIFEST.MF: Update BREE to J2SE-1.5.
+
+2008-10-14 Jeff Johnston <jjohnstn@redhat.com>
+
+ * META-INF/MANIFEST.MF: Bump up release to 1.0.1.
+
+2008-10-10 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsMakefileBuilder.java (build): Add check for default
+ configuration coming back null from buildinfo.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsBuildPropertyPage.java (performDefaults):
+ Set make -w default to be true.
+ * src/org/eclipse/linuxtools/cdt/autotools/wizards/ConvertToAutotoolsProjectWizardPage.java (convertProject):
+ Set make -w project property to true and don't turn off indexer.
+ * src/org/eclipse/linuxtools/cdt/autotools/wizards/NewAutotoolsCCProjectWizard.java (doRun): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/wizards/NewAutotoolsCProjectWizard.java (doRun): Ditto.
+
+2008-10-10 Jeff Johnston <jjohnstn@redhat.com>
+
+ Fix for #249416
+
+ * src/org/eclipse/linuxtools/cdt/autotools/MakeGenerator.java: Fix addition of MakeTargets to run faster.
+ (addMakeTargetsToManager): Rewritten to not use MakeTargetManager addTarget or removeTarget methods which
+ cause a rewrite of the .cproject file each time.
+ (isValidTarget): Remove checking MakeTargetManager existing target.
+ (translateDocumentToCDTProject): New method which outputs the MakeTargets to the .cproject file.
+ (MakeTargetComparator): New Comparator for sorting MakeTargets.
+ (createTargetElement): New method.
+ * src/org/eclipse/linuxtools/cdt/autotools/Resources.properties: Add subtask message for refreshing Make Targets
+ which might take some time.
+
+2008-10-07 Jeff Johnston <jjohnstn@redhat.com>
+
+ Fix for #249231
+
+ * src/org/eclipse/linuxtools/cdt/autotools/MakeGenerator.java (getAutogenArgs): Add
+ support to resolve build macros.
+ (getConfigArgs): Ditto.
+ (initializeBuildConfigDirs): Ditto.
+
+2008-10-03 Jeff Johnston <jjohnstn@redhat.com>
+
+ Fix for #249644.
+
+ * plugin.xml: Change visible to true for invoke autotools action set. Also add
+ new popupmenus for running autoconf directly on configure.ac or configure.in.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAclocalAction.java (run): Use
+ getCWD to get the relative current working directory and pass a string to the new
+ TwoInputDialog constructor.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAutomakeAction.java (run): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAction.java (getCWD): New method
+ to get the relative CWD for an autotools action.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/TwoInputDialog.java (createDialogArea):
+ Use CLabel instead of Label for first label (the CWD).
+ (TwoInputDialog): Change to accept a String for the first message instead of an IPath.
+ * src/org/eclipse/linuxtools/cdt/autotools/MakeGenerator.java (addMakeTargetsToManager):
+ Temporarily disable.
+
+2008-10-01 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsScannerInfo.java (getIncludePaths): Fix bug that
+ was properly resolving relative paths. Also add support for parsing -isystem specifiers and putting
+ the paths on the include path list.
+
+2008-09-19 Jeff Johnston <jjohnstn@redhat.com>
+
+ * META-INF/MANIFEST.MF: Change Eclipse-AutoStart over to Bundle-ActivationPolicy.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/LibHover.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/LibHoverMessages.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/LibHoverMessages.properties: Removed.
+ * plugin.xml: Remove CHelpProvider library hover extension as this functionality
+ has been moved into its own plugin.
+
+2008-09-18 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakefileCodeScanner.java (createRules):
+ Specify Token.UNDEFINED for WordRules default token. Otherwise, just getting the first possible
+ character of a word detector will result in default token being returned and no further parsing.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfCodeScanner.java (AutoconfCodeScanner):
+ Ditto.
+
+2008-09-17 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsScannerInfoProvider.java (getScannerInformation):
+ Return null if project is not an Autotools project.
+ (unsubscribe): Check scanner info for null before accessing.
+
+2008-09-17 Jeff Johnston <jjohnstn@redhat.com>
+
+ Refactored from com.redhat.eclipse.cdt.autotools to org.eclipse.linuxtools.cdt.autotools
+
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/text/hover/AutoconfTextHover.java:
+ (AUTOCONF_MACROS_DOC_NAME): Change to use default URL pointing to sourceware.org.
+ (AUTOMAKE_MACROS_DOC_NAME): Ditto.
+ (getHoverDoc): Remove unused variable.
+ (getAMDoc): Modify to handle either a file or URL.
+ (getACDoc): Ditto.
+ (.createInformationControl): Switch to use non-deprecated constructor.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/LibHover.java (getLibHoverDocs): Modify to handle
+ either an external file name or URL.
+ (getLibHoverDocName): New method that returns default URL pointing to sourceware.org.
+ (HelpResource.getHref): Change to return URL.
+ (getFunctionInfo): Remove unread variable.
+
+2008-09-09 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsMakefileBuilder(hasTargetBuilder): Change logic
+ to look for ProjectType id rather than looking at builder id of configuration since ManagedProject
+ might have had configuration removed. Resolves #461647.
+ * plugin.xml: Fix typo in referenced nature of autoolsNature. Resolves #461201.
+
+2008-08-08 Jeff Johnston <jjohnstn@redhat.com>
+
+ * META-INF/MANIFEST.MF: Update version number to 1.0.0 and specify minimum/maximum versions
+ for all dependencies now that CDT 5.0 and Eclipse 3.4 must be used.
+
+2008-07-04 Jeff Johnston <jjohnstn@redhat.com>
+
+ * icons/ac16/acmacro_arg_obj.gif: New File.
+ * src/com/redhat/eclipse/cdt/autotools/ui/properties/AutotoolsEditorPropertyPage.java:
+ (getproject): Remove.
+ * META-INF/MANIFEST.MF: Add org.eclipse.core.filesystem as dependency.
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java: Update imports.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/outline/AutoconfLabelProvider.java (getImage):
+ Use special image for acmacro argument.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/AutoconfEditorPreferencePage.java:
+ Update imports.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/AutotoolsPluginImages.java: Add image for
+ acmacro argument.
+ * src/com/redhat/eclipse/cdt/autotools/internal/text/hover/AutoconfTextHover.java: Update imports.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeEditor.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileReconcilingStrategy.java (reconcile):
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeDocumentProvider.java: Update imports.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MakefileReconcilingStrategy.java (reconcile):
+ Call new form of parse method.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/Directive.java:
+ (getMakefile): New required method.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/GNUAutomakefile.java:
+ (parse): New required method.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/AbstractMakefile.java:
+ (getFileURI): New required method.
+ (getMakefile): Ditto.
+ (setFileURI): Ditto.
+ (getMakefileReaderProvider): Ditto.
+ (parse): Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/OpenDeclarationAction.java:
+ (openInEditor): Use URI instead of File.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/NullMakefile.java:
+ (parse): New required method to implement.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MakefileDocumentProvider.java (createMakefile):
+ Add throws modifier.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfMacroCodeScanner.java: Update imports.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfMacroContentAssistProcessor.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfDocumentProvider.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfMacroDamagerRepairer.java: Ditto.
+
+2008-07-04 Jeff Johnston <jjohnstn@redhat.com>
+
+ * META-INF/MANIFEST.MF: Bump release to 0.9.7.
+
+2008-04-17 14:12 Ed Swartz <ed.swartz@nokia.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/:
+ internal/ui/editors/autoconf/ProjectionFileUpdater.java,
+ ui/editors/AutoconfCodeScanner.java,
+ ui/editors/AutoconfPKGWordDetector.java,
+ ui/editors/outline/AutoconfLabelProvider.java: Collapse and
+ decorate long macro arguments, and notice PKG_ macros
+
+2008-04-17 13:13 Ed Swartz <ed.swartz@nokia.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/:
+ internal/ui/editors/autoconf/ProjectionFileUpdater.java,
+ ui/editors/AutoconfEditorMacroValidator.java,
+ ui/editors/parser/AutoconfElement.java,
+ ui/editors/parser/AutoconfParser.java: Fix editor collapsing and
+ remove line number metadata from AutoconfElement, since the "end
+ line" is only meaningful in the context of the client.
+
+2008-04-17 10:43 Ed Swartz <ed.swartz@nokia.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/:
+ AutoconfEditorMessages.properties,
+ outline/AutoconfContentOutlinePage.java,
+ parser/AutoconfCaseConditionElement.java,
+ parser/AutoconfCaseElement.java, parser/AutoconfElement.java,
+ parser/AutoconfElifElement.java, parser/AutoconfElseElement.java,
+ parser/AutoconfForElement.java, parser/AutoconfIfElement.java,
+ parser/AutoconfMacroDetector.java,
+ parser/AutoconfMacroElement.java,
+ parser/AutoconfOutlineErrorHandler.java,
+ parser/AutoconfParser.java, parser/AutoconfRootElement.java,
+ parser/AutoconfTokenizer.java, parser/AutoconfWhileElement.java,
+ parser/OldAutoconfParser.java, parser/Token.java: More autoconf
+ parser work. Remove old parser and standardize AST node
+ constructors. Add more tests and fix some bugs.
+
+2008-04-10 15:40 Ed Swartz <ed.swartz@nokia.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/:
+ internal/ui/editors/autoconf/ProjectionFileUpdater.java,
+ ui/editors/AutoconfEditor.java,
+ ui/editors/AutoconfEditorMacroValidator.java,
+ ui/editors/AutoconfEditorMessages.properties,
+ ui/editors/AutoconfErrorHandler.java,
+ ui/editors/AutoconfReconcilingStrategy.java,
+ ui/editors/outline/AutoconfLabelProvider.java,
+ ui/editors/parser/AutoconfElement.java,
+ ui/editors/parser/AutoconfMacroArgumentElement.java,
+ ui/editors/parser/AutoconfMacroElement.java,
+ ui/editors/parser/AutoconfParser.java,
+ ui/editors/parser/AutoconfParser2.java,
+ ui/editors/parser/AutoconfSelectElement.java,
+ ui/editors/parser/AutoconfTokenizer.java,
+ ui/editors/parser/AutoconfUntilElement.java,
+ ui/editors/parser/AutoconfWhileElement.java,
+ ui/editors/parser/ITokenConstants.java,
+ ui/editors/parser/OldAutoconfParser.java,
+ ui/editors/parser/ParseException.java: More autoconf parser work.
+
+2008-04-09 14:38 Ed Swartz <ed.swartz@nokia.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/:
+ AutoconfEditorMacroValidator.java,
+ AutoconfEditorMessages.properties, AutoconfErrorHandler.java,
+ parser/AutoconfCaseConditionElement.java,
+ parser/AutoconfElement.java,
+ parser/AutoconfMacroArgumentElement.java,
+ parser/AutoconfMacroDetector.java, parser/AutoconfParser.java,
+ parser/AutoconfParser2.java, parser/AutoconfTokenizer.java,
+ parser/IAutoconfErrorHandler.java,
+ parser/IAutoconfMacroDetector.java, parser/IMacroDetector.java,
+ parser/ITokenConstants.java, parser/Token.java: New autoconf
+ parser work in progress
+
+2008-04-07 14:06 Ed Swartz <ed.swartz@nokia.com>
+
+ * META-INF/MANIFEST.MF,
+ src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfEditor.java,
+ src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfEditorMacroValidator.java,
+ src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfErrorHandler.java,
+ src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfMacroPartitionRule.java,
+ src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfMacroWordDetector.java,
+ src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfReconcilingStrategy.java,
+ src/com/redhat/eclipse/cdt/autotools/ui/editors/ParseException.java,
+ src/com/redhat/eclipse/cdt/autotools/ui/editors/outline/AutoconfLabelProvider.java,
+ src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfElement.java,
+ src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfMacroArgumentElement.java,
+ src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfMacroElement.java,
+ src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfOutlineErrorHandler.java,
+ src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfParser.java,
+ src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/IAutoconfErrorHandler.java,
+ src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/IAutoconfMacroValidator.java,
+ src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/ParseException.java:
+ Initial checkpoint for autotools parser changes
+
+
+2008-01-28 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/actions/AclocalHandler.java: New file for
+ future menu support.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsProjectNature.java: New file.
+ * META-INF/MANIFEST.MF: Release updated.
+ * plugin.properties: Add some new messages for autotools tool invocation.
+ * plugin.xml: Update release to 0.9.6. Add autotools project nature. Make
+ autotools commands enablement dependent on autotools project nature.
+ Specify enablesFor 1 for all autotools tool actions.
+ * src/com/redhat/eclipse/cdt/autotools/actions/AbstractTargetAction.java (setSelectedContainer): New
+ method for future menu support.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsMakefileBuilder.java (hasTargetBuilder): Use
+ AutotoolsProjectNature static addAutotoolsBuilder method.
+ (addAutotoolsBuilder): Moved to AutotoolsProjectNature.
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java (runScript): New method to
+ run scripts.
+ (regenerateMakefiles): Use runScript method to run configuration scripts. Use
+ runCommand for executables like "make".
+ (runCommand): Added comments.
+ * src/com/redhat/eclipse/cdt/autotools/wizards/ConvertToAutotoolsProjectWizardPage.java (convertProject):
+ Add new autotools project nature.
+ * src/com/redhat/eclipse/cdt/autotools/wizards/NewAutotoolsCCProjectWizard.java (addNature):
+ Ditto plus set up autotools builder.
+ (doRun): Don't set up autotools builder since it is done in addNature.
+ * src/com/redhat/eclipse/cdt/autotools/wizards/NewAutotoolsCProjectWizard.java (addNature):
+ Add new autotools project nature and set up autotools builder.
+ (doRun): Don't set up autotools builder since it is done in addNature.
+
+2007-12-05 Jeff Johnston <jjohnstn@redhat.com>
+
+ * plugin.xml: Update release to 0.9.5.3.
+
+2007-12-05 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #412651, #412661
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java (getConfigurePath): Fetch tool command
+ name instead of hard-wiring to "configure".
+ (autogenExists): Fetch command name from autogen.sh options.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsMakefileBuilder.java: (removeBuildDir): New method.
+ (clean): If user has specified remove build directory, then use removeBuildDir method.
+ * src/com/redhat/eclipse/cdt/autotools/Resources.properties: New messages for supporting
+ build directory removal operation.
+
+2007-11-28 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/LibHoverMessages.java: New File.
+ * src/com/redhat/eclipse/cdt/autotools/ui/LibHoverMessages.properties: New File.
+ * src/com/redhat/eclipse/cdt/autotools/ui/LibHover.java: Add references to
+ LibHoverMessages instead of hard-coded strings.
+ * libhoverdocs/glibc-2.7-2.xml: Regenerated.
+
+2007-11-27 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/LibHover.java
+ (HelpResource.getHref): Use latest glibc doc version.
+ (getLibHoverDocs): Ditto.
+ * libhoverdocs/glibc-2.7-2.xml: New C library docs based on glibc-2.7-2 manual.
+ * libhoverdocs/glibc.xml: Old glibc docs removed.
+
+2007-11-19 Jeff Johnston <jjohnstn@redhat.com>
+
+ * plugin.xml: Update release to 0.9.5.2. Also clear all OS lists for build definitions to
+ default to "all" OSes.
+
+2007-11-15 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #385991
+ * src/com/redhat/eclipse/cdt/autotools/ui/LibHover.java (getMatchingFunctions): New method.
+ (FunctionSummary.compareTo): New method to support Comparable interface.
+ (FunctionSummary.getIncludes): Fix to avoid type cast exception/
+ (getFunctionInfo): Revised to call getFunctionSummaryFromNode method.
+ (FunctionSummary): Add Comparable interface.
+ (getFunctionSummaryFromNode): New method.
+ (FunctionSummary.FunctionPrototypeSummary.getPrototypeString): Add NLS
+ comments.
+
+
+2007-11-01 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/properties/AutotoolsToolsPropertyPage.java: New File for
+ setting tool paths for the various autotools.
+ * src/com/redhat/eclipse/cdt/autotools/actions/InvokeAclocalAction.java (run): Use the
+ project properties setting to determine what tools to use.
+ * src/com/redhat/eclipse/cdt/autotools/actions/InvokeAutoconfAction.java (run): Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/actions/InvokeAutomakeAction.java (run): Ditto.
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/properties/AutotoolsPropertyMessages.properties: New
+ messages.
+ * src/com/redhat/eclipse/cdt/autotools/ui/properties/AutotoolsPropertyConstants.java: Add new
+ constants for setting the tool paths for aclocal, automake, and autoconf.
+ * plugin.xml: Add tools settings property page for Autotools.
+ * plugin.properties: New message for added property page.
+
+2007-10-30 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #359311, #359301, #359321
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfMacro.java: New File.
+ * src/com/redhat/eclipse/cdt/autotools/ui/properties/AutotoolsPropertyManager.java: New File.
+ * src/com/redhat/eclipse/cdt/autotools/ui/properties/IProjectPropertyListener.java: New File.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsProjectPropertyTester.java: New File.
+ * src/com/redhat/eclipse/cdt/autotools/ui/properties/IPropertyChangeManager.java: New File.
+ * src/com/redhat/eclipse/cdt/autotools/internal/text/hover/AutoconfTextHover.java:
+ (getAMDoc): New method.
+ (fBindingService):
+ (getAutomakeMacrosDocName): Modified to take a version parameter.
+ (getAutoconfMacrosDocName): Ditto.
+ (getPrototype): Changed to take an editor input.
+ (getAutoconfMacrosDocName): Ditto.
+ (AutotoolsHoverDoc): New internal class.
+ (getMacroList): New method to merge AC and AM macros together based on version
+ properties.
+ (getACDoc): New method.
+ (getIndexedInfo): Changed to take editor input.
+ (getHoverDoc): New metohd.
+ (getIndexedInfoFromDocument): New method that will parse the given document.
+ (getDefaultAutoconfMacrosDocName): New method to get the default preference
+ Autoconf macros doc name.
+ (getHoverRegion): Modified to get editor from elsewhere.
+ (getDefaultAutomakeMacrosDocName): New method to get the default preference
+ Autoconf AM macros doc name.
+ (getHoverInfo): Changed to take an editor input.
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfMacroParser.java: Removed.
+
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/editors/autoconf/ProjectionFileUpdater.java (initialize):
+ (processReconcile): Use stored editor.
+ (install): Change input parameter to AutoconfEditor.
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfParser.java (parseMacro):
+ (parse): Modified to take IEditorInput argument and pass that on to AutoconfErrorHandler.
+ (AutoconfParser): Modified to take an editor parameter.
+
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsDefaultBuildDirHandler.java: Updated
+ copyright to just Red Hat Inc.
+ * plugin.properties: New messages.
+ * plugin.xml: Add ICPropertyTab extension for editor properties. Add properties
+ page for Autotools properties.
+ * src/com/redhat/eclipse/cdt/autotools/ui/properties/AutotoolsEditorPropertyPage.java: New file.
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/properties/AutotoolsPropertyPage.java: Rewritten.
+ * src/com/redhat/eclipse/cdt/autotools/ui/properties/AutotoolsBuildPropertyPage.java:
+ * src/com/redhat/eclipse/cdt/autotools/ui/properties/AutotoolsPropertyConstants.java:
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfErrorHandler.java (AutoconfErrorHandler):
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfSourceViewerConfiguration.java
+ (AutoconfSourceViewerConfiguration): Take editor as parameter.
+ (getPresentationReconciler): Pass along or use editor passed in.
+ (getContentAssistant): Ditto.
+ (getReconciler): Ditto.
+ (getTextHover): Ditto.
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfDocumentProvider.java (connect):
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfMacroDamagerRepairer.java:
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfMacroContentAssistProcessor.java (computeCompletionProposals):
+ (AutoconfMacroContentAssistProcessor): Take editor input.
+ (computeMacroStart): Use editor.
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfReconcilingStrategy.java (reconcile):
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfEditor.java: Make this implement
+ IProjectPropertyListener
+ (handlePreferenceStoreChanged): Modified to call handleVersionChange method if a
+ autoconf or automake macro version preference change has occurred.
+ (doSetInput): Deregister editor as property listener if editor was for a project
+ file previously and register editor as property listener if editor is now for a
+ project.
+ (getAutoconfDocumentProvider): Make static.
+ (getAutoconfCodeScanner): Pass this to constructor.
+ (handleVersionChange): New method.
+ (handleProjectPropertyChanged): New IProjectPropertyListener method.
+ (initializeEditor): Pass this to source viewer configuration constructor.
+ (getAutoconfParser): Pass this to constructor.
+ (dispose): Deregister editor as property listener for a project if applicable.
+ (getAutoconfMacroCodeScanner): Pass this to constructor.
+
+2007-10-23 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfMacroCodeScanner.java: New File.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/RestrictedEndOfLineRule.java: New File.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfPartitionScanner.java (AutoconfPartitionScanner):
+ Move macro partitioning ahead of comments.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfSourceViewerConfiguration.java (getPresentationReconciler):
+ Use AutoconfMacroCodeScanner for macro damager repairer.
+ (getContentAssistant): Use AutoconfMacroCodeScanner for macro content assist.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfCodeScanner.java (nextToken):
+ New method that simply defaults to super.nextToken to be used for debugging purposes.
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfEditor.java (getAutoconfMacroCodeScanner):
+
+ * plugin.xml: Update to release 0.9.5.1.
+
+2007-10-23 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #330701
+ * src/com/redhat/eclipse/cdt/autotools/ui/properties/AutotoolsBuildPropertyPage.java: New File to
+ add property settings for how to clean an Autotools project and whether or not to use the
+ current Autotools info scanner.
+ * src/com/redhat/eclipse/cdt/autotools/ui/properties/AutotoolsPropertyMessages.java: New File.
+ * src/com/redhat/eclipse/cdt/autotools/ui/properties/AutotoolsPropertyConstants.java: New File.
+ * src/com/redhat/eclipse/cdt/autotools/ui/properties/AutotoolsPropertyMessages.properties: New File.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfParser.java (parseLines):
+ Process macros ahead of stripping out comments as this prevents removing quotes inside the
+ macro which have precedence over # (e.g. used to specify #include and not meaning a
+ comment to end of line).
+ (parseWhile): Change comment typo.
+ (parseFor): Ditto.
+ * plugin.properties: Add new messages regarding property pages.
+ * plugin.xml: Add Autotools build IcPropertyTab (AutotoolsBuildPropertyPage). Also
+ specify that AutotoolsDefaultBuildDirHandler is also an option applicability tester.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/AutotoolsPreferencesMessages.properties:
+ Change the message for autoconf and automake versions to include the word "Default".
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfPartitioner.java (computePartitioning):
+ Add override method as way to print out partitions. Cannot compute and print out partitions at
+ connect time as in 4.0.1 we initially are given an empty document that is later filled.
+ (printPartitions): Change argument to be an array of partition regions.
+
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsMakefileBuilder.java (build):
+ (clean): New method. Pay attention to user clean method preference.
+ (getTargets): Pay attention to user clean target preference.
+
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsScannerInfo.java (getCompilationString):
+ Pay attention to user preference on scanner info retrieval and disable if need be.
+ (createIncludeChain): Use AutotoolsPropertyConstants to get property names to use.
+ (followIncludeChain): Ditto.
+ (getMakefile): Add nls comments.
+ (AutotoolsScannerInfo): Ditto.
+ (getDefinedSymbols): Ditto.
+ (buildFile): Ditto.
+
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java (regenerateMakefiles): Don't
+ call AutotoolsScannerInfoProvider.setDirty method anymore. Instead, set a project property
+ to indicate the scanner info is dirty.
+ (addMakeTargetsToManager): Add a try/catch statement to prevent duplicate entries from
+ stopping loop that adds make targets.
+ (initializeBuildConfigDirs): Formatting change.
+
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsScannerInfoProvider.java (getScannerInformation):
+ Add a check for project property indicating the scanner info is dirty in which case call
+ setDirty method.
+ (setDirty): Make private.
+
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsDefaultBuildDirHandler.java: Now implements
+ IOptionApplicability.
+ (isOptionEnabled): New interface method to implement.
+ (isOptionVisible): Ditto.
+ (isOptionUsedInCommandLine): Ditto (set to false).
+
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsBuilder.java (getProject): New method.
+ (AutotoolsBuilder): Add project argument.
+ (getCleanBuildTarget): Implemented using new Autotools CLEAN_MAKE_TARGET property.
+
+ * src/com/redhat/eclipse/cdt/autotools/Resources.properties: Add new message.
+
+2007-10-09 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #323641
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsScannerInfo.java (getDefinedSymbols): Use
+ the patch provided by Jose Fonseca to provide a proper regular expression for parsing
+ the defined symbols from the make output.
+
+2007-10-05 Jeff Johnston <jjohnstn@redhat.com>
+
+ * plugin.xml: Ensure the ids for InvokeAutoconf and InvokeAutomake actions are unique.
+
+2007-10-04 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsDefaultBuildDirHandler.java (handleValue):
+ Add some place holders for supporting the user manually setting the build directory.
+ * src/com/redhat/eclipse/cdt/autotools/Resources.properties: Add some dialog messages for
+ future usage.
+ * plugin.xml: Update version to 0.9.5.
+
+2007-10-02 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #315811
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsDefaultBuildDirHandler.java: New File.
+ * plugin.xml: Change build definition to version 4.0.0. Remove unused project converter
+ extension. For build directory, specify an option handler which is implemented by
+ AutotoolsDefaultBuildDirHandler.
+
+2007-09-24 Andrew Overholt <overholt@redhat.com>
+
+ * plugin.xml: Update version to 0.9.4.
+
+2007-09-21 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/actions/InvokeAutoconfAction.java (run):
+ Fix array indexing.
+
+2007-09-18 Jeff Johnston <jjohnstn@redhat.com>
+
+ * plugin.xml: Add ELF and GNU_ELF binary parsers as default for an Autotools project.
+
+2007-09-05 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #274551
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsScannerInfo.java (getCompilationString): Support
+ the case where the file isn't part of the build and there is no scanner info to gather.
+ (buildFile): Minor cosmetic changes.
+
+ * META-INF/MANIFEST.MF: Update release.
+
+2007-09-04 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java (regenerateMakefiles): Add a
+ clause to check for the case whereby there was no way to generate the Makefile and one
+ didn't already exist.
+ * src/com/redhat/eclipse/cdt/autotools/Resources.properties (Makegenerator.didnt.generate):
+ New message.
+
+2007-08-24 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #254248
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/outline/AutoconfContentOutlinePage.java (selectionChanged):
+ Make call to editor.selectAndReveal method to focus editor page on selected outline item.
+
+2007-08-24 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #254246
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/CWordFinder.java (findWord): Fix
+ to handle being in the first word of the file.
+
+2007-08-17 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #253331
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsMakefileBuilder.java (build): Enable
+ autobuilding.
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java (regenerateMakefiles): If
+ the configuration options change, clean the previous build directory so a full rebuild
+ will occur.
+
+2007-08-15 Jeff Johnston <jjohnstn@redhat.com>
+
+ * META-INF/MANIFEST.MF: Change release to 0.9.2 and specify minimum java runtime as
+ 1.4.
+
+2007-08-15 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #251412
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsMakefileBuilder.java (addAutotoolsBuilder):
+ When calling IProject.setDescription(), pass a NullProgressMonitor instead of
+ null, despite what the function API says because an isCancelled() call may occur
+ and will result in an exception thrown. Also, use a try/catch block to handle any
+ of the legitimate exceptions that might occur in this operation.
+
+2007-08-15 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/Resources.properties: Add new messages
+ for new C and C++ project wizards.
+ * src/com/redhat/eclipse/cdt/autotools/wizards/NewAutotoolsProjectWizard.java: Renamed...
+ * src/com/redhat/eclipse/cdt/autotools/wizards/NewAutotoolsCProjectWizard.java: ..to this.
+ (doRun): Rewritten based on conversion wizard to properly set up project.
+ (getProjectType): New method.
+ * src/com/redhat/eclipse/cdt/autotools/wizards/NewAutotoolsCCProjectWizard.java: New file
+ copied from NewAutotoolsCProjectWizard but inherits from NewCCProjectWizard.
+
+ * icons/dlcl16/newc_app.gif: New gif.
+ * icons/dlcl16/newcc_app.gif: Ditto.
+ * icons/elcl16/newc_app.gif: Ditto.
+ * icons/elcl16/newcc_app.gif: Ditto.
+
+ * plugin.properties: Add new strings for new C and C++ project wizards.
+ * plugin.xml: Add new C and C++ project wizards.
+
+2007-08-09 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #251604
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java (getAutogenArgs): New method.
+ (regenerateMakefiles): Pass user-specified autogen.sh options when invoking autogen.sh.
+ * plugin.xml: Add autogen.sh tool support with user options.
+ * plugin.properties: Add new autogen tool message strings.
+
+2007-07-24 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfEditor.java
+ (handlePreferenceStoreChanged): Add support for changing automake macros version.
+ * src/com/redhat/eclipse/cdt/autotools/internal/text/hover/AutoconfTextHover.java
+ (getAutomakeMacrosDocument):
+ New method.
+ (getIndexInfo, getPrototype): Create private versions of these that take a document
+ as an input parameter. Change the public static methods to call the private
+ versions with the autoconf macro document and the automake macro document, if
+ the macro isn't found yet.
+ (init): Set up the autoconf macro document and automake macro document.
+ (reinit): Reset both the autoconf and automake macro documents.
+
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/AutoconfEditorPreferencePage.java
+ (LATEST_VERSION): Replace with LATEST_AC_VERSION and LATEST_AM_VERSION.
+ (createOverlayStore): Add automake version setting.
+ (initializeVersion): Replace with initializeACVersion and initializeAMVersion.
+ (initialize): Call the two replacements of initializeVersion.
+ (createVersionTabContent): Add automake version support.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/AutotoolsEditorPreferenceConstants.java
+ Add automake version support.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/AutotoolsPreferencesMessages.properties:
+ Add messages used in automake version preference.
+
+ * libhoverdocs/ammacros-1.4-p6.xml: New automake macro docs for 1.4-p6.
+ * libhoverdocs/ammacros-1.9.5.xml: New automake macro docs for 1.9.5.
+ * libhoverdocs/ammacros-1.9.6.xml: New automake macro docs for 1.9.6.
+
+2007-07-17 Jeff Johnston <jjohnstn@redhat.com>
+
+ * MANIFEST.MF: Bump up release to 0.9.1.
+
+2007-07-16 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/GNUAutomakefile.java
+ (parse): Fix Automake if/else constructs to be child/parent directives as appropriate.
+ (bypassIf, bypassElse, isTrue): Removed.
+ (parseIf): Add rules parameter.
+ (addDirective): Remove caveat when dealing with automake if/else.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/IAutomakeConditional.java
+ (getRules, setRules): New methods for the interface.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/Else.java: Add ICommand
+ interface and implement required methods including new ones add to IAutomakeConditional.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/If.java: Ditto.
+
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeErrorHandler.java
+ (update): Change to call checkChildren for makefile.
+ (checkChildren): New recursive method to check for bad directives.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileContentOutlinePage.java
+ (AutomakefileLabelProvider.getImage): Add support for IAutomakeConditional elements and
+ remove reference to AutomakeIfElse class.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeMacroDefinitionRule.java
+ (isValidCharacter): Add support for "+-$()@" chars.
+
+2007-07-11 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/GNUAutomakefile.java
+ (parseIf): Add @if support.
+ (isTrue): Default to true for if conditions.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/GNUMakefileConstants.java:
+ Add @if and @endif macros.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/GNUMakefileUtil.java
+ (isIf): Add @if support.
+ (isEndif): Add @endif support.
+
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileCodeScanner.java:
+ Add support for @if and @endif keywords.
+ (createRules): Add support for whitespace and simple identifiers.
+
+2007-07-09 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #247518
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileCodeScanner.java
+ (createRules): Use new AutoconfSubstRule class for identifying autoconf substituitions.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileUtil.java (isConfigMacro):
+ Refine so that macro must start and end with @ and contain at least one valid char.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutoconfSubstRule.java: New file.
+
+2007-07-06 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #246153
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeDocumentProvider.java (createFileInfo):
+ Rewrite to handle workspace files as well as external ones.
+ (createMakefile): Change to accept a file name rather than an IFile.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeEditor
+ (getDefault): New method.
+ (doSetInput): Ditto.
+ (initializeEditor): Add a few lines that would have been performed by
+ base class initializeEditor.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeErrorHandler
+ (AutomakeMarker): New internal class for error marking.
+ (update): Switch to using internal markers and directly updating the
+ Annotation model.
+ (removeExistingMarkers): Directly reference the annotation model.
+ (AutomakeErrorHandler): Fetch and store the annotation model for the input.
+ Change prototype.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileReconcilingStrategy.java
+ (AutomakefileReconcilingStrategy): Change to store an IEditorInput. Use new
+ AutomakeErrorHandler interface.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MakefileEditor.java
+ (initializeEditor): Remove fixme comment.
+
+2007-07-04 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #246783
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeEditor.java:
+ (initializeEditor): Call AutotoolsEditorPreferenceConstants.initializeDefaultValues
+ to ensure the editor default values are set.
+
+2007-06-29 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #246154
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsBuilder.java: New proxy
+ class to wrap an existing IBuilder and override build path functionality.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsMakefileBuilder.java:
+ (build): Wrap the builder using the new AutotoolsBuilder class so the
+ build path will work properly.
+
+2007-06-28 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #246134
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfErrorHandler.java:
+ (AutoconfErrorHandler): Change constructor to just take IDocument input.
+ (AutoconfMarker): New private class for marking autoconf document.
+ (createMarker): New private method to create AutoconfMarker in document.
+ (handleError): Create a marker and add it to annotation model durectly
+ instead of using MarkerUtilities.
+ (removeAllMarkers): Remove directly from annotation model instead of using file.
+ (removeExistingMarkers): Ditto.
+ (getDocument): New method.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfDocumentProvider.java:
+ (connect): Change constructor call to AutoconfErrorHandler.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfEditor.java:
+ (getViewer): New method to return the source viewer for the editor.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfMacroParser.java:
+ (AutoconfMacroParser): Change constructor call to AutoconfErrorHandler.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfParser.java:
+ Change all uses of AutoconfOutlineErrorHandler to AutoconfErrorHandler.
+
+2007-06-26 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #245820
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileUtil.java (isAutomakeCommand):
+ New method.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/Conditional.java (isIf): New
+ method.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/IAutomakeConditional.java:
+ New interface.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/Else.java: Changed to
+ implement new IAutomakeConditional interface.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/If.java: New file.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/GNUAutomakefile.java
+ (parse): Add Automake if/else parsing and support for Makefile.in processed if/else blocks.
+ (bypassIf, bypassElse, parseIf): New private methods.
+ (addDirective): Don't add directives to an Automake if or else construct.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/GNUMakefileConstants.java:
+ Add CONDITIONAL_IF constant.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/GNUMakefileUtil.java
+ (isIf): New method.
+
+2007-06-25 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MakefileEditorTogglePresentationAction.java:
+ New file.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MakefileEditorActionContributor.java: Ditto.
+
+ * icons/etool16/alphab_sort_co.gif: New icon.
+ * icons/etool16/build_menu.gif: Ditto.
+ * icons/etool16/convert_normal.gif: Ditto.
+ * icons/etool16/make.gif: Ditto.
+ * icons/etool16/makefile.gif: Ditto.
+ * icons/etool16/newc_app.gif: Ditto.
+ * icons/etool16/newcc_app.gif: Ditto.
+ * icons/etool16/segment_edit.gif: Ditto.
+ * icons/etool16/target_add.gif: Ditto.
+ * icons/etool16/target_build.gif: Ditto.
+ * icons/etool16/target_delete.gif: Ditto.
+ * icons/etool16/target_edit.gif: Ditto.
+ * icons/etool16/target_filter.gif: Ditto.
+ * icons/etool16/update_old.gif: Ditto.
+
+ * plugin.xml: Change Automake editor to use new internal MakefileEditorActionContributor
+ class rather than point to the internal one in internal CDT make.
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfDocumentSetupParticipant.java:
+ (setup): Don't bother registering this as document listener.
+ (documentAboutToBeChanged): Remove body of method as this is no longer needed.
+
+2007-06-25 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #245611
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfMacroContentAssistProcessor.java
+ (getMacroList): Change to call AutoconfTextHover to get the name of the macros
+ document since it will depend on current preferences.
+ * src/com/redhat/eclipse/cdt/autotools/internal/text/hover/AutoconfTextHover.java
+ (getAutoconfMacrosDocName): New static method.
+
+2007-06-19 Jeff Johnston <jjohnstn@redhat.com>
+
+ * libhoverdocs/acmacros-2.59.xml: New autoconf hover text and syntax info
+ for autoconf 2.59.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/AutoconfEditorPreferencePage.java:
+ Add 2.59 support.
+
+2007-06-18 Jeff Johnston <jjohnstn@redhat.com>
+
+ * libhoverdocs/acmacros-2.13.xml: New autoconf hover text and syntax info
+ for autoconf 2.13.
+ * libhoverdocs/acmacros-2.61.xml: New autoconf hover text and syntax info
+ for autoconf 2.61.
+ * libhoverdocs/acmacros.xml: Replaced with files above.
+
+ * src/com/redhat/eclipse/cdt/autotools/internal/text/hover (init): Change document
+ to be dependent on autoconf version preference.
+ (reinit): New method to force reinitialization of help document.
+ (getPrototype): Fix to allow for earlier versions which specify multiple
+ prototypes in one using "[,", for example.
+
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/AutoconfEditorPreferencePage.java:
+ Add version preference support.
+ (createOverlayStore): Add version support.
+ (createContents): Add version tab.
+ (initializeVersion): New method.
+ (createVersionTabContents): Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/AutotoolsEditorPreferenceConstants.java:
+ Add AUTOCONF_VERSION and initialize the default autoconf version value to be the
+ highest possible.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/AutotoolsPreferencesMessages.properties:
+ Add new messages pertaining to autoconf version.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfEditor.java (handlePreferenceStoreChanged):
+ If the autoconf version is changed, invalidate the document and force a reparse.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfEditorMessages.java (getFormattedString):
+ Add new method which takes 3 replacement strings.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfEditorMessages.properties:
+ Change macro error messages to take the autoconf version as a parameter.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfParser.java: Fix
+ typo for too many args message id.
+ (parseMacro): For wrong number of argument messages, get the current autoconf version preference
+ and pass it in to the message.
+
+2007-06-07 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/Automakefile.java: Rebase on
+ GNUAutomakefile class. Remove all parsing methods.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeDocumentProvider.java: Fix
+ comments to refer to internal Autotools classes as appropriate.
+
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/Conditional.java: New file.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/DefineVariable.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/DeleteOnErrorRule.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/Else.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/Endef.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/Endif.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/ExportAllVariablesRule.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/ExternalEditorInput.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/GNUAutomakefile.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/GNUTargetRule.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/GNUVariableDef.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/Ifdef.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/Ifeq.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/Ifndef.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/Ifneq.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/Include.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/IntermediateRule.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/LowResolutionTimeRule.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/NotParallelRule.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/OverrideDefine.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/OverrideVariable.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/PhonyRule.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/SecondaryRule.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/StaticTargetRule.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/TargetVariable.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/Terminal.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/UnExport.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/VPath.java: Ditto.
+
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/ExternalEditorInput.java: Update comments
+ that should refer to internal Autotools classes.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/MakefileDocumentProvider.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/ProjectionMakefileUpdater.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/WorkingCopyManager.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/editors/autoconf/ProjectionFileUpdater.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/AutoconfEditorPreferencePage.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/AutomakeEditorPreferencePage.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfDocumentProvider.java: Ditto.
+
+2007-06-07 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #243184
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeConfigMacro.java: New file.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/Automakefile.java (parse): Add
+ support for autoconf macros.
+ (parseConfigMacro): New method.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileCodeScanner.java
+ (createRules): Add rule for configure macros.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileContentOutlinePage.java
+ (getImage): Add support for AutomakeConfigMacro.
+ (getText): Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileUtil.java (isConfigMacro):
+ New method.
+
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/MakeUIImages.java: Add acmacro_obj image.
+ * icons/obj16/acmacro_obj.gif: New icon.
+
+2007-06-05 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/actions/BuildSpecial.java: Removed. No
+ longer used now that MakeTargets work.
+ * src/com/redhat/eclipse/cdt/autotools/actions/CheckboxTablePart.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/actions/MakeContentProvider.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/actions/MakeTargetDialog.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/actions/SharedPart.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/actions/SharedPartWithButtons.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/actions/StructuredViewerPart.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/actions/TargetListViewerPart.java: Ditto.
+
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/editors/autoconf/ProjectionFileUpdater.java: New file.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/AutotoolsEditorPreferenceConstants.java:
+ Add new constants for Autoconf editor folding.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/IAutotoolsEditor.java: New interface.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfEditor.java: Make class
+ implement IAutotoolsEditor interface. This allows ProjectionFileUpdater class to
+ work. Add folding support based on MakefileEditor class.
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfElement.java
+ (getStartOffset, setStartOffset, getEndLineNumber, setEndLineNumber): New methods.
+ (getEndOffset, setEndOffset, getLastChild): Ditto.
+ (AutoconfElement): New constructor which takes start offset.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfCaseElement.java:
+ Add new constructor to match that of AutoconfElement.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfElifElement.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfElseElement.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfForElement.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfIfElement.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfMacroElement.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfWhileElement.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfParser.java:
+ (AutoconfLineReader): New internal class to replace LineNumberReader class. Change
+ all internal parse routines to use this class instead of LineNumberReader.
+ (parseLines): When a semicolon is found that denotes a multistatement line, update the end
+ offset of the previous construct and set the start offset for the next construct to be after
+ the semicolon and additional whitespace.
+ (parseMacro, parseIf, parseElif, parseElse, parseCase, parseFor, parseWhile): Construct with
+ start offset based on previous mark. After processing, set the end line number for the
+ element.
+
+2007-06-01 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeEditor.java:
+ Refactor AutomakeEditorPreferenceConstants to AutotoolsEditorPreferenceConstants.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/ColorManager.java: Moved from here to..
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/ColorManager.java: ...here
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeEditorFactory.java:
+ Changed due to movement of ColorManager class.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileCodeScanner.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/AbstractMakefileCodeScanner.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MakefileCodeScanner.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MakefileSourceConfiguration.java: Ditto.
+
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/AbstractAutomakeEditorPreferencePaga.java:
+ Refactored to be...
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/AbstractEditorPreferencePage.java:
+ ...this.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/AutoconfEditorPreferencePage.java: New file.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/AutomakeEditorPreferenceConstants.java:
+ Refactored to be...
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/AutotoolsEditorPreferenceConstants.java:
+ ...this.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/AutomakePreferencesMessages.java:
+ Refactored to be...
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/AutotoolsPreferencesMessages.java:
+ ...this.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/AutomakePreferencesMessages.properties:
+ Refactored to be...
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/AutotoolsPreferencesMessages.properties:
+ ...this.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/AutomakeEditorPreferencePage.java:
+ Use new refactored classes.
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfCodeScanner.java: Add color preference
+ support.
+ (AutoconfCodeScanner): A color provider is no longer needed as input.
+ (getToken, getTokenProperties, addToken, indexOf, affectsBehavior): New methods.
+ (adaptToPreferenceChange, adaptToColorChange, adaptToStyleChange); Ditto.
+ (createTextAttribute, initialize): Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfColorProvider.java: Removed and replaced
+ with ColorManager.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfEditor.java: Change to use
+ ColorManager.
+ (initializeEditor): Set the preference change store and initialize the editor preferences.
+ (getAutoconfCodeScanner): Changed to match new AutoconfCodeScanner constructor.
+ (getPreferenceColor): New method.
+ (getColorProvider): Removed.
+ (handlePreferenceStoreChanged): New method.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfSourceViewerConfiguration.java:
+ Inherit from TextSourceViewerConfiguration. Store the preference store.
+ * plugin.properties: Add new internationalized string for Autoconf editor preferences.
+ * plugin.xml: Add Autoconf editor preference page.
+
+2007-05-30 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #241908
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java (addMakeTargetsToManager):
+ Change builder id used to one used in plugin.xml.
+
+2007-05-30 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #241782
+ * src/com/redhat/eclipse/cdt/autotools/Resources.properties: Add new message
+ for Autotools preference page.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeEditor.java
+ (initializeEditor): Initialize color and folding preference defaults.
+ (handlePreferenceStoreChanges): Call super method to refresh editor.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/ColorManager.java:
+ Change constants to be in Autotools domain.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/AbstractAutomakeEditorPreferencePage.java:
+ New file.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/AutomakeEditorPreferenceConstants.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/AutomakeEditorPreferencePage.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/AutomakePreferencesMessages.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/AutomakePreferencesMessages.properties:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/AutotoolsPreferencePage.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/ColorEditor.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/OverlayPreferenceStore.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/StatusInfo.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/TabFolderLayout.java: Ditto.
+
+ * plugin.properties: Add new internationalized strings from plugin.xml.
+ * plugin.xml: Add Autotools and Automake Editor preference pages. Also
+ clean up some extensions to use internationalized strings.
+
+2007-05-28 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #241612
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsPlugin.java:
+ Add utility methods from MakeUIPlugin to log messages and
+ issue error dialogs, etc..
+ * src/com/redhat/eclipse/cdt/autotools/actions/MakeTargetDialog.java:
+ Use MakeUIMessages instead of MakeUIPlugin for messages.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeCompletionProcessor.java:
+ Replace internal CDT classes with internal Autotools classes.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeDocumentProvider.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeEditor.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeEditorFactory.java:
+ Ditto.
+ (getPreferenceColor): New method.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeErrorHandler.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/Automakefile.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileCodeScanner.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileContentOutlinePage.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileReconcilingStrategy.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileSourceConfiguration.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeIfElse.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeMacroDefinitionRule.java:
+ Ditto.
+ (evaluate): Remove unused local variable ch.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeTextHover.java: Ditto.
+
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/AbstractElementListSelectionDialog.java:
+ New file transported from CDT internals.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/AbstractMakefile.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/AbstractMakefileCodeScanner.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/AddBuildTargetAction.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/ArchiveTarget.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/BadDirective.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/ColorManager.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/Command.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/Comment.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/CompletionProposalComparator.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/DefaultRule.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/Directive.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/EditorUtility.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/ElementListSelectionDialog.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/EmptyLine.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/ExternalEditorInput.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/ExternalEditorInputFactory: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/GNUMakefileConstants.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/IgnoreRule.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/IMakefileDocumentProvider.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/IMakefileEditorActionDefinitionIds.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/InferenceRule.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/IReconcilingParticipant.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/ISelectionValidator.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/ITranslationUnitEditorInput.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/LexicalSortingAction.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MacroDefinition.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MacroDefinitionRule.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MacroReferenceRule.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MakefileAnnotationHover.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MakefileCodeScanner.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MakefileCompletionProcessor.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MakefileConstants.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MakefileContentOutlinePage.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MakefileDocumentProvider.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MakefileDocumentSetupParticipant.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MakefileEditor.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MakefileEditorPreferenceConstants.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MakefileMessages.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MakefilePartitionScanner.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MakefileReader.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MakefileReconcilingStrategy.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MakeFileResources.properties: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MakefileSourceConfiguration.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MakefileStorageDocumentProvider.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MakefileTextHover.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MakefileWordDetector.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MessageLine.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/NullMakefile.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/OpenDeclarationAction.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/OpenIncludeAction.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/Parent.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/PosixMakefileUtil.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/PosixRule.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/PreciousRule.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/ProjectionMakefileUpdater.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/Rule.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/SccsGetRule.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/SelectionList.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/SilentRule.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/SpecialRule.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/StatusInfo.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/StringMatcher.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/SuffixesRule.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/Target.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/TargetRule.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/TwoArrayQuickSort.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/Util.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/VariableDefinition.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/WordPartDetector.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/WorkingCopyManager.java: Ditto.
+
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/AutotoolsPluginImages.java: Switch to
+ use new ac16 icon directory instead of etools16.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/ErrorParserBlock.java: Use
+ MakeUIMessages instead of MakeUIPlugin for messages.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/MakeUIImages.java: Use
+ AutotoolsPlugin for error dialogs. Add new images.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/MakeUIMessages.java: New file.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/MakeUIPlugin.java: Removed.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/MessageLine.java: Fix typo.
+
+ * src/com/redhat/eclipse/cdt/autotools/internal/wizards/AutotoolsWizardMessages.java:
+ Fix bundle id for messages.
+
+ * plugin.xml: Fix icon references.
+
+ * icons/ac16: New folder containing icons that used to be in etool16.
+ * icons/dlcl16/build_configs.gif: New icon.
+ * icons/dlcl16/open_include.gif: Ditto.
+ * icons/elcl16/build_configs.gif: Ditto.
+ * icons/elcl16/open_include.gif: Ditto.
+ * icons/dtool16/alphab_sort_co.gif: Ditto.
+ * icons/dtool16/build_menu.gif: Ditto.
+ * icons/dtool16/convert-normal.gif: Ditto.
+ * icons/dtool16/make.gif: Ditto.
+ * icons/dtool16/makefile.gif: Ditto.
+ * icons/dtool16/newc_app.gif: Ditto.
+ * icons/dtool16/newcc_app.gif: Ditto.
+ * icons/dtool16/segment_edit.gif: Ditto.
+ * icons/dtool16/target_add.gif: Ditto.
+ * icons/dtool16/target_build.gif: Ditto.
+ * icons/dtool16/target_delete.gif: Ditto.
+ * icons/dtool16/target_edit.gif: Ditto.
+ * icons/dtool16/update_old.gif: Ditto.
+ * icons/etool16: Move autoconf editor icons to ac16 folder.
+ * icons/obj16/command_obj.gif: New icon.
+ * icons/obj16/define_obj.gif: Ditto.
+ * icons/obj16/environment_obj.gif: Ditto.
+ * icons/obj16/envvar_obj.gif: Ditto.
+ * icons/obj16/error_obj.gif: Ditto.
+ * icons/obj16/hfolder_obj.gif: Ditto.
+ * icons/obj16/include_obj.gif: Ditto.
+ * icons/obj16/irule_obj.gif: Ditto.
+ * icons/obj16/lib_obj.gif: Ditto.
+ * icons/obj16/macro_obj.gif: Ditto.
+ * icons/obj16/relation_obj.gif: Ditto.
+ * icons/obj16/target_obj.gif: Ditto.
+ * icons/obj16/trule_obj.gif: Ditto.
+
+2007-05-14 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java:
+ (addMakeTargetsToManager): Use MakeCorePlugin to get an IMakefile
+ rather than use the internal PosixMakefile class directly.
+
+2007-05-14 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java:
+ (initialize): Store the configuration for later usage.
+ (getConfigSettingsPath): Use stored configuration instead of fetching
+ it each time.
+ (runCommand): Ditto.
+ (addMakeTargetsToManager): Use the real MakeTargetManager to store
+ targets. Mark targets added by parsing the Makefile with special
+ tag. Delete all MakeTargets with special tag before adding the
+ new targets.
+ (initializeBuildConfigDirs): Use stored configuration to get the
+ tool options rather than the ManagedBuildInfo.
+ (getConfigArgs): Ditto.
+ (addMakeTargetsToManager):
+
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsMakefileBuilder.java:
+ Inherit from CommonBuilder.
+ (build): Change to fetch make target name from args map and store for
+ later use.
+ (getTargets): Change to get make target from stored make target name.
+
+ * plugin.xml: Remove Build Special Targets menu item as it is no longer
+ needed. Add MakeTargetBuilder extension so we can use MakeTargets.
+
+2007-05-11 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #239886
+ * src/com/redhat/eclipse/cdt/autotools/actions/InvokeAclocalAction.java (run):
+ Pass the CWD to TwoInputDialog and use it when executing the command. On
+ success, show a success dialog.
+ * src/com/redhat/eclipse/cdt/autotools/actions/InvokeAutoconfAction.java (run):
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/actions/TwoInputDialog.java (TwoInputDialog):
+ Take the CWD as a parameter.
+ (createDialogArea): Add label with CWD.
+
+ * src/com/redhat/eclipse/cdt/autotools/actions/InvokeAutomakeAction.java (run):
+ * src/com/redhat/eclipse/cdt/autotools/actions/InvokeMessages.java (getString):
+ Add comments.
+ (getFormattedString): New method.
+
+ * src/com/redhat/eclipse/cdt/autotools/actions/InvokeAction.java (getExecDir):
+ New method to return the CWD.
+ (showSuccess): New method to display a success dialog.
+
+ * src/com/redhat/eclipse/cdt/autotools/actions/InvokeMessages.properties: Add new
+ messages.
+
+2007-05-10 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #238173
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfIdentifierRule.java (evaluate):
+ Cast read character to char before invoking Character methods to avoid gcj bug.
+
+2007-04-30 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #238493
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/RecursiveSingleLineRule.java (evaluate):
+ Add check for scanner column < 0 which means we are already at EOF.
+
+2007-04-25 jjohnstn <jjohnstn@toocool.toronto.redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/wizards/NewAutotoolsProjectOptionPage.java (ManagedWizardOptionBlock.setupHelpContextIds):
+ Switch to use CDTHelpContextIds for static help context id.
+ * src/com/redhat/eclipse/cdt/autotools/wizards/CProjectPlatformPage.java (createControl):
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/wizards/ManagedProjectOptionBlock.java (createContents):
+ Ditto.
+
+2007-04-25 Jeff Johnston <jjohnstn@redhat.com>
+
+ Bugzilla #182821
+
+ 2007-04-25 Mikhail Sennikovsky
+ * plugin.xml: Add plugin extensions which let the CDT know that includes and
+ defined symbols are supported for the Autotools tool-chain.
+
+2007-04-12 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #236304
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java (runCommand): Use the
+ job description as a message in the console.
+ (regenerateMakefiles): Fix autogen.sh logic to run configure after invoking
+ autogen.sh if config.status doesn't exist. Make sure console is reused for
+ 2nd step. Change some of the status messages with new ones.
+ (autogenExists): Fix bug where path to autogen.sh wasn't being set on return.
+ * src/com/redhat/eclipse/cdt/autotools/Resources.properties: Add new MakeGenerator messages.
+
+2007-04-11 jjohnstn <jjohnstn@toocool.toronto.redhat.com>
+
+ Bugzilla #236077
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/CWordFinder.java: New file.
+ * src/com/redhat/eclipse/cdt/autotools/internal/text/hover/AutoconfTextHover.java: Replace
+ CDT internal classes with Autotools internal classes.
+ * src/com/redhat/eclipse/cdt/autotools/internal/wizards/ManagedProjectOptionBlock.java (createContents):
+ Replace WorkbenchHelp reference with non-deprecated alternative.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsMakeTargetManager.java: Fix
+ imports.
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java (runCommand): Replace
+ deprecated environmental variable method being used.
+ (createFile): Make protected instead of private.
+ (getInvalidDirList): Remove.
+ * src/com/redhat/eclipse/cdt/autotools/wizards/ConvertToAutotoolsProjectWizardPage.java (convertProject):
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsPlugin.java (getWorkingCopyManager):
+ Moved into AutomakeEditorFactory.
+ (getAutomakefileDocumentProvider): Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeEditorFactory.java: New file.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeCompletionProcessor.java:
+ Change all calls to getWorkingCopyManager and getAutomakefileDocumentProvider to use
+ new AutomakeEditorFactory class.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeEditor.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileContentOutlinePage.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileReconcilingStrategy.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeCompletionProcessor.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfEditorMessages.java (getResourceBundle):
+ New method.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfEditorMessages.properties: Add
+ new messages that were formerly fetched internally from CDT.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfEditor.java: Comment out unused
+ projectSupport.
+ (createActions): Use AutoconfEditorMessages.
+ (InformationDispatchAction.makeAnnotationHoverFocusable): Ditto.
+ (fProjectionModelUpdater): Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfAnnotationHover.java (formatMultipleMessages):
+ Use AutoconfEditorMessages instead of CUIMessages.
+ * src/com/redhat/eclipse/cdt/autotools/interenal/ui/ErrorParserBlock.java: New file.
+ * src/com/redhat/eclipse/cdt/autotools/wizards/CProjectPlatformPage.java (createControl): Remove
+ usage of WorkbenchHelp class which is deprecated.
+ * src/com/redhat/eclipse/cdt/autotools/wizards/NewAutotoolsProjectOptionPage.java (ManagedWizardOptionBlock.setupHelpContextIds):
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/wizards/ConvertToAutotoolsProjectWizardPage.java (convertProject):
+ Remove unused code. Switch to use non-deprecated interface for getting
+ indexer.
+
+2007-04-10 jjohnstn <jjohnstn@toocool.toronto.redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/wizards/NewAutotoolsProjectWizard.java:
+ Removed.
+ * src/com/redhat/eclipse/cdt/autotools/wizards/NewAutotoolsProjectOptionPage.java:
+ Use new internal ManagedProjectOptionBlock class.
+ * src/com/redhat/eclipse/cdt/autotools/wizards/CProjectPlatformPage.java:
+ Switch to use new AutotoolsWizardMessages internal class.
+ * src/com/redhat/eclipse/cdt/autotools/wizards/ConvertToAutotoolsProjectWizardPage.java:
+ Fix imports.
+ * src/com/redhat/eclipse/cdt/autotools/wizards/ConvertToAutotoolsProjectWizard.java (doRunEpilogue):
+ Switch to new IRunnableWithProgress interface.
+ * src/com/redhat/eclipse/cdt/autotools/internal/wizards/AutotoolsWizardMessages.java:
+ New file to support old wizard code.
+ * src/com/redhat/eclipse/cdt/autotools/internal/wizards/AutotoolsWizardMessages.properties:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/wizards/ConfigurationContentProvider.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/wizards/ConfigurationLabelProvider.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/wizards/ManagedProjectOptionBlock:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/AutotoolsPluginImages.java:
+ Add build_configs.gif for Wizard support.
+ * src/com/redhat/eclipse/cdt/autotools/internal/MarkerGenerator.java (addMarker):
+ New method required by IMarkerGenerator interface.
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java (getProject):
+ New method.
+ (initializeBuildConfigDirs): Change the default build directory
+ for the configuration's builder.
+ Add support for CDT 4.0 M6.
+ * cdtpatches/*: Removed.
+ * icons/eclcl16: New icon directory.
+ * icons/eclcl16/build_configs.gif: New icon.
+ * plugin.properties: Add new strings used in plugin.xml.
+ * plugin.xml: Add buildType and buildArtefactType extensions. Add
+ toolchain to Autotools project buildDefinitions extension.
+
+2007-04-04 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #235076
+ * src/com/redhat/eclipse/cdt/autotools/wizards/CProjectPlatformPage.java (CProjectPlatformPage):
+ Add missing NLS comment.
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java (makefileCvsExists): Use
+ getMakefileCVSPath method.
+ (configureExists): Use getConfigurePath method.
+ (getConfigurePath): New method.
+ (getMakefileCVSPath): New method.
+ (regenerateMakefiles): Use getConfigurePath and getMakefileCVSPath to get the
+ command to use when either of these is found to exist.
+ (autogenExists): Change to protected method.
+
+2007-03-30 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfMacroDamagerRepairer.java (createPresentation):
+ Comment out macro parsing as this is now done by the reconciler and overall parsing.
+ * src/com/redhat/eclipse/cdt/autotools/internal/text/hover/AutoconfTextHover.java (getPrototype):
+ Fix so it is properly setting minimum and maximum parm counts for a macro.
+ * src/com/redhat/eclipse/cdt/autotools/internal/text/hover/AutoconfPrototype.java (setMaxParms):
+ Fix typo.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfParser.java (matchParentheses):
+ Update logic.
+ (parseMacro): Add error checking for minimum and maximum parameters as well as unmatched
+ parentheses or square-brackets.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfMacroElement.java (setParmCount):
+ New method.
+ (setQuoteDepth): Ditto.
+ (getParmCount): Ditto.
+ (getQuoteDepth): Ditto.
+ (setDepth): Ditto.
+ (getDepth): Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfEditorMessages.properties: Add
+ new error messages for parsing of macros.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/outline/AutoconfContentOutlinePage (update):
+ Use viewer refresh instead of redraw when updating.
+ (updateSelection): New method.
+
+2007-03-19 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/Makegenerator.java (regenerateMakefiles):
+ Refine algorithm so we don't cause a reconfigure if the configuration settings
+ file doesn't contain the project name. If the configuration arguments are
+ unchanged and the settings file is the old style, rewrite with project
+ name.
+
+2007-03-19 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #230128
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java (saveConfigArgs): Add
+ the project name as first argument saved.
+ (regenerateMakefiles): Read off first argument and verify that it matches the
+ current project name.
+
+2007-03-19 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #232965
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java (runCommand):
+ Change prototype to accept a console and a boolean which when true
+ means to restart the console which may possibly clear the console.
+ (regenerateMakefiles): Change calls to runCommand. For multiple
+ actions (e.g. autogen.sh then configure), opt for the 2nd, 3rd, etc...
+ calls to not clear the console. Don't run config.status unless
+ the top-level Makefile is missing.
+ * src/com/redhat/eclipse/cdt/autotools/Resources.properties: Add new
+ MakeGenerator.unsupportedConfig message.
+
+2007-03-16 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java (regenerateMakefiles):
+ If configuration parameters have changed, mark all Scanner Info as dirty.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsScannerInfoProvider.java (getCollectionName):
+ Make synchronized to avoid concurrent access of the infoCollection.
+ (getScannerInformation): Ditto.
+ (setDirty): New method.
+
+2007-03-14 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #230493
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsScannerInfo.java (getDefinedSymbols):
+ Recalculate each time if compilation string is null.
+ (getIncludePaths): Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsScannerInfoProvider.java (getScannerInformation):
+ Use a map of configurations to keep ScannerInfo seperate per configuration. Use
+ current configuration to fetch scanner info.
+
+2007-02-27 Jeff Johnston <jjohnstn@redhat.com>
+
+ * plugin.xml: Bump up release to 0.0.8.1.
+
+2007-02-27 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzillas #230253, #205310.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsMakeTargetManager.java (addTargets):
+ New method to do mass add of MakeTargets for performance improvement.
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java:
+ (addMakeTargetsToManager): Use new AutotoolsMakeTargetManager addTargets method.
+ * src/com/redhat/eclipse/cdt/autotools/wizards/NewAutotoolsProjectWizard.java (doRun):
+ Set indexer to NullIndexer before applying options.
+ * src/com/redhat/eclipse/cdt/autotools/wizards/ConvertToAutotoolsProjectWizardPage.java (convertProject):
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/wizards/ConvertToAutotoolsProjectWizard.java:
+ Add new NULL_INDEXER_ID.
+ * src/com/redhat/eclipse/cdt/autotools/internal/MakeTargetManager.java: Expose
+ projectTargetMap to inheriting classes.
+
+2007-02-23 Jeff Johnston <jjohnstn@redhat.com>
+
+ Fix for Bugzilla 229891.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsMakefileBuilder.java (getMakeTargets):
+ Use Make Target info to find the real build target which may have been set by the
+ Build Special Targets action.
+ (build): Set up the IMakeBuildInfo needed to fetch Make Target from.
+
+2007-02-22 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/actions/InvokeMessages.properties: Fix a few
+ typos.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfDocumentSetupParticipant.java (setup):
+ Use IDocumentExtension3 version of setDocumentParitioner if document is an instance of
+ IDocumentExtension3.
+
+2007-02-22 Andrew Overholt <overholt@redhat.com>
+
+ * icons/automake.gif: New craptacular icon for automake editor.
+ * icons/autoconf.gif: Another manifestation of my poor artistic skills.
+ * plugin.xml: Use new icons.
+
+2007-02-21 Jeff Johnston <jjohnstn@redhat.com>
+
+ Fix for Bugzilla 229893.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfDocumentProvider.java: Switch
+ to superclass TextFileDocumentProvider instead of FileDocumentProvider so as to fix
+ undo support.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfDocumentSetupParticipant.java:
+ New file.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfEditorMessages.properties: Fix typo.
+ * plugin.xml: Add extension for document setup that ties document setup for configuration
+ files to AutoconfDocumentSetupParticipant.
+
+2007-02-20 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfParser.java (findDelimeter): Ignore
+ escaped character.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfPartitionScanner.java (AutoconfPartitionScanner):
+ Add escape character for # format comment and eat "\#" as character.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfCodeScanner.java (AutoconfCodeScanner):
+ Ditto.
+ * plugin.xml: Update release to 0.0.8.
+
+2007-02-20 Andrew Overholt <overholt@redhat.com>
+
+ Patch from Jordy Potman
+ http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=229352
+
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileSourceConfiguration.java
+ (AutomakefileSourceConfiguration): Update super constructor call to reflect
+ change in CDT 3.1.2.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeEditor.java
+ (initializeEditor): Likewise.
+
+2007-02-20 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfElement.java: New class.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfElifElement: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfElseElement.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfOutlineErrorHandler.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfMacroElement.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfIfElement.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfRootElement.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfWhileElement.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfCaseElement.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfForElement.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfCaseConditionElement.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfCodeScanner.java (AutoconfCodeScanner):
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfParser.java: New class to
+ do Autoconf file parsing and error marking.
+ Add AutoconfIdentifierRule and InlineDataRule.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfDocumentProvider.java (createDocument):
+ Changed to use new AutoconfErrorHandler interface.
+ (documentAboutToBeChanged): Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfErrorHandler.java (removeExistingMarkers):
+ Add verification that file exists.
+ (removeAllExistingMarkers): Ditto.
+ (handleError): Ditto.
+ (getCharOffset): Reformatted.
+ (AutoconfErrorHandler): Change constructor to take an IStorageEditorInput rather than
+ an IFile. This allows external files to be edited without error handling.
+ * src/com/redhat/eclipse/cdt/autotools/editors/AutoconfEditorMessages.properties: New messages
+ added for outline parsing.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfPartitionScanner.java (AutoconfPartitionScanner):
+ Use new AutoconfIdentifierRule.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfSourceViewerConfiguration.java (getPresentationReconciler):
+ Change default partition to use MultilineRuleDamagerRepairer.
+ (getReconciler): New method.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfMacroDamagerRepairer.java (createPresentation):
+ Change to use new AutoconfErrorHandler constructor.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfMacroParser.java (AutoconfMacroParser): Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfEditor.java (doSetInput): New.
+ (getInputDocument): Ditto.
+ (getRootElement): Ditto.
+ (getAutoconfParser): Ditto.
+ (getAdapter): Ditto.
+ (InformationProvider): Ditto.
+ (getOutlinePage): Ditto.
+ (setRootElement): Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/outline/AutoconfContentOutlinePage.java: New file.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/outline/AutoconfContentProvider.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/outline/AutoconfLabelProvider.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfIdentifierRule.java: New class to
+ prevent matches of other strings that happen to be inside common identifiers.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/InlineDataRule.java: New class to
+ recognize inline data files.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/MultilineRuleDamagerRepairer.java: New class
+ to handle damage/repair when multiline rules are used.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfReconciliingStrategy.java: New class
+ for delayed document-change parsing.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/AutotoolsPluginImages.java: New class
+ to handle image repository.
+ * icons/etool16/acmacro_obj.gif: New image for Autoconf outline view.
+ * icons/etool16/ammacro_obj.gif: Ditto.
+ * icons/etool16/case_obj.gif: Ditto.
+ * icons/etool16/condition_obj.gif: Ditto.
+ * icons/etool16/elif_obj.gif: Ditto.
+ * icons/etool16/for_obj.gif: Ditto.
+ * icons/etool16/if_obj.gif: Ditto.
+ * icons/etool16/while_obj.gif: Ditto.
+ * plugin.xml: Add new error marker extension for outline view.
+
+2007-02-02 Andrew Overholt <overholt@redhat.com>
+
+ * cdtpatches/README: Fix CVS location of managedbuilder.
+
+2007-02-02 Andrew Overholt <overholt@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeCompletionProcessor.java:
+ New file.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/Automakefile.java (getBuiltins):
+ Add $<, $@, and $?.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileSourceConfiguration.java
+ (getContentAssistant): Make use of AutomakeCompletionProcessor.
+
+2007-01-31 Jeff Johnston <jjohnstn@redhat.com>
+
+ * cdtpatches/cdt.ui.buildconsole.patch: New file that contains the
+ 3.1.1 version of the patch for Bugzilla 153816 which adds multiple
+ build console support to CDT 4.0.
+ * cdtpatches/cdt.ui.patch: Altered to remove any build console patches.
+ * cdtpatches/README: Updated to include the new patch.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/CConfigureConsole.java (CConfigureConsole):
+ Modified to use new CUIPlugin build console manager interface.
+
+2007-01-31 Andrew Overholt <overholt@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeErrorHandler.java: New class.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfDocumentProvider.java: Remove unnecessary import.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeDocumentProvider.java
+ (connect): New method. Update error markers at document load time.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileReconcilingStrategy.java
+ (reconcile): Update error markers.
+ (AutomakefileReconcilingStrategy): Set class-wide variables.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeEditor.java
+ (getAutomakeErrorHandler): New method.
+
+2007-01-26 Jeff Johnston <jjohnstn@redhat.com>
+
+ Fix for Bugzilla 224644.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsMakefileBuilder.java (getMakeTargets):
+ Don't add "clean" for fullbuild anymore. It causes unnecessary extra building to occur.
+ (build): Set a flag that build was called.
+ (clean): Only clean if this method is called directly and via a call to build method.
+ Clean by doing a make clean rather than calling super.clean.
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java (runCommand): When an
+ error occurs in configure, we want to set the status of the project to "needs rebuild".
+ (getConfigSettingsPath): New method to generate name of config settings file.
+ (saveConfigArgs): Use new getConfigSettingsPath method.
+ (regenerateMakefiles): Ditto, when checking if config options have changed.
+ (autogenExists): Clean up unused variables.
+ (getMakefileName): Return "Makefile" instead of "makefile".
+
+2007-01-22 Andrew Overholt <overholt@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileCodeScanner.java:
+ Update copyright.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeDocumentProvider.java:
+ Likewise.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeIfElse.java:
+ Likewise.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileReconcilingStrategy.java:
+ Likewise.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileUtil.java:
+ Likewise.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/Automakefile.java:
+ Likewise.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileSourceConfiguration.java:
+ Likewise.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeEditor.java
+ (getAutomakeSourceViewer): New method. Update copyright.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileContentOutlinePage.java:
+ Update copyright.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeTextHover.java
+ (getHoverInfo): Remove debugging println. Update copyright.
+
+2007-01-19 Jeff Johnston <jjohnstn@redhat.com>
+
+ Fix for Bugzilla 214624.
+ * src/com/redhat/eclipse/cdt/autotools/internal/MarkerGenerator.java: New file.
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java (runCommand): Add check
+ for return code being 0 or 1 to reveal whether command ran correctly.
+ (regenerateMakefiles): Add boolean checking for runCmd calls and also quit
+ if runCmd fails. For autogen.sh cases, check if configure is run by autogen.sh
+ and don't bother calling configure afterwards if true. Add error checking to
+ ensure a second command is not run if the first fails.
+ (PathVar): New private class.
+ (autogenExists): Fixed to take a path parameter to fill in. It also looks for
+ any file that ends in autogen.sh to handle projects like Gnome.
+ * Resources.properties: Add new messages used by MakeGenerator.
+ * cdtpatches/managedbuilder.core.patch: New patch to cause ManagedMake build
+ to stop if an error occurs generating Makefile.
+ * cdtpatches/README: Add details on how to install new patch.
+
+2007-01-16 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfMacroParser.java: New code
+ to parse an Autoconf macro.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfMacroDamagerRepairer.java (createPresentation):
+ Use new AutoconfMacroParser.parse method instead of embedding the code. Remove
+ all corresponding parse methods.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfDocumentProvider.java (documentAboutToBeChanged):
+ Add checks for whether we should remove the error markers in an autoconf_macro
+ partition.
+
+2007-01-12 Jeff Johnston <jjohnstn@redhat.com>
+
+ * about.html: New EPL license file.
+
+2007-01-12 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/ParseException.java: New file.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfEditorMessages.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfErrorHandler.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/text/hover/AutoconfPrototype.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfAnnotationHover.java: Ditto.
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfCodeScanner.java: Add
+ copyright info.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfColorProvider.java: Ditto.
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfDocumentProvider.java: Ditto.
+ (createDocument): New method.
+ (documentChanged): Ditto.
+ (documentAboutToBeChanged): Ditto.
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfEditor.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfKeywordDetector.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfM4WordDetector.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfMacroContentAssistProcessor.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfMacroDamagerRepairer.java: Ditto.
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfMacroPartitionRule.java : Ditto.
+ (matchParentheses): Fix up logic.
+ (evaluate):
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfMacroRule.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfMacroWordDetector.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfPartitioner.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfPartitionScanner.java: Ditto.
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfSourceViewerConfiguration.java: Ditto.
+ (getPresentationReconciler): Use AutoconfMacroDamagerRepairer for macro partition.
+ (getAnnotationHover): New method.
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfWhitespaceDetector.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfWordDetector.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/IAutotoolEditorActionDefinitionIds.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/IAutotoolHelpContextIds.java: Ditto.
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/RecursiveSingleLineRule.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/LibHover.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/popup/actions/GetDefinedSymbolsAction.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/popup/actions/GetIncludePathAction.java: Ditto.
+
+ * src/com/redhat/eclipse/cdt/autotools/internal/text/hover/AutoconfTextHover.java: Ditto.
+ (getIndexedInfo): New method.
+ (getPrototype): Ditto.
+
+ * src/com/redhat/eclipse/cdt/autotools/internal/text/hover/HoverMessages.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeWordDetector.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/actions/BuildSpecial.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/actions/InvokeAclocalAction.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/actions/InvokeAction.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/actions/InvokeAutoconfAction.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/actions/InvokeAutomakeAction.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/actions/InvokeMessages.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/actions/TwoInputDialog.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsScannerInfoProvider.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsScannerInfo.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsPlugin.java: Ditto.
+
+2007-01-12 Andrew Overholt <overholt@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeTextHover.java: New class. Hover help provider for automake editor.
+ (getHoverControlCreator): New method. Return null for now.
+ (AutomakeTextHover): New method.
+ (getHoverRegion): New method. Return an IRegion from an offset in the document.
+ (findWord): New method. Return an IRegion of the hover region.
+ (getHoverInfo): New method. Return the hover information for a particular region.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileSourceConfiguration.java (getTextHover): New method.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/Automakefile.java (getDirectiveContainingLine): Likewise.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeEditor.java (getMakefile): Likewise.
+
+2007-01-09 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfDocumentProvider.java: Revert
+ to version 1.2 prior to 2006-11-27. This reversion is required because the previous
+ fix causes a regression in autoconf partitioning.
+
+2007-01-08 Andrew Overholt <overholt@redhat.com>
+
+ * libhoverdocs/acmacros.xml: Add PKG_* macros from pkgconfig.
+
+2007-01-05 Andrew Overholt <overholt@redhat.com>
+
+ * libhoverdocs/acmacros.xml: Add AM_* macros from automake's Public-macros.html.
+
+2007-01-05 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java (regenerateMakefiles):
+ Add check for Makefile.cvs ahead of configure check. Use resource strings
+ for runCommand descriptions.
+ (makefileCvsExists): New internal method.
+ * src/com/redhat/eclipse/cdt/autotools/Resources.properties: Add new
+ resource strings.
+
+2007-01-02 Andrew Overholt <overholt@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileCodeScanner.java
+ (automaticVariables): New $<, etc. variables.
+ (createRules): Add automatic variables as keywords. Also add @AC_SUBST_VAR@
+ highlighting.
+ (nextToken): New method.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeDocumentProvider.java
+ (getDocument): New method.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeWordDetector.java:
+ New file.
+
+2006-12-15 Andrew Overholt <overholt@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileSourceConfiguration.java
+ (getAutomakeCodeScanner): New method.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeEditor.java
+ (getAutomakeSourceViewerConfiguration): Likewise.
+ (getAutomakefileDocumentProvider): Likewise
+ (initializeEditor): Set up field variables.
+
+2006-12-12 Andrew Overholt <overholt@redhat.com>
+
+ * META-INF/MANIFEST.MF: Add package visibility for tests.
+ * plugin.xml: Add filename associations for AutomakeEditor.
+
+2006-12-11 Jeff Johnston <jjohnstn@redhat.com>
+
+ * MANIFEST.MF: Update release to 0.0.6.
+
+2006-12-11 Kyu Lee <klee@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/actions/TwoInputDialog.java: New class
+ for getting 2 text field inputs.
+ * src/com/redhat/eclipse/cdt/autotools/actions/InvokeMessages.java: New class
+ for NLS strings.
+ * src/com/redhat/eclipse/cdt/autotools/actions/InvokeAutomakeAction.java: New
+ class for handling invoke automake.
+ * src/com/redhat/eclipse/cdt/autotools/actions/InvokeAutoconfAction.java: New
+ class for handling invoke autoconf.
+ * src/com/redhat/eclipse/cdt/autotools/actions/InvokeAction.java: New super
+ class for invoking autotools classes.
+ * src/com/redhat/eclipse/cdt/autotools/actions/InvokeAclocalAction.java: New
+ class for handling invoke aclocal.
+ * src/com/redhat/eclipse/cdt/autotools/actions/InvokeMessages.properties:
+ Property file for NLS strings.
+ * plugin.xml: Added menu options for invoking autotools under project menu.
+
+2006-12-11 Andrew Overholt <overholt@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsPlugin.java
+ (getWorkingCopyManager): New method.
+ (getAutomakefileDocumentProvider): Likewise.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeEditor.java
+ (initializeEditor): New method.
+ (getAutomakeOutlinePage): Likewise.
+ (createPartControl): Likewise.
+ (getAdapter): Likewise.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeDocumentProvider.java:
+ New file.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeMacroReferenceRule.java:
+ Likewise.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeMacroDefinitionRule.java:
+ Likewise.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeIfElse.java:
+ Likewise.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileUtil.java:
+ Likewise.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileSourceConfiguration.java:
+ Likewise.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileReconcilingStrategy.java:
+ Likewise.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileContentOutlinePage.java:
+ Likewise.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/Automakefile.java:
+ Likewise.
+
+2006-12-08 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/wizards/ConvertToAutotoolsProjectWizard.java
+ (setCurrentProject): Make protected to allow subclasses to use.
+ * MANIFEST.MF: Export org.eclipse.linuxtools.cdt.autotools.wizards classes to the
+ autotools.tests plug-in.
+
+2006-12-01 Andrew Overholt <overholt@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake: New directory.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeEditor.java: New
+ file. Simple extension of MakefileEditor for now.
+ * plugin.xml: Add automake editor.
+
+2006-11-29 Jeff Johnston <jjohnstn@redhat.com>
+
+ * plugin.xml: Add .m4 file support to the Autoconf editor.
+
+2006-11-27 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfEditor.java
+ (performRevert): Method copied from CDT and JDT editors.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfDocumentProvider.java:
+ Change base class to be TextFileDocumentProvider. This means no longer providing
+ a createDocument() method.
+ (createDocument): Deleted.
+ (AutoconfStorageDocumentProvider.AutoconfStorageDocumentProvider): New internal
+ class based on StorageDocumentProvider.
+ (AutoconfStorageDocumentProvider.setupDocument): New method of internal class.
+ (AutoconfDocumentProvider): New constructor which sets up a
+ TextFileDocumentProvider that takes the internal AutoconfStorageDocumentProvider
+ class as parent DocumentProvider. This emulates what the CDT CEditor does and is
+ done to provide proper edit reversion support.
+
+2006-11-22 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/IAutotoolHelpContextIds.java:
+ Add CONTENT_ASSIST string.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfSourceViewerConfiguration.java
+ (getContentAssistant): New routine to add content assist support.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfEditor.java
+ (createActions): Add action for content assist.
+ * src/com/redhat/eclipse/cdt/autotools/internal/text/hover/AutoconfTextHover.java
+ (getIndexedInfo):
+ (getInformationControlCreator): New method.
+ (getTooltipAffordanceString): Make static.
+ (init): Ditto.
+ (getIndexedInfo): Ditto plus add call to init.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfMacroContentAssistProcessor.java:
+ New class for macro content assist.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfMacroParameterListValidator.java:
+ New class for content assist to help with macro call parameters.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfMacroProposalContextInformation.java:
+ New file for parameter context assist information.
+
+2006-11-14 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfPartitionScanner.java
+ (AutoconfPartitionScanner): Change partitions to be comments, macros, and
+ default.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfSourceViewerConfiguration.java
+ (getPresentationReconciler): Change to match new paritioning. Use a special new
+ MultiLineDamagerRepairer for macros.
+ (getConfiguredContentTypes): Change to list of new partitions.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfEditor.java
+ (createPartControl): Specify new AUTOCONF_MACRO partition.
+ (InformationDispatchAction.makeAnnotationHoverFocusable): Ditto.
+ (InformationDispatchAction.makeTextHoverFocusable): Ditto.
+ (getAutoconfInlineCodeScanner, getAutoconfStringScanner): Removed.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfInlineCodeScanner.java:
+ Removed.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfSectionRule.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfStringScanner.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfCodeScanner.java
+ (AutoconfCodeScanner): Change rules to add a recursive single line rule for
+ strings and a multiline rule for inlined code. Also add a rule to discover m4
+ macros.
+ * src/com/redhat/eclipse.cdt/autotools/ui/editors/AutoconfM4WordDetector.java:
+ New file.
+ * src/com/redhat/eclipse.cdt/autotools/ui/editors/AutoconfMacroPartitionRule.java:
+ Ditto.
+ * src/com/redhat/eclipse.cdt/autotools/ui/editors/MultiLineDamagerRepairer.java:
+ Ditto.
+ * src/com/redhat/eclipse.cdt/autotools/ui/editors/RecursiveSingleLineRule.java:
+ Ditto.
+
+2006-10-31 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/internal/text/hover/AutoconfTextHover.java
+ (init): Turn off parser validation.
+ * libhoverdocs/acmacros.xml: Update including m4 macros.
+
+2006-10-30 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfDocumentProvider.java:
+ Remove unneeded import.
+ * src/com/redhat/eclipse/cdt/autotools/ui/LibHover.java
+ (getLibHoverDocs): Specify no xml validation since there may be duplicate
+ function ids due to multiple standard definitions used in glibc.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfSourceViewerConfiguration.java
+ (getTextHover): New method to add text hover for autoconf editor.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfPartitioner.java
+ (connect): Remove calls to print debug messages.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfEditor.java
+ (isFoldingEnabled):
+ (InformationDispatchAction.InformationDispatchAction): New for scrollable
+ tooltip support.
+ (createPartControl): Ditto.
+ (fProjectionModelUpdater): Ditto.
+ (InformationProvider.getInformation): Ditto.
+ (InformationDispatchAction): Ditto.
+ (initializeKeyBindingScopes): Ditto.
+ (InformationDispatchAction.makeTextHoverFocusable): Ditto.
+ (InformationProvider.getInformation2): Ditto.
+ (InformationProvider): Ditto.
+ (InformationDispatchAction.computeOffsetAtLocation): Ditto.
+ (fInformationPresenter): Ditto.
+ (.createInformationControl): Ditto.
+ (InformationProvider.getInformationPresenterControlCreator): Ditto.
+ (createActions): Ditto.
+ (InformationDispatchAction..createInformationControl): Ditto.
+ (InformationDispatchAction.run): Ditto.
+ (InformationDispatchAction.fTextOperationAction): Ditto.
+ (InformationDispatchAction.makeAnnotationHoverFocusable): Ditto.
+ (fProjectionSupport): Ditto.
+ (InformationProvider.getSubject): Ditto.
+ (InformationProvider.InformationProvider): Ditto.
+ * src/libhoverdocs/acmacros.xml: New file containing autoconf hover help.
+ * src/libhoverdocs/glibc.xml: Updated.
+ * src/libhoverdocs/LIBHOVERDOCS.LICENSE: New file with licensing info.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/IAutotoolEditorActionDefinitionIds.java:
+ New file.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editoros/IAutotoolHelpContextIds.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/text/hover/AutoconfTextHover.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/text/hover/HoverMessages.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/text/hover/HoverMessages.properties:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/HTML2TextReader.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/HTMLPrinter.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/HTMLTextPresenter.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/LineBreakingReader.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/SingleCharReader.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/SubstitutionTextReader.java:
+ Ditto.
+ * plugin.xml: Fix autoconf editor to look for configure.in or configure.ac. Add
+ hover help for autoconf editor and set up F2 key binding for scrollable tooltips.
+ * plugin.properties: Add autoconf editor strings.
+
+2006-10-16 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfCodeScanner.java: New
+ file.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfWordDetector.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfWhitespaceDetector.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfStringScanner.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfSourceViewerConfiguration.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfSectionRule.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfPartitionScanner.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfPartitioner.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfMacroWordDetector.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfMacroRule.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfKeywordDetector.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfInlineCodeScanner.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfEditor.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfDocumentProvider.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfColorProvider.java:
+ Ditto.
+ * plugin.properties: Add Autoconf editor name.
+ * plugin.xml: Add Autoconf editor.
+
+2006-10-03 Jeff Johnston <jjohnstn@redhat.com>
+
+ Fix for Bugzilla 209161.
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java
+ (initializeBuildConfigDirs): New method.
+ (initialize): Call initializeBuildConfigDirs().
+ (regenerateMakefiles): Ditto if configuration parameters have changed.
+ (createDirectory): Return project path if input directory is empty string or
+ ".".
+
+2006-09-29 Jeff Johnston <jjohnstn@redhat.com>
+
+ * build.properties: Update so plugin.properties built into binary.
+ * build.xml: New file.
+
+2006-09-28 Jeff Johnston <jjohnstn@redhat.com>
+
+ * plugin.xml: Bump up release number to 0.0.5.
+
+2006-09-15 Jeff Johnston <jjohnstn@redhat.com>
+
+ Fix for Bugzilla 206719
+ * plugin.xml: Comment out deprecated ManagedBuildInfo extension and replace with
+ new org.eclipse.cdt.managedbuilder.core.buildDefinitions extension point.
+ * plugin.properties: Add new strings from new build definition.
+ * src/com/redhat/eclipse/cdt/autotools/wizards/CProjectPlatformPage.java
+ (CProjectPlatformPage): Fix project type reference to refer to new project type
+ id in build definition.
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java
+ (initialize): Switch over to new option ids in new build definition.
+ (getConfigArgs): Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsScannerInfo.java
+ (getCompilationString): Don't bother if input resource isn't a file.
+ (buildFile): Fix how build directory is fetched to work with new build
+ definition.
+ (AutotoolsScannerInfo): Save the original resource reference.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsMakefileBuilder.java
+ (AUTOTOOLS_CONFIG_ID): Change to match new build definition.
+
+2006-09-13 Jeff Johnston <jjohnstn@redhat.com>
+
+ Fix for Bugzilla 206359
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsPlugin.java
+ (verifyScannerInfoProvider): New method to check ScannerInfoProvider and set it
+ only if necessary.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsMakefileBuilder.java
+ (hasTargetBuilder): Call verifyScannerInfoProvider instead of
+ setScannerInfoProvider to prevent changing the project file every time the
+ hasTargetBuilder check is made.
+
+2006-09-12 Jeff Johnston <jjohnstn@redhat.com>
+
+ Fix for Bugzilla 206164.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsScannerInfo.java
+ (followIncludeChain): Follow the session property as far as possible. When it
+ ends try looking for the new OPEN_INCLUDE_P persistent property to re-establish
+ the chain.
+ (createIncludeChain): Set a new persistent property OPEN_INCLUDE_P that is the
+ location of the resource.
+
+2006-09-11 Jeff Johnston <jjohnstn@redhat.com>
+
+ * cdtpatches/cdt.ui.patch: Update patch to include defined symbol hover help.
+
+2006-09-11 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsScannerInfo.java
+ (getDefinedSymbols): Prepare code for failure to get compilation string.
+
+2006-09-06 Jeff Johnston <jjohnstn@redhat.com>
+
+ * cdtpatches/README: New file to instruct how to apply patches to the CDT.
+ * cdtpatches/cdt.core.patch: Patch for org.eclipse.cdt.core.
+ * cdtpatches/cdt.ui.patch: Patch for org.eclipse.cdt.ui.
+
+2006-08-28 Jeff Johnston <jjohnstn@redhat.com>
+
+ * plugin.xml: Replace DynamicScannerInfo extension hack with existing CDT
+ ScannerInfoProvider extension. Change version to 0.0.4.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/CConfigureConsole.java
+ (CConfigureConsole): Use new getSubConsoleManager method of CUIPlugin.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/ConfigureConsole.java: No
+ longer needed, so removed.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/ConfigureConsoleDocument.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/ConfigureConsoleManager.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/ConfigureConsolePage.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/ConfigureConsolePartition.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/ConfigureConsolePartitioner.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/ConfigureConsoleStream.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/ConfigureConsoleViewer.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/ConsoleEvent.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/ConsoleOutputTextStore.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/ScrollLockAction.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/wizards/ConvertToAutotoolsProjectWizardPage.java
+ (convertProject): Set scanner info provider for project.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsScannerInfoProvider.java: Extend
+ AbstractCExtension.
+ (getScannerInformation): Call AutotoolsScannerInfo.followIncludeChain method to
+ get real underlying resource to get dynamic build info from.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsScannerInfo.java: Implement new
+ interface IScannerInfoPlus.
+ (followIncludeChain): New method to adhere to new interface.
+ (createIncludeChain): New method.
+ (getDefinedSymbols): Add defined symbols found by ManagedBuildManager.
+ (getIncludePaths): Append include path found by ManagedBuildManager.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsPlugin.java
+ (setScannerInfoProvider): New method.
+ (getConsoleManager): Removed.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsMakefileBuilder.java:
+ (hasTargetBuilder): Replace the default scanner provider for Managed Make
+ projects with AutotoolsScannerInfoProvider.
+
+2006-08-21 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/actions/BuildSpecial.java
+ (run): If there are no targets yet
+ (i.e. no makefile), try and regenerate the makefile.* src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java (getConfigArgs):
+ Make sure there is an "other" string to process rather than adding an empty
+ argument.
+
+2006-08-16 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java
+ (regenerateMakefiles): Add logic to check if the configuration arguments have
+ changed since the last configuration and reconfigure if they have.
+ (saveConfigArgs): New method.
+
+2006-08-03 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsMakefileBuilder.java
+ (addAutotoolsBuilder): Check for ManagedMake's genmakebuilder and remove if
+ found.
+ (hasTargetBuilder): Look for Autotools default configuration and if found, add
+ the Autotools Makefile builder.
+
+2006-07-31 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/LibHover.java
+ (getLibHoverDocs): New method which replaces buildDocPath and fetches libhover
+ base data file from the plugin's jar.
+ * src/com/redhat/eclipse/cdt/autotools/ui/LibHover.java
+ (buildDocPath): Replaced by getLibHoverDocs. Change all callers.
+ * src/com/redhat/eclipse/cdt/autotools/ui/LibHover.java
+ (getDocument): Removed.
+
+2006-07-24 Jeff Johnston <jjohnstn@redhat.com>
+
+ * plugin.xml: Remove unused sample extensions.
+ * src/com/redhat/eclipse/cdt/autotools/editors/*: Remove all files.
+ * src/com/redhat/eclipse/cdt/autotools/preferences/*: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/properties/*: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/views/*: Ditto.
+
+2006-07-24 Jeff Johnston <jjohnstn@redhat.com>
+
+ * plugin.xml: Update release.
+ * META-INF/MANIFEST.MF: Export libhoverdocs.
+
+2006-07-13 Jeff Johnston <jjohnstn@redhat.com>
+
+ * plugin.xml: Update release.
+
+2006-07-11 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsMakefileBuilder.java
+ (getMakeTargets): Use IMakeBuildInfo.BUILD_TARGET_INCREMENTAL instead of
+ IMakeBuildInfo.BUILD_TARGET_FULL which is now obsoleted and not set by the
+ MakeTargets.
+ (clean): Ditto.
+
+2006-07-10 Jeff Johnston <jjohnstn@redhat.com>
+
+ * plugin.xml: Add new "other" option which allows the end-user to specify any
+ configuration option manually.
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java
+ (getConfigArgs): New function to get configure arguments from preferences.
+ (runCommand): Change prototype to take an argument array.
+ (regenerateMakefiles): Only when running full configure, pass args to runCommand
+ and get these from getConfigArgs method.
+
+2006-07-05 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsScannerInfo.java
+ (getCompilationString): Don't use previous compilation string if we have marked
+ the scanner info as dirty.
+ (getIncludePaths): Don't continue processing if the compilation string is null.
+
+2006-06-26 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/popup/actions/GetDefinedSymbolsAction.java:
+ New file.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsScannerInfo.java
+ (getDefinedSymbols): Fill in function details to fetch flags used in dynamic
+ compilation info.
+ (getCompilationString): New function to get and save the actual compilation
+ string from the make invocation.
+ (getIncludePaths): Move logic into getCompilationString.
+ (compilationString): New field to store compilation string.
+ (definedSymbols): New field to store map of defined symbols.
+ * plugin.xml: Add defined symbols menu item.
+
+2006-06-20 jjohnstn <jjohnstn@toy.toronto.redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/popup/actions/GetIncludePathAction.java:
+ Remove unused imports.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/MakeUIImages.java: New class
+ copied from Std Make internal packages to local internal package.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/MessageLine.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/MakeUIPlugin.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/MakeResources.properties: New
+ properties message file used by MakeUIPlugin.
+ * src/com/redhat/eclipse/cdt/autotools/actions/TargetListViewerPart.java: Use
+ Autotools StructureViewPart instead of internal one from Std Make plugin.
+ * src/com/redhat/eclipse/cdt/autotools/actions/MakeTargetDialog.java: Use new
+ Autotools internal classes rather than internal ones from Std Make plugin.
+ * src/com/redhat/eclipse/cdt/autotools/actions/AbstractTargetAction.java
+ (getShell): Use new AutotoolsPlugin getActiveWorkbenchShell method instead of
+ the one in internal MakeUIPlugin.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsMakefileBuilder.java: Remove
+ unused imports.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsPlugin.java
+ (getActiveWorkbenchShell): New method.
+
+2006-06-19 Jeff Johnston <jjohnstn@redhat.com>
+
+ * plugin.xml: Add dependency on org.eclipse.core.variables.
+ * src/com/redhat/eclipse/cdt/autotools/internal/MakeTargetManager: New internal
+ class copied from Std Make projects.
+ * src/com/redhat/eclipse/cdt/autotools/internal/MakeTarget: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ProjectTargets: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/MakeMessages: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsMakeTargetManager: Base on local
+ internal MakeTargetManager class rather than unpublished Std Make internal class.
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator: Remove reference to Std
+ Make MakeMessages internal class.
+ * src/com/redhat/eclipse/cdt/autotools/Resources.properties: Add new message
+ about invoking make for the project.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsPlugin.java
+ (getFormattedString): New method to get resource string with arguments.
+
+2006-06-16 Jeff Johnston <jjohnstn@redhat.com>
+
+ * plugin.xml: Added "org.eclipse.cdt.core.DynamicScannerInfoProvider" extension.
+ * src/com/redhat/eclipse/cdt/autotools/popup/actions/GetIncludePathAction.java
+ (run): Altered to use new AutotoolsScannerInfo class.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsScannerInfoProvider.java: New
+ class used to hook up to added extension point:
+ org.eclipse.cdt.core.DynamicScannerInfoProvider.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsScannerInfo.java: New file based
+ on AutotoolsMakefileMiner.java. Class implements IScannerInfo interface.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsMakefileMiner.java: Transformed
+ into AutotoolsScannerInfo.java.
+
+2006-06-14 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/popup/actions/GetIncludePathAction.java:
+ Fix up imports.
+
+2006-06-08 Jeff Johnston <jjohnstn@redhat.com>
+
+ * plugin.xml: Make provider Red Hat.
+
+2006-06-08 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsMakefileMiner.java: New file.
+ * src/com/redhat/eclipse/cdt/autotools/popup/actions: GetIncludePathAction.java:
+ Ditto.
+ * plugin.xml: Add extensions to create menu for source files that will grab the
+ dynamic include path for the build and display it in a message dialog. This is
+ just a temporary test.
+
+2006-05-19 Andrew Overholt <overholt@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/actions/BuildSpecial.java
+ (run): Create our target selection dialog in-line. Make this dialog have a
+ filter for selection of make target.
+ * src/com/redhat/eclipse/cdt/autotools/actions/BuildTargetDialog.java: Remove:
+ no longer necessary.
+
+2006-05-18 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsMakefileBuilder.java
+ (clean): Overriding method to check for MakeTargets in which case we don't want
+ to clean out directory.
+ * plugin.xml: Remove unneeded extension.
+
+2006-04-28 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/LibHover.java
+ (getHref): Change to reference the glibc book rather than the Gnu help.
+
+2006-04-28 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/LibHover.java: New file based on Chris
+ Moller's hover help, using ICHelpProvider interface.
+ * plugin.xml: Add CHelpProvider extension to supply hover help.
+ * libhoverdocs/glibc.xml: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/AutoconfPlugin.java: Refactored.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsPlugin.java: Refactored from
+ AutoconfPlugin.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/CConfigureConsole.java:
+ Refactor AutoconfPlugin to AutotoolsPlugin.
+ * src/com/redhat/eclipse/cdt/autotools/wizards/CProjectPlatformPage.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/wizards/ConvertToAutotoolsProjectWizard.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/wizards/ConvertToAutotoolsProjectWizardPage.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/preferences/PreferenceInitializer.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/actions/TargetListViewerPart.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/actions/MakeTargetDialog.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/actions/MakeContentProvider.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/actions/BuildTargetDialog.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/actions/BuildSpecial.java: Ditto.
+
+2006-04-18 Jeff Johnston <jjohnstn@redhat.com>
+
+ * plugin.xml: Remove toc extension since we have moved docs to a separate
+ plug-in.
+ * getdocs.sh: Moved to autotools-doc plugin.
+ * doc.zip: Ditto.
+ * toc.xml: Ditto.
+ * testToc.xml: Removed.
+
+2006-04-07 Jeff Johnston <jjohnstn@redhat.com>
+
+ * toc.xml: Add references for Gnu Tools documents.
+ * doc.zip: New file containing zipped up html files for Gnu tools.
+ * getdocs.sh: Shell script to get html files from the web and build doc.zip.
+ * plugin.xml: Connect toc extension to toc.xml so that Gnu tools help is
+ provided with Autotools plugin.
+
+2006-03-21 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/AutoconfPlugin.java
+ (getConsoleManager): New method.
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java
+ (runCommand): Specify the Autotools configure console to use for configuration
+ output.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/CConfigureConsole.java: New
+ file stodified from ManagedBuild Project internal directory.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/ConfigureConsoleDocument.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/ConfigureConsoleManager.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/ConfigureConsolePage.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/ConfigureConsolePartitioner.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/ConfigureConsolePartition.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/ConfigureConsoleStream.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/ConfigureConsoleViewer.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/ConfigureConsole.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/ConsoleEvent.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/ConsoleMessages.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/ConsoleMessages.properties:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/ScrollLockAction.java: Ditto.
+ * plugin.xml: Set up CBuildConsole extension to be CConfigureConsole.
+
+2006-03-15 Andrew Overholt <overholt@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java
+ (addMakeTargetsToManager): New method.
+ (regenerateMakefiles): Call addMakeTargetsToManager after Makefile is generated.
+
+2006-03-13 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/wizards/NewAutotoolsProjectOptionPage.java
+ (getProject): If dealing with a ConvertToAutotoolsProjectWizard, use it's
+ getProject method.
+ * src/com/redhat/eclipse/cdt/autotools/wizards/ConvertToAutotoolsProjectWizard.java
+ (setCurrentProject): New method.
+ (applyOptions): Change prototype to accept project as input. Call
+ setCurrentProject method using the project variable before getting the optionPage
+ to performApply.
+ * src/com/redhat/eclipse/cdt/autotools/wizards/ConvertToAutotoolsProjectWizardPage.java
+ (applyOptions): Add project as input variable and pass this on call.
+ (convertProject): Pass project when calling applyOptions method.
+
+2006-03-09 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsMakefileBuilder.java
+ (getMakeTargets): When doing a full build, we don't want to do a "clean" if the
+ target is not "all".
+
+2006-03-09 Andrew Overholt <overholt@redhat.com>
+
+ * .cvsignore: Initial checkin. Ignore bin.
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java
+ (regenerateMakefiles): Rename CONFIG_STATUS_NAME to CONFIG_STATUS. Call
+ autogen.sh first if configure does not exist.
+ (configureExists): New method.
+ (autogenExists): New method.
+ (runCommand): New method. Run configure or autogen and report success.
+ * plugin.properties: Change "CVS Autotools" to Autotools.
+ * plugin.xml: Likewise.
+ * src/com/redhat/eclipse/cdt/autotools/wizards/NewAutotoolsProjectWizard.java
+ (NewAutotoolsProjectWizard): Likewise.
+
+2006-03-08 Jeff Johnston <jjohnstn@redhat.com>
+
+ * plugin.xml: Set up default gcc scanner in our ManagedMakeProject target
+ extension -
+ org.eclipse.cdt.managedbuilder.internal.scannerconfig.DefaultGCCScannerInfoCollector.
+ * src/com/redhat/eclipse/cdt/autotools/wizards/ConvertToAutotoolsProjectWizardPage.java
+ (convertProject): Remove commented code about setting ScannerConfig as we now
+ set the default GCC scanner collector in our ManagedMakeProject extension.
+
+2006-03-07 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/AutoconfPlugin.java
+ (ftargetManager): New field.
+ (getUniqueIdentifier): New method.
+ (getTargetManager): Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsMakefileBuilder.java: New
+ builder that extends ManagedMakeProject's GeneratedMakefileBuilder and allows us
+ to override behavior.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsMakeTargetManager.java: New
+ class that extends a Std MakeProject's MakeTargetManager and allows us to
+ override behavior.
+ * src/com/redhat/eclipse/cdt/autotools/Resources.properties: New strings added
+ to support BuildSpecial functionality.
+ * src/com/redhat/eclipse/cdt/autotools/AbstractTargetAction.java: New file based
+ on Std MakeProject class.
+ * src/com/redhat/eclipse/cdt/autotools/actions/BuildSpecial.java: Rewritten to
+ extend AbstractTargetAction and to create a dialog rather than print out hello
+ world.
+ * src/com/redhat/eclipse/cdt/autotools/actions/BuildTargetDialog.java: New file
+ that implements the Build Special Targets dialog. Based on a Std Make Project's
+ BuildTargetDialog.
+ * src/com/redhat/eclipse/cdt/autotools/actions/CheckboxTablePart.java: New file
+ to support new dialogs.
+ * src/com/redhat/eclipse/cdt/autotools/actions/MakeContentProvider.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/actions/MakeTargetDialog.java: New file
+ that implements the Make Target dialog allowing management of make targets. Based
+ on Std Make Project's MakeTargetDialog.
+ * src/com/redhat/eclipse/cdt/autotools/actions/SharedPartWithButtons.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/actions/StructuredViewerPart.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/actions/TargetListViewerPart.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/wizards/ConvertToAutotoolsProjectWizardPage.java:
+ Instead of adding a ManagedProject builder, add our new AutotoolsMakefileBuilder.
+ * plugin.xml: Add our new AutotoolsMakefileBuilder as an official builder.
+
+2006-02-24 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java: Remove some warnings.
+ * plugin.xml: Fix duplicate target configuration options and re-add in --build
+ option.
+
+2006-02-23 Jeff Johnston <jjohnstn@redhat.com>
+
+ * Initial import.
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/META-INF/MANIFEST.MF b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..a7069db062
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/META-INF/MANIFEST.MF
@@ -0,0 +1,32 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name.0
+Bundle-SymbolicName: org.eclipse.linuxtools.cdt.autotools.core;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.eclipse.linuxtools.cdt.autotools.core.AutotoolsPlugin
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.ui;bundle-version="3.4.0",
+ org.eclipse.core.runtime;bundle-version="3.4.0",
+ org.eclipse.jface.text;bundle-version="3.4.0",
+ org.eclipse.ui.editors;bundle-version="3.4.0",
+ org.eclipse.ui.workbench.texteditor;bundle-version="3.4.0",
+ org.eclipse.core.resources;bundle-version="3.4.0",
+ org.eclipse.ui.ide;bundle-version="3.4.0",
+ org.eclipse.cdt.managedbuilder.core;bundle-version="5.0.100",
+ org.eclipse.cdt.core;bundle-version="5.1.0",
+ org.eclipse.cdt.ui;bundle-version="5.1.0",
+ org.eclipse.cdt.managedbuilder.ui;bundle-version="5.0.100",
+ org.eclipse.cdt.managedbuilder.gnu.ui;bundle-version="5.0.100",
+ org.eclipse.cdt.make.core;bundle-version="5.1.0",
+ org.eclipse.cdt.make.ui;bundle-version="5.0.100",
+ org.eclipse.ui.console;bundle-version="3.3.0",
+ org.eclipse.help;bundle-version="3.3.100",
+ org.eclipse.core.variables;bundle-version="3.2.100",
+ org.eclipse.ui.views;bundle-version="3.3.0",
+ org.eclipse.core.filesystem;bundle-version="1.2.0"
+Bundle-ActivationPolicy: lazy
+Bundle-Vendor: %provider
+Export-Package: org.eclipse.linuxtools.cdt.autotools.core;x-friends:="org.eclipse.linuxtools.cdt.autotools.tests,org.eclipse.linuxtools.cdt.autotools.ui",
+ org.eclipse.linuxtools.internal.cdt.autotools.core;x-friends:="org.eclipse.linuxtools.cdt.autotools.ui,org.eclipse.linuxtools.cdt.autotools.tests",
+ org.eclipse.linuxtools.internal.cdt.autotools.core.configure;x-friends:="org.eclipse.linuxtools.cdt.autotools.tests,org.eclipse.linuxtools.cdt.autotools.ui"
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/about.html b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/about.html
new file mode 100644
index 0000000000..44e229003e
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/about.html
@@ -0,0 +1,33 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html>
+<head>
+<title>About</title>
+<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>8th September, 2004</p>
+<h3>License</h3>
+<p>The Eclipse Software Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<h3>Contributions</h3>
+
+<p>If this Content is licensed to you under the terms and conditions of the EPL, any Contributions, as defined in the EPL, uploaded, submitted, or otherwise
+made available to the Eclipse Foundation, its members and/or the host of the Eclipse Foundation web site, by you that relate to such
+Content are provided under the terms and conditions of the <a href="http://www.eclipse.org/legal/termsofuse.html">Terms of Use</a>
+for the Eclipse Foundation web site and can be made available to others under the terms of the licenses as set out in the
+<a href="http://www.eclipse.org/legal/termsofuse.html">Terms of Use</a>.</p>
+
+<p>If this Content is licensed to you under license terms and conditions other than the EPL (&quot;Other License&quot;), any modifications, enhancements and/or
+other code and/or documentation (&quot;Modifications&quot;) uploaded, submitted, or otherwise made available to the Eclipse Foundation, its members and/or the
+host of the Eclipse Foundation web site, 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 <a href="http://www.eclipse.org/legal/termsofuse.html">Terms of Use</a>
+for the Eclipse Foundation web site and such Modifications can be made available to others under the terms of the licenses as set out in the
+<a href="http://www.eclipse.org/legal/termsofuse.html">Terms of Use</a>.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/build.properties b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/build.properties
new file mode 100644
index 0000000000..7cbd1d3651
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/build.properties
@@ -0,0 +1,7 @@
+source.. = src/
+output.. = bin/
+bin.includes = plugin.xml,\
+ META-INF/,\
+ .,\
+ html/,\
+ plugin.properties \ No newline at end of file
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/html/maintopic.html b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/html/maintopic.html
new file mode 100644
index 0000000000..a476078ace
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/html/maintopic.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <title>Main Topic</title>
+</head>
+
+<body>
+<h1>Main Topic</h1>
+Please enter your text here.
+</body>
+</html> \ No newline at end of file
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/html/subtopic.html b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/html/subtopic.html
new file mode 100644
index 0000000000..8a61c501d6
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/html/subtopic.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <title>Sub Topic</title>
+</head>
+
+<body>
+<h1>Sub Topic</h1>
+Please enter your text here.
+</body>
+</html> \ No newline at end of file
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/html/toc.html b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/html/toc.html
new file mode 100644
index 0000000000..326f0a9ff3
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/html/toc.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <title>Table of Contents</title>
+</head>
+
+<body>
+<h1>Table of Contents</h1>
+Please enter your text here.
+</body>
+</html> \ No newline at end of file
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/plugin.properties b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/plugin.properties
new file mode 100644
index 0000000000..5eeed011d8
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/plugin.properties
@@ -0,0 +1,177 @@
+#################################################################################
+# Copyright (c) 2006, 2008, 2009 Red Hat, Inc.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Red Hat Incorporated - initial API and implementation
+#################################################################################
+ConvertWizard.description=Convert to C/C++ Autotools Project
+NewCProject.description=GNU C Autotools Project
+NewCProjectV2.description=GNU C Autootols Project V2
+NewCCProject.description=GNU C++ Autotools Project
+NewCWizard.name=GNU C Autotools Project
+NewCWizardV2.name=GNU C Autotools Project V2
+NewCCWizard.name=GNU C++ Autotools Project
+
+Autotools.wizard.name=GNU Autotools Build Wizard
+
+Autoconf.editor.name=Autoconf Editor
+
+BuildProperty.value.name.default=Default;
+BuildProperty.type.name.autotools=GNU Autotools
+
+PreferenceAutotools.name=Autotools
+PreferenceAutomakeEditor.name=Automake Editor
+PreferenceAutoconfEditor.name=Autoconf Editor
+
+PropertyAutotools.name=Autotools
+PropertyAutotools.general.name=General
+PropertyAutotools.configure.name=Configure Settings
+PropertyTabEditor.name=Editors
+AutotoolsBuildPropertyTab.name=Behaviour
+AutotoolsEditorsPropertyTab.name=Editors
+AutotoolsToolsPropertyTab.name=Tools Settings
+AutotoolsConfigurePropertyTab.name=Configure Settings
+
+PropertyTabEditor.tooltip=Set options for Autotools-specific editors
+PropertyTabBuild.tooltip=Set additional Autotools build options
+
+Makefile.builder.name=Autotools Makefile Generator
+Autotools.projecttype.name=GNU Autotools
+AutotoolsNature.name=Autotools Project Nature
+AutotoolsNewNature.name=Autotools Project Nature V2
+Configuration.build.name=Build (GNU)
+Autotools.targetplatform.name=GNU Autotools Target Platform
+Autotools.gnu.toolchain.name=GNU Autotools Toolchain
+Configure.outputType=Configure Output (config.status)
+Autogen.outputType=Autogen Output (configure)
+
+CommandCategorySource.name=Source
+CommandCategorySource.description=Source commands
+CommandCategoryTools.name=Tools
+CommandCategoryTools.description=Autotool tools
+ShowTooltip.name=Show Tooltip Description
+ShowTooltip.description=Shows the tooltip description for the element at the cursor
+
+# Scope and Key Commands
+ACeditor.scope.name=Autoconf Editor
+ACeditor.scope.description=Editor for Autoconf Configuration Source Files
+
+Tool.configure=configure
+
+OptionCategory.configure.general=General
+Option.configure.name=Name
+Option.configure.builddir=Build directory
+Option.configure.builddir.tip=Subdirectory off of project where build will occur
+Option.configure.configdir=Configure tool directory
+Option.configure.configdir.tip=Subdirectory off of project containing configure scripts
+Option.configure.cache_file=Name of configuration cache file (--cache-file)
+Option.configure.cache_file.tip=Specify the name of the configuration cache file [config.cache]
+Option.configure.no_create=Turn off file creation <not advised> (--no-create)
+Option.configure.no_create.tip=This tells configuration not to generate the output files as part of configuration
+Option.configure.quiet=Turn off checking messages (--quiet)
+Option.configure.quiet.tip=This turns off "checking ..." style messages from the configuration console output
+Option.configure.help=Display help contents of top-level configuration (--help)
+Option.configure.help.tip=Ask configuration file to display its help documentation
+Option.configure.version=Display version of autotools used to create configuration (--version)
+Option.configure.version.tip=This outputs the version of the Autotools used to create the configuration files
+
+OptionCategory.configure.platform=Platform Specifiers
+Option.configure.host=Host platform (--host)
+Option.configure.host.tip=Platform that project will run on
+Option.configure.target=Target platform (--target)
+Option.configure.target.tip=Platform that project will target output for
+Option.configure.build=Build platform (--build)
+Option.configure.build.tip=Platform where project is being built
+
+OptionCategory.configure.directories=Directory specifiers
+Option.configure.prefix=Arch-independent install directory (--prefix)
+Option.configure.prefix.tip=Place where architecture-independent files are installed [/usr/local]
+Option.configure.exec_prefix=Arch-dependent install directory (--exec-prefix)
+Option.configure.exec_prefix.tip=Place where architecture-dependent files are installed [PREFIX]
+Option.configure.libdir=Object code library directory (--libdir)
+Option.configure.libdir.tip=Place where object code libraries are installed [EPREFIX/lib]
+Option.configure.bindir=User executable directory (--bindir)
+Option.configure.bindir.tip=Place where binary executables are installed [EPREFIX/bin]
+Option.configure.sbindir=System admin executable directory (--sbindir)
+Option.configure.sbindir.tip=Place where system admin executables are installed [EPREFIX/sbin]
+Option.configure.includedir=C Header file directory (--includdir)
+Option.configure.includedir.tip=Place where header files will be installed [PREFIX/include]
+Option.configure.datadir=Read-only architecture-independent data (--datadir)
+Option.configure.datadir.tip=Place where read-only architecture-independent data is installed [PREFIX/share]
+Option.configure.sysconfdir=Read-only single-machine data directory (--syconfdir)
+Option.configure.sysconfdir.tip=Place where read-only single-machine data is stored [PREFIX/etc]
+Option.configure.infodir=Info file documentation directory (--infodir)
+Option.configure.infodir.tip=Place where info files are installed [PREFIX/info]
+Option.configure.mandir=Man file documentation directory (--mandir)
+Option.configure.mandir.tip=Place where man file documentation is installed [PREFIX/man]
+Option.configure.srcdir=Sources directory (--srcdir)
+Option.configure.srcdir.tip=Place where configure can find sources [configure directory or ..]
+Option.configure.localstatedir=Modifiable single-machine data directory (--localstatedir)
+Option.configure.localstatedir.tip=Place where modifiable single-machine data is installed [PREFIX/var]
+Option.configure.sharedstatedir=Modifiable architecture-independent data directory (--sharedstatedir)
+Option.configure.sharedstatedir.tip=Place where modifiable architecture-independent data is installed [PREFIX/com}
+Option.configure.libexecdir=Program executable directory (--libexecdir)
+Option.configure.libexecdir=Place where program executables will be installed [EPREFIX/libexec]
+Option.configure.oldincludedir=Non-gcc C header file directory (--oldincludedir)
+Option.configure.oldincludedir.tip=Place where non-gcc C header files are installed [/usr/include]
+
+OptionCategory.configure.filenames=File-name transformations
+Option.configure.program_prefix=Installed program prefix (--program-prefix)
+Option.configure.program_prefix.tip=Prepend PREFIX to the beginning of installed program names
+Option.configure.program_suffix=Installed program suffix (--program-suffix)
+Option.configure.program_suffix.tip=Append SUFFIX to the end of installed program names
+Option.configure.program_transform_name=Installed program name transform (--program-transform-name)
+Option.configure.program_transform_name.tip=A sed string used to transform installed program names
+
+OptionCategory.configure.features=Features and packages
+Option.configure.enable_maintainer_mode=Enable maintainer mode (--enable-maintainer-mode)
+Option.configure.enable_maintainer_mode.tip=Specify this to have Makefiles generated with checks for Autotool configuration file changes
+Option.configure.user=User-specified configuration options
+Option.configure.user.tip=Specify one or more configuration options (e.g. --enable-FEATURE, --disable-FEATURE, or --with-PACKAGE)
+
+Tool.autogen = autogen.sh
+
+OptionCategory.autogen.general=Options
+Option.autogen.user=Command line options
+Option.autogen.user.tip=Specify options to pass to the top-level autogen.sh script
+
+RedHatVendor.name = Red Hat
+Bundle-Name.0 = Autotools Plug-in (Incubation)
+provider=Eclipse
+ConvertWizard.name = Convert to a C/C++ Autotools Project
+InvokeAutotools.label = Invoke Autotools
+InvokeAutotools.mnemonic = I
+InvokeAutoconf.label = Invoke Autoconf
+InvokeAutoconf.mnemonic = c
+InvokeAutoconf.description = Run autoconf in the selected directory
+InvokeAutoheader.label = Invoke Autoheader
+InvokeAutoheader.mnemonic = h
+InvokeAutoheader.description = Run autoheader from the selected directory
+InvokeAutomake.label = Invoke Automake
+InvokeAutomake.mnemonic = m
+InvokeAutomake.description = Run automake from the selected directory
+InvokeAutoreconf.label = Invoke Autoreconf
+InvokeAutoreconf.mnemonic = r
+InvokeAutoreconf.description = Run autoreconf from the selected directory
+InvokeAclocal.label = Invoke Aclocal
+InvokeAclocal.mnemonic = l
+InvokeAclocal.description = Run aclocal from the selected directory
+InvokeLibtoolize.label = Invoke Libtoolize
+InvokeLibtoolize.mnemonic = t
+InvokeLibtoolize.description = Run libtoolize in the selected directory
+Reconfigure.label = Reconfigure Project
+Reconfigure.mnemonic = f
+Reconfigure.description = Run configuration scripts for project
+DynamicBuild.label = Dynamic Build Info
+GetIncludePath.label = Get Include Path
+GetDefinedSymbols.label = Get Defined Symbols
+IncludesOption.name = includes
+SymbolsOption.name = symbols
+AutomakeEditor.name = AutomakeEditor
+Automake.name = automake
+ConfigureScript.name=Configure Script
+AutogenScript.name=Autogen Script \ No newline at end of file
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/plugin.xml b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/plugin.xml
new file mode 100644
index 0000000000..af9fbf5fc1
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/plugin.xml
@@ -0,0 +1,517 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+
+ <extension
+ id="autotoolsProperties"
+ name="Autotools Build Properties"
+ point="org.eclipse.cdt.managedbuilder.core.buildProperties">
+ <propertyValue
+ property="org.eclipse.cdt.build.core.buildType"
+ id="org.eclipse.linuxtools.cdt.autotools.core.buildType.default"
+ name="%BuildProperty.value.name.default"/>
+ <propertyValue
+ property="org.eclipse.cdt.build.core.buildArtefactType"
+ id="org.eclipse.linuxtools.cdt.autotools.core.buildArtefactType.autotools"
+ name="%BuildProperty.type.name.autotools"/>
+ </extension>
+ <extension
+ id="cdt.autotools.core.managed.build.info"
+ name="Autotools Managed Build Info"
+ point="org.eclipse.cdt.managedbuilder.core.buildDefinitions">
+ <managedBuildRevision fileVersion="4.0.0"/>
+ <tool
+ command="configure"
+ id="org.eclipse.linuxtools.cdt.autotools.core.tool.configure"
+ isAbstract="false"
+ name="%Tool.configure"
+ natureFilter="both"
+ supportsManagedBuild="false">
+ <optionCategory
+ id="org.eclipse.linuxtools.cdt.autotools.core.optionCategory.configure.general"
+ name="%OptionCategory.configure.general"
+ owner="org.eclipse.linuxtools.cdt.autotools.core.tool.configure"/>
+ <option
+ applicabilityCalculator="org.eclipse.linuxtools.internal.cdt.autotools.core.configure.AutotoolsOptionValueHandler"
+ category="org.eclipse.linuxtools.cdt.autotools.core.optionCategory.configure.general"
+ id="org.eclipse.linuxtools.cdt.autotools.core.option.configure.name"
+ isAbstract="false"
+ name="%Option.configure.name"
+ resourceFilter="all"
+ valueHandler="org.eclipse.linuxtools.internal.cdt.autotools.core.configure.AutotoolsOptionValueHandler"
+ valueType="string">
+ </option>
+ <option
+ applicabilityCalculator="org.eclipse.linuxtools.internal.cdt.autotools.core.configure.AutotoolsOptionValueHandler"
+ category="org.eclipse.linuxtools.cdt.autotools.core.optionCategory.configure.general"
+ defaultValue="build"
+ id="org.eclipse.linuxtools.cdt.autotools.core.option.configure.builddir"
+ isAbstract="false"
+ name="%Option.configure.builddir"
+ resourceFilter="all"
+ tip="%Option.configure.builddir.tip"
+ valueHandler="org.eclipse.linuxtools.internal.cdt.autotools.core.configure.AutotoolsOptionValueHandler"
+ valueType="string"/>
+ <option
+ applicabilityCalculator="org.eclipse.linuxtools.internal.cdt.autotools.core.configure.AutotoolsOptionValueHandler"
+ category="org.eclipse.linuxtools.cdt.autotools.core.optionCategory.configure.general"
+ id="org.eclipse.linuxtools.cdt.autotools.core.option.configure.configdir"
+ isAbstract="false"
+ name="%Option.configure.configdir"
+ resourceFilter="all"
+ tip="%Option.configure.configdir.tip"
+ valueType="string"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.core.optionCategory.configure.general"
+ command="--cache-file="
+ id="org.eclipse.linuxtools.cdt.autotools.core.option.configure.cache_file"
+ isAbstract="false"
+ name="%Option.configure.cache_file"
+ resourceFilter="all"
+ tip="%Option.configure.cache_file.tip"
+ valueType="string"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.core.optionCategory.configure.general"
+ command="--help"
+ defaultValue="false"
+ id="org.eclipse.linuxtools.cdt.autotools.core.option.configure.help"
+ isAbstract="false"
+ name="%Option.configure.help"
+ resourceFilter="all"
+ tip="%Option.configure.help.tip"
+ valueType="boolean"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.core.optionCategory.configure.general"
+ command="--no-create"
+ defaultValue="false"
+ id="org.eclipse.linuxtools.cdt.autotools.core.option.configure.no_create"
+ isAbstract="false"
+ name="%Option.configure.no_create"
+ resourceFilter="all"
+ tip="%Option.configure.no_create.tip"
+ valueType="boolean"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.core.optionCategory.configure.general"
+ command="--quiet"
+ defaultValue="false"
+ id="org.eclipse.linuxtools.cdt.autotools.core.option.configure.quiet"
+ isAbstract="false"
+ name="%Option.configure.quiet"
+ resourceFilter="all"
+ tip="%Option.configure.quiet.tip"
+ valueType="boolean"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.core.optionCategory.configure.general"
+ command="--version"
+ defaultValue="false"
+ id="org.eclipse.linuxtools.cdt.autotools.core.option.configure.version"
+ isAbstract="false"
+ name="%Option.configure.version"
+ resourceFilter="all"
+ tip="%Option.configure.version.tip"
+ valueType="boolean"/>
+ <optionCategory
+ id="org.eclipse.linuxtools.cdt.autotools.core.configure.optionCategory.configure.platform"
+ name="%OptionCategory.configure.platform"
+ owner="org.eclipse.linuxtools.cdt.autotools.core.tool.configure"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.core.configure.optionCategory.configure.platform"
+ command="--host="
+ id="org.eclipse.linuxtools.cdt.autotools.core.option.configure.host"
+ isAbstract="false"
+ name="%Option.configure.host"
+ resourceFilter="all"
+ tip="%Option.configure.host.tip"
+ valueType="string"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.core.configure.optionCategory.configure.platform"
+ command="--target="
+ id="org.eclipse.linuxtools.cdt.autotools.core.option.configure.target"
+ isAbstract="false"
+ name="%Option.configure.target"
+ resourceFilter="all"
+ tip="%Option.configure.target.tip"
+ valueType="string"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.core.configure.optionCategory.configure.platform"
+ command="--build="
+ id="org.eclipse.linuxtools.cdt.autotools.core.option.configure.build"
+ isAbstract="false"
+ name="%Option.configure.build"
+ resourceFilter="all"
+ tip="%Option.configure.build.tip"
+ valueType="string"/>
+ <optionCategory
+ id="org.eclipse.linuxtools.cdt.autotools.core.optionCategory.configure.directories"
+ name="%OptionCategory.configure.directories"
+ owner="org.eclipse.linuxtools.cdt.autotools.core.tool.configure"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.core.optionCategory.configure.directories"
+ command="--prefix="
+ id="org.eclipse.linuxtools.cdt.autotools.core.option.configure.prefix"
+ isAbstract="false"
+ name="%Option.configure.prefix"
+ resourceFilter="all"
+ tip="%Option.configure.prefix.tip"
+ valueType="string"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.core.optionCategory.configure.directories"
+ command="--exec-prefix="
+ id="org.eclipse.linuxtools.cdt.autotools.core.option.configure.exec_prefix"
+ isAbstract="false"
+ name="%Option.configure.exec_prefix"
+ resourceFilter="all"
+ tip="%Option.configure.exec_prefix.tip"
+ valueType="string"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.core.optionCategory.configure.directories"
+ command="--libdir="
+ id="org.eclipse.linuxtools.cdt.autotools.core.option.configure.libdir"
+ isAbstract="false"
+ name="%Option.configure.libdir"
+ resourceFilter="all"
+ tip="%Option.configure.libdir.tip"
+ valueType="string"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.core.optionCategory.configure.directories"
+ command="--bindir="
+ id="org.eclipse.linuxtools.cdt.autotools.core.option.configure.bindir"
+ isAbstract="false"
+ name="%Option.configure.bindir"
+ resourceFilter="all"
+ tip="%Option.configure.bindir.tip"
+ valueType="string"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.core.optionCategory.configure.directories"
+ command="--sbindir="
+ id="org.eclipse.linuxtools.cdt.autotools.core.option.configure.sbindir"
+ isAbstract="false"
+ name="%Option.configure.sbindir"
+ resourceFilter="all"
+ tip="%Option.configure.sbindir.tip"
+ valueType="string"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.core.optionCategory.configure.directories"
+ command="--includedir="
+ id="org.eclipse.linuxtools.cdt.autotools.core.option.configure.includedir"
+ isAbstract="false"
+ name="%Option.configure.includedir"
+ resourceFilter="all"
+ tip="%Option.configure.includedir.tip"
+ valueType="string"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.core.optionCategory.configure.directories"
+ command="--datadir="
+ id="org.eclipse.linuxtools.cdt.autotools.core.option.configure.datadir"
+ isAbstract="false"
+ name="%Option.configure.datadir"
+ resourceFilter="all"
+ tip="%Option.configure.datadir.tip"
+ valueType="string"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.core.optionCategory.configure.directories"
+ command="--sysconfdir="
+ id="org.eclipse.linuxtools.cdt.autotools.core.option.configure.sysconfdir"
+ isAbstract="false"
+ name="%Option.configure.sysconfdir"
+ resourceFilter="all"
+ tip="%Option.configure.sysconfdir.tip"
+ valueType="string"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.core.optionCategory.configure.directories"
+ command="--infodir="
+ id="org.eclipse.linuxtools.cdt.autotools.core.option.configure.infodir"
+ isAbstract="false"
+ name="%Option.configure.infodir"
+ resourceFilter="all"
+ tip="%Option.configure.infodir.tip"
+ valueType="string"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.core.optionCategory.configure.directories"
+ command="--mandir="
+ id="org.eclipse.linuxtools.cdt.autotools.core.option.configure.mandir"
+ isAbstract="false"
+ name="%Option.configure.mandir"
+ resourceFilter="all"
+ tip="%Option.configure.mandir.tip"
+ valueType="string"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.core.optionCategory.configure.directories"
+ command="--srcdir="
+ id="org.eclipse.linuxtools.cdt.autotools.core.option.configure.srcdir"
+ isAbstract="false"
+ name="%Option.configure.srcdir"
+ resourceFilter="all"
+ tip="%Option.configure.srcdir.tip"
+ valueType="string"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.core.optionCategory.configure.directories"
+ command="--localstatedir="
+ id="org.eclipse.linuxtools.cdt.autotools.core.option.configure.localstatedir"
+ isAbstract="false"
+ name="%Option.configure.localstatedir"
+ resourceFilter="all"
+ tip="%Option.configure.localstatedir"
+ valueType="string"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.core.optionCategory.configure.directories"
+ command="--sharedstatedir="
+ id="org.eclipse.linuxtools.cdt.autotools.core.option.configure.sharedstatedir"
+ isAbstract="false"
+ name="%Option.configure.sharedstatedir"
+ resourceFilter="all"
+ tip="%Option.configure.sharedstatedir"
+ valueType="string"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.core.optionCategory.configure.directories"
+ command="--libexecdir="
+ id="org.eclipse.linuxtools.cdt.autotools.core.option.configure.libexecdir"
+ isAbstract="false"
+ name="%Option.configure.libexecdir"
+ resourceFilter="all"
+ tip="%Option.configure.libexecdir"
+ valueType="string"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.core.optionCategory.configure.directories"
+ command="--oldincludedir="
+ id="org.eclipse.linuxtools.cdt.autotools.core.option.configure.oldincludedir"
+ isAbstract="false"
+ name="%Option.configure.oldincludedir"
+ resourceFilter="all"
+ tip="%Option.configure.oldincludedir.tip"
+ valueType="string"/>
+ <optionCategory
+ id="org.eclipse.linuxtools.cdt.autotools.core.optionCategory.configure.filenames"
+ name="%OptionCategory.configure.filenames"
+ owner="org.eclipse.linuxtools.cdt.autotools.core.tool.configure"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.core.optionCategory.configure.filenames"
+ command="--program-prefix="
+ id="org.eclipse.linuxtools.cdt.autotools.core.option.configure.program_prefix"
+ isAbstract="false"
+ name="%Option.configure.program_prefix"
+ resourceFilter="all"
+ tip="%Option.configure.program_prefix.tip"
+ valueType="string"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.core.optionCategory.configure.filenames"
+ command="--program-suffix="
+ id="org.eclipse.linuxtools.cdt.autotools.core.option.program_suffix"
+ isAbstract="false"
+ name="%Option.configure.program_suffix"
+ resourceFilter="all"
+ tip="%Option.configure.program_suffix.tip"
+ valueType="string"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.core.optionCategory.configure.filenames"
+ command="--program-transform-name="
+ id="org.eclipse.linuxtools.cdt.autotools.core.option.configure.program_transform_name"
+ isAbstract="false"
+ name="%Option.configure.program_transform_name"
+ resourceFilter="all"
+ tip="%Option.configure.program_transform_name.tip"
+ valueType="string"/>
+ <optionCategory
+ id="org.eclipse.linuxtools.cdt.autotools.core.optionCategory.configure.features"
+ name="%OptionCategory.configure.features"
+ owner="org.eclipse.linuxtools.cdt.autotools.core.tool.configure"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.core.optionCategory.configure.features"
+ command="--enable-maintainer-mode"
+ defaultValue="false"
+ id="org.eclipse.linuxtools.cdt.autotools.core.option.configure.enable_maintainer_mode"
+ isAbstract="false"
+ name="%Option.configure.enable_maintainer_mode"
+ resourceFilter="all"
+ tip="%Option.configure.enable_maintainer_mode.tip"
+ valueType="boolean"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.core.optionCategory.configure.features"
+ id="org.eclipse.linuxtools.cdt.autotools.core.option.configure.user"
+ isAbstract="false"
+ name="%Option.configure.user"
+ resourceFilter="all"
+ tip="%Option.configure.user.tip"
+ valueType="string"/>
+ <outputType
+ id="org.eclipse.linuxtools.cdt.autotools.core.outputType.configure"
+ name="%Configure.outputType"
+ outputs="status"
+ primaryOutput="true"/>
+ <inputType
+ id="org.eclipse.linuxtools.cdt.autotools.core.inputType.configure"
+ multipleOfType="false"
+ sourceContentType="org.eclipse.linuxtools.cdt.autotools.core.configureScript">
+ </inputType>
+ </tool>
+ <tool
+ command="autogen.sh"
+ id="org.eclipse.linuxtools.cdt.autotools.core.tool.autogen"
+ isAbstract="false"
+ name="%Tool.autogen"
+ natureFilter="both"
+ supportsManagedBuild="false">
+ <optionCategory
+ id="org.eclipse.linuxtools.cdt.autotools.core.optionCategory.autogen.general"
+ name="%OptionCategory.autogen.general"
+ owner="org.eclipse.linuxtools.cdt.autotools.core.tool.autogen">
+ </optionCategory>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.core.optionCategory.autogen.general"
+ id="org.eclipse.linuxtools.cdt.autotools.core.option.autogen.user"
+ isAbstract="false"
+ name="%Option.autogen.user"
+ resourceFilter="all"
+ tip="%Option.autogen.user.tip"
+ valueType="string">
+ </option>
+ <outputType
+ id="org.eclipse.linuxtools.cdt.autotools.core.outputType.autogen"
+ name="%Autogen.outputType"
+ outputNames="configure"
+ primaryOutput="true">
+ </outputType>
+ <inputType
+ id="org.eclipse.linuxtools.cdt.autotools.core.inputType.autogen"
+ multipleOfType="false"
+ sourceContentType="org.eclipse.linuxtools.cdt.autotools.core.autogenScript">
+ </inputType>
+ </tool>
+ <targetPlatform
+ archList="all"
+ binaryParser="org.eclipse.cdt.core.ELF;org.eclipse.cdt.core.GNU_ELF"
+ id="org.eclipse.linuxtools.cdt.autotools.core.targetPlatform"
+ isAbstract="false"
+ name="%Autotools.targetplatform.name"/>
+ <projectType
+ buildArtefactType="org.eclipse.linuxtools.cdt.autotools.core.buildArtefactType.autotools"
+ id="org.eclipse.linuxtools.cdt.autotools.core.projectType"
+ isAbstract="false">
+ <configuration
+ buildProperties="org.eclipse.linuxtools.cdt.autotools.core.buildType.default"
+ cleanCommand="rm -rf"
+ errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.GASErrorParser"
+ id="org.eclipse.linuxtools.cdt.autotools.core.configuration.build"
+ name="%Configuration.build.name">
+ <toolChain
+ archList="all"
+ id="org.eclipse.linuxtools.cdt.autotools.core.toolChain"
+ name="%Autotools.gnu.toolchain.name"
+ scannerConfigDiscoveryProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"
+ supportsManagedBuild="false"
+ targetTool="org.eclipse.linuxtools.cdt.autotools.core.tool.configure">
+ <tool
+ id="org.eclipse.linuxtools.cdt.autotools.core.gnu.toolchain.tool.configure"
+ isAbstract="false"
+ natureFilter="both"
+ superClass="org.eclipse.linuxtools.cdt.autotools.core.tool.configure"/>
+ <tool
+ id="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.autogen"
+ isAbstract="false"
+ natureFilter="both"
+ superClass="org.eclipse.linuxtools.cdt.autotools.core.tool.autogen">
+ </tool>
+ <tool
+ id="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.gcc"
+ isAbstract="false"
+ superClass="cdt.managedbuild.tool.gnu.c.compiler">
+ </tool>
+ <tool
+ id="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.gpp"
+ isAbstract="false"
+ superClass="cdt.managedbuild.tool.gnu.cpp.compiler">
+ </tool>
+ <targetPlatform
+ id="org.eclipse.linuxtools.cdt.autotools.core.toolchain.targetPlatform"
+ isAbstract="false"
+ name="%Autotools.targetplatform.name"
+ superClass="org.eclipse.linuxtools.cdt.autotools.core.targetPlatform">
+ </targetPlatform>
+ <builder
+ id="org.eclipse.linuxtools.cdt.autotools.core.toolchain.builder"
+ isAbstract="false"
+ isVariableCaseSensitive="false">
+ </builder>
+ <supportedProperties>
+ <property
+ id="org.eclipse.cdt.build.core.buildArtefactType">
+ <value
+ id="org.eclipse.linuxtools.cdt.autotools.core.buildArtefactType.autotools">
+ </value>
+ </property>
+ </supportedProperties>
+ </toolChain>
+ </configuration>
+ </projectType>
+ </extension>
+ <extension
+ id="autotoolsNatureV2"
+ name="%AutotoolsNewNature.name"
+ point="org.eclipse.core.resources.natures">
+ <requires-nature
+ id="org.eclipse.cdt.managedbuilder.core.managedBuildNature">
+ </requires-nature>
+ <runtime>
+ <run
+ class="org.eclipse.linuxtools.cdt.autotools.core.AutotoolsNewProjectNature">
+ </run>
+ </runtime>
+ <builder
+ id="org.eclipse.linuxtools.cdt.autotools.core.genmakebuilderV2">
+ </builder>
+ </extension>
+ <extension
+ id="genmakebuilderV2"
+ name="%Makefile.builder.name"
+ point="org.eclipse.core.resources.builders">
+ <builder
+ hasNature="true">
+ <run
+ class="org.eclipse.linuxtools.internal.cdt.autotools.core.AutotoolsConfigurationBuilder">
+ </run>
+ </builder>
+ </extension>
+ <extension
+ point="org.eclipse.cdt.core.templateProcessTypes">
+ <processType
+ name="NewAutotoolsProject"
+ processRunner="org.eclipse.linuxtools.internal.cdt.autotools.core.wizards.NewAutotoolsProject">
+ <simple
+ name="name">
+ </simple>
+ <simple
+ external="true"
+ name="location"
+ nullable="true">
+ </simple>
+ <simple
+ name="artifactExtension">
+ </simple>
+ <simple
+ external="true"
+ name="isCProject">
+ </simple>
+ </processType>
+ </extension>
+ <extension
+ point="org.eclipse.core.contenttype.contentTypes">
+ <content-type
+ id="org.eclipse.linuxtools.cdt.autotools.core.configureScript"
+ name="%ConfigureScript.name"
+ priority="high">
+ </content-type>
+ <content-type
+ id="org.eclipse.linuxtools.cdt.autotools.core.autogenScript"
+ name="%AutogenScript.name"
+ priority="high">
+ </content-type>
+ <file-association
+ content-type="org.eclipse.linuxtools.cdt.autotools.core.configureScript"
+ file-names="configure">
+ </file-association>
+ <file-association
+ content-type="org.eclipse.linuxtools.cdt.autotools.core.autogenScript"
+ file-names="autogen.sh">
+ </file-association>
+ </extension>
+</plugin>
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/cdt/autotools/core/AutotoolsNewProjectNature.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/cdt/autotools/core/AutotoolsNewProjectNature.java
new file mode 100644
index 0000000000..995fba179f
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/cdt/autotools/core/AutotoolsNewProjectNature.java
@@ -0,0 +1,219 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2009 Red Hat Inc.. and others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial implementation
+ * IBM Rational Software - add and remove nature static methods
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.core;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
+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.resources.IWorkspace;
+import org.eclipse.core.resources.IWorkspaceRunnable;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.ISchedulingRule;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.linuxtools.internal.cdt.autotools.core.AutotoolsConfigurationBuilder;
+
+public class AutotoolsNewProjectNature implements IProjectNature {
+
+ public static final String AUTOTOOLS_NATURE_ID = AutotoolsPlugin.getUniqueIdentifier() + ".autotoolsNatureV2"; //$NON-NLS-1$
+ public static final String OLD_AUTOTOOLS_NATURE_ID = "org.eclipse.linuxtools.cdt.autotools.autotoolsNature"; //$NON-NLS-1$
+ public final static String BUILDER_ID = ManagedBuilderCorePlugin.getUniqueIdentifier() + ".genmakebuilder"; //$NON-NLS-1$
+ public final static String OLD_AUTOTOOLS_BUILDER_ID = "org.eclipse.linuxtools.cdt.autotools.genmakebuilder"; //$NON-NLS-1$
+
+ private IProject project;
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.resources.IProjectNature#configure()
+ */
+ public void configure() throws CoreException {
+ addAutotoolsBuilder(project, new NullProgressMonitor());
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.resources.IProjectNature#deconfigure()
+ */
+ public void deconfigure() throws CoreException {
+ // TODO remove builder from here
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.resources.IProjectNature#getProject()
+ */
+ public IProject getProject() {
+ return project;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.resources.IProjectNature#setProject(org.eclipse.core.resources.IProject)
+ */
+ public void setProject(IProject project) {
+ this.project = project;
+ }
+
+ /**
+ * Add the Autotools builder to the project
+ * @param project
+ * @param monitor
+ * @throws CoreException
+ */
+ public static void addAutotoolsBuilder(IProject project, IProgressMonitor monitor) throws CoreException {
+ // Add the builder to the project
+ IProjectDescription description = project.getDescription();
+ ICommand[] commands = description.getBuildSpec();
+ ArrayList<ICommand> commandList = new ArrayList<ICommand>();
+
+ // Make sure the Autotools Configuration builder just precedes the Common Builder
+ for (int i = 0; i < commands.length; i++) {
+ ICommand command = commands[i];
+ if (command.getBuilderName().equals(AutotoolsConfigurationBuilder.BUILDER_ID)) {
+ // ignore it
+ } else {
+ if (command.getBuilderName().equals(OLD_AUTOTOOLS_BUILDER_ID)) {
+ ICommand newCommand = description.newCommand();
+ newCommand.setBuilderName(BUILDER_ID);
+ command = newCommand;
+ }
+ if (command.getBuilderName().equals(BUILDER_ID)) {
+ // add Autotools Configuration builder just before builder
+ ICommand newCommand = description.newCommand();
+ newCommand.setBuilderName(AutotoolsConfigurationBuilder.BUILDER_ID);
+ commandList.add(newCommand);
+ }
+ commandList.add(command);
+ }
+ }
+ final ICommand[] newCommands = commandList.toArray(new ICommand[commandList.size()]);
+ if (newCommands.length == commands.length) {
+ boolean hasCorrectBuilderCommands = true;
+ for (int j = 0; j < commands.length; ++j) {
+ if (!commands[j].getBuilderName().equals(newCommands[j])) {
+ hasCorrectBuilderCommands = false;
+ break;
+ }
+ }
+ if (hasCorrectBuilderCommands)
+ return;
+ }
+ final ISchedulingRule rule = ResourcesPlugin.getWorkspace().getRoot();
+ final IProject proj = project;
+
+ Job backgroundJob = new Job("Autotools Set Project Description") {
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
+
+ public void run(IProgressMonitor monitor) throws CoreException {
+
+ IProjectDescription description = proj.getDescription();
+ description.setBuildSpec(newCommands);
+ proj.setDescription(description, new NullProgressMonitor());
+ }
+ }, rule, IWorkspace.AVOID_UPDATE, monitor);
+ } catch (CoreException e) {
+ return e.getStatus();
+ }
+ IStatus returnStatus = Status.OK_STATUS;
+ return returnStatus;
+ }
+ };
+ backgroundJob.setRule(rule);
+ backgroundJob.schedule();
+ }
+
+ /**
+ * Utility method for adding an autotools nature to a project.
+ *
+ * @param proj the project to add the autotools nature to.
+ * @param monitor a progress monitor to indicate the duration of the operation, or
+ * <code>null</code> if progress reporting is not required.
+ */
+ public static void addAutotoolsNature(IProject project, IProgressMonitor monitor) throws CoreException {
+ addNature(project, AUTOTOOLS_NATURE_ID, monitor);
+ }
+
+ /**
+ * 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
+ * <code>null</code> 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 to remove the autotools nature from a project.
+ *
+ * @param project to remove the autotools nature from
+ * @param mon progress monitor to indicate the duration of the operation, or
+ * <code>null</code> if progress reporting is not required.
+ * @throws CoreException
+ */
+ public static void removeAutotoolsNature(IProject project, IProgressMonitor mon) throws CoreException {
+ removeNature(project, AUTOTOOLS_NATURE_ID, mon);
+ }
+
+ /**
+ * Utility method to remove the old autotools nature from a project.
+ *
+ * @param project to remove the old autotools nature from
+ * @param mon progress monitor to indicate the duration of the operation, or
+ * <code>null</code> if progress reporting is not required.
+ * @throws CoreException
+ */
+ public static void removeOldAutotoolsNature(IProject project, IProgressMonitor mon) throws CoreException {
+ removeNature(project, OLD_AUTOTOOLS_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
+ * <code>null</code> 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<String> newNatures = new ArrayList<String>(Arrays.asList(prevNatures));
+ newNatures.remove(natureId);
+ description.setNatureIds((String[])newNatures.toArray(new String[newNatures.size()]));
+ project.setDescription(description, monitor);
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/cdt/autotools/core/AutotoolsPlugin.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/cdt/autotools/core/AutotoolsPlugin.java
new file mode 100644
index 0000000000..87ce42e177
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/cdt/autotools/core/AutotoolsPlugin.java
@@ -0,0 +1,291 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2007 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.core;
+
+import java.lang.reflect.InvocationTargetException;
+import java.text.MessageFormat;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
+import org.eclipse.cdt.managedbuilder.core.IManagedProject;
+import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
+import org.eclipse.cdt.managedbuilder.core.ManagedCProjectNature;
+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.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.jface.resource.ImageDescriptor;
+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;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The main plugin class to be used in the desktop.
+ */
+
+public class AutotoolsPlugin extends AbstractUIPlugin {
+
+ //The shared instance.
+ private static AutotoolsPlugin plugin;
+ private ResourceBundle resourceBundle;
+
+ public static final String PLUGIN_ID = "org.eclipse.linuxtools.cdt.autotools.core"; //$NON-NLS-1$
+ public static final String AUTOTOOLS_PROJECT_TYPE_ID = PLUGIN_ID + ".projectType"; //$NON-NLS-1$
+
+ /**
+ * The constructor.
+ */
+ public AutotoolsPlugin() {
+ plugin = this;
+ try {
+ resourceBundle = ResourceBundle.getBundle(PLUGIN_ID + ".Resources"); //$NON-NLS-1$
+ } catch (MissingResourceException x) {
+ resourceBundle = null;
+ }
+
+ }
+
+ public static String getPluginId() {
+ return PLUGIN_ID;
+ }
+
+ 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().getBundle().getSymbolicName();
+ }
+
+ /**
+ * This method is called upon plug-in activation
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ }
+
+ /**
+ * This method is called when the plug-in is stopped
+ */
+ public void stop(BundleContext context) throws Exception {
+ super.stop(context);
+ plugin = null;
+ }
+
+ /**
+ * Returns the shared instance.
+ */
+ public static AutotoolsPlugin getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Returns active shell.
+ */
+ public static Shell getActiveWorkbenchShell() {
+ IWorkbenchWindow window = getDefault().getWorkbench().getActiveWorkbenchWindow();
+ if (window != null) {
+ return window.getShell();
+ }
+ return null;
+ }
+
+ /**
+ * Returns the string from the plugin's resource bundle,
+ * or 'key' if not found.
+ *
+ * @param key the message key
+ * @return the resource bundle message
+ */
+ public static String getResourceString(String key) {
+ ResourceBundle bundle = AutotoolsPlugin.getDefault().getResourceBundle();
+ try {
+ return bundle.getString(key);
+ } catch (MissingResourceException e) {
+ return key;
+ }
+ }
+
+ /**
+ * Returns the string from the plugin's resource bundle,
+ * or 'key' if not found.
+ *
+ * @param key the message key
+ * @param args an array of substituition strings
+ * @return the resource bundle message
+ */
+ public static String getFormattedString(String key, String[] args) {
+ return MessageFormat.format(getResourceString(key), (Object[])args);
+ }
+
+ /**
+ * Returns the plugin's resource bundle,
+ */
+ public ResourceBundle getResourceBundle() {
+ return resourceBundle;
+ }
+
+ public static boolean hasTargetBuilder(IProject project) {
+ try {
+ // When a project is converted to an Autotools project, we
+ // replace the ManagedMake builder with a special one that
+ // handles MakeTargets. If a project is brought into Eclipse and
+ // uses the New Project Wizard to create a ManagedMake project that
+ // is of type: Autotools, this added step is not done. If we know
+ // we have an Autotools project from the configuration id, then
+ // we should add the builder now. We also should replace the
+ // default ManagedMake scanner provider with the Autotools one,
+ // then return true.
+ if (project.getNature(ManagedCProjectNature.MNG_NATURE_ID) != null) {
+ IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project);
+ IManagedProject m = info.getManagedProject();
+ if (m != null && m.getProjectType().getId().equals(AUTOTOOLS_PROJECT_TYPE_ID)) {
+ AutotoolsNewProjectNature.addAutotoolsBuilder(project, new NullProgressMonitor());
+ return true;
+ }
+ }
+ } catch (CoreException e) {
+ // Don't care...fall through to not found.
+ } catch (Exception f) {
+ // Don't care...fall through to not found.
+ }
+ // Otherwise not found.
+ return false;
+ }
+
+ /**
+ * Returns an image descriptor for the image file at the given
+ * plug-in relative path.
+ *
+ * @param path the path
+ * @return the image descriptor
+ */
+ public static ImageDescriptor getImageDescriptor(String path) {
+ return AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path);
+ }
+
+ 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, AutotoolsPlugin.getUniqueIdentifier(), -1, "Internal Error: ", t); //$NON-NLS-1$
+ }
+ ErrorDialog.openError(shell, title, message, status);
+ }
+
+ /**
+ * Returns the workspace instance.
+ */
+ public static IWorkspace getWorkspace() {
+ return ResourcesPlugin.getWorkspace();
+ }
+
+ /**
+ * Returns the active workbench window or <code>null</code> if none
+ */
+ public static IWorkbenchWindow getActiveWorkbenchWindow() {
+ return getDefault().getWorkbench().getActiveWorkbenchWindow();
+ }
+
+ /**
+ * Returns the active workbench page or <code>null</code> if none.
+ */
+ public static IWorkbenchPage getActivePage() {
+ IWorkbenchWindow window= getActiveWorkbenchWindow();
+ if (window != null) {
+ return window.getActivePage();
+ }
+ return null;
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/cdt/autotools/core/Resources.properties b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/cdt/autotools/core/Resources.properties
new file mode 100644
index 0000000000..ee20f59d75
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/cdt/autotools/core/Resources.properties
@@ -0,0 +1,106 @@
+#################################################################################
+# Copyright (c) 2006, 2007, 2009 Red Hat, Inc.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Red Hat Incorporated - initial API and implementation
+# IBM Rational Software - ManagedMakeMessages copied to AutotoolsMakefileBuilder
+#################################################################################
+MakeCWizard.title=C/Make Project
+MakeCWizard.description=Create a New C Project using 'make' to build it
+
+WARNING_UNSUPPORTED_CONFIGURATION=Warning: unsupported configuration
+
+AutotoolsMakefileBuilder.message.finished=Build complete for project {0}
+AutotoolsMakefileBuilder.message.stopped=Build stopped
+AutotoolsMakefileBuilder.type.clean=Clean-only build
+AutotoolsMakefileBuilder.message.clean.deleting.output=Removing build artifacts from {0}
+AutotoolsMakefileBuilder.message.console.header=**** {0} of configuration {1} for project {2} ****
+
+MakeGenerator.makefile.built=Makefile built
+MakeGenerator.refresh=Refresh
+MakeGenerator.refresh.error=Refresh error
+MakeGenerator.generation.error=Configuration failed with error
+MakeGenerator.configuring=Configuring
+MakeGenerator.make.message=Invoking {0} for project {1}
+MakeGenerator.config.error=Error {0} occurred while running {1}
+MakeGenerator.createdir.error=Error creating build directory: {0}
+MakeGenerator.run.config.status=Running config.status in build directory: {0}
+MakeGenerator.makefile.cvs=Invoking Makefile.cvs in build directory: {0}
+MakeGenerator.autogen.sh=Invoking autogen.sh in build directory: {0}
+MakeGenerator.autoreconf=Invoking autoreconf in build directory: {0}
+MakeGenerator.gen.makefile=Generating Makefile in build directory: {0}
+MakeGenerator.clean.builddir=Cleaning build directory: {0}
+MakeGenerator.clean.topdir=Cleaning top-level source directory to allow other configuration to run
+MakeGenerator.gen.configure=Generating configure
+MakeGenerator.unsupportedConfig=Warning: unsupported configuration {0}
+MakeGenerator.success=[Operation successful]
+MakeGenerator.didnt.generate=No Makefile generated
+MakeGenerator.refresh.MakeTargets=Refreshing Make Targets
+
+BuildDir.apply=Build directory already in use
+BuildDir.default=Default build directory to unused value?
+BuildDir.yes=Yes
+BuildDir.no=No
+
+WizardAutotoolsProjectConversion.title=Convert to CVS C/C++ Autotools Project
+WizardAutotoolsProjectConversion.description=Convert a CVS source repository to C/C++ Autotools Project
+WizardAutotoolsProjectConversion.message.add_nature=Adding C/C++ Autotools Managed Project Nature
+WizardAutotoolsProjectConversion.message.add_builder=Adding C/C++ Autotools Managed Project Builder
+WizardMakeProjectConversion.monitor.convertingToMakeProject=Converting Project...
+WizardAutotoolsConversion=CVS C/C++ Autotools Conversion
+WizardAutotoolsConversion.windowTitle=Conversion to CVS C/C++ Autotools Project
+WizardAutotoolsConversion.config.title=Select a configuration
+WizardAutotoolsConversion.config.desc=Select the configuration you wish to deploy on
+WizardAutotoolsConversion.options.title=Additional Project Settings
+WizardAutotoolsConversion.options.desc=Define the inter-project dependencies, if any.
+WizardAutotoolsConversion.message.save=Saving new build options
+
+WizardAutotoolsNewCProject.title=Autotools C Project
+WizardAutotoolsNewCProject.description=Create a new C Autotools project
+WizardAutotoolsNewCProject.monitor.creatingProject=Creating Project...
+WizardAutotoolsNewCProject.windowTitle=GNU Autotools C Project
+WizardAutotoolsNewCProject.config.title=Select a configuration
+WizardAutotoolsNewCProject.config.desc=Select the configuration you wish to deploy on
+WizardAutotoolsNewCProject.options.title=Additional Project Settings
+WizardAutotoolsNewCProject.options.desc=Define the inter-project dependencies, if any.
+WizardAutotoolsNewCProject.message.save=Saving new build options
+
+WizardAutotoolsNewCProjectV2.title=Autotools C Project V2
+WizardAutotoolsNewCProjectV2.description=Create a new C Autotools project
+WizardAutotoolsNewCProjectV2.monitor.creatingProject=Creating Project...
+WizardAutotoolsNewCProjectV2.windowTitle=GNU Autotools C Project V2
+WizardAutotoolsNewCProjectV2.config.title=Select a configuration
+WizardAutotoolsNewCProjectV2.config.desc=Select the configuration you wish to deploy on
+WizardAutotoolsNewCProjectV2.options.title=Additional Project Settings
+WizardAutotoolsNewCProjectV2.options.desc=Define the inter-project dependencies, if any.
+WizardAutotoolsNewCProjectV2.message.save=Saving new build options
+
+WizardAutotoolsNewCCProject.title=Autotools C++ Project
+WizardAutotoolsNewCCProject.description=Create a new C++ Autotools project
+WizardAutotoolsNewCCProject.monitor.creatingProject=Creating Project...
+WizardAutotoolsNewCCProject.windowTitle=GNU Autotools C++ Project
+WizardAutotoolsNewCCProject.config.title=Select a configuration
+WizardAutotoolsNewCCProject.config.desc=Select the configuration you wish to deploy on
+WizardAutotoolsNewCCProject.options.title=Additional Project Settings
+WizardAutotoolsNewCCProject.options.desc=Define the inter-project dependencies, if any.
+WizardAutotoolsNewCCProject.message.save=Saving new build options
+
+
+BuildTargetDialog.title.buildTarget=Build Special Targets
+BuildTargetDialog.title.makeTargetsFor=Make targets for
+BuildTargetDialog.button.build=Build
+
+TargetListViewer.button.add=Add...
+TargetListViewer.button.remove=Remove
+TargetListViewer.button.edit=Edit...
+TargetListViewer.label.target=Target
+TargetListViewer.label.location=Location
+TargetListViewer.exception.error=Error
+TargetListViewer.exception.message=An error occurred performing the selected action
+
+AutotoolsPreferencePage.useAutotoolsFileScanner.label=Use make -w for includepath scanning
+MakeTargetPreferencePage.buildTargetInBackground.label=Build target in background
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/AutotoolsConfigurationBuilder.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/AutotoolsConfigurationBuilder.java
new file mode 100644
index 0000000000..fce7c2937f
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/AutotoolsConfigurationBuilder.java
@@ -0,0 +1,159 @@
+package org.eclipse.linuxtools.internal.cdt.autotools.core;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.Map;
+
+import org.eclipse.cdt.core.CCorePlugin;
+import org.eclipse.cdt.core.resources.ACBuilder;
+import org.eclipse.cdt.core.resources.IConsole;
+import org.eclipse.cdt.managedbuilder.core.IBuilder;
+import org.eclipse.cdt.managedbuilder.core.IConfiguration;
+import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
+import org.eclipse.cdt.managedbuilder.core.IMultiConfiguration;
+import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.linuxtools.cdt.autotools.core.AutotoolsPlugin;
+import org.eclipse.linuxtools.internal.cdt.autotools.core.configure.AutotoolsConfigurationManager;
+import org.eclipse.linuxtools.internal.cdt.autotools.core.configure.IAConfiguration;
+
+public class AutotoolsConfigurationBuilder extends ACBuilder {
+
+ public static final String BUILDER_NAME = "genmakebuilderV2"; //$NON-NLS-1$
+ public static final String BUILDER_ID = AutotoolsPlugin.getUniqueIdentifier() + "." + BUILDER_NAME; //$NON-NLS-1$
+
+ private static final String BUILD_STOPPED="AutotoolsMakefileBuilder.message.stopped"; //$NON-NLS-1$
+ private AutotoolsNewMakeGenerator generator;
+
+ public AutotoolsConfigurationBuilder() {
+ super();
+ generator = new AutotoolsNewMakeGenerator();
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ protected IProject[] build(int kind, Map args, IProgressMonitor monitor)
+ throws CoreException {
+ IProject project = getProject();
+
+ boolean bPerformBuild = true;
+ IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project);
+ if (!shouldBuild(kind, info)) {
+ return new IProject[0];
+ }
+ if (kind == IncrementalProjectBuilder.AUTO_BUILD) {
+ IResourceDelta delta = getDelta(getProject());
+ if (delta != null) {
+ IResource res = delta.getResource();
+ if (res != null) {
+ bPerformBuild = res.getProject().equals(getProject());
+ }
+ } else {
+ bPerformBuild = false;
+ }
+ IConfiguration cfg = info.getDefaultConfiguration();
+ if (cfg != null) {
+ IAConfiguration acfg = AutotoolsConfigurationManager.getInstance().findCfg(project, cfg.getName());
+ if (acfg == null || acfg.isDirty())
+ bPerformBuild = true;
+ }
+ }
+ if (bPerformBuild) {
+ MultiStatus result = performMakefileGeneration(project, info, monitor);
+ if (result.getSeverity() == IStatus.ERROR) {
+ // Failure to create Makefile, output error message to console.
+ IConsole console = CCorePlugin.getDefault().getConsole();
+ console.start(project);
+
+ OutputStream cos = console.getOutputStream();
+ String errormsg = AutotoolsPlugin.getResourceString(BUILD_STOPPED);
+ StringBuffer buf = new StringBuffer(errormsg);
+ buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$ //$NON-NLS-2$
+ buf.append("(").append(result.getMessage()).append(")"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ try {
+ cos.write(buf.toString().getBytes());
+ cos.flush();
+ cos.close();
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ AutotoolsPlugin.log(e);
+ }
+ }
+ }
+ checkCancel(monitor);
+ return getProject().getReferencedProjects();
+ }
+
+ @Override
+ protected void clean(IProgressMonitor monitor) throws CoreException {
+ IProject project = getProject();
+ final IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(getProject());
+ if (shouldBuild(CLEAN_BUILD, info)) {
+ IConfiguration icfg = info.getDefaultConfiguration();
+ if (icfg instanceof IMultiConfiguration) {
+ IMultiConfiguration mcfg = (IMultiConfiguration)icfg;
+ IConfiguration[] cfgs = (IConfiguration[])mcfg.getItems();
+ for (int i = 0; i < cfgs.length; ++i) {
+ IAConfiguration cfg = AutotoolsConfigurationManager.getInstance().getConfiguration(project, icfg.getName());
+ cfg.setDirty(true);
+ }
+ } else {
+ IAConfiguration cfg = AutotoolsConfigurationManager.getInstance().getConfiguration(project, icfg.getName());
+ cfg.setDirty(true); // Mark Configuration dirty so next build will do full reconfigure
+ }
+ }
+ }
+
+ protected MultiStatus performMakefileGeneration(IProject project, IManagedBuildInfo info,
+ IProgressMonitor monitor) throws CoreException {
+ MultiStatus result;
+
+ try {
+ generator.initialize(project, info, monitor);
+ result = generator.regenerateMakefiles(false);
+ } catch (CoreException e) {
+ String errMsg = AutotoolsPlugin.getResourceString("MakeGenerator.didnt.generate"); //$NON-NLS-1$
+ result = new MultiStatus(AutotoolsPlugin.getUniqueIdentifier(), IStatus.ERROR,
+ errMsg, e);
+ }
+
+ return result;
+ }
+
+ /**
+ * 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, IManagedBuildInfo info) {
+ IConfiguration cfg = info.getDefaultConfiguration();
+ IBuilder builder = null;
+ if (cfg != null) {
+ builder = cfg.getEditableBuilder();
+ switch (kind) {
+ case IncrementalProjectBuilder.AUTO_BUILD :
+ return builder.isAutoBuildEnable();
+ case IncrementalProjectBuilder.INCREMENTAL_BUILD : // now treated as the same!
+ case IncrementalProjectBuilder.FULL_BUILD :
+ return builder.isFullBuildEnabled() | builder.isIncrementalBuildEnabled() ;
+ case IncrementalProjectBuilder.CLEAN_BUILD :
+ return builder.isCleanBuildEnabled();
+ }
+ }
+ return true;
+ }
+
+}
+
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/AutotoolsNewMakeGenerator.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/AutotoolsNewMakeGenerator.java
new file mode 100644
index 0000000000..1cb552d865
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/AutotoolsNewMakeGenerator.java
@@ -0,0 +1,1273 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.core;
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.eclipse.cdt.core.CCorePlugin;
+import org.eclipse.cdt.core.CommandLauncher;
+import org.eclipse.cdt.core.ConsoleOutputStream;
+import org.eclipse.cdt.core.ICDescriptor;
+import org.eclipse.cdt.core.envvar.IEnvironmentVariable;
+import org.eclipse.cdt.core.resources.IConsole;
+import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
+import org.eclipse.cdt.core.settings.model.ICProjectDescription;
+import org.eclipse.cdt.core.settings.model.ICStorageElement;
+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.core.makefile.IMakefile;
+import org.eclipse.cdt.make.core.makefile.ITarget;
+import org.eclipse.cdt.make.core.makefile.ITargetRule;
+import org.eclipse.cdt.managedbuilder.core.BuildException;
+import org.eclipse.cdt.managedbuilder.core.IBuilder;
+import org.eclipse.cdt.managedbuilder.core.IConfiguration;
+import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
+import org.eclipse.cdt.managedbuilder.core.IMultiConfiguration;
+import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
+import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
+import org.eclipse.cdt.managedbuilder.macros.BuildMacroException;
+import org.eclipse.cdt.managedbuilder.macros.IBuildMacroProvider;
+import org.eclipse.cdt.newmake.core.IMakeCommonBuildInfo;
+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.IResourceDelta;
+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.MultiStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.linuxtools.cdt.autotools.core.AutotoolsPlugin;
+import org.eclipse.linuxtools.internal.cdt.autotools.core.configure.AutotoolsConfigurationManager;
+import org.eclipse.linuxtools.internal.cdt.autotools.core.configure.IAConfiguration;
+import org.eclipse.linuxtools.internal.cdt.autotools.core.configure.IConfigureOption;
+
+
+@SuppressWarnings("deprecation")
+public class AutotoolsNewMakeGenerator extends MarkerGenerator {
+
+ public final String CONFIG_STATUS = "config.status"; //$NON-NLS-1$
+ public final String MAKEFILE = "Makefile"; //$NON-NLS-1$
+ public final String MAKEFILE_CVS = "Makefile.cvs"; //$NON-NLS-1$
+ public final String SETTINGS_FILE_NAME = ".cdtconfigure"; //$NON-NLS-1$
+ public final String SHELL_COMMAND = "sh"; //$NON-NLS-1$
+
+ public final String AUTOGEN_TOOL_ID = "autogen"; //$NON-NLS-1$
+ public final String CONFIGURE_TOOL_ID = "configure"; //$NON-NLS-1$
+
+ public final String GENERATED_TARGET = AutotoolsPlugin.PLUGIN_ID + ".generated.MakeTarget"; //$NON-NLS-1$
+
+ private static final String MAKE_TARGET_KEY = MakeCorePlugin.getUniqueIdentifier() + ".buildtargets"; //$NON-NLS-1$
+ 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"; //$NON-NLS-1$
+ private static final String TARGET_ATTR_NAME = "name"; //$NON-NLS-1$
+ private static final String TARGET_STOP_ON_ERROR = "stopOnError"; //$NON-NLS-1$
+ private static final String TARGET_USE_DEFAULT_CMD = "useDefaultCommand"; //$NON-NLS-1$
+ private static final String TARGET_ARGUMENTS = "buildArguments"; //$NON-NLS-1$
+ private static final String TARGET_COMMAND = "buildCommand"; //$NON-NLS-1$
+ private static final String TARGET_RUN_ALL_BUILDERS = "runAllBuilders";
+ private static final String TARGET = "buildTarget"; //$NON-NLS-1$
+ private static final String DEFAULT_AUTORECONF = "autoreconf"; //$NON-NLS-1$
+
+ private IProject project;
+
+ private IProgressMonitor monitor;
+
+ private IPath buildLocation;
+ private String buildDir;
+ private String srcDir;
+
+ private IConfiguration cfg;
+ private ICConfigurationDescription cdesc;
+ private IAConfiguration toolsCfg;
+ private IBuilder builder;
+
+ public void generateDependencies() throws CoreException {
+ // TODO Auto-generated method stub
+
+ }
+
+ public MultiStatus generateMakefiles(IResourceDelta delta)
+ throws CoreException {
+ return regenerateMakefiles(false);
+ }
+
+ private void initializeBuildConfigDirs(IConfiguration c, IAConfiguration a) {
+ IBuilder b = c.getBuilder();
+ IPath buildDirectory = b.getBuildLocation();
+ if (buildDirectory == null || buildDirectory.isEmpty()) {
+ // default build directory to project directory
+ buildDirectory = project.getLocation();
+ }
+ buildLocation = buildDirectory;
+ buildDir = buildDirectory.toString();
+ srcDir = a.getConfigToolDirectory();
+ try {
+ String resolved = ManagedBuildManager.getBuildMacroProvider().resolveValue(srcDir, "", null,
+ IBuildMacroProvider.CONTEXT_CONFIGURATION, c);
+ srcDir = resolved;
+ } catch (BuildMacroException e) {
+ // do nothing
+ }
+ }
+
+ public void initialize(IProject project, IManagedBuildInfo info,
+ IProgressMonitor monitor) {
+ this.project = project;
+ ICProjectDescription pdesc = CCorePlugin.getDefault().getProjectDescription(project);
+ this.cdesc = pdesc.getActiveConfiguration();
+ this.cfg = info.getDefaultConfiguration();
+ this.builder = cfg.getBuilder();
+ this.monitor = monitor;
+ }
+
+ public IProject getProject() {
+ return project;
+ }
+
+ public boolean isGeneratedResource(IResource resource) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public void regenerateDependencies(boolean force) throws CoreException {
+ // TODO Auto-generated method stub
+
+ }
+
+ /*
+ * (non-Javadoc) Check whether the build has been cancelled. Cancellation
+ * requests propagated to the caller by throwing <code>OperationCanceledException</code>.
+ *
+ * @see org.eclipse.core.runtime.OperationCanceledException#OperationCanceledException()
+ */
+ protected void checkCancel() {
+ if (monitor != null && monitor.isCanceled()) {
+ throw new OperationCanceledException();
+ }
+ }
+
+ /*
+ * (non-Javadoc) Return or create the makefile needed for the build. If we
+ * are creating the resource, set the derived bit to true so the CM system
+ * ignores the contents. If the resource exists, respect the existing
+ * derived setting.
+ *
+ * @param makefilePath @return IFile
+ */
+ protected 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, new SubProgressMonitor(monitor, 1));
+ // Make sure the new file is marked as derived
+ if (!newFile.isDerived()) {
+ newFile.setDerived(true);
+ }
+
+ } 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;
+ }
+
+ /*
+ * Create a directory
+ *
+ * @param boolean @return whether the directory was created
+ */
+ private boolean createDirectory(String dirName) throws CoreException {
+ // Create or get the handle for the build directory
+ IPath path = new Path(dirName);
+ boolean rc = true;
+ if (dirName.length() == 0 || dirName.equals("."))
+ path = project.getLocation().append(dirName);
+ File f = path.toFile();
+ if (!f.exists())
+ rc = f.mkdirs();
+
+ return rc;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.cdt.managedbuilder.makegen.IManagedBuilderMakefileGenerator#getMakefileName()
+ */
+ public String getMakefileName() {
+ return new String(MAKEFILE);
+ }
+
+ /**
+ * Reconfigure the project.
+ * @return MultiStatus status of regeneration operation
+ * @throws CoreException
+ */
+ public MultiStatus reconfigure() throws CoreException {
+ return regenerateMakefiles(true);
+ }
+
+ public MultiStatus regenerateMakefiles(boolean reconfigure) throws CoreException {
+ MultiStatus status = null;
+ if (cfg instanceof IMultiConfiguration) {
+ IMultiConfiguration mfcg = (IMultiConfiguration)cfg;
+ Object[] objs = mfcg.getItems();
+ for (int i = 0; i < objs.length; ++i) {
+ IConfiguration icfg = (IConfiguration)objs[i];
+ Status rc = regenerateMakefiles(icfg, reconfigure);
+ if (!rc.isOK()) {
+ if(status == null){
+ status = new MultiStatus(
+ AutotoolsPlugin.getUniqueIdentifier(),
+ IStatus.ERROR,
+ new String(),
+ null);
+ }
+ status.add(rc);
+ }
+ }
+ } else {
+ Status rc = regenerateMakefiles(cfg, reconfigure);
+ if (!rc.isOK()) {
+ if(status == null){
+ status = new MultiStatus(
+ AutotoolsPlugin.getUniqueIdentifier(),
+ IStatus.ERROR,
+ new String(),
+ null);
+ }
+ status.add(rc);
+ }
+ }
+ if(status == null){
+ status = new MultiStatus(
+ ManagedBuilderCorePlugin.getUniqueIdentifier(),
+ IStatus.OK,
+ new String(),
+ null);
+ }
+ return status;
+ }
+
+ private Status regenerateMakefiles(IConfiguration icfg, boolean reconfigure) throws CoreException {
+ Status status;
+ int rc = IStatus.OK;
+ String errMsg = new String();
+ boolean needFullConfigure = false;
+
+ // See if the user has cancelled the build
+ checkCancel();
+
+ // Synchronize the Autotools configurations with the Project Description
+ AutotoolsConfigurationManager.getInstance().syncConfigurations(getProject());
+ toolsCfg = AutotoolsConfigurationManager.getInstance().getConfiguration(getProject(), icfg.getId());
+
+ initializeBuildConfigDirs(icfg, toolsCfg);
+ // Create the top-level directory for the build output
+ if (!createDirectory(buildDir)) {
+ rc = IStatus.ERROR;
+ errMsg = AutotoolsPlugin.getFormattedString("MakeGenerator.createdir.error", //$NON-NLS-1$
+ new String[] {buildDir});
+ status = new MultiStatus(AutotoolsPlugin
+ .getUniqueIdentifier(), rc, errMsg, null);
+ }
+ checkCancel();
+
+ // // How did we do
+ // if (!getInvalidDirList().isEmpty()) {
+ // status = new MultiStatus (
+ // ManagedBuilderCorePlugin.getUniqueIdentifier(),
+ // IStatus.WARNING,
+ // new String(),
+ // null);
+ // // Add a new status for each of the bad folders
+ // iter = getInvalidDirList().iterator();
+ // while (iter.hasNext()) {
+ // status.add(new Status (
+ // IStatus.WARNING,
+ // ManagedBuilderCorePlugin.getUniqueIdentifier(),
+ // SPACES_IN_PATH,
+ // ((IContainer)iter.next()).getFullPath().toString(),
+ // null));
+ // }
+ // } else {
+ // status = new MultiStatus(
+ // ManagedBuilderCorePlugin.getUniqueIdentifier(),
+ // IStatus.OK,
+ // new String(),
+ // null);
+ // }
+
+ // Get a build console for the project
+ IConsole console = CCorePlugin.getDefault().getConsole("org.eclipse.linuxtools.cdt.autotools.ui.configureConsole"); //$NON-NLS-1$
+ boolean consoleStart = true;
+
+ // Make sure there's a monitor to cancel the build
+ if (monitor == null) {
+ monitor = new NullProgressMonitor();
+ }
+
+ try {
+ // If a config.status file exists in the build directory, we call it
+ // to
+ // regenerate the makefile
+ IPath configfile = buildLocation.append(CONFIG_STATUS);
+ IPath topConfigFile = project.getLocation().append(CONFIG_STATUS);
+ IPath makefilePath = buildLocation.append(MAKEFILE);
+ IPath topMakefilePath = project.getLocation().append(MAKEFILE);
+ File configStatus = configfile.toFile();
+ File topConfigStatus = topConfigFile.toFile();
+ File makefile = makefilePath.toFile();
+ File topMakefile = topMakefilePath.toFile();
+
+ // Check if a configure has been done in the top-level source directory
+ if (!(configfile.equals(topConfigFile)) && topConfigStatus.exists()) {
+ // Must perform distclean on source directory because 2nd configuration
+ // cannot occur otherwise
+ // There is a make target for cleaning.
+ if (topMakefile != null && topMakefile.exists()) {
+ String[] makeargs = new String[1];
+ IPath makeCmd = new Path("make"); //$NON-NLS-1$
+ String target = null;
+ try {
+ target = getProject().getPersistentProperty(AutotoolsPropertyConstants.CLEAN_MAKE_TARGET);
+ } catch (CoreException ce) {
+ // do nothing
+ }
+ if (target == null)
+ target = AutotoolsPropertyConstants.CLEAN_MAKE_TARGET_DEFAULT;
+ String args = builder.getBuildArguments();
+ if (args != null && !(args = args.trim()).equals("")) { //$NON-NLS-1$
+ String[] newArgs = makeArray(args);
+ makeargs = new String[newArgs.length + 1];
+ System.arraycopy(newArgs, 0, makeargs, 0, newArgs.length);
+ }
+ makeargs[makeargs.length - 1] = target;
+ rc = runCommand(makeCmd,
+ project.getLocation(),
+ makeargs,
+ AutotoolsPlugin.getResourceString("MakeGenerator.clean.topdir"), //$NON-NLS-1$
+ errMsg, console, consoleStart);
+ consoleStart = false;
+ }
+ }
+ // If the active configuration is dirty, then we need to do a full
+ // reconfigure.
+ if (toolsCfg.isDirty() || reconfigure) {
+ needFullConfigure = true;
+ // If we are going to do a full reconfigure, then if the current
+ // build directory exists, we should clean it out first. This is
+ // because the reconfiguration could change compile flags, etc..
+ // and the Makefile might not detect a rebuild is required. In
+ // addition, the build directory itself could have been changed and
+ // we should remove the previous build.
+ if (buildLocation != null && buildLocation.toFile().exists()) {
+ // See what type of cleaning the user has set up in the
+ // build properties dialog.
+ String cleanDelete = null;
+ try {
+ cleanDelete = getProject().getPersistentProperty(AutotoolsPropertyConstants.CLEAN_DELETE);
+ } catch (CoreException ce) {
+ // do nothing
+ }
+
+ if (cleanDelete != null && cleanDelete.equals(AutotoolsPropertyConstants.TRUE))
+ buildLocation.toFile().delete();
+ else {
+ // There is a make target for cleaning.
+ if (makefile != null && makefile.exists()) {
+ String[] makeargs = new String[1];
+ IPath makeCmd = new Path("make"); //$NON-NLS-1$
+ String target = null;
+ try {
+ target = getProject().getPersistentProperty(AutotoolsPropertyConstants.CLEAN_MAKE_TARGET);
+ } catch (CoreException ce) {
+ // do nothing
+ }
+ if (target == null)
+ target = AutotoolsPropertyConstants.CLEAN_MAKE_TARGET_DEFAULT;
+ String args = builder.getBuildArguments();
+ if (args != null && !(args = args.trim()).equals("")) { //$NON-NLS-1$
+ String[] newArgs = makeArray(args);
+ makeargs = new String[newArgs.length + 1];
+ System.arraycopy(newArgs, 0, makeargs, 0, newArgs.length);
+ }
+ makeargs[makeargs.length - 1] = target;
+ rc = runCommand(makeCmd,
+ buildLocation,
+ makeargs,
+ AutotoolsPlugin.getFormattedString("MakeGenerator.clean.builddir", new String[]{buildDir}), //$NON-NLS-1$
+ errMsg, console, consoleStart);
+ consoleStart = false;
+ }
+ }
+ }
+ // Mark the scanner info as dirty.
+ try {
+ project.setSessionProperty(AutotoolsPropertyConstants.SCANNER_INFO_DIRTY, Boolean.TRUE);
+ } catch (CoreException ce) {
+ // do nothing
+ }
+ }
+
+ ArrayList<String> configureEnvs = new ArrayList<String>();
+ ArrayList<String> configureCmdParms = new ArrayList<String>();
+ IPath configurePath = getConfigurePath(configureEnvs, configureCmdParms);
+ String[] configArgs = getConfigArgs(configureCmdParms);
+ ArrayList<String> autogenEnvs = new ArrayList<String>();
+ ArrayList<String> autogenCmdParms = new ArrayList<String>();
+ IPath autogenPath = getAutogenPath(autogenEnvs, autogenCmdParms);
+
+ // Check if we have a config.status (meaning configure has already run).
+ if (!needFullConfigure && configStatus != null && configStatus.exists()) {
+ // If no corresponding Makefile in the same build location, then we
+ // can simply run config.status again to ensure the top level Makefile has been
+ // created.
+ if (makefile == null || !makefile.exists()) {
+ rc = runScript(configfile, buildLocation, null,
+ AutotoolsPlugin.getFormattedString("MakeGenerator.run.config.status", new String[]{buildDir}), //$NON-NLS-1$
+ errMsg, console, null, consoleStart);
+ consoleStart = false;
+ }
+ }
+ // Look for configure and configure from scratch
+ else if (configurePath.toFile().exists()) {
+ rc = runScript(configurePath,
+ buildLocation,
+ configArgs,
+ AutotoolsPlugin.getFormattedString("MakeGenerator.gen.makefile", new String[]{buildDir}), //$NON-NLS-1$
+ errMsg, console, configureEnvs, consoleStart);
+ consoleStart = false;
+ if (rc != IStatus.ERROR) {
+ File makefileFile = buildLocation.append(MAKEFILE).toFile();
+ addMakeTargetsToManager(makefileFile);
+ // TODO: should we do something special if configure doesn't
+ // return ok?
+ toolsCfg.setDirty(false);
+ }
+ }
+ // If no configure, look for autogen.sh which may create configure and
+ // possibly even run it.
+ else if (autogenPath.toFile().exists()) {
+ // Remove the existing config.status file since we use it
+ // to figure out if configure was run.
+ if (configStatus.exists())
+ configStatus.delete();
+ // Get any user-specified arguments for autogen.
+ String[] autogenArgs = getAutogenArgs(autogenCmdParms);
+ rc = runScript(autogenPath,
+ autogenPath.removeLastSegments(1), autogenArgs,
+ AutotoolsPlugin.getFormattedString("MakeGenerator.autogen.sh", new String[]{buildDir}), //$NON-NLS-1$
+ errMsg, console, autogenEnvs, consoleStart);
+ consoleStart = false;
+ if (rc != IStatus.ERROR) {
+ configStatus = configfile.toFile();
+ // Check for config.status. If it is created, then
+ // autogen.sh ran configure and we should not run it
+ // ourselves.
+ if (configStatus == null || !configStatus.exists()) {
+ rc = runScript(configurePath,
+ buildLocation,
+ configArgs,
+ AutotoolsPlugin.getFormattedString("MakeGenerator.gen.makefile", new String[]{buildDir}), //$NON-NLS-1$
+ errMsg, console, configureEnvs, false);
+ if (rc != IStatus.ERROR) {
+ File makefileFile = buildLocation.append(MAKEFILE).toFile();
+ addMakeTargetsToManager(makefileFile);
+ toolsCfg.setDirty(false);
+ }
+ } else {
+ File makefileFile = buildLocation.append(MAKEFILE).toFile();
+ addMakeTargetsToManager(makefileFile);
+ toolsCfg.setDirty(false);
+ }
+ }
+ }
+ // If nothing this far, look for a Makefile.cvs file which needs to be run.
+ else if (makefileCvsExists()) {
+ String[] makeargs = new String[1];
+ IPath makeCmd = new Path("make"); //$NON-NLS-1$
+ makeargs[0] = "-f" + getMakefileCVSPath().toOSString(); //$NON-NLS-1$
+ rc = runCommand(makeCmd,
+ project.getLocation().append(buildDir),
+ makeargs,
+ AutotoolsPlugin.getFormattedString("MakeGenerator.makefile.cvs", new String[]{buildDir}), //$NON-NLS-1$
+ errMsg, console, consoleStart);
+ consoleStart = false;
+ if (rc != IStatus.ERROR) {
+ File makefileFile = project.getLocation().append(buildDir)
+ .append(MAKEFILE).toFile();
+ addMakeTargetsToManager(makefileFile);
+ toolsCfg.setDirty(false);
+ }
+ }
+ // If nothing this far, try running autoreconf -i
+ else {
+ String[] reconfArgs = new String[1];
+ String reconfCmd = project.getPersistentProperty(AutotoolsPropertyConstants.AUTORECONF_TOOL);
+ if (reconfCmd == null)
+ reconfCmd = DEFAULT_AUTORECONF;
+ IPath reconfCmdPath = new Path(reconfCmd);
+ reconfArgs[0] = "-i"; //$NON-NLS-1$
+ rc = runCommand(reconfCmdPath,
+ project.getLocation().append(srcDir),
+ reconfArgs,
+ AutotoolsPlugin.getFormattedString("MakeGenerator.autoreconf", new String[]{buildDir}), //$NON-NLS-1$
+ errMsg, console, consoleStart);
+ consoleStart = false;
+ // Check if configure generated and if yes, run it.
+ if (rc != IStatus.ERROR) {
+ if (configurePath.toFile().exists()) {
+ rc = runScript(configurePath,
+ buildLocation,
+ configArgs,
+ AutotoolsPlugin.getFormattedString("MakeGenerator.gen.makefile", new String[]{buildDir}), //$NON-NLS-1$
+ errMsg, console, configureEnvs, false);
+ if (rc != IStatus.ERROR) {
+ File makefileFile = buildLocation.append(MAKEFILE).toFile();
+ addMakeTargetsToManager(makefileFile);
+ // TODO: should we do something special if configure doesn't
+ // return ok?
+ toolsCfg.setDirty(false);
+ }
+ }
+ }
+ }
+ // If we didn't create a Makefile, consider that an error.
+ if (makefile == null || !makefile.exists()) {
+ rc = IStatus.ERROR;
+ errMsg = AutotoolsPlugin.getResourceString("MakeGenerator.didnt.generate"); //$NON-NLS-1$
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ // forgetLastBuiltState();
+ rc = IStatus.ERROR;
+ } finally {
+ // getGenerationProblems().clear();
+ status = new MultiStatus(AutotoolsPlugin
+ .getUniqueIdentifier(), rc, errMsg, null);
+ }
+ return status;
+ }
+
+ /**
+ * Strip a command of VAR=VALUE pairs that appear ahead of the command and add
+ * them to a list of environment variables.
+ *
+ * @param command - command to strip
+ * @param envVars - ArrayList to add environment variables to
+ * @return stripped command
+ */
+ public static String stripEnvVars(String command, ArrayList<String> envVars) {
+ Pattern p = Pattern.compile("(\\w+[=]([$]?\\w+[:;]?)+\\s+)\\w+.*");
+ Pattern p2 = Pattern.compile("(\\w+[=]\\\".*?\\\"\\s+)\\w+.*");
+ Pattern p3 = Pattern.compile("(\\w+[=]'.*?'\\s+)\\w+.*");
+ boolean finished = false;
+ while (!finished) {
+ Matcher m = p.matcher(command);
+ if (m.matches()) {
+ command = command.replaceFirst("\\w+[=]([$]?\\w+[:;]?)+", "").trim();
+ envVars.add(m.group(1).trim());
+ } else {
+ Matcher m2 = p2.matcher(command);
+ if (m2.matches()) {
+ command = command.replaceFirst("\\w+[=]\\\".*?\\\"","").trim();
+ String s = m2.group(1).trim();
+ envVars.add(s.replaceAll("\\\"", ""));
+ } else {
+ Matcher m3 = p3.matcher(command);
+ if (m3.matches()) {
+ command = command.replaceFirst("\\w+[=]'.*?'", "").trim();
+ String s = m3.group(1).trim();
+ envVars.add(s.replaceAll("'", ""));
+ } else {
+ finished = true;
+ }
+ }
+ }
+ }
+ return command;
+ }
+
+ protected IPath getConfigurePath(ArrayList<String> envVars, ArrayList<String> cmdParms) {
+ IPath configPath;
+ IConfigureOption configOption = toolsCfg.getOption(CONFIGURE_TOOL_ID);
+ String command = "configure"; // $NON-NLS-1$
+ if (configOption != null)
+ command = stripEnvVars(configOption.getValue().trim(), envVars);
+
+ String[] tokens = command.split("\\s");
+ if (tokens.length > 1) {
+ command = tokens[0];
+ for (int i = 1; i < tokens.length; ++i)
+ cmdParms.add(tokens[i]);
+ }
+ if (srcDir.equals(""))
+ configPath = project.getLocation().append(command);
+ else
+ configPath = project.getLocation().append(srcDir).append(command);
+ return configPath;
+ }
+
+ protected IPath getMakefileCVSPath() {
+ IPath makefileCVSPath;
+ if (srcDir.equals(""))
+ makefileCVSPath = project.getLocation().append(MAKEFILE_CVS);
+ else
+ makefileCVSPath= project.getLocation().append(srcDir).append(
+ MAKEFILE_CVS);
+ return makefileCVSPath;
+ }
+
+ protected boolean makefileCvsExists() {
+ IPath makefileCVSPath = getMakefileCVSPath();
+ return makefileCVSPath.toFile().exists();
+ }
+
+ protected IPath getAutogenPath(ArrayList<String> envVars, ArrayList<String> cmdParms) {
+ IPath autogenPath;
+ IConfigureOption autogenOption = toolsCfg.getOption(AUTOGEN_TOOL_ID);
+ String command = "autogen.sh"; // $NON-NLS-1$
+ if (autogenOption != null)
+ command = stripEnvVars(autogenOption.getValue().trim(), envVars);
+
+ String[] tokens = command.split("\\s");
+ if (tokens.length > 1) {
+ command = tokens[0];
+ for (int i = 1; i < tokens.length; ++i)
+ cmdParms.add(tokens[i]);
+ }
+
+ if (srcDir.equals(""))
+ autogenPath = project.getLocation().append(command);
+ else
+ autogenPath = project.getLocation().append(srcDir).append(command);
+ return autogenPath;
+ }
+
+ private String[] getAutogenArgs(ArrayList<String> cmdParms) {
+ // Get the arguments to be passed to config from build model
+ ArrayList<String> autogenArgs = toolsCfg.getToolArgs(AUTOGEN_TOOL_ID);
+ cmdParms.addAll(autogenArgs);
+ return cmdParms.toArray(new String[cmdParms.size()]);
+ }
+
+ private String[] getConfigArgs(ArrayList<String> cmdParms) {
+ // Get the arguments to be passed to config from build model
+ ArrayList<String> configArgs = toolsCfg.getToolArgs(CONFIGURE_TOOL_ID);
+ cmdParms.addAll(configArgs);
+ return cmdParms.toArray(new String[cmdParms.size()]);
+ }
+
+ // Run a command or executable (e.g. make).
+ private int runCommand(IPath commandPath, IPath runPath, String[] args,
+ String jobDescription, String errMsg, IConsole console,
+ boolean consoleStart) throws BuildException, CoreException,
+ NullPointerException, IOException {
+
+ int rc = IStatus.OK;
+
+ removeAllMarkers(project);
+
+ String[] configTargets = args;
+ if (args == null)
+ configTargets = new String[0];
+
+ for (int i = 0; i < configTargets.length; ++i) {
+ // try to resolve the build macros in any argument
+ try{
+ String resolved =
+ ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(
+ configTargets[i],
+ "", //$NON-NLS-1$
+ " ", //$NON-NLS-1$
+ IBuildMacroProvider.CONTEXT_CONFIGURATION,
+ cfg);
+ configTargets[i] = resolved;
+ } catch (BuildMacroException e) {
+ }
+ }
+
+ String[] msgs = new String[2];
+ msgs[0] = commandPath.toString();
+ msgs[1] = project.getName();
+ monitor.subTask(AutotoolsPlugin.getFormattedString(
+ "MakeGenerator.make.message", msgs)); //$NON-NLS-1$
+
+
+ ConsoleOutputStream consoleOutStream = null;
+ StringBuffer buf = new StringBuffer();
+
+ // Launch command - main invocation
+ if (consoleStart)
+ console.start(project);
+ consoleOutStream = console.getOutputStream();
+ String[] consoleHeader = new String[3];
+
+ consoleHeader[0] = jobDescription;
+ consoleHeader[1] = toolsCfg.getId();
+ consoleHeader[2] = project.getName();
+ buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$ //$NON-NLS-2$
+ buf.append(jobDescription);
+ buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$ //$NON-NLS-2$
+ buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$ //$NON-NLS-2$
+
+ consoleOutStream.write(buf.toString().getBytes());
+ consoleOutStream.flush();
+
+ // Get a launcher for the config command
+ CommandLauncher launcher = new CommandLauncher();
+ // Set the environment
+ IEnvironmentVariable variables[] =
+ CCorePlugin.getDefault().getBuildEnvironmentManager().getVariables(cdesc, true);
+ String[] env = null;
+ ArrayList<String> envList = new ArrayList<String>();
+ if (variables != null) {
+ for (int i = 0; i < variables.length; i++) {
+ envList.add(variables[i].getName()
+ + "=" + variables[i].getValue()); //$NON-NLS-1$
+ }
+ env = (String[]) envList.toArray(new String[envList.size()]);
+ }
+
+ // // Hook up an error parser manager
+ // String[] errorParsers =
+ // info.getDefaultConfiguration().getErrorParserList();
+ // ErrorParserManager epm = new ErrorParserManager(project, topBuildDir,
+ // this, errorParsers);
+ // epm.setOutputStream(consoleOutStream);
+ OutputStream stdout = consoleOutStream;
+ OutputStream stderr = consoleOutStream;
+
+ launcher.showCommand(true);
+ Process proc = launcher.execute(commandPath, configTargets, env,
+ runPath, new NullProgressMonitor());
+ 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
+ // ensure
+ // the UI is up-to-date with the build results
+ // monitor.subTask(ManagedMakeMessages
+ // .getResourceString(REFRESH));
+ monitor.subTask(AutotoolsPlugin.getResourceString("MakeGenerator.refresh")); //$NON-NLS-1$
+ try {
+ project.refreshLocal(IResource.DEPTH_INFINITE, null);
+ } catch (CoreException e) {
+ monitor.subTask(AutotoolsPlugin
+ .getResourceString("MakeGenerator.refresh.error")); //$NON-NLS-1$
+ }
+ } else {
+ errMsg = launcher.getErrorMessage();
+ }
+
+ // Report either the success or failure of our mission
+ buf = new StringBuffer();
+ if (errMsg != null && errMsg.length() > 0) {
+ String errorDesc = AutotoolsPlugin
+ .getResourceString("MakeGenerator.generation.error"); //$NON-NLS-1$
+ buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$//$NON-NLS-2$
+ buf.append(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$
+ rc = IStatus.ERROR;
+ } else if (proc.exitValue() >= 1 || proc.exitValue() < 0) {
+ // We have an invalid return code from configuration.
+ String[] errArg = new String[2];
+ errArg[0] = Integer.toString(proc.exitValue());
+ errArg[1] = commandPath.toString();
+ errMsg = AutotoolsPlugin.getFormattedString(
+ "MakeGenerator.config.error", errArg); //$NON-NLS-1$
+ buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$//$NON-NLS-2$
+ buf.append(AutotoolsPlugin.getResourceString("MakeGenerator.generation.error")); //$NON-NLS-1$
+ buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$//$NON-NLS-2$
+ if (proc.exitValue() == 1)
+ rc = IStatus.WARNING;
+ else
+ rc = IStatus.ERROR;
+ } else {
+ // Report a successful build
+ String successMsg =
+ AutotoolsPlugin.getResourceString("MakeGenerator.success"); //$NON-NLS-1$
+ buf.append(successMsg);
+ buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$//$NON-NLS-2$
+ rc = IStatus.OK;
+ }
+
+ // Write message on the console
+ consoleOutStream.write(buf.toString().getBytes());
+ consoleOutStream.flush();
+
+ // // Generate any error markers that the build has discovered
+ // monitor.subTask(ManagedMakeMessages
+ // .getResourceString(MARKERS));
+ // epm.reportProblems();
+ consoleOutStream.close();
+
+ // TODO: For now, add a marker with our generated error message.
+ // In the future, we might add an error parser to do this properly
+ // and give the actual error line, etc..
+ if (rc == IStatus.ERROR) {
+ addMarker(project, -1, errMsg, SEVERITY_ERROR_BUILD, null);
+ }
+
+ return rc;
+ }
+
+ // Get the path string. We add a Win check to handle MingW.
+ // For MingW, we would rather represent C:\a\b as /C/a/b which
+ // doesn't cause Makefile to choke.
+ // TODO: further logic would be needed to handle cygwin if desired
+ private String getPathString(IPath path) {
+ String s = path.toString();
+ if (Platform.getOS().equals(Platform.OS_WIN32))
+ s = s.replaceAll("^([A-Z])(:)", "/$1");
+ return s;
+ }
+
+ // Run an autotools script (e.g. configure, autogen.sh, config.status).
+ private int runScript(IPath commandPath, IPath runPath, String[] args,
+ String jobDescription, String errMsg, IConsole console,
+ ArrayList<String> additionalEnvs,
+ boolean consoleStart) throws BuildException, CoreException,
+ NullPointerException, IOException {
+
+ int rc = IStatus.OK;
+
+ removeAllMarkers(project);
+
+ // We want to run the script via the shell command. So, we add the command
+ // script as the first argument and expect "sh" to be on the runtime path.
+ // Any other arguments are placed after the script name.
+ String[] configTargets = null;
+ if (args == null)
+ configTargets = new String[1];
+ else {
+ configTargets = new String[args.length+1];
+ System.arraycopy(args, 0, configTargets, 1, args.length);
+ }
+ configTargets[0] = getPathString(commandPath);
+
+ for (int i = 0; i < configTargets.length; ++i) {
+ // try to resolve the build macros in any argument
+ try{
+ String resolved =
+ ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(
+ configTargets[i],
+ "", //$NON-NLS-1$
+ " ", //$NON-NLS-1$
+ IBuildMacroProvider.CONTEXT_CONFIGURATION,
+ cfg);
+ configTargets[i] = resolved;
+ } catch (BuildMacroException e) {
+ }
+ }
+
+ String[] msgs = new String[2];
+ msgs[0] = commandPath.toString();
+ msgs[1] = project.getName();
+ monitor.subTask(AutotoolsPlugin.getFormattedString(
+ "MakeGenerator.make.message", msgs)); //$NON-NLS-1$
+
+
+ ConsoleOutputStream consoleOutStream = null;
+ StringBuffer buf = new StringBuffer();
+
+ // Launch command - main invocation
+ if (consoleStart)
+ console.start(project);
+ consoleOutStream = console.getOutputStream();
+ String[] consoleHeader = new String[3];
+
+ consoleHeader[0] = jobDescription;
+ consoleHeader[1] = toolsCfg.getId();
+ consoleHeader[2] = project.getName();
+ buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$ //$NON-NLS-2$
+ buf.append(jobDescription);
+ buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$ //$NON-NLS-2$
+ buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$ //$NON-NLS-2$
+
+ consoleOutStream.write(buf.toString().getBytes());
+ consoleOutStream.flush();
+
+ // Get a launcher for the config command
+ CommandLauncher launcher = new CommandLauncher();
+ // Set the environment
+ IEnvironmentVariable variables[] =
+ CCorePlugin.getDefault().getBuildEnvironmentManager().getVariables(cdesc, true);
+ String[] env = null;
+ ArrayList<String> envList = new ArrayList<String>();
+ if (variables != null) {
+ for (int i = 0; i < variables.length; i++) {
+ envList.add(variables[i].getName()
+ + "=" + variables[i].getValue()); //$NON-NLS-1$
+ }
+ if (additionalEnvs != null)
+ envList.addAll(additionalEnvs); // add any additional environment variables specified ahead of script
+ env = (String[]) envList.toArray(new String[envList.size()]);
+ }
+
+ // // Hook up an error parser manager
+ // String[] errorParsers =
+ // info.getDefaultConfiguration().getErrorParserList();
+ // ErrorParserManager epm = new ErrorParserManager(project, topBuildDir,
+ // this, errorParsers);
+ // epm.setOutputStream(consoleOutStream);
+ OutputStream stdout = consoleOutStream;
+ OutputStream stderr = consoleOutStream;
+
+ launcher.showCommand(true);
+ // Run the shell script via shell command.
+ Process proc = launcher.execute(new Path(SHELL_COMMAND), configTargets, env,
+ runPath, new NullProgressMonitor());
+ 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
+ // ensure
+ // the UI is up-to-date with the build results
+ // monitor.subTask(ManagedMakeMessages
+ // .getResourceString(REFRESH));
+ monitor.subTask(AutotoolsPlugin.getResourceString("MakeGenerator.refresh")); //$NON-NLS-1$
+ try {
+ project.refreshLocal(IResource.DEPTH_INFINITE, null);
+ } catch (CoreException e) {
+ monitor.subTask(AutotoolsPlugin
+ .getResourceString("MakeGenerator.refresh.error")); //$NON-NLS-1$
+ }
+ } else {
+ errMsg = launcher.getErrorMessage();
+ }
+
+ // Report either the success or failure of our mission
+ buf = new StringBuffer();
+ if (errMsg != null && errMsg.length() > 0) {
+ String errorDesc = AutotoolsPlugin
+ .getResourceString("MakeGenerator.generation.error"); //$NON-NLS-1$
+ buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$//$NON-NLS-2$
+ buf.append(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$
+ rc = IStatus.ERROR;
+ } else if (proc.exitValue() >= 1 || proc.exitValue() < 0) {
+ // We have an invalid return code from configuration.
+ String[] errArg = new String[2];
+ errArg[0] = Integer.toString(proc.exitValue());
+ errArg[1] = commandPath.toString();
+ errMsg = AutotoolsPlugin.getFormattedString(
+ "MakeGenerator.config.error", errArg); //$NON-NLS-1$
+ buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$//$NON-NLS-2$
+ buf.append(AutotoolsPlugin.getResourceString("MakeGenerator.generation.error")); //$NON-NLS-1$
+ buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$//$NON-NLS-2$
+ if (proc.exitValue() == 1)
+ rc = IStatus.WARNING;
+ else
+ rc = IStatus.ERROR;
+ } else {
+ // Report a successful build
+ String successMsg =
+ AutotoolsPlugin.getResourceString("MakeGenerator.success"); //$NON-NLS-1$
+ buf.append(successMsg);
+ buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$//$NON-NLS-2$
+ rc = IStatus.OK;
+ }
+
+ // Write message on the console
+ consoleOutStream.write(buf.toString().getBytes());
+ consoleOutStream.flush();
+
+ // // Generate any error markers that the build has discovered
+ // monitor.subTask(ManagedMakeMessages
+ // .getResourceString(MARKERS));
+ // epm.reportProblems();
+ consoleOutStream.close();
+
+ // TODO: For now, add a marker with our generated error message.
+ // In the future, we might add an error parser to do this properly
+ // and give the actual error line, etc..
+ if (rc == IStatus.ERROR) {
+ addMarker(project, -1, errMsg, SEVERITY_ERROR_BUILD, null);
+ }
+
+ return rc;
+ }
+
+ private ICStorageElement createTargetElement(ICStorageElement parent, IMakeTarget target) {
+ ICStorageElement targetElem = parent.createChild(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());
+ ICStorageElement elem = targetElem.createChild(TARGET_COMMAND);
+ elem.setValue(target.getBuildAttribute(IMakeCommonBuildInfo.BUILD_COMMAND, "make")); //$NON-NLS-1$
+
+ String targetAttr = target.getBuildAttribute(IMakeCommonBuildInfo.BUILD_ARGUMENTS, null);
+ if ( targetAttr != null) {
+ elem = targetElem.createChild(TARGET_ARGUMENTS);
+ elem.setValue(targetAttr);
+ }
+
+ targetAttr = target.getBuildAttribute(IMakeTarget.BUILD_TARGET, null);
+ if (targetAttr != null) {
+ elem = targetElem.createChild(TARGET);
+ elem.setValue(targetAttr);
+ }
+
+ elem = targetElem.createChild(TARGET_STOP_ON_ERROR);
+ elem.setValue(new Boolean(target.isStopOnError()).toString());
+
+ elem = targetElem.createChild(TARGET_USE_DEFAULT_CMD);
+ elem.setValue(new Boolean(target.isDefaultBuildCmd()).toString());
+
+ elem = targetElem.createChild(TARGET_RUN_ALL_BUILDERS);
+ elem.setValue(new Boolean(target.runAllBuilders()).toString());
+
+ return targetElem;
+ }
+
+ /**
+ * This output method saves the information into the .cdtproject metadata file.
+ *
+ * @param doc
+ * @throws CoreException
+ */
+ private void saveTargets(IMakeTarget[] makeTargets) throws CoreException {
+ // FIXME: fix this when MakeTargetManager fixes its code.
+ ICDescriptor descriptor = CCorePlugin.getDefault().getCProjectDescription(getProject(), true);
+ ICStorageElement rootElement = descriptor.getProjectStorageElement(MAKE_TARGET_KEY);
+
+ //Nuke the children since we are going to write out new ones
+ rootElement.clear();
+
+ // Fetch the ProjectTargets as ICStorageElements
+ rootElement = rootElement.createChild(BUILD_TARGET_ELEMENT);
+ for (int i = 0; i < makeTargets.length; ++i)
+ createTargetElement(rootElement, makeTargets[i]);
+
+ //Save the results
+ descriptor.saveProjectData();
+ }
+
+ protected class MakeTargetComparator implements Comparator<Object> {
+ public int compare(Object a, Object b) {
+ IMakeTarget make1 = (IMakeTarget)a;
+ IMakeTarget make2 = (IMakeTarget)b;
+ return make1.getName().compareToIgnoreCase(make2.getName());
+ }
+
+ }
+
+ /**
+ * This method parses the given Makefile and produces MakeTargets for all targets so the
+ * end-user can access them from the MakeTargets popup-menu.
+ *
+ * @param makefileFile the Makefile to parse
+ * @throws CoreException
+ */
+ private void addMakeTargetsToManager(File makefileFile) throws CoreException {
+ // We don't bother if the Makefile wasn't created.
+ if (makefileFile == null || !makefileFile.exists())
+ return;
+
+ checkCancel();
+ if (monitor == null)
+ monitor = new NullProgressMonitor();
+ String statusMsg = AutotoolsPlugin.getResourceString("MakeGenerator.refresh.MakeTargets"); //$NON-NLS-1$
+ monitor.subTask(statusMsg);
+
+ IMakeTargetManager makeTargetManager =
+ MakeCorePlugin.getDefault().getTargetManager();
+
+ IMakefile makefile = MakeCorePlugin.createMakefile(makefileFile.toURI(), false, null);
+ ITargetRule[] targets = makefile.getTargetRules();
+ ITarget target = null;
+ Map<String, IMakeTarget> makeTargets = new HashMap<String, IMakeTarget>(); // use a HashMap so duplicate names are handled
+ String[] id = makeTargetManager.getTargetBuilders(getProject());
+ if (id.length == 0) {
+ return;
+ }
+ String targetBuildID = id[0];
+ IMakeBuilderInfo buildInfo = MakeCorePlugin.createBuildInfo(getProject(),
+ makeTargetManager.getBuilderID(targetBuildID));
+ boolean isStopOnError = buildInfo.isStopOnError();
+ IPath buildCommand = buildInfo.getBuildCommand();
+ String defaultBuildCommand = buildCommand.toString();
+ String buildArguments = buildInfo.getBuildArguments();
+ for (int i = 0; i < targets.length; i++) {
+ target = targets[i].getTarget();
+ String targetName = target.toString();
+ if (!isValidTarget(targetName, makeTargetManager))
+ continue;
+ try {
+ IMakeTarget makeTarget = makeTargetManager.findTarget(project, targetName);
+ if (makeTarget == null)
+ makeTarget = makeTargetManager.createTarget(
+ project, targetName, targetBuildID);
+ makeTarget.setContainer(project);
+ makeTarget.setStopOnError(isStopOnError);
+ makeTarget.setRunAllBuilders(false);
+ makeTarget.setUseDefaultBuildCmd(true);
+ makeTarget.setBuildAttribute(IMakeTarget.BUILD_ARGUMENTS, buildArguments);
+ makeTarget.setBuildAttribute(IMakeTarget.BUILD_COMMAND, defaultBuildCommand);
+
+ makeTarget.setBuildAttribute(GENERATED_TARGET, "true");
+ makeTarget.setBuildAttribute(IMakeTarget.BUILD_TARGET,
+ targetName);
+
+ //TODO: should this be raw build directory in macro form?
+ makeTarget.setBuildAttribute(IMakeTarget.BUILD_LOCATION,
+ buildDir);
+ makeTargets.put(makeTarget.getName(), makeTarget);
+ } catch (CoreException e) {
+ // Duplicate target. Ignore.
+ }
+ }
+
+ IMakeTarget[] makeTargetArray = new IMakeTarget[makeTargets.size()];
+ Collection<IMakeTarget> values = makeTargets.values();
+ ArrayList<IMakeTarget> valueList = new ArrayList<IMakeTarget>(values);
+ valueList.toArray(makeTargetArray);
+ MakeTargetComparator compareMakeTargets = new MakeTargetComparator();
+ Arrays.sort(makeTargetArray, compareMakeTargets);
+
+ // Check if we have MakeTargetManager patch which adds the ability
+ // to save multiple targets at once. If yes, use it as it updates
+ // the MakeTargets now. Otherwise, fall back to old method which
+ // saves the targets externally..requiring closing the project and
+ // reopening to see them.
+ Class<? extends IMakeTargetManager> c = makeTargetManager.getClass();
+ boolean targetsAdded = false;
+ try {
+ Method m = c.getMethod("setTargets", IContainer.class, IMakeTarget[].class);
+ m.invoke(makeTargetManager, project, makeTargetArray);
+ targetsAdded = true;
+ } catch (NoSuchMethodException e) {
+ // ignore and use fail-safe saveTargets method
+ } catch (IllegalArgumentException e) {
+ // ignore and use fail-safe saveTargets method
+ } catch (IllegalAccessException e) {
+ // ignore and use fail-safe saveTargets method
+ } catch (InvocationTargetException e) {
+ // ignore and use fail-safe saveTargets method
+ }
+ if (!targetsAdded)
+ saveTargets(makeTargetArray);
+ }
+
+ private boolean isValidTarget(String targetName, IMakeTargetManager makeTargetManager) {
+ return !(targetName.endsWith("-am") //$NON-NLS-1$
+ || targetName.endsWith("PROGRAMS") //$NON-NLS-1$
+ || targetName.endsWith("-generic") //$NON-NLS-1$
+ || (targetName.indexOf('$') >= 0)
+ || (targetName.charAt(0) == '.')
+ || targetName.equals(targetName.toUpperCase()));
+ }
+
+ // Turn the string into an array.
+ private String[] makeArray(String string) {
+ string = string.trim();
+ char[] array = string.toCharArray();
+ ArrayList<String> aList = new ArrayList<String>();
+ StringBuilder buffer = new StringBuilder();
+ boolean inComment = false;
+ for (int i = 0; i < array.length; i++) {
+ char c = array[i];
+ boolean needsToAdd = true;
+ if (array[i] == '"' || array[i] == '\'') {
+ if (i > 0 && array[i - 1] == '\\') {
+ inComment = false;
+ } else {
+ inComment = !inComment;
+ needsToAdd = false; // skip it
+ }
+ }
+ if (c == ' ' && !inComment) {
+ if (buffer.length() > 0){
+ String str = buffer.toString().trim();
+ if(str.length() > 0){
+ aList.add(str);
+ }
+ }
+ buffer = new StringBuilder();
+ } else {
+ if (needsToAdd)
+ buffer.append(c);
+ }
+ }
+ if (buffer.length() > 0){
+ String str = buffer.toString().trim();
+ if(str.length() > 0){
+ aList.add(str);
+ }
+ }
+ return (String[])aList.toArray(new String[aList.size()]);
+ }
+} \ No newline at end of file
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/AutotoolsPropertyConstants.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/AutotoolsPropertyConstants.java
new file mode 100644
index 0000000000..af3aac27ae
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/AutotoolsPropertyConstants.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 Red Hat Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.core;
+
+import org.eclipse.core.runtime.QualifiedName;
+import org.eclipse.linuxtools.cdt.autotools.core.AutotoolsPlugin;
+
+
+public class AutotoolsPropertyConstants {
+
+ static final String PREFIX = AutotoolsPlugin.getUniqueIdentifier() + "."; // $NON-NLS-1$
+ static final String PREFIX_COMPAT = "org.eclipse.linuxtools.cdt.autotools."; // $NON-NLS-1$
+ public static final String AUTOMAKE_VERSION_STRING = "AutoconfEditorAutomakeVersion"; // $NON-NLS-1$
+ public static final QualifiedName AUTOMAKE_VERSION = new QualifiedName(PREFIX, AUTOMAKE_VERSION_STRING);
+ public static final QualifiedName AUTOMAKE_VERSION_COMPAT = new QualifiedName(PREFIX_COMPAT, AUTOMAKE_VERSION_STRING);
+ public static final String AUTOCONF_VERSION_STRING = "AutoconfEditorAutoconfVersion"; // $NON-NLS-1$
+ public static final QualifiedName AUTOCONF_VERSION = new QualifiedName(PREFIX, AUTOCONF_VERSION_STRING);
+ public static final QualifiedName AUTOCONF_VERSION_COMPAT = new QualifiedName(PREFIX_COMPAT, AUTOCONF_VERSION_STRING);
+ public static final String AUTOCONF_MACRO_VERSIONING = "AutoconfEditorMacroVersioning"; // $NON-NLS-1$
+ public static final QualifiedName AUTOCONF_TOOL = new QualifiedName(PREFIX, "AutoconfToolPath"); // $NON-NLS-1$
+ public static final QualifiedName AUTOMAKE_TOOL = new QualifiedName(PREFIX, "AutomakeToolPath"); // $NON-NLS-1$
+ public static final QualifiedName ACLOCAL_TOOL = new QualifiedName(PREFIX, "AclocalToolPath"); // $NON-NLS-1$
+ public static final QualifiedName AUTOHEADER_TOOL = new QualifiedName(PREFIX, "AutoheaderToolPath"); // $NON-NLS-1$
+ public static final QualifiedName AUTORECONF_TOOL = new QualifiedName(PREFIX, "AutoreconfToolPath"); // $NON-NLS-1$
+ public static final QualifiedName LIBTOOLIZE_TOOL = new QualifiedName(PREFIX, "LibtoolizePath"); // $NON-NLS-1$
+ public static final QualifiedName CLEAN_DELETE = new QualifiedName(PREFIX, "CleanDelete"); // $NON-NLS-1$
+ public static final QualifiedName CLEAN_MAKE_TARGET = new QualifiedName(PREFIX, "CleanMakeTarget"); // $NON-NLS-1$
+ public static final QualifiedName SCANNER_USE_MAKE_W = new QualifiedName(PREFIX, "ScannerUseMakeW");
+ public static final QualifiedName AUTO_BUILD_NAME = new QualifiedName(PREFIX, "AutoBuildName"); // $NON-NLS-1$
+ public static final QualifiedName OPEN_INCLUDE = new QualifiedName(PREFIX, "IncludeResourceMapping"); // $NON-NLS-1$
+ public static final QualifiedName OPEN_INCLUDE_P = new QualifiedName(PREFIX, "PersistentIncludeResourceMapping"); //$NON-NLS-1$
+ public static final QualifiedName SCANNER_INFO_DIRTY = new QualifiedName(PREFIX, "ScannerInfoDirty"); // $NON-NLSp-1$
+
+ public static String[] fACVersions = {"2.13", "2.59", "2.61"}; // $NON-NLS-1$
+ public static final String LATEST_AC_VERSION = fACVersions[fACVersions.length - 1];
+
+ public static String[] fAMVersions = {"1.4-p6", "1.9.5", "1.9.6"}; // $NON-NLS-1$
+ public static final String LATEST_AM_VERSION = fAMVersions[fAMVersions.length - 1];
+
+ public static final String CLEAN_MAKE_TARGET_DEFAULT = "distclean"; // $NON-NLS-1$
+
+ public static final String TRUE = "true"; // $NON-NLS-1$
+ public static final String FALSE = "false"; // $NON-NLS-1$
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/DefaultNoDependencyCalculator.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/DefaultNoDependencyCalculator.java
new file mode 100644
index 0000000000..1eed38fc71
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/DefaultNoDependencyCalculator.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.cdt.autotools.core;
+
+import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
+import org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyGenerator;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+
+/**
+ * This is the dependency calculator used by the makefile generation system when
+ * nothing is defined for a tool.
+ *
+ * @since 2.0
+ */
+@SuppressWarnings("deprecation")
+public class DefaultNoDependencyCalculator implements IManagedDependencyGenerator {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.managedbuilder.makegen.IManagedBuilderDependencyCalculator#findDependencies(org.eclipse.core.resources.IResource, org.eclipse.core.resources.IProject)
+ */
+ public IResource[] findDependencies(IResource resource, IProject project) {
+ // Never answers any dependencies
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.managedbuilder.makegen.IManagedBuilderDependencyCalculator#getCalculatorType()
+ */
+ public int getCalculatorType() {
+ return TYPE_NODEPS;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.managedbuilder.makegen.IManagedBuilderDependencyCalculator#getDependencyCommand(org.eclipse.core.resources.IResource)
+ */
+ public String getDependencyCommand(IResource resource, IManagedBuildInfo info) {
+ // Never answers this call with an actual value
+ return null;
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/IConfigurationCloneListener.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/IConfigurationCloneListener.java
new file mode 100644
index 0000000000..34ce8379a6
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/IConfigurationCloneListener.java
@@ -0,0 +1,12 @@
+package org.eclipse.linuxtools.internal.cdt.autotools.core;
+
+import org.eclipse.cdt.managedbuilder.core.IConfiguration;
+
+public interface IConfigurationCloneListener {
+ /**
+ * Notified when a configuration gets cloned.
+ * @param cloneName - name of the cloned configuration
+ * @param c - the clone
+ */
+ public void cloneCfg(String cloneName, IConfiguration c);
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/MakeMessages.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/MakeMessages.java
new file mode 100644
index 0000000000..05cfe3c1ed
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/MakeMessages.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 2004 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.core;
+
+import java.text.MessageFormat;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class MakeMessages {
+
+ private static final String RESOURCE_BUNDLE= MakeMessages.class.getName();
+ private static ResourceBundle fgResourceBundle;
+ static {
+ try {
+ fgResourceBundle = ResourceBundle.getBundle(RESOURCE_BUNDLE);
+ } catch (MissingResourceException x) {
+ fgResourceBundle = null;
+ }
+ }
+
+ private MakeMessages() {
+ }
+
+ public static String getString(String key) {
+ try {
+ return fgResourceBundle.getString(key);
+ } catch (MissingResourceException e) {
+ return '!' + key + '!';
+ } catch (NullPointerException e) {
+ return "#" + key + "#"; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+
+ /**
+ * 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/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/MarkerGenerator.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/MarkerGenerator.java
new file mode 100644
index 0000000000..3e6982acff
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/MarkerGenerator.java
@@ -0,0 +1,155 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.core;
+
+import org.eclipse.cdt.core.CCorePlugin;
+import org.eclipse.cdt.core.IMarkerGenerator;
+import org.eclipse.cdt.core.ProblemMarkerInfo;
+import org.eclipse.cdt.core.model.ICModelMarker;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.runtime.CoreException;
+
+public abstract class MarkerGenerator implements IMarkerGenerator {
+
+ /**
+ * Constructor for MarkerGenerator
+ */
+ public MarkerGenerator() {
+ 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++) {
+ int line = ((Integer) cur[i].getAttribute(IMarker.LOCATION)).intValue();
+ int sev = ((Integer) cur[i].getAttribute(IMarker.SEVERITY)).intValue();
+ String mesg = (String) cur[i].getAttribute(IMarker.MESSAGE);
+ if (line == lineNumber && sev == mapMarkerSeverity(severity) && mesg.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());
+ }
+
+ }
+
+ public abstract IProject getProject();
+
+ /*
+ * callback from Output Parser
+ */
+ public void addMarker(ProblemMarkerInfo problemMarkerInfo) {
+ try {
+ IResource markerResource = problemMarkerInfo.file ;
+ if (markerResource==null) {
+ markerResource = getProject();
+ }
+ IMarker[] cur = markerResource.findMarkers(ICModelMarker.C_MODEL_PROBLEM_MARKER, true, 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++) {
+ int line = ((Integer) cur[i].getAttribute(IMarker.LOCATION)).intValue();
+ int sev = ((Integer) cur[i].getAttribute(IMarker.SEVERITY)).intValue();
+ String mesg = (String) cur[i].getAttribute(IMarker.MESSAGE);
+ if (line == problemMarkerInfo.lineNumber && sev == mapMarkerSeverity(problemMarkerInfo.severity) && mesg.equals(problemMarkerInfo.description)) {
+ return;
+ }
+ }
+ }
+
+ IMarker marker = markerResource.createMarker(ICModelMarker.C_MODEL_PROBLEM_MARKER);
+ marker.setAttribute(IMarker.LOCATION, problemMarkerInfo.lineNumber);
+ marker.setAttribute(IMarker.MESSAGE, problemMarkerInfo.description);
+ marker.setAttribute(IMarker.SEVERITY, mapMarkerSeverity(problemMarkerInfo.severity));
+ marker.setAttribute(IMarker.LINE_NUMBER, problemMarkerInfo.lineNumber);
+ marker.setAttribute(IMarker.CHAR_START, -1);
+ marker.setAttribute(IMarker.CHAR_END, -1);
+ if (problemMarkerInfo.variableName != null) {
+ marker.setAttribute(ICModelMarker.C_MODEL_MARKER_VARIABLE, problemMarkerInfo.variableName);
+ }
+ if (problemMarkerInfo.externalPath != null) {
+ marker.setAttribute(ICModelMarker.C_MODEL_MARKER_EXTERNAL_LOCATION, problemMarkerInfo.externalPath.toOSString());
+ }
+ }
+ catch (CoreException e) {
+ CCorePlugin.log(e.getStatus());
+ }
+ }
+
+ private 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;
+ }
+
+ /* (non-Javadoc)
+ * Removes the IMarkers for the project specified in the argument if the
+ * project exists, and is open.
+ *
+ * @param project
+ */
+ public void removeAllMarkers(IProject project) {
+ if (project == null || !project.isAccessible()) return;
+
+ // Clear out the problem markers
+ IWorkspace workspace = project.getWorkspace();
+ IMarker[] markers;
+ try {
+ markers = project.findMarkers(ICModelMarker.C_MODEL_PROBLEM_MARKER, true, IResource.DEPTH_INFINITE);
+ } catch (CoreException e) {
+ // Handled just about every case in the sanity check
+ return;
+ }
+ if (markers != null) {
+ try {
+ workspace.deleteMarkers(markers);
+ } catch (CoreException e) {
+ // The only situation that might cause this is some sort of resource change event
+ return;
+ }
+ }
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/AbstractConfigurationOption.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/AbstractConfigurationOption.java
new file mode 100644
index 0000000000..3fcf840aaf
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/AbstractConfigurationOption.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.core.configure;
+
+import java.util.ArrayList;
+
+public abstract class AbstractConfigurationOption implements IConfigureOption {
+
+ protected String name;
+ private String msgName;
+ protected AutotoolsConfiguration cfg;
+
+ public AbstractConfigurationOption(String name, AutotoolsConfiguration cfg) {
+ this(name, name, cfg);
+ }
+
+ public AbstractConfigurationOption(String name, String msgName, AutotoolsConfiguration cfg) {
+ this.name = name;
+ this.msgName = msgName;
+ this.cfg = cfg;
+ }
+
+ public String getDescription() {
+ return ConfigureMessages.getConfigureDescription(msgName);
+ }
+
+ public String getToolTip() {
+ return ConfigureMessages.getConfigureTip(msgName);
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public AutotoolsConfiguration getCfg() {
+ return cfg;
+ }
+
+ public ArrayList<String> getParameters() {
+ ArrayList<String> parameters = new ArrayList<String>();
+ if (isParmSet())
+ parameters.add(getParameter());
+ return parameters;
+ }
+
+ public String getParameterName() {
+ return "--" + getName();
+ }
+
+ public boolean isCategory() {
+ return false;
+ }
+
+ public boolean isMultiArg() {
+ return false;
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/AutotoolsConfiguration.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/AutotoolsConfiguration.java
new file mode 100644
index 0000000000..f6e1625baf
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/AutotoolsConfiguration.java
@@ -0,0 +1,320 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.core.configure;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+
+public class AutotoolsConfiguration implements IAConfiguration {
+
+ public static class Option {
+ private String name;
+ private String transformedName;
+ private int type;
+ private String defaultValue;
+
+ public Option(String name, int type) {
+ this(name, name, type);
+ }
+
+ public Option(String name, String transformedName, int type) {
+ this.name = name;
+ this.transformedName = transformedName;
+ this.type = type;
+ }
+
+ public Option(String name, String transformedName, String defaultValue, int type) {
+ this.name = name;
+ this.transformedName = transformedName;
+ this.type = type;
+ this.defaultValue = defaultValue;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public int getType() {
+ return type;
+ }
+
+ public String getDefaultValue() {
+ return defaultValue;
+ }
+
+ public String getDescription() {
+ return ConfigureMessages.getConfigureDescription(transformedName);
+ }
+
+ public String getToolTip() {
+ return ConfigureMessages.getConfigureTip(transformedName);
+ }
+ }
+
+ // Configure options and categories. List below is ordered.
+ // All options following a category are children of that category
+ // in a tree view, up to the next category.
+ private static Option[] configOpts = new Option[] {
+ new Option("configure", IConfigureOption.TOOL), // $NON-NLS-1$
+ new Option("general", IConfigureOption.CATEGORY), // $NON-NLS-1$
+ new Option("configdir", IConfigureOption.INTERNAL), // $NON-NLS-1$
+ new Option("cache-file", "cache_file", IConfigureOption.STRING), // $NON-NLS-1$
+ new Option("help", IConfigureOption.BIN), // $NON-NLS-1$
+ new Option("no-create", "no_create", IConfigureOption.BIN), // $NON-NLS-1$
+ new Option("quiet", IConfigureOption.BIN), // $NON-NLS-1$
+ new Option("version", IConfigureOption.BIN), // $NON-NLS-1$
+ new Option("platform", IConfigureOption.CATEGORY), // $NON-NLS-1$
+ new Option("host", IConfigureOption.STRING), // $NON-NLS-1$
+ new Option("build", IConfigureOption.STRING), // $NON-NLS-1$
+ new Option("target", IConfigureOption.STRING), // $NON-NLS-1$
+ new Option("directories", IConfigureOption.CATEGORY), // $NON-NLS-1$
+ new Option("prefix", IConfigureOption.STRING), // $NON-NLS-1$
+ new Option("exec-prefix", "exec_prefix", IConfigureOption.STRING), // $NON-NLS-1$
+ new Option("libdir", IConfigureOption.STRING), // $NON-NLS-1$
+ new Option("bindir", IConfigureOption.STRING), // $NON-NLS-1$
+ new Option("sbindir", IConfigureOption.STRING), // $NON-NLS-1$
+ new Option("includedir", IConfigureOption.STRING), // $NON-NLS-1$
+ new Option("datadir", IConfigureOption.STRING), // $NON-NLS-1$
+ new Option("sysconfdir", IConfigureOption.STRING), // $NON-NLS-1$
+ new Option("infodir", IConfigureOption.STRING), // $NON-NLS-1$
+ new Option("mandir", IConfigureOption.STRING), // $NON-NLS-1$
+ new Option("srcdir", IConfigureOption.STRING), // $NON-NLS-1$
+ new Option("localstatedir", IConfigureOption.STRING), // $NON-NLS-1$
+ new Option("sharedstatedir", IConfigureOption.STRING), // $NON-NLS-1$
+ new Option("libexecdir", IConfigureOption.STRING), // $NON-NLS-1$
+ new Option("oldincludedir", IConfigureOption.STRING), // $NON-NLS-1$
+ new Option("filenames", IConfigureOption.CATEGORY), // $NON-NLS-1$
+ new Option("program-prefix", "program_prefix", IConfigureOption.STRING), // $NON-NLS-1$
+ new Option("program-suffix", "program_suffix", IConfigureOption.STRING), // $NON-NLS-1$
+ new Option("program-transform-name", "program_transform_name", IConfigureOption.STRING), // $NON-NLS-1$
+ new Option("features", IConfigureOption.CATEGORY), // $NON-NLS-1$
+ new Option("enable-maintainer-mode", "enable_maintainer_mode", IConfigureOption.BIN), // $NON-NLS-1$
+ new Option("user", IConfigureOption.MULTIARG), // $NON-NLS-1$
+ new Option("autogen", "autogen", "autogen.sh", IConfigureOption.TOOL), // $NON-NLS-1$
+ new Option("options", IConfigureOption.CATEGORY), // $NON-NLS-1$
+ new Option("autogenOpts", IConfigureOption.MULTIARG), // $NON-NLS-1$
+ };
+
+ private static Option[] toolList;
+
+ private String id;
+ private boolean isDirty;
+ private boolean isParmsDirty;
+ private Map<String, IConfigureOption> configOptions;
+ private ArrayList<String> configParms = new ArrayList<String>();
+
+ public AutotoolsConfiguration(String name) {
+ this(name, true);
+ }
+
+ private AutotoolsConfiguration(String name, boolean initialize) {
+ this.id = name;
+ configOptions = new HashMap<String, IConfigureOption>();
+ if (initialize)
+ initConfigOptions();
+ isParmsDirty = true;
+ }
+
+ private void initConfigOptions() {
+ // Put configure options in hash map. Ignore categories.
+ ArrayList<Option> tools = new ArrayList<Option>();
+ for (int i = 0; i < configOpts.length; ++i) {
+ Option opt = configOpts[i];
+ String defaultValue = opt.getDefaultValue();
+ int type = opt.type;
+ switch (type) {
+ case IConfigureOption.BIN:
+ BinConfigureOption b = new BinConfigureOption(opt.name, opt.transformedName, this);
+ if (defaultValue != null)
+ b.setValue(defaultValue);
+ configOptions.put(opt.name, b);
+ break;
+ case IConfigureOption.STRING:
+ StringConfigureOption s = new StringConfigureOption(opt.name, opt.transformedName, this);
+ if (defaultValue != null)
+ s.setValue(defaultValue);
+ configOptions.put(opt.name, s);
+ break;
+ case IConfigureOption.INTERNAL:
+ InternalConfigureOption io = new InternalConfigureOption(opt.name, opt.transformedName, this);
+ if (defaultValue != null)
+ io.setValue(defaultValue);
+ configOptions.put(opt.name, io);
+ break;
+ case IConfigureOption.MULTIARG:
+ MultiArgConfigureOption m = new MultiArgConfigureOption(opt.name, opt.transformedName, this);
+ if (defaultValue != null)
+ m.setValue(defaultValue);
+ configOptions.put(opt.name, m);
+ break;
+ case IConfigureOption.TOOL:
+ tools.add(opt);
+ ConfigureTool t = new ConfigureTool(opt.name, opt.transformedName, this);
+ if (defaultValue != null)
+ t.setValue(defaultValue);
+ configOptions.put(opt.name, t);
+ break;
+ case IConfigureOption.CATEGORY:
+ configOptions.put(opt.name, new ConfigureOptionCategory(opt.name));
+ }
+ }
+ toolList = tools.toArray(new Option[tools.size()]);
+ }
+
+ public static Option[] getOptionList() {
+ return configOpts;
+ }
+
+ public static Option[] getChildOptions(String name) {
+ ArrayList<Option> options = new ArrayList<Option>();
+ for (int i = 0; i < configOpts.length; ++i) {
+ Option opt = configOpts[i];
+ if (opt.getName().equals(name)) {
+ if (opt.getType() == IConfigureOption.CATEGORY) {
+ for (int j = i + 1; j < configOpts.length; ++j) {
+ Option o = configOpts[j];
+ int type = o.getType();
+ if (type != IConfigureOption.CATEGORY &&
+ type != IConfigureOption.TOOL)
+ options.add(o);
+ else
+ return options.toArray(new Option[options.size()]);
+ }
+ } else if (opt.getType() == IConfigureOption.TOOL) {
+ for (int j = i + 1; j < configOpts.length; ++j) {
+ Option o = configOpts[j];
+ int type = o.getType();
+ if (type == IConfigureOption.CATEGORY)
+ options.add(o);
+ else if (type == IConfigureOption.TOOL)
+ return options.toArray(new Option[options.size()]);
+ }
+ }
+ }
+ }
+ return options.toArray(new Option[options.size()]);
+ }
+
+ public static Option[] getTools() {
+ return toolList;
+ }
+
+ public IConfigureOption getOption(String name) {
+ return configOptions.get(name);
+ }
+
+ public IAConfiguration copy() {
+ return copy(id);
+ }
+
+ public IAConfiguration copy(String newId) {
+ AutotoolsConfiguration cfg = new AutotoolsConfiguration(newId, false);
+ Collection<IConfigureOption> oldValues = configOptions.values();
+ for (Iterator<IConfigureOption> i = oldValues.iterator(); i.hasNext();) {
+ IConfigureOption opt = i.next();
+ cfg.configOptions.put(opt.getName(), opt.copy(cfg));
+ }
+ if (getId().equals(newId))
+ cfg.setDirty(isDirty()); // copying with same id, do not change dirty attribute
+ else
+ cfg.setDirty(true); // we are cloning with a new id, treat it as never built/dirty
+ return cfg;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public boolean isDirty() {
+ return isDirty;
+ }
+
+ public void setDirty(boolean value) {
+ isDirty = value;
+ if (isDirty)
+ isParmsDirty = true;
+ }
+
+ public Map<String, IConfigureOption> getOptions() {
+ return configOptions;
+ }
+
+ public String getToolParameters(String name) {
+ StringBuffer buf = new StringBuffer();
+ Option[] options = getChildOptions(name);
+ for (int i = 0; i < options.length; ++i) {
+ IConfigureOption option = getOption(options[i].getName());
+ if (option.getType() == IConfigureOption.CATEGORY) {
+ Option[] childOptions = getChildOptions(option.getName());
+ for (int j = 0; j < childOptions.length; ++j) {
+ IConfigureOption childOption = getOption(childOptions[j].getName());
+ String parameter = childOption.getParameter();
+ if (!parameter.equals(""))
+ buf.append(" " + parameter);
+ }
+ } else {
+ String parameter = option.getParameter();
+ if (!parameter.equals(""))
+ buf.append(" " + parameter);
+ }
+ }
+ return buf.toString();
+ }
+
+ public ArrayList<String> getToolArgs(String name) {
+ if (isParmsDirty) {
+ configParms = new ArrayList<String>();
+ Option[] options = getChildOptions(name);
+ for (int i = 0; i < options.length; ++i) {
+ IConfigureOption option = getOption(options[i].getName());
+ if (option.getType() == IConfigureOption.CATEGORY) {
+ Option[] childOptions = getChildOptions(option.getName());
+ for (int j = 0; j < childOptions.length; ++j) {
+ IConfigureOption childOption = getOption(childOptions[j].getName());
+ ArrayList<String> parameters = childOption.getParameters();
+ configParms.addAll(parameters);
+ }
+ } else {
+ ArrayList<String> parameters = option.getParameters();
+ configParms.addAll(parameters);
+ }
+ }
+ }
+ return configParms;
+ }
+
+ public void setOption(String name, String value) {
+ IConfigureOption option = configOptions.get(name);
+ if (option != null) {
+ if (!option.getValue().equals(value)) {
+ option.setValue(value);
+ setDirty(true);
+ }
+ }
+ }
+
+ public void setConfigToolDirectory(String configToolDirectory) {
+ setOption("configdir", configToolDirectory);
+ }
+
+ public String getConfigToolDirectory() {
+ IConfigureOption option = configOptions.get("configdir");
+ return option.getValue();
+ }
+
+ public void setDefaultOptions() {
+ initConfigOptions();
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/AutotoolsConfigurationManager.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/AutotoolsConfigurationManager.java
new file mode 100644
index 0000000000..161feaf867
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/AutotoolsConfigurationManager.java
@@ -0,0 +1,486 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.core.configure;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.eclipse.cdt.core.model.CoreModel;
+import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
+import org.eclipse.cdt.core.settings.model.ICProjectDescription;
+import org.eclipse.cdt.core.settings.model.extension.CConfigurationData;
+import org.eclipse.cdt.managedbuilder.core.BuildException;
+import org.eclipse.cdt.managedbuilder.core.IConfiguration;
+import org.eclipse.cdt.managedbuilder.core.IHoldsOptions;
+import org.eclipse.cdt.managedbuilder.core.IOption;
+import org.eclipse.cdt.managedbuilder.core.ITool;
+import org.eclipse.cdt.managedbuilder.core.IToolChain;
+import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
+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.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.linuxtools.cdt.autotools.core.AutotoolsPlugin;
+import org.eclipse.linuxtools.internal.cdt.autotools.core.configure.AutotoolsConfiguration.Option;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+public class AutotoolsConfigurationManager implements IResourceChangeListener {
+
+ public final static String CFG_FILE_NAME = ".autotools"; //$NON-NLS-1$
+ private final static String CFG_CANT_SAVE = "Configure.Error.NoProjectToSave"; //$NON-NLS-1$
+
+
+ private static AutotoolsConfigurationManager instance;
+
+ private boolean isSyncing;
+
+ private static Map<String, Map<String, IAConfiguration>> configs;
+ private static Map<String, Map<String, IAConfiguration>> tmpConfigs;
+
+ private AutotoolsConfigurationManager() {
+ configs = new HashMap<String, Map<String, IAConfiguration>>();
+ tmpConfigs = new HashMap<String, Map<String, IAConfiguration>>();
+ AutotoolsPlugin.getWorkspace().addResourceChangeListener(this);
+ }
+
+ public static AutotoolsConfigurationManager getInstance() {
+ if (instance == null) {
+ instance = new AutotoolsConfigurationManager();
+ }
+ return instance;
+ }
+
+ public IAConfiguration createDefaultConfiguration(IProject project, String id) {
+ IAConfiguration cfg = new AutotoolsConfiguration(id);
+ return cfg;
+ }
+
+ public IAConfiguration findCfg(IProject p, String id) {
+ Map<String, IAConfiguration> cfgs = getConfigurations(p);
+ return cfgs.get(id);
+ }
+
+ public IAConfiguration getConfiguration(IProject p, String cfgId) {
+ return getConfiguration(p, cfgId, true);
+ }
+
+ public IAConfiguration getConfiguration(IProject p, String cfgId, boolean persist) {
+ IAConfiguration cfg = findCfg(p, cfgId);
+ if (cfg == null) {
+ cfg = createDefaultConfiguration(p, cfgId);
+ if (persist) {
+ addConfiguration(p, cfg);
+ }
+ } else {
+ if (!persist) {
+ cfg = cfg.copy();
+ }
+ }
+ return cfg;
+ }
+
+
+ public boolean isConfigurationAlreadySaved(IProject project, ICConfigurationDescription cfgd) {
+ Map<String, IAConfiguration> cfgs = getSavedConfigs(project);
+ if (cfgs != null)
+ return cfgs.get(cfgd.getId()) != null;
+ return false;
+ }
+
+ public void addConfiguration(IProject project, IAConfiguration cfg) {
+ String projectName = project.getName();
+ Map<String, IAConfiguration> cfgs = getSavedConfigs(project);
+ if (cfgs == null) {
+ cfgs = new HashMap<String, IAConfiguration>();
+ configs.put(projectName, cfgs);
+ }
+ cfgs.put(cfg.getId(), cfg);
+ saveConfigs(project);
+ }
+
+ public boolean isSyncing() {
+ return isSyncing;
+ }
+
+ private void setSyncing(boolean value) {
+ isSyncing = value;
+ }
+
+ /**
+ * Synchronize the current set of configurations for the project with the
+ * Autotools saved configuration data. This is required when configuration
+ * management occurs outside of the Autotools Configure Settings page in the
+ * Property menu.
+ *
+ * @param project to synchronize configurations for
+ *
+ */
+ public void syncConfigurations(IProject project) {
+ setSyncing(true);
+ clearTmpConfigurations(project);
+ ICProjectDescription pd = CoreModel.getDefault().getProjectDescription(project);
+ ICConfigurationDescription[] cfgs = pd.getConfigurations();
+ Map <String, IAConfiguration> newCfgList = new HashMap<String, IAConfiguration>();
+ for (int i = 0; i < cfgs.length; ++i) {
+ cfgs[i].getConfigurationData();
+ IAConfiguration acfg = getTmpConfiguration(project, cfgs[i]);
+ newCfgList.put(cfgs[i].getId(), acfg);
+ }
+ setSyncing(false);
+ clearTmpConfigurations(project);
+ replaceProjectConfigurations(project, newCfgList);
+ }
+
+ public void replaceProjectConfigurations(IProject project, Map<String, IAConfiguration> cfgs) {
+ String projectName = project.getName();
+ configs.put(projectName, cfgs);
+ saveConfigs(project);
+ }
+
+ public void replaceProjectConfigurations(IProject project, Map<String, IAConfiguration> cfgs, ICConfigurationDescription[] cfgds) {
+ String projectName = project.getName();
+ configs.put(projectName, cfgs);
+ saveConfigs(project, cfgds);
+ }
+
+ private Map<String, IAConfiguration> getSavedConfigs(IProject project) {
+ String projectName = project.getName();
+ Map<String, IAConfiguration> list = configs.get(projectName);
+ if (list == null) {
+ try {
+ IPath fileLocation = project.getLocation().append(CFG_FILE_NAME);
+ File dirFile = fileLocation.toFile();
+ Map<String, IAConfiguration> cfgList = new HashMap<String, IAConfiguration>();
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ DocumentBuilder db = dbf.newDocumentBuilder();
+ if (dirFile.exists()) {
+ Document d = db.parse(dirFile);
+ Element e = d.getDocumentElement();
+ // Get the stored configuration data
+ NodeList cfgs = e.getElementsByTagName("configuration"); // $NON-NLS-1$
+ for (int x = 0; x < cfgs.getLength(); ++x) {
+ Node n = cfgs.item(x);
+ NamedNodeMap attrs = n.getAttributes();
+ // Originally we used the configuration name, but now we use
+ // the ConfigurationDescription id which is unique. Check for
+ // id first, but fall back to name for older .autotools files.
+ Node nameNode = attrs.getNamedItem("name"); // $NON-NLS-1$
+ Node cfgIdNode = attrs.getNamedItem("id"); // $NON-NLS-1$
+ String cfgId = null;
+ if (cfgIdNode != null)
+ cfgId = cfgIdNode.getNodeValue();
+ else if (nameNode != null) {
+ String cfgName = nameNode.getNodeValue();
+ ICConfigurationDescription cfgd =
+ CoreModel.getDefault().getProjectDescription(project).getConfigurationByName(cfgName);
+ if (cfgd != null)
+ cfgId = cfgd.getId();
+ else
+ continue; // have to punt, this doesn't map to real cfg
+ }
+ IAConfiguration cfg = new AutotoolsConfiguration(cfgId);
+ NodeList l = n.getChildNodes();
+ for (int y = 0; y < l.getLength(); ++y) {
+ Node child = l.item(y);
+ if (child.getNodeName().equals("option")) { // $NON-NLS-1$
+ NamedNodeMap optionAttrs = child.getAttributes();
+ Node id = optionAttrs.getNamedItem("id"); // $NON-NLS-1$
+ Node value = optionAttrs.getNamedItem("value"); // $NON-NLS-1$
+ if (id != null && value != null)
+ cfg.setOption(id.getNodeValue(), value.getNodeValue());
+ }
+ }
+ cfg.setDirty(false);
+ cfgList.put(cfg.getId(), cfg);
+ }
+ if (cfgList.size() > 0) {
+ configs.put(projectName, cfgList);
+ list = cfgList;
+ }
+ }
+ } catch (ParserConfigurationException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (SAXException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ return list;
+ }
+
+ public IAConfiguration getTmpConfiguration(IProject p, ICConfigurationDescription cfgd) {
+ Map <String, IAConfiguration> list = getTmpConfigs(p);
+ IAConfiguration acfg = list.get(cfgd.getId());
+ if (acfg != null) {
+ return acfg;
+ }
+ IAConfiguration oldCfg = getConfiguration(p, cfgd.getId(), false);
+ list.put(cfgd.getId(), oldCfg);
+ return oldCfg;
+ }
+
+ /**
+ * Clone a configuration and put it on the tmp list if it is not already a saved configuration
+ * and not already on the tmp list.
+ *
+ * @param p project
+ * @param oldId the id of the old configuration to clone
+ * @param cfgd the configuration descriptor for the clone
+ * @return true if the configuration is already saved, false otherwise
+ */
+ public boolean cloneCfg(IProject p, String oldId, ICConfigurationDescription cfgd) {
+ if (isConfigurationAlreadySaved(p, cfgd))
+ return true;
+ Map <String, IAConfiguration> tmpList = getTmpConfigs(p);
+ String newId = cfgd.getId();
+ // Don't bother if the new configuration is already on the tmp list
+ IAConfiguration cfg = tmpList.get(newId);
+ if (cfg != null)
+ return false;
+ // Otherwise, try and find the old id to copy the configuration from
+ // or punt if not found
+ Map <String, IAConfiguration> savedList = getSavedConfigs(p);
+ IAConfiguration oldCfg = savedList.get(oldId);
+ if (oldCfg != null) {
+ IAConfiguration newCfg = oldCfg.copy(cfgd.getId());
+ tmpList.put(cfgd.getId(), newCfg);
+ // Check to see if the new configuration is already stored as part of the project description.
+ // If yes, it should already be saved. This can occur if the configuration was added as part of
+ // another CDT Property page and the Autotools Property page was never opened.
+ if (CoreModel.getDefault().getProjectDescription(p).getConfigurationById(newId) != null) {
+ addConfiguration(p, newCfg);
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private Map<String, IAConfiguration> getTmpConfigs(IProject p) {
+ Map <String, IAConfiguration> tmpList = tmpConfigs.get(p.getName());
+ if (tmpList == null) {
+ tmpList = new HashMap<String, IAConfiguration>();
+ tmpConfigs.put(p.getName(), tmpList);
+ }
+ return tmpList;
+ }
+
+ public void clearTmpConfigurations(IProject p) {
+ tmpConfigs.remove(p.getName());
+ }
+
+ public void saveConfigs(IProject project) {
+ ICConfigurationDescription[] cfgds = CoreModel.getDefault().getProjectDescription(project).getConfigurations();
+ saveConfigs(project, cfgds);
+ }
+
+ private void syncNameField(ICConfigurationDescription cfgd) {
+ IConfiguration icfg = ManagedBuildManager.getConfigurationForDescription(cfgd);
+ String id = cfgd.getId();
+ if (icfg != null) {
+ IToolChain toolchain = icfg.getToolChain();
+ ITool[] tools = toolchain.getTools();
+ for (int j = 0; j < tools.length; ++j) {
+ ITool tool = tools[j];
+ if (tool.getName().equals("configure")) { //$NON-NLS-1$
+ IOption option =
+ tool.getOptionBySuperClassId("org.eclipse.linuxtools.cdt.autotools.core.option.configure.name"); // $NON-NLS-1$
+ IHoldsOptions h = (IHoldsOptions)tool;
+ try {
+ IOption optionToSet = h.getOptionToSet(option, false);
+ optionToSet.setValue(id);
+ } catch (BuildException e) {
+ }
+ }
+ }
+ }
+ }
+
+
+ private void saveConfigs(IProject project, ICConfigurationDescription[] cfgds) {
+ try {
+ String projectName = project.getName();
+ IPath output = project.getLocation().append(CFG_FILE_NAME);
+ File f = output.toFile();
+ if (!f.exists())
+ f.createNewFile();
+ if (f.exists()) {
+ PrintWriter p = new PrintWriter(new BufferedWriter(new FileWriter(f)));
+ Map<String, IAConfiguration> cfgs = configs.get(projectName);
+ p.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); //$NON-NLS-1$
+ p.println("<configurations>"); // $NON-NLS-1$
+ Option[] optionList = AutotoolsConfiguration.getOptionList();
+ // Before saving, force any cloning to occur via the option value handler.
+ setSyncing(true);
+ for (int i = 0; i < cfgds.length; ++i) {
+ @SuppressWarnings("unused")
+ CConfigurationData data = cfgds[i].getConfigurationData();
+ }
+ setSyncing(false);
+ for (int i = 0; i < cfgds.length; ++i) {
+ ICConfigurationDescription cfgd = cfgds[i];
+ String id = cfgd.getId();
+ IAConfiguration cfg = cfgs.get(id);
+ if (cfg == null) {
+ cfg = createDefaultConfiguration(project, id);
+ }
+ p.println("<configuration id=\"" + cfg.getId() + "\">"); //$NON-NLS-1$ //$NON-NLS-2$
+ for (int j = 0; j < optionList.length; ++j) {
+ Option option = optionList[j];
+ IConfigureOption opt = cfg.getOption(option.getName());
+ if (!opt.isCategory())
+ p.println("<option id=\"" + option.getName() + "\" value=\"" + opt.getValue() + "\"/>"); //$NON-NLS-1$ //$NON-NLS-2$ // $NON-NLS-3$
+ }
+ p.println("</configuration>"); //$NON-NLS-1$
+ // Sync name field as this configuration is now officially saved
+ syncNameField(cfgd);
+ }
+ p.println("</configurations>");
+ p.close();
+ }
+ } catch (IOException e) {
+ AutotoolsPlugin.log(e);
+ }
+ }
+
+ // Perform apply of configuration changes. This rewrites out the current known list of configurations
+ // with any changes currently that have been made to them. If a configuration has been renamed, but this
+ // has not yet been confirmed by the end-user, then only the changes to the configuration are made. The
+ // name currently remains the same in the output file.
+ public void applyConfigs(String projectName, ICConfigurationDescription[] cfgds) {
+ try {
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+ IResource res = (IProject)root.findMember(projectName, false);
+ if (res == null || res.getType() != IResource.PROJECT) {
+ AutotoolsPlugin.logErrorMessage(ConfigureMessages.getFormattedString(CFG_CANT_SAVE,
+ new String[]{projectName}));
+ return;
+ }
+ IProject project = (IProject)res;
+ IPath output = project.getLocation().append(CFG_FILE_NAME);
+ File f = output.toFile();
+ if (!f.exists())
+ f.createNewFile();
+ if (f.exists()) {
+ PrintWriter p = new PrintWriter(new BufferedWriter(new FileWriter(f)));
+ Map<String, IAConfiguration> cfgs = getSavedConfigs(project);
+ if (cfgs == null)
+ return;
+ p.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); //$NON-NLS-1$
+ p.println("<configurations>"); // $NON-NLS-1$
+ Option[] optionList = AutotoolsConfiguration.getOptionList();
+ HashSet<String> savedIds = new HashSet<String>();
+ setSyncing(true);
+ for (int x = 0; x < cfgds.length; ++x) {
+ ICConfigurationDescription cfgd = cfgds[x];
+ @SuppressWarnings("unused")
+ CConfigurationData data = cfgd.getConfigurationData();
+ String id = cfgd.getId();
+ savedIds.add(id);
+ IAConfiguration cfg = getTmpConfiguration(project, cfgd);
+ cfgs.put(id, cfg); // add to list in case we have a new configuration not yet added to Project Description
+ p.println("<configuration id=\"" + id + "\">"); //$NON-NLS-1$ //$NON-NLS-2$
+ for (int j = 0; j < optionList.length; ++j) {
+ Option option = optionList[j];
+ IConfigureOption opt = cfg.getOption(option.getName());
+ if (!opt.isCategory())
+ p.println("<option id=\"" + option.getName() + "\" value=\"" + opt.getValue() + "\"/>"); //$NON-NLS-1$ //$NON-NLS-2$ // $NON-NLS-3$
+ }
+ p.println("</configuration>"); //$NON-NLS-1$
+ syncNameField(cfgd);
+ }
+ setSyncing(false);
+
+ // Put all the remaining configurations already saved back into the file.
+ // These represent deleted configurations, but confirmation has not occurred.
+ for (Iterator<String> i = cfgs.keySet().iterator(); i.hasNext(); ) {
+ String id = i.next();
+ // A remaining id won't appear in our savedIds list.
+ if (!savedIds.contains(id)) {
+ IAConfiguration cfg = cfgs.get(id);
+ p.println("<configuration id=\"" + id + "\">"); //$NON-NLS-1$ //$NON-NLS-2$
+ for (int j = 0; j < optionList.length; ++j) {
+ Option option = optionList[j];
+ IConfigureOption opt = cfg.getOption(option.getName());
+ if (!opt.isCategory())
+ p.println("<option id=\"" + option.getName() + "\" value=\"" + opt.getValue() + "\"/>"); //$NON-NLS-1$ //$NON-NLS-2$ // $NON-NLS-3$
+ }
+ p.println("</configuration>"); //$NON-NLS-1$
+ }
+ }
+ p.println("</configurations>");
+ p.close();
+ }
+ } catch (IOException e) {
+ AutotoolsPlugin.log(e);
+ }
+ }
+
+ public Map<String, IAConfiguration> getConfigurations(IProject project) {
+ Map<String, IAConfiguration> list = getSavedConfigs(project);
+ if (list == null) {
+ list = new HashMap<String, IAConfiguration>();
+ configs.put(project.getName(), list);
+ }
+ return list;
+ }
+
+ public void resourceChanged(IResourceChangeEvent event) {
+ IResource res = event.getResource();
+ if (!(res instanceof IProject))
+ return;
+ String name = res.getName();
+ IResourceDelta delta = event.getDelta();
+ int kind = delta.getKind();
+ if (configs.containsKey(name)) {
+ if (kind == IResourceDelta.REMOVED) {
+ configs.remove(name);
+ tmpConfigs.remove(name);
+ } else if (kind == IResourceDelta.CHANGED) {
+ int flags = delta.getFlags();
+ if ((flags & IResourceDelta.MOVED_TO) != 0) {
+ IPath path = delta.getMovedToPath();
+ Map<String, IAConfiguration> cfgs = configs.get(name);
+ String newName = path.lastSegment();
+ configs.remove(name);
+ configs.put(newName, cfgs);
+ Map<String, IAConfiguration> tmpcfgs = tmpConfigs.get(name);
+ tmpConfigs.remove(name);
+ tmpConfigs.put(newName, tmpcfgs);
+ }
+ }
+ }
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/AutotoolsOptionValueHandler.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/AutotoolsOptionValueHandler.java
new file mode 100644
index 0000000000..b707d3ef64
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/AutotoolsOptionValueHandler.java
@@ -0,0 +1,124 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.core.configure;
+
+import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
+import org.eclipse.cdt.managedbuilder.core.BuildException;
+import org.eclipse.cdt.managedbuilder.core.IBuildObject;
+import org.eclipse.cdt.managedbuilder.core.IBuilder;
+import org.eclipse.cdt.managedbuilder.core.IConfiguration;
+import org.eclipse.cdt.managedbuilder.core.IHoldsOptions;
+import org.eclipse.cdt.managedbuilder.core.IManagedOptionValueHandler;
+import org.eclipse.cdt.managedbuilder.core.IOption;
+import org.eclipse.cdt.managedbuilder.core.IOptionApplicability;
+import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
+import org.eclipse.cdt.managedbuilder.core.ManagedOptionValueHandler;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.linuxtools.cdt.autotools.core.AutotoolsPlugin;
+import org.eclipse.linuxtools.internal.cdt.autotools.core.AutotoolsPropertyConstants;
+
+public class AutotoolsOptionValueHandler extends ManagedOptionValueHandler
+ implements IOptionApplicability {
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.managedbuilder.core.IManagedOptionValueHandler#handleValue(IConfiguration,IToolChain,IOption,String,int)
+ */
+
+ public final static String DEFAULT_BUILD_DIR = "build"; //$NON-NLS-1$
+ public final static String CONFIGURE_TOOL_ID = AutotoolsPlugin.PLUGIN_ID + ".gnu.toolchain.tool.configure"; //$NON-NLS-1$
+ public final static String BUILD_DIR_OPTION_ID = AutotoolsPlugin.PLUGIN_ID + ".option.configure.builddir"; //$NON-NLS-1$
+ public final static String BUILD_DIR_APPLY = "BuildDir.apply"; //$NON-NLS-1$
+ public final static String BUILD_DIR_DEFAULT_QUESTION = "BuildDir.default"; //$NON-NLS-1$
+ public final static String BUILD_DIR_YES = "BuildDir.yes"; //$NON-NLS-1$
+ public final static String BUILD_DIR_NO = "BuildDir.no"; //$NON-NLS-1$
+
+ //FIXME: Use holder to set option value, not the "option" parameter
+ public boolean handleValue(IBuildObject buildObject,
+ IHoldsOptions holder,
+ IOption option,
+ String extraArgument, int event)
+ {
+ // Get the current value of the build dir option.
+ String value = (String)option.getValue();
+
+ if (buildObject instanceof IConfiguration &&
+ (event == IManagedOptionValueHandler.EVENT_OPEN)) {
+// SortedSet<Integer> nums = new TreeSet<Integer>();
+ IConfiguration configuration = (IConfiguration)buildObject;
+ ICConfigurationDescription cfgd = ManagedBuildManager.getDescriptionForConfiguration(configuration);
+ if (option.getName().equals("Name") && cfgd != null) {
+ String cfgId = cfgd.getId();
+ if (!value.equals("") && !value.equals(cfgId)) {
+ // we have a cloned configuration and we know that the
+ // clonee's name is the value of the option
+ IProject project = (IProject)configuration.getManagedProject().getOwner();
+ String autoName = null;
+ String autoNameTemplate = null;
+ // Check if we are supposed to automatically name the build directory for any
+ // new configuration. If yes, generate a build directory under the project using
+ // the configuration name which must be unique.
+ try {
+ autoName = project.getPersistentProperty(AutotoolsPropertyConstants.AUTO_BUILD_NAME);
+ } catch (CoreException e) {
+ // ignore
+ }
+ if (autoName == null || autoName.equals(AutotoolsPropertyConstants.TRUE)) {
+ autoNameTemplate = "${workspace_loc:/" + project.getName() + // $NON-NLS-1$
+ "}/build-" + fixName(configuration.getName()); // $NON-NLS-1$
+ IBuilder cfgBuilder = configuration.getEditableBuilder();
+ cfgBuilder.setBuildPath(autoNameTemplate);
+ }
+ // Clone old configuration to tmp configuration list
+ boolean isSaved = AutotoolsConfigurationManager.getInstance().cloneCfg(project, value, cfgd);
+ // Check to see if we should patch up the name option. If we aren't synchronizing
+ // configurations or the configuration isn't already saved, we leave the name field alone
+ // so we will trigger this again when the clone will get used.
+ if (!isSaved && !AutotoolsConfigurationManager.getInstance().isSyncing()) {
+ return true;
+ }
+ }
+ try {
+ IOption optionToSet = holder.getOptionToSet(option, false);
+ optionToSet.setValue(cfgId);
+ } catch (BuildException e) {
+ return false;
+ }
+ }
+ }
+
+ // The event was not handled, thus return false
+ return true;
+ }
+
+ private String fixName(String cfgName) {
+ // Replace whitespace with underscores.
+ return cfgName.replaceAll("\\s", "_");
+ }
+
+ // IOptionApplicability methods
+
+ public boolean isOptionEnabled(IBuildObject configuration,
+ IHoldsOptions holder, IOption option) {
+ return true;
+ }
+
+ public boolean isOptionUsedInCommandLine(IBuildObject configuration,
+ IHoldsOptions holder, IOption option) {
+ return false;
+ }
+
+ public boolean isOptionVisible(IBuildObject configuration,
+ IHoldsOptions holder, IOption option) {
+ return true;
+ }
+
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/BinConfigureOption.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/BinConfigureOption.java
new file mode 100644
index 0000000000..fb885bd641
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/BinConfigureOption.java
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.core.configure;
+
+public class BinConfigureOption extends AbstractConfigurationOption {
+
+ private boolean value;
+
+ public BinConfigureOption(String name, AutotoolsConfiguration cfg) {
+ super(name, cfg);
+ }
+
+ public BinConfigureOption(String name, String msgName, AutotoolsConfiguration cfg) {
+ super(name, msgName, cfg);
+ }
+
+ private BinConfigureOption(String name, AutotoolsConfiguration cfg, boolean value) {
+ super(name, cfg);
+ this.value = value;
+ }
+
+ public boolean isParmSet() {
+ return value;
+ }
+
+ public String getParameter() {
+ if (isParmSet())
+ return getParameterName();
+ else
+ return ""; // $NON-NLS-1$
+ }
+
+ public String getValue() {
+ return Boolean.toString(value);
+ }
+
+ public void setValue(String value) {
+ boolean oldValue = this.value;
+ if (value.equals("true")) // $NON-NLS-1$
+ this.value = true;
+ else
+ this.value = false;
+ if (this.value != oldValue)
+ cfg.setDirty(true);
+ }
+
+ public IConfigureOption copy(AutotoolsConfiguration config) {
+ return new BinConfigureOption(name, config, value);
+ }
+
+ public int getType() {
+ return BIN;
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/ConfigureMessages.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/ConfigureMessages.java
new file mode 100644
index 0000000000..f51e5ff8ea
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/ConfigureMessages.java
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2007, 2009 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.core.configure;
+
+import java.text.MessageFormat;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class ConfigureMessages {
+ private static final String BUNDLE_NAME = ConfigureMessages.class.getName();
+
+ private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
+ .getBundle(BUNDLE_NAME);
+
+ private ConfigureMessages() {
+ }
+
+ public static String getConfigureDescription(String name) {
+ return getString("Option.configure." + name); //$NON-NLS-11$
+ }
+
+ public static String getConfigureTip(String name) {
+ return getString("Option.configure." + name + ".tip"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ /**
+ * Returns the string from the resource bundle,
+ * or 'key' if not found.
+ *
+ * @param key the message key
+ * @return the resource bundle message
+ */
+ public static String getString(String key) {
+ try {
+ return RESOURCE_BUNDLE.getString(key);
+ } catch (MissingResourceException e) {
+ return '!' + key + '!';
+ }
+ }
+
+ /**
+ * Returns the formatted string from the resource bundle,
+ * or 'key' if not found.
+ *
+ * @param key the message key
+ * @param args an array of substituition strings
+ * @return the resource bundle message
+ */
+ public static String getFormattedString(String key, String[] args) {
+ return MessageFormat.format(getString(key), (Object[])args);
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/ConfigureMessages.properties b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/ConfigureMessages.properties
new file mode 100644
index 0000000000..32c745e373
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/ConfigureMessages.properties
@@ -0,0 +1,91 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+Option.configure.configure=configure
+Option.configure.general=General
+Option.configure.builddir=Build directory
+Option.configure.builddir.tip=Subdirectory off of project where build will occur
+Option.configure.configdir=Configure tool directory
+Option.configure.configdir.tip=Subdirectory off of project where configure script resides
+Option.configure.cache_file=Name of cache file (--cache-file)
+Option.configure.cache_file.tip=Specify the name of the configuration cache file [config.cache]
+Option.configure.no_create=Turn off file creation <not advised> (--no-create)
+Option.configure.no_create.tip=This tells configuration not to generate the output files as part of configuration
+Option.configure.quiet=Turn off checking messages (--quiet)
+Option.configure.quiet.tip=This turns off "checking ..." style messages from the configuration console output
+Option.configure.help=Display help contents (--help)
+Option.configure.help.tip=Ask configuration file to display its help documentation
+Option.configure.version=Display version of autotools used (--version)
+Option.configure.version.tip=This outputs the version of the Autotools used to create the configuration files
+
+Option.configure.platform=Platform specifiers
+Option.configure.host=Host platform (--host)
+Option.configure.host.tip=Platform that project will run on
+Option.configure.target=Target platform (--target)
+Option.configure.target.tip=Platform that project will target output for
+Option.configure.build=Build platform (--build)
+Option.configure.build.tip=Platform where project is being built
+
+Option.configure.directories=Directory specifiers
+Option.configure.prefix=Arch-independent install directory (--prefix)
+Option.configure.prefix.tip=Place where architecture-independent files are installed [/usr/local]
+Option.configure.exec_prefix=Arch-dependent install directory (--exec-prefix)
+Option.configure.exec_prefix.tip=Place where architecture-dependent files are installed [PREFIX]
+Option.configure.libdir=Object code library directory (--libdir)
+Option.configure.libdir.tip=Place where object code libraries are installed [EPREFIX/lib]
+Option.configure.bindir=User executable directory (--bindir)
+Option.configure.bindir.tip=Place where binary executables are installed [EPREFIX/bin]
+Option.configure.sbindir=System admin executable directory (--sbindir)
+Option.configure.sbindir.tip=Place where system admin executables are installed [EPREFIX/sbin]
+Option.configure.includedir=C Header file directory (--includdir)
+Option.configure.includedir.tip=Place where header files will be installed [PREFIX/include]
+Option.configure.datadir=Read-only arch-independent data (--datadir)
+Option.configure.datadir.tip=Place where read-only architecture-independent data is installed [PREFIX/share]
+Option.configure.sysconfdir=Read-only single-machine data directory (--sysconfdir)
+Option.configure.sysconfdir.tip=Place where read-only single-machine data is stored [PREFIX/etc]
+Option.configure.infodir=Info file directory (--infodir)
+Option.configure.infodir.tip=Place where info files are installed [PREFIX/info]
+Option.configure.mandir=Man file documentation directory (--mandir)
+Option.configure.mandir.tip=Place where man file documentation is installed [PREFIX/man]
+Option.configure.srcdir=Sources directory (--srcdir)
+Option.configure.srcdir.tip=Place where configure can find sources [configure directory or ..]
+Option.configure.localstatedir=Single-machine data directory (--localstatedir)
+Option.configure.localstatedir.tip=Place where modifiable single-machine data is installed [PREFIX/var]
+Option.configure.sharedstatedir=Arch-independent data directory (--sharedstatedir)
+Option.configure.sharedstatedir.tip=Place where modifiable architecture-independent data is installed [PREFIX/com}
+Option.configure.libexecdir=Program executable directory (--libexecdir)
+Option.configure.libexecdir.tip=Place where program executables will be installed [EPREFIX/libexec]
+Option.configure.oldincludedir=Non-gcc C header file directory (--oldincludedir)
+Option.configure.oldincludedir.tip=Place where non-gcc C header files are installed [/usr/include]
+
+Option.configure.filenames=File-name transformations
+Option.configure.program_prefix=Program prefix (--program-prefix)
+Option.configure.program_prefix.tip=Prepend PREFIX to the beginning of installed program names
+Option.configure.program_suffix=Program suffix (--program-suffix)
+Option.configure.program_suffix.tip=Append SUFFIX to the end of installed program names
+Option.configure.program_transform_name=Program name transform (--program-transform-name)
+Option.configure.program_transform_name.tip=A sed string used to transform installed program names
+
+Option.configure.features=Advanced
+Option.configure.enable_maintainer_mode=Enable maintainer mode (--enable-maintainer-mode)
+Option.configure.enable_maintainer_mode.tip=Specify this to have Makefiles generated with checks for Autotool configuration file changes
+Option.configure.user=Additional command-line options
+Option.configure.user.tip=Specify one or more configuration options (e.g. --enable-FEATURE, --disable-FEATURE, or --with-PACKAGE)
+
+Option.configure.autogen=autogen
+Option.configure.options=Options
+Option.configure.autogenOpts=Additional command-line options
+Option.configure.autogenOpts.tip=Specify any additional options required
+
+Tool.command=Command
+Tool.allopts=All Options
+
+Configure.Error.AlreadyExists="A configuration named {0} already exists"
+Configure.Error.NoProjectToSave="Project: {0} does not exist at time of saving configuration" \ No newline at end of file
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/ConfigureOptionCategory.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/ConfigureOptionCategory.java
new file mode 100644
index 0000000000..90e6cb74f8
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/ConfigureOptionCategory.java
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.core.configure;
+
+import java.util.ArrayList;
+
+public class ConfigureOptionCategory implements IConfigureOption {
+
+ private String name;
+
+ public ConfigureOptionCategory(String name) {
+ this.name = name;
+ }
+
+ public IConfigureOption copy(AutotoolsConfiguration config) {
+ return new ConfigureOptionCategory(name);
+ }
+
+ public String getDescription() {
+ return ConfigureMessages.getConfigureDescription(name);
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getParameter() {
+ return "";
+ }
+
+ public ArrayList<String> getParameters() {
+ return new ArrayList<String>();
+ }
+
+ public String getToolTip() {
+ return "";
+ }
+
+ public String getValue() {
+ return "null";
+ }
+
+ public boolean isCategory() {
+ return true;
+ }
+
+ public boolean isParmSet() {
+ return false;
+ }
+
+ public void setValue(String value) {
+ // Do nothing..nothing to set
+ }
+
+ public boolean isMultiArg() {
+ return false;
+ }
+
+ public int getType() {
+ return CATEGORY;
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/ConfigureTool.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/ConfigureTool.java
new file mode 100644
index 0000000000..a082a626ae
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/ConfigureTool.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.core.configure;
+
+import java.util.ArrayList;
+
+public class ConfigureTool extends AbstractConfigurationOption {
+
+ private String value;
+
+ public ConfigureTool(String name, AutotoolsConfiguration cfg) {
+ super(name, cfg);
+ this.value = name;
+ }
+
+ public ConfigureTool(String name, String transformedName, AutotoolsConfiguration cfg) {
+ super(name, transformedName, cfg);
+ this.value = name;
+ }
+
+ private ConfigureTool(String name, AutotoolsConfiguration cfg, String value) {
+ super(name, cfg);
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String newValue) {
+ if (!newValue.equals(value)) {
+ cfg.setDirty(true);
+ value = newValue;
+ }
+ }
+
+ public boolean isParmSet() {
+ return false;
+ }
+
+ public String getParameter() {
+ return ""; // $NON-NLS-1$
+ }
+
+ public ArrayList<String> getParameters() {
+ return new ArrayList<String>();
+ }
+
+ public IConfigureOption copy(AutotoolsConfiguration config) {
+ return new ConfigureTool(name, config, value);
+ }
+
+ public int getType() {
+ return TOOL;
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/IAConfiguration.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/IAConfiguration.java
new file mode 100644
index 0000000000..e1cc0e4dc3
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/IAConfiguration.java
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.core.configure;
+
+import java.util.ArrayList;
+import java.util.Map;
+
+public interface IAConfiguration {
+ public IConfigureOption getOption(String name);
+ public String getId();
+ public boolean isDirty();
+ public void setDirty(boolean value);
+ public Map<String, IConfigureOption> getOptions();
+ public String getToolParameters(String name);
+ public ArrayList<String> getToolArgs(String name);
+ public void setOption(String name, String value);
+ public void setConfigToolDirectory(String configToolDirectory);
+ public String getConfigToolDirectory();
+ public IAConfiguration copy();
+ public IAConfiguration copy(String id);
+ public void setDefaultOptions();
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/IConfigureOption.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/IConfigureOption.java
new file mode 100644
index 0000000000..310d4b4091
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/IConfigureOption.java
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.core.configure;
+
+import java.util.ArrayList;
+
+public interface IConfigureOption {
+
+ public final static int CATEGORY = 0;
+ public final static int BIN = 1;
+ public final static int STRING = 2;
+ public final static int INTERNAL = 3;
+ public final static int MULTIARG = 4;
+ public final static int TOOL = 5;
+ public String getName();
+ public String getParameter();
+ public ArrayList<String> getParameters();
+ public boolean isParmSet();
+ public String getDescription();
+ public String getToolTip();
+ public void setValue(String value);
+ public IConfigureOption copy(AutotoolsConfiguration cfg);
+ public String getValue();
+ public boolean isCategory();
+ public boolean isMultiArg();
+ public int getType();
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/InternalConfigureOption.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/InternalConfigureOption.java
new file mode 100644
index 0000000000..d42739b32f
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/InternalConfigureOption.java
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.core.configure;
+
+public class InternalConfigureOption extends AbstractConfigurationOption {
+
+ private String value;
+
+ public InternalConfigureOption(String name, AutotoolsConfiguration cfg) {
+ super(name, cfg);
+ this.value = ""; // $NON-NLS-1$
+ }
+
+ public InternalConfigureOption(String name, String msgName, AutotoolsConfiguration cfg) {
+ super(name, msgName, cfg);
+ this.value = ""; // $NON-NLS-1$
+ }
+
+ private InternalConfigureOption(String name, AutotoolsConfiguration cfg,
+ String value) {
+ super(name, cfg);
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String newValue) {
+ if (!newValue.equals(value)) {
+ cfg.setDirty(true);
+ value = newValue;
+ }
+ }
+
+ public boolean isParmSet() {
+ return false;
+ }
+
+ public String getParameter() {
+ return "";
+ }
+
+ public IConfigureOption copy(AutotoolsConfiguration config) {
+ return new InternalConfigureOption(name, config, value);
+ }
+
+ public int getType() {
+ return INTERNAL;
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/MultiArgConfigureOption.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/MultiArgConfigureOption.java
new file mode 100644
index 0000000000..1d17702c78
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/MultiArgConfigureOption.java
@@ -0,0 +1,119 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.core.configure;
+
+import java.util.ArrayList;
+
+
+public class MultiArgConfigureOption extends AbstractConfigurationOption {
+
+ private String value;
+ private ArrayList<String> userArgs;
+ private boolean isDirty;
+
+ public MultiArgConfigureOption(String name, AutotoolsConfiguration cfg) {
+ super(name, cfg);
+ this.value = ""; // $NON-NLS-1$
+ }
+
+ public MultiArgConfigureOption(String name, String msgName, AutotoolsConfiguration cfg) {
+ super(name, msgName, cfg);
+ this.value = ""; // $NON-NLS-1$
+ }
+
+ private MultiArgConfigureOption(String name, AutotoolsConfiguration cfg,
+ String value) {
+ super(name, cfg);
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String newValue) {
+ if (!newValue.equals(value)) {
+ cfg.setDirty(true);
+ isDirty = true;
+ value = newValue;
+ }
+ }
+
+ public boolean isParmSet() {
+ return value.length() > 0;
+ }
+
+ public boolean isMultiArg() {
+ return true;
+ }
+
+ public String getParameter() {
+ return value;
+ }
+
+ public ArrayList<String> getParameters() {
+ // May be multiple user-specified options in which case we
+ // need to split them up into individual options
+ if (!isDirty && userArgs != null)
+ return userArgs;
+ // Otherwise, we need to calculate userArgs
+ userArgs = new ArrayList<String>();
+ isDirty = false;
+ int lastArgIndex = -1;
+ int i = 0;
+ while (i < value.length()) {
+ char ch = value.charAt(i);
+ // Skip white-space
+ while (Character.isWhitespace(ch)) {
+ ++i;
+ if (i < value.length())
+ ch = value.charAt(i);
+ else // Otherwise we are done
+ return userArgs;
+ }
+
+ // Simplistic parser. We break up into strings delimited
+ // by blanks. If quotes are used, we ignore blanks within.
+ // If a backslash is used, we ignore the next character and
+ // pass it through.
+ lastArgIndex = i;
+ boolean inString = false;
+ while (i < value.length()) {
+ ch = value.charAt(i);
+ if (ch == '\\') // escape character
+ ++i; // skip over the next character
+ else if (ch == '\"') { // double quotes
+ inString = !inString;
+ } else if (Character.isWhitespace(ch)) {
+ if (!inString) {
+ userArgs.add(value.substring(lastArgIndex, i));
+ break;
+ }
+ }
+ ++i;
+ }
+ // Look for the case where we ran out of chars for the last
+ // token.
+ if (i >= value.length())
+ userArgs.add(value.substring(lastArgIndex));
+ ++i;
+ }
+ return userArgs;
+ }
+
+ public IConfigureOption copy(AutotoolsConfiguration config) {
+ return new MultiArgConfigureOption(name, config, value);
+ }
+
+ public int getType() {
+ return MULTIARG;
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/StringConfigureOption.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/StringConfigureOption.java
new file mode 100644
index 0000000000..4c9a117cfb
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/configure/StringConfigureOption.java
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.core.configure;
+
+
+public class StringConfigureOption extends AbstractConfigurationOption {
+
+ private String value;
+
+ public StringConfigureOption(String name, AutotoolsConfiguration cfg) {
+ super(name, cfg);
+ this.value = ""; // $NON-NLS-1$
+ }
+
+ public StringConfigureOption(String name, String msgName, AutotoolsConfiguration cfg) {
+ super(name, msgName, cfg);
+ this.value = ""; // $NON-NLS-1$
+ }
+
+ private StringConfigureOption(String name, AutotoolsConfiguration cfg,
+ String value) {
+ super(name, cfg);
+ this.value = value;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String newValue) {
+ if (!newValue.equals(value)) {
+ cfg.setDirty(true);
+ value = newValue;
+ }
+ }
+
+ public boolean isParmSet() {
+ return value.length() > 0;
+ }
+
+ public String getParameter() {
+ if (isParmSet())
+ return getParameterName() + "=" + getValue(); // $NON-NLS-1$
+ return "";
+ }
+
+ public IConfigureOption copy(AutotoolsConfiguration config) {
+ return new StringConfigureOption(name, config, value);
+ }
+
+ public int getType() {
+ return STRING;
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/wizards/NewAutotoolsProject.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/wizards/NewAutotoolsProject.java
new file mode 100644
index 0000000000..ef8eb787bb
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.core/src/org/eclipse/linuxtools/internal/cdt/autotools/core/wizards/NewAutotoolsProject.java
@@ -0,0 +1,143 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 Symbian Software Limited and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Bala Torati (Symbian) - Initial API and implementation
+ * Red Hat Inc - Modification to use with Autotools project
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.core.wizards;
+
+import java.util.List;
+
+import org.eclipse.cdt.core.CCorePlugin;
+import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
+import org.eclipse.cdt.core.templateengine.TemplateCore;
+import org.eclipse.cdt.core.templateengine.process.ProcessArgument;
+import org.eclipse.cdt.core.templateengine.process.ProcessFailureException;
+import org.eclipse.cdt.core.templateengine.process.ProcessRunner;
+import org.eclipse.cdt.core.templateengine.process.processes.Messages;
+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.ManagedBuildManager;
+import org.eclipse.cdt.managedbuilder.templateengine.ProjectCreatedActions;
+import org.eclipse.core.resources.IProject;
+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.IProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.linuxtools.cdt.autotools.core.AutotoolsNewProjectNature;
+import org.eclipse.linuxtools.internal.cdt.autotools.core.configure.AutotoolsConfigurationManager;
+
+
+/**
+ * Creates a new Project in the workspace.
+ */
+public class NewAutotoolsProject extends ProcessRunner {
+ protected boolean savedAutoBuildingValue;
+ protected ProjectCreatedActions pca;
+ protected IManagedBuildInfo info;
+
+ public NewAutotoolsProject() {
+ pca = new ProjectCreatedActions();
+ }
+
+ public void process(TemplateCore template, ProcessArgument[] args, String processId, IProgressMonitor monitor) throws ProcessFailureException {
+ String projectName = args[0].getSimpleValue();
+ String location = args[1].getSimpleValue();
+ String artifactExtension = args[2].getSimpleValue();
+ String isCProjectValue = args[3].getSimpleValue();
+ boolean isCProject = Boolean.valueOf(isCProjectValue).booleanValue();
+
+ IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
+
+ try {
+ if (!project.exists()) {
+ IWorkspace workspace = ResourcesPlugin.getWorkspace();
+ turnOffAutoBuild(workspace);
+
+ IPath locationPath = null;
+ if (location != null && !location.trim().equals("")) { //$NON-NLS-1$
+ locationPath = Path.fromPortableString(location);
+ }
+
+ List<?> configs = template.getTemplateInfo().getConfigurations();
+ if (configs == null || configs.size() == 0) {
+ throw new ProcessFailureException(Messages.getString("NewManagedProject.4") + projectName); //$NON-NLS-1$
+ }
+
+ pca.setProject(project);
+ pca.setProjectLocation(locationPath);
+ pca.setConfigs((IConfiguration[]) configs.toArray(new IConfiguration[configs.size()]));
+ pca.setArtifactExtension(artifactExtension);
+ info = pca.createProject(monitor, CCorePlugin.DEFAULT_INDEXER, isCProject);
+
+ AutotoolsNewProjectNature.addAutotoolsNature(project, monitor);
+
+ // For each IConfiguration, create a corresponding Autotools Configuration
+ IConfiguration[] cfgs = pca.getConfigs();
+ for (int i = 0; i < cfgs.length; ++i) {
+ IConfiguration cfg = cfgs[i];
+ ICConfigurationDescription cfgd = ManagedBuildManager.getDescriptionForConfiguration(cfg);
+ String id = cfgd.getId();
+ AutotoolsConfigurationManager.getInstance().getConfiguration(project, id, true);
+ }
+ AutotoolsConfigurationManager.getInstance().saveConfigs(project);
+
+ info.setValid(true);
+ ManagedBuildManager.saveBuildInfo(project, true);
+
+ restoreAutoBuild(workspace);
+
+ }
+ else {
+ AutotoolsNewProjectNature.addAutotoolsNature(project, monitor);
+ // throw new ProcessFailureException(Messages.getString("NewAutotoolsProject.5") + projectName); //$NON-NLS-1$
+ }
+ } catch (CoreException e) {
+ throw new ProcessFailureException(Messages.getString("NewManagedProject.3") + e.getMessage(), e); //$NON-NLS-1$
+ } catch (BuildException e) {
+ throw new ProcessFailureException(Messages.getString("NewManagedProject.3") + e.getMessage(), e); //$NON-NLS-1$
+ }
+ }
+
+ protected final void turnOffAutoBuild(IWorkspace workspace) throws CoreException {
+ IWorkspaceDescription workspaceDesc = workspace.getDescription();
+ savedAutoBuildingValue = workspaceDesc.isAutoBuilding();
+ workspaceDesc.setAutoBuilding(false);
+ workspace.setDescription(workspaceDesc);
+ }
+
+ protected final void restoreAutoBuild(IWorkspace workspace) throws CoreException {
+ IWorkspaceDescription workspaceDesc = workspace.getDescription();
+ workspaceDesc.setAutoBuilding(savedAutoBuildingValue);
+ workspace.setDescription(workspaceDesc);
+ }
+
+ /**
+ * setOptionValue
+ * @param config
+ * @param option
+ * @param val
+ * @throws BuildException
+ */
+ protected void setOptionValue(IConfiguration config, IOption option, String val) throws BuildException {
+ if (val != null) {
+ if (!option.isExtensionElement()) {
+ option.setValue(val);
+ } else {
+ IOption newOption = config.getToolChain().createOption(option, option.getId() + "." + ManagedBuildManager.getRandomNumber(), option.getName(), false); //$NON-NLS-1$
+ newOption.setValue(val);
+ }
+ }
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/.classpath b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/.classpath
new file mode 100644
index 0000000000..751c8f2e50
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/.project b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/.project
new file mode 100644
index 0000000000..e6edf235f2
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.linuxtools.cdt.autotools.tests</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/.settings/org.eclipse.jdt.core.prefs b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000000..b8bcab4452
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,12 @@
+#Mon Dec 11 11:40:26 EST 2006
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
+org.eclipse.jdt.core.compiler.source=1.3
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/.settings/org.eclipse.jdt.ui.prefs b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 0000000000..1e28f05fb3
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,3 @@
+#Mon Dec 11 11:40:26 EST 2006
+eclipse.preferences.version=1
+internal.default.compliance=default
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/ChangeLog b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/ChangeLog
new file mode 100644
index 0000000000..7f40324ce6
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/ChangeLog
@@ -0,0 +1,242 @@
+2010-03-12 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/cdt/autotools/tests/ProjectTools.java (setConfigDir): Fix up how
+ configuration is allocated. Use id instead of name.
+
+2009-11-13 Jeff Johnston <jjohnstn@redhat.com>
+
+ * META-INF/MANIFEST.MF: Make singleton.
+
+2009-11-03 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/cdt/autotools/tests/ProjectTools.java: Remove warnings.
+
+2009-10-15 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/cdt/autotools/tests/AutotoolsProjectTest0.java (testAutotoolsProject0): Fix to
+ handle fact that default build directory is now project directory.
+ * src/org/eclipse/linuxtools/cdt/autotools/tests/AutotoolsProjectTest1.java (testAutotoolsProject1): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/tests/AutotoolsProjectTest2.java (testAutotoolsProject2): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/tests/ProjectTools.java (setConfigDir): Fix to use new
+ AutotoolsConfigurationManager logic.
+
+2009-10-13 Jeff Johnston <jjohnstn@redhat.com>
+
+ * META-INF/MANIFEST.MF: Bump up release to 2.0.0.
+
+ * src/org/eclipse/linuxtools/cdt/autotools/tests/AllAutotoolsTests.java (suite): Modified to use
+ new core and ui plug-ins.
+ (suite): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/tests/autoconf/AutoconfTests.java (suite): Ditto.
+ (suite): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/tests/AutotoolsTestsPlugin.java (AutotoolsTestsPlugin): Ditto.
+ (AutotoolsTestsPlugin): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/tests/editors/AutomakeColourizationTests.java: Ditto.
+
+ * src/org/eclipse/linuxtools/cdt/autotools/tests/editors/AutomakeEditorTests.java: Ditto.
+
+ * src/org/eclipse/linuxtools/cdt/autotools/tests/editors/AutomakeTextHoverTest.java: Ditto.
+
+ * src/org/eclipse/linuxtools/cdt/autotools/tests/editors/EditorTests.java (suite): Ditto.
+ (suite): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/tests/ProjectTools.java (ConvertToAutotoolsProjectWizardTest.getSelectedConfigurations): Ditto.
+ (generateFiles): Ditto.
+ (markExecutable): Ditto.
+ (ConvertToAutotoolsProjectWizardTest.getSelectedConfigurations): Ditto.
+ (generateFiles): Ditto.
+ (markExecutable): Ditto.
+
+2009-04-21 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/cdt/autotools/tests/CoreUtility.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/tests/ProjectTools.java: Use local CoreUtility
+ class to avoid internal class access warnings.
+
+2009-03-05 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/cdt/autotools/tests/ProjectTools.java (generateFiles): Call
+ genfiles.sh instead of issuing aclocal, autoconf, and automake which might not exist on
+ test system.
+ * zip/project1.zip: Add generated files into special genfiles directory and add EPL.
+ * zip/project2.zip: Ditto.
+
+2009-03-05 Jeff Johnston <jjohnstn@redhat.com>
+
+ * build.properties: Add zip directory to binary build.
+
+2009-01-15 Jeff Johnston <jjohnstn@redhat.com>
+
+ * META-INF/MANIFEST.MF: Add .qualifier to id.
+
+2008-12-09 Andrew Overholt <overholt@redhat.com>
+
+ * test.xml: Debugging statement.
+
+2008-12-08 Andrew Overholt <overholt@redhat.com>
+
+ * test.xml: Clean up some typos.
+
+2008-12-04 Andrew Overholt <overholt@redhat.com>
+
+ * build.properties: Add test.xml to bin.includes.
+
+2008-11-05 Andrew Overholt <overholt@redhat.com>
+
+ * META-INF/MANIFEST.MF: Update BREE to 1.5.
+
+2008-11-05 Andrew Overholt <overholt@redhat.com>
+
+ * src/org/eclipse/linuxtools/cdt/autotools/tests/AllAutotoolsTests.java: New test suite.
+ * src/org/eclipse/linuxtools/cdt/autotools/tests/autoconf/AutoconfTests.java: New test suite.
+ * src/org/eclipse/linuxtools/cdt/autotools/tests/editors/EditorTests.java: New test suite.
+ * test.xml: New file to drive tests on build.eclipse.org.
+
+2008-11-03 Andrew Overholt <overholt@redhat.com>
+
+ * build.properties: Remove plugin.xml, add plugin.properties.
+
+2008-10-31 Andrew Overholt <overholt@redhat.com>
+
+ * META-INF/MANIFEST.MF: Use plugin.properties for %bundleName and %provider.
+ Add "(Incubation)".
+ * plugin.properties: Initial import.
+
+2008-10-14 Jeff Johnston <jjohnstn@redhat.com>
+
+ * META-INF/MANIFEST.MF: Bump release to 1.0.3.
+
+2008-09-19 Jeff Johnston <jjohnstn@redhat.com>
+
+ * META-INF/MANIFEST.MF: Change Eclipse-AutoStart to Bundle-ActivationPolicy.
+
+2008-09-18 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/cdt/autotools/tests/editors/AutomakeColourizationTests.java (setUp): Make sure
+ test project has unique name since JUNIT tests are run multithread.
+ * src/org/eclipse/linuxtools/cdt/autotools/tests/editors/AutomakeEditorTests.java (testAutomakeEditorAssociation):
+ Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/tests/editors/AutomakeTextHoverTest.java (setUp): Ditto.
+
+2008-09-17 Jeff Johnston <jjohnstn@redhat.com>
+
+ Refactored com.redhat.eclipse.cdt.autotools.tests to org.eclipse.linuxtools.cdt.autotools.tests.
+
+ * src/org/eclipse/linuxtools/cdt/autotools/tests/AllTests.java: Removed since must run as Junit
+ plugin and default is to run all tests in plugin which causes duplicate test runs.
+ * src/org/eclipse/linuxtools/cdt/autotools/tests/autoconf/AllTests.java: Removed. Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/tests/AutotoolsProjectTest0.java (testAutotoolsProject0):
+ Add new generate configuration files parameter and set to true.
+ * src/org/eclipse/linuxtools/cdt/autotools/tests/AutotoolsProjectTest1.java (testAutotoolsProject1):
+ Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/tests/AutotoolsProjectTest2.java (testAutotoolsProject2):
+ Add new generate configuration files parameter and set to false.
+ * src/org/eclipse/linuxtools/cdt/autotools/tests/ProjectTools.java (addSourceContainerWithImport):
+ Add new parameter which states whether configuration files require generation after
+ import.
+ (importFilesFromZipAndGenerate): New method which imports project files and performs
+ generation of configuration files.
+ (generateFiles): New method.
+
+2008-07-04 Jeff Johnston <jjohnstn@redhat.com>
+
+ * META-INF/MANIFEST.MF: Bump to 1.0.2.
+
+2008-04-17 10:43 Ed Swartz <ed.swartz@nokia.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/tests/autoconf/:
+ TestMacroParser.java, TestShellParser.java: More autoconf parser
+ work. Remove old parser and standardize AST node constructors.
+ Add more tests and fix some bugs.
+
+2008-04-10 15:40 Ed Swartz <ed.swartz@nokia.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/tests/autoconf/:
+ BaseParserTest.java, TestMacroParser.java, TestShellParser.java,
+ TestTokenizer.java: More autoconf parser work.
+
+2008-04-09 14:38 Ed Swartz <ed.swartz@nokia.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/tests/: AllTests.java,
+ autoconf/AllTests.java, autoconf/BaseParserTest.java,
+ autoconf/TestMacroParser.java, autoconf/TestParser.java,
+ autoconf/TestShellParser.java, autoconf/TestSourceInfo.java,
+ autoconf/TestTokenizer.java: New autoconf parser work in progress
+
+2008-04-07 14:06 Ed Swartz <ed.swartz@nokia.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/tests/: AllTests.java,
+ autoconf/AllTests.java, autoconf/TestParser.java,
+ autoconf/TestSourceInfo.java: Initial checkpoint for autotools
+ parser changes
+
+
+2007-08-15 Jeff Johnston <jjohnstn@redhat.com>
+
+ * META-INF/MANIFEST.MF: Change release to 1.0.1 and specify minimum java runtime as
+ 1.4.
+
+2007-04-16 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/tests/AutotoolsProjectTest0.java: New
+ test to test simple project with configure in top-level directory.
+ * src/com/redhat/eclipse/cdt/autotools/tests/AllTests.java: Add
+ new AutotoolsProjectTest0 test.
+
+2007-04-13 Jeff Johnston <jjohnstn@redhat.com>
+
+ Verifies fix for #236304
+ * src/com/redhat/eclipse/cdt/autotools/tests/AutotoolsProjectTest1.java (tearDown):
+ Add try catch around project delete.
+ * src/com/redhat/eclipse/cdt/autotools/tests/AutotoolsProjectTest2.java: New test
+ for autogen.sh.
+ * src/com/redhat/eclipse/cdt/autotools/tests/AllTests.java (suite): Add
+ new AutotoolsProjectTest2 test.
+ * zip/project2.zip: New autogen.sh test project.
+
+2007-04-04 Jeff Johnston <jjohnstn@redhat.com>
+
+ Verifies fix for #235076
+ * src/com/redhat/eclipse/cdt/autotools/tests/ProjectTools.java (createFile): Add comments.
+ (setup): Ditto.
+ (getMonitor): Ditto.
+ (createEmptyFile): Ditto.
+ (addSourceContainer): Ditto.
+ (createProject): Ditto.
+ (addSourceContainerWithImport): Ditto.
+ (ConvertToAutotoolsProjectWizardTest): Ditto.
+ (ConvertToAutotoolsProjectWizardTest.getSelectedConfigurations): Ditto.
+ (build): New method.
+ (setConfigDir): Ditto.
+ (markExecutable): Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/tests/AutotoolsProjectTest1.java: New test.
+ * src/com/redhat/eclipse/cdt/autotools/tests/AllTests.java (suite): Add
+ AutotoolsProjectTest1 test.
+ * zip/project1.zip: New sample project file for testing.
+
+2007-01-22 Andrew Overholt <overholt@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/tests/editors/AutomakeEditorTests.java:
+ Add copyright.
+ * src/com/redhat/eclipse/cdt/autotools/tests/editors/AutomakeColourizationTests.java:
+ Add copyright.
+ * src/com/redhat/eclipse/cdt/autotools/tests/editors/AutomakeTextHoverTest.java:
+ New file.
+
+
+2006-12-15 Andrew Overholt <overholt@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/tests/editors/AutomakeColourizationTests.java:
+ New file.
+ * src/com/redhat/eclipse/cdt/autotools/tests/ProjectTools.java
+ (createFile): New method.
+ * src/com/redhat/eclipse/cdt/autotools/tests/AllTests.java
+ (suite): Add AutomakeColourizationTests.
+
+2006-12-12 Andrew Overholt <overholt@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/tests/editors/AutomakeEditorTests.java:
+ New file.
+ * src/com/redhat/eclipse/cdt/autotools/tests/ProjectTools.java
+ (createEmptyFile): New method.
+ * src/com/redhat/eclipse/cdt/autotools/tests/AutotoolsProjectNatureTest.java:
+ Clean up imports. \ No newline at end of file
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/META-INF/MANIFEST.MF b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..9d3aa1e556
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,25 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %bundleName
+Bundle-SymbolicName: org.eclipse.linuxtools.cdt.autotools.tests;singleton:=true
+Bundle-Version: 2.0.0.qualifier
+Bundle-Activator: org.eclipse.linuxtools.cdt.autotools.tests.AutotoolsTestsPlugin
+Bundle-Vendor: %provider
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.linuxtools.cdt.autotools.core,
+ org.eclipse.core.resources,
+ org.eclipse.cdt.managedbuilder.core,
+ org.eclipse.cdt.ui,
+ org.junit,
+ org.eclipse.ui.ide,
+ org.eclipse.jface.text,
+ org.eclipse.ui.editors,
+ org.eclipse.cdt.make.core,
+ org.eclipse.cdt.make.ui,
+ org.eclipse.ui.workbench.texteditor,
+ org.eclipse.cdt.core,
+ org.eclipse.linuxtools.cdt.autotools.ui;bundle-version="1.0.0"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/about.html b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/about.html
new file mode 100644
index 0000000000..44e229003e
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/about.html
@@ -0,0 +1,33 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html>
+<head>
+<title>About</title>
+<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>8th September, 2004</p>
+<h3>License</h3>
+<p>The Eclipse Software Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<h3>Contributions</h3>
+
+<p>If this Content is licensed to you under the terms and conditions of the EPL, any Contributions, as defined in the EPL, uploaded, submitted, or otherwise
+made available to the Eclipse Foundation, its members and/or the host of the Eclipse Foundation web site, by you that relate to such
+Content are provided under the terms and conditions of the <a href="http://www.eclipse.org/legal/termsofuse.html">Terms of Use</a>
+for the Eclipse Foundation web site and can be made available to others under the terms of the licenses as set out in the
+<a href="http://www.eclipse.org/legal/termsofuse.html">Terms of Use</a>.</p>
+
+<p>If this Content is licensed to you under license terms and conditions other than the EPL (&quot;Other License&quot;), any modifications, enhancements and/or
+other code and/or documentation (&quot;Modifications&quot;) uploaded, submitted, or otherwise made available to the Eclipse Foundation, its members and/or the
+host of the Eclipse Foundation web site, 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 <a href="http://www.eclipse.org/legal/termsofuse.html">Terms of Use</a>
+for the Eclipse Foundation web site and such Modifications can be made available to others under the terms of the licenses as set out in the
+<a href="http://www.eclipse.org/legal/termsofuse.html">Terms of Use</a>.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/build.properties b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/build.properties
new file mode 100644
index 0000000000..5c6ae502c6
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/build.properties
@@ -0,0 +1,7 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.properties,\
+ test.xml,\
+ zip/
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/plugin.properties b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/plugin.properties
new file mode 100644
index 0000000000..ea28acf0df
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/plugin.properties
@@ -0,0 +1,12 @@
+#################################################################################
+# Copyright (c) 2008 Red Hat, Inc.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Red Hat Incorporated - initial API and implementation
+#################################################################################
+bundleName=Autotools Tests Plug-in (Incubation)
+provider=Eclipse.org \ No newline at end of file
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/AllAutotoolsTests.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/AllAutotoolsTests.java
new file mode 100644
index 0000000000..5064f51d2a
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/AllAutotoolsTests.java
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.tests;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+public class AllAutotoolsTests {
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite(
+ "Test for org.eclipse.linuxtools.cdt.autotools.core.tests");
+ //$JUnit-BEGIN$
+ suite.addTestSuite(AutotoolsProjectTest0.class);
+ suite.addTestSuite(AutotoolsProjectNatureTest.class);
+ suite.addTestSuite(AutotoolsProjectTest1.class);
+ suite.addTestSuite(AutotoolsProjectTest2.class);
+ //$JUnit-END$
+ return suite;
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/AutotoolsProjectNatureTest.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/AutotoolsProjectNatureTest.java
new file mode 100644
index 0000000000..dc1f46ae4a
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/AutotoolsProjectNatureTest.java
@@ -0,0 +1,27 @@
+package org.eclipse.linuxtools.cdt.autotools.tests;
+
+import junit.framework.TestCase;
+
+import org.eclipse.cdt.managedbuilder.core.ManagedCProjectNature;
+import org.eclipse.core.resources.IProject;
+
+public class AutotoolsProjectNatureTest extends TestCase {
+
+ /*
+ * @see TestCase#setUp()
+ */
+ protected void setUp() throws Exception {
+ super.setUp();
+ if (!ProjectTools.setup())
+ fail("could not perform basic project workspace setup");
+ }
+
+ public void testAutotoolsProjectNature() throws Exception {
+ IProject testProject = ProjectTools.createProject("testProject");
+ if(testProject == null) {
+ fail("Unable to create test project");
+ }
+ assertTrue(testProject.hasNature(ManagedCProjectNature.MNG_NATURE_ID));
+ testProject.delete(true, false, ProjectTools.getMonitor());
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/AutotoolsProjectTest0.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/AutotoolsProjectTest0.java
new file mode 100644
index 0000000000..ce63dccfeb
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/AutotoolsProjectTest0.java
@@ -0,0 +1,68 @@
+package org.eclipse.linuxtools.cdt.autotools.tests;
+
+import junit.framework.TestCase;
+
+import org.eclipse.cdt.managedbuilder.core.ManagedCProjectNature;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+
+public class AutotoolsProjectTest0 extends TestCase {
+
+ private IProject testProject;
+
+ /*
+ * @see TestCase#setUp()
+ */
+ protected void setUp() throws Exception {
+ super.setUp();
+ if (!ProjectTools.setup())
+ fail("could not perform basic project workspace setup");
+ testProject = ProjectTools.createProject("testProject0");
+ if (testProject == null) {
+ fail("Unable to create test project");
+ }
+ testProject.open(new NullProgressMonitor());
+ }
+
+ /**
+ * Test sample project which has a hello world program. The top-level
+ * configure is found in the top-level directory. The hello world source
+ * is found in sample/hello.c.
+ * @throws Exception
+ */
+ public void testAutotoolsProject0() throws Exception {
+ Path p = new Path("zip/project1.zip");
+ ProjectTools.addSourceContainerWithImport(testProject, null, p, null, true);
+ assertTrue(testProject.hasNature(ManagedCProjectNature.MNG_NATURE_ID));
+ org.eclipse.core.runtime.Path x = new org.eclipse.core.runtime.Path("ChangeLog");
+ assertTrue(testProject.exists(x));
+ x = new org.eclipse.core.runtime.Path("configure");
+ ProjectTools.markExecutable(testProject, "configure");
+ ProjectTools.markExecutable(testProject, "config.guess");
+ ProjectTools.markExecutable(testProject, "config.sub");
+ ProjectTools.markExecutable(testProject, "missing");
+ ProjectTools.markExecutable(testProject, "mkinstalldirs");
+ ProjectTools.markExecutable(testProject, "install-sh");
+ assertTrue(ProjectTools.build());
+ x = new org.eclipse.core.runtime.Path("config.status");
+ assertTrue(testProject.exists(x));
+ x = new org.eclipse.core.runtime.Path("Makefile");
+ assertTrue(testProject.exists(x));
+ x = new org.eclipse.core.runtime.Path("sample/a.out");
+ assertTrue(testProject.exists(x));
+ x = new org.eclipse.core.runtime.Path("sample/Makefile");
+ assertTrue(testProject.exists(x));
+ }
+
+ protected void tearDown() throws Exception {
+ testProject.refreshLocal(IResource.DEPTH_INFINITE, null);
+ try {
+ testProject.delete(true, true, null);
+ } catch (Exception e) {
+ //FIXME: Why does a ResourceException occur when deleting the project??
+ }
+ super.tearDown();
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/AutotoolsProjectTest1.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/AutotoolsProjectTest1.java
new file mode 100644
index 0000000000..7355493e24
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/AutotoolsProjectTest1.java
@@ -0,0 +1,71 @@
+package org.eclipse.linuxtools.cdt.autotools.tests;
+
+import junit.framework.TestCase;
+
+import org.eclipse.cdt.managedbuilder.core.ManagedCProjectNature;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+
+public class AutotoolsProjectTest1 extends TestCase {
+
+ private IProject testProject;
+
+ /*
+ * @see TestCase#setUp()
+ */
+ protected void setUp() throws Exception {
+ super.setUp();
+ if (!ProjectTools.setup())
+ fail("could not perform basic project workspace setup");
+ testProject = ProjectTools.createProject("testProject1");
+ if (testProject == null) {
+ fail("Unable to create test project");
+ }
+ testProject.open(new NullProgressMonitor());
+ }
+
+ /**
+ * Test sample project which has a hello world program. The top-level
+ * configure is found in the subdirectory src which also contains the
+ * subdirectory sample. The hello world source is found in
+ * src/sample/hello.c so configuration must create multiple
+ * Makefiles.
+ * @throws Exception
+ */
+ public void testAutotoolsProject1() throws Exception {
+ Path p = new Path("zip/project1.zip");
+ ProjectTools.addSourceContainerWithImport(testProject, "src", p, null, true);
+ assertTrue(testProject.hasNature(ManagedCProjectNature.MNG_NATURE_ID));
+ org.eclipse.core.runtime.Path x = new org.eclipse.core.runtime.Path("src/ChangeLog");
+ assertTrue(testProject.exists(x));
+ x = new org.eclipse.core.runtime.Path("src/configure");
+ ProjectTools.setConfigDir(testProject, "src");
+ ProjectTools.markExecutable(testProject, "src/configure");
+ ProjectTools.markExecutable(testProject, "src/config.guess");
+ ProjectTools.markExecutable(testProject, "src/config.sub");
+ ProjectTools.markExecutable(testProject, "src/missing");
+ ProjectTools.markExecutable(testProject, "src/mkinstalldirs");
+ ProjectTools.markExecutable(testProject, "src/install-sh");
+ assertTrue(ProjectTools.build());
+ x = new org.eclipse.core.runtime.Path("config.status");
+ assertTrue(testProject.exists(x));
+ x = new org.eclipse.core.runtime.Path("Makefile");
+ assertTrue(testProject.exists(x));
+ x = new org.eclipse.core.runtime.Path("sample/a.out");
+ assertTrue(testProject.exists(x));
+ x = new org.eclipse.core.runtime.Path("sample/Makefile");
+ assertTrue(testProject.exists(x));
+ }
+
+ protected void tearDown() throws Exception {
+ testProject.refreshLocal(IResource.DEPTH_INFINITE, null);
+ try {
+ testProject.delete(true, true, null);
+ } catch (Exception e) {
+ //FIXME: Why does a ResourceException occur when deleting the project??
+ }
+ super.tearDown();
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/AutotoolsProjectTest2.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/AutotoolsProjectTest2.java
new file mode 100644
index 0000000000..85f9d4bf27
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/AutotoolsProjectTest2.java
@@ -0,0 +1,85 @@
+package org.eclipse.linuxtools.cdt.autotools.tests;
+
+import junit.framework.TestCase;
+
+import org.eclipse.cdt.managedbuilder.core.ManagedCProjectNature;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+
+// This test verifies an autogen.sh project that builds configure, but
+// does not run it.
+public class AutotoolsProjectTest2 extends TestCase {
+
+ private IProject testProject;
+
+ /*
+ * @see TestCase#setUp()
+ */
+ protected void setUp() throws Exception {
+ super.setUp();
+ if (!ProjectTools.setup())
+ fail("could not perform basic project workspace setup");
+ testProject = ProjectTools.createProject("testProject2");
+ if (testProject == null) {
+ fail("Unable to create test project");
+ }
+ testProject.open(new NullProgressMonitor());
+ }
+
+ /**
+ * Test sample project which has a hello world program. The top-level
+ * contains autogen.sh which will build configure, but not run it.
+ * The hello world source is found in
+ * src/sample/hello.c so configuration must create multiple
+ * Makefiles.
+ * @throws Exception
+ */
+ public void testAutotoolsProject2() throws Exception {
+ Path p = new Path("zip/project2.zip");
+ ProjectTools.addSourceContainerWithImport(testProject, "src", p, null);
+ assertTrue(testProject.hasNature(ManagedCProjectNature.MNG_NATURE_ID));
+ org.eclipse.core.runtime.Path x = new org.eclipse.core.runtime.Path("src/ChangeLog");
+ assertTrue(testProject.exists(x));
+ x = new org.eclipse.core.runtime.Path("src/configure");
+ ProjectTools.setConfigDir(testProject, "src");
+ ProjectTools.markExecutable(testProject, "src/autogen.sh");
+ x = new org.eclipse.core.runtime.Path("src/configure");
+ assertFalse(testProject.exists(x));
+ x = new org.eclipse.core.runtime.Path("src/Makefile.in");
+ assertFalse(testProject.exists(x));
+ x = new org.eclipse.core.runtime.Path("src/sample/Makefile.in");
+ assertFalse(testProject.exists(x));
+ x = new org.eclipse.core.runtime.Path("src/aclocal.m4");
+ assertFalse(testProject.exists(x));
+ assertTrue(ProjectTools.build());
+ x = new org.eclipse.core.runtime.Path("src/configure");
+ assertTrue(testProject.exists(x));
+ x = new org.eclipse.core.runtime.Path("src/Makefile.in");
+ assertTrue(testProject.exists(x));
+ x = new org.eclipse.core.runtime.Path("src/sample/Makefile.in");
+ assertTrue(testProject.exists(x));
+ x = new org.eclipse.core.runtime.Path("src/aclocal.m4");
+ assertTrue(testProject.exists(x));
+ x = new org.eclipse.core.runtime.Path("config.status");
+ assertTrue(testProject.exists(x));
+ x = new org.eclipse.core.runtime.Path("Makefile");
+ assertTrue(testProject.exists(x));
+ x = new org.eclipse.core.runtime.Path("sample/a.out");
+ assertTrue(testProject.exists(x));
+ x = new org.eclipse.core.runtime.Path("sample/Makefile");
+ assertTrue(testProject.exists(x));
+ }
+
+ protected void tearDown() throws Exception {
+ testProject.refreshLocal(IResource.DEPTH_INFINITE, null);
+ try {
+ testProject.delete(true, true, null);
+ } catch (Exception e) {
+ //FIXME: Why does a ResourceException occur when deleting the project??
+ }
+ super.tearDown();
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/AutotoolsTestsPlugin.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/AutotoolsTestsPlugin.java
new file mode 100644
index 0000000000..533bd448ea
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/AutotoolsTestsPlugin.java
@@ -0,0 +1,103 @@
+package org.eclipse.linuxtools.cdt.autotools.tests;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class AutotoolsTestsPlugin extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.linuxtools.cdt.autotools.core.tests";
+
+ // The shared instance
+ private static AutotoolsTestsPlugin plugin;
+ private ResourceBundle resourceBundle;
+
+ /**
+ * The constructor
+ */
+ public AutotoolsTestsPlugin() {
+ plugin = this;
+ try {
+ resourceBundle = ResourceBundle.getBundle("org.eclipse.linuxtools.cdt.autotools.core.tests.Resources");
+ } catch (MissingResourceException x) {
+ resourceBundle = null;
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static AutotoolsTestsPlugin getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Returns an image descriptor for the image file at the given
+ * plug-in relative path
+ *
+ * @param path the path
+ * @return the image descriptor
+ */
+ public static ImageDescriptor getImageDescriptor(String path) {
+ return imageDescriptorFromPlugin(PLUGIN_ID, path);
+ }
+
+ /**
+ * Returns active shell.
+ */
+ public static Shell getActiveWorkbenchShell() {
+ IWorkbenchWindow window = getDefault().getWorkbench().getActiveWorkbenchWindow();
+ if (window != null) {
+ return window.getShell();
+ }
+ return null;
+ }
+
+ /**
+ * Returns the string from the plugin's resource bundle,
+ * or 'key' if not found.
+ */
+ public static String getResourceString(String key) {
+ ResourceBundle bundle = AutotoolsTestsPlugin.getDefault().getResourceBundle();
+ try {
+ return (bundle != null) ? bundle.getString(key) : key;
+ } catch (MissingResourceException e) {
+ return key;
+ }
+ }
+
+ /**
+ * Returns the plugin's resource bundle,
+ */
+ public ResourceBundle getResourceBundle() {
+ return resourceBundle;
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/CoreUtility.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/CoreUtility.java
new file mode 100644
index 0000000000..67b1b8749d
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/CoreUtility.java
@@ -0,0 +1,108 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - initial API and implementation
+ * Markus Schorn (Wind River Systems)
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.tests;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.swt.custom.BusyIndicator;
+import org.osgi.framework.Bundle;
+
+public class CoreUtility {
+
+ /**
+ * Creates a folder and all parent folders if not existing.
+ * Project must exist.
+ * <code> org.eclipse.ui.dialogs.ContainerGenerator</code> is too heavy
+ * (creates a runnable)
+ */
+ public static void createFolder(IFolder folder, boolean force, boolean local, IProgressMonitor monitor) throws CoreException {
+ if (!folder.exists()) {
+ IContainer parent= folder.getParent();
+ if (parent instanceof IFolder) {
+ createFolder((IFolder)parent, force, local, null);
+ }
+ folder.create(force, local, monitor);
+ }
+ }
+
+ /**
+ * Creates an extension. If the extension plugin has not
+ * been loaded a busy cursor will be activated during the duration of
+ * the load.
+ *
+ * @param element the config element defining the extension
+ * @param classAttribute the name of the attribute carrying the class
+ * @return the extension object
+ */
+ public static Object createExtension(final IConfigurationElement element, final String classAttribute) throws CoreException {
+ // If plugin has been loaded create extension.
+ // Otherwise, show busy cursor then create extension.
+
+ String id= element.getContributor().getName();
+ Bundle bundle = Platform.getBundle(id);
+ if(bundle.getState() == org.osgi.framework.Bundle.ACTIVE) {
+ return element.createExecutableExtension(classAttribute);
+ }
+ final Object[] ret = new Object[1];
+ final CoreException[] exc = new CoreException[1];
+ BusyIndicator.showWhile(null, new Runnable() {
+ public void run() {
+ try {
+ ret[0] = element.createExecutableExtension(classAttribute);
+ } catch (CoreException e) {
+ exc[0] = e;
+ }
+ }
+ });
+ if (exc[0] != null)
+ throw exc[0];
+ return ret[0];
+ }
+
+ /**
+ * Calls equals after checking for nulls
+ */
+ public static boolean safeEquals(Object lhs, Object rhs) {
+ if (lhs==rhs) {
+ return true;
+ }
+ if (lhs == null || rhs == null) {
+ return false;
+ }
+ return lhs.equals(rhs);
+ }
+
+ /**
+ * Calls hashCode after checking for null
+ */
+ public static int safeHashcode(Object o) {
+ return o == null ? 0 : o.hashCode();
+ }
+
+ /**
+ * Comparse two integers.
+ */
+ public static int compare(int lhs, int rhs) {
+ if (lhs < rhs) {
+ return -1;
+ }
+ if (lhs > rhs) {
+ return 1;
+ }
+ return 0;
+ }
+}
+
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/ProjectTools.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/ProjectTools.java
new file mode 100644
index 0000000000..c78eca1941
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/ProjectTools.java
@@ -0,0 +1,418 @@
+package org.eclipse.linuxtools.cdt.autotools.tests;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.lang.reflect.InvocationTargetException;
+import java.util.zip.ZipFile;
+
+import org.eclipse.cdt.core.CommandLauncher;
+import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
+import org.eclipse.cdt.managedbuilder.core.IConfiguration;
+import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
+import org.eclipse.cdt.managedbuilder.core.IProjectType;
+import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
+import org.eclipse.cdt.ui.wizards.conversion.ConvertProjectWizardPage;
+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.IWorkspace;
+import org.eclipse.core.resources.IWorkspaceDescription;
+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.FileLocator;
+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.SubProgressMonitor;
+import org.eclipse.linuxtools.internal.cdt.autotools.core.configure.AutotoolsConfigurationManager;
+import org.eclipse.linuxtools.internal.cdt.autotools.core.configure.IAConfiguration;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.wizards.ConvertToAutotoolsProjectWizard;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.wizards.ConvertToAutotoolsProjectWizardPage;
+import org.eclipse.ui.dialogs.IOverwriteQuery;
+import org.eclipse.ui.wizards.datatransfer.ImportOperation;
+import org.eclipse.ui.wizards.datatransfer.ZipFileStructureProvider;
+
+
+public class ProjectTools {
+
+ static IWorkspace workspace;
+ static IWorkspaceRoot root;
+ static NullProgressMonitor monitor;
+ static String pluginRoot;
+ static ConvertProjectWizardPage page;
+ static boolean setupComplete;
+
+ /**
+ * Setup routine for tests.
+ * @return true if setup successful, false otherwise
+ * @throws Exception
+ */
+ public static boolean setup() throws Exception {
+ if (!setupComplete) {
+ IWorkspaceDescription desc;
+ workspace = ResourcesPlugin.getWorkspace();
+ root = workspace.getRoot();
+ monitor = new NullProgressMonitor();
+ if(workspace == null) {
+ return false;
+ }
+ if(root == null) {
+ return false;
+ }
+ desc = workspace.getDescription();
+ desc.setAutoBuilding(false);
+ workspace.setDescription(desc);
+ }
+ setupComplete = true;
+ return true;
+ }
+
+ /**
+ * Build the project.
+ * @return true if build started successfully or false otherwise
+ */
+ public static boolean build() {
+ try {
+ workspace.build(IncrementalProjectBuilder.FULL_BUILD, getMonitor());
+ } catch (CoreException e) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Get the default monitor.
+ * @return The current monitor
+ */
+ public static IProgressMonitor getMonitor() {
+ return monitor;
+ }
+
+ /**
+ * Mark a specified file in a project as executable.
+ * @param project The project that the file is found in
+ * @param filePath The relative path to the file
+ * @return true if the change was successful, false otherwise
+ */
+ public static boolean markExecutable(IProject project, String filePath) {
+ // Get a launcher for the config command
+ CommandLauncher launcher = new CommandLauncher();
+ OutputStream stdout = new ByteArrayOutputStream();
+ OutputStream stderr = new ByteArrayOutputStream();
+
+ launcher.showCommand(true);
+ IPath commandPath = new Path("chmod");
+ IPath runPath = project.getLocation().append(filePath).removeLastSegments(1);
+ String[] args = new String[2];
+ args[0] = "+x";
+ args[1] = project.getLocation().append(filePath).toOSString();
+ try {
+ Process proc = launcher.execute(commandPath, args, new String[0],
+ runPath, new NullProgressMonitor());
+ 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) {
+ return false;
+ }
+ } else
+ return false;
+ } catch (CoreException e) {
+ return false;
+ }
+ return true;
+ }
+
+ // Inner class to allow us to fake a project wizard without starting up
+ // the UI for it.
+ protected static class ConvertToAutotoolsProjectWizardTest extends ConvertToAutotoolsProjectWizard {
+ ConvertToAutotoolsProjectWizardTest() {
+ super();
+ }
+
+ // The following is a kludge to allow testing to occur for the
+ // wizard code. The regular applyOptions() method would also attempt
+ // to call performApply() for the optionPage. This doesn't work in
+ // the test scenario because the UI display logic is needed to
+ // initialize some things. The performApply() call is only needed
+ // to check out referenced projects. In our test scenario, this is
+ // not required.
+ public void applyOptions(IProject project, IProgressMonitor monitor) {
+ setCurrentProject(project);
+ }
+
+ public IConfiguration[] getSelectedConfigurations() {
+ IProjectType projectType = ManagedBuildManager.getExtensionProjectType("org.eclipse.linuxtools.cdt.autotools.core.projectType"); //$NON-NLS-1$
+ IConfiguration[] cfgs = projectType.getConfigurations();
+ return cfgs;
+ }
+ }
+
+ /**
+ * Creates an empty Autotools project.
+ * @param name The name of the new project
+ * @return The newly created project or null
+ */
+ public static IProject createProject(String name) {
+ IProject testProject = root.getProject(name);
+ if (testProject == null) {
+ return null;
+ }
+ try {
+ testProject.create(monitor);
+ testProject.open(monitor);
+ ConvertToAutotoolsProjectWizardTest wizard = new ConvertToAutotoolsProjectWizardTest();
+ wizard.addPages();
+ ConvertToAutotoolsProjectWizardPage page = new ConvertToAutotoolsProjectWizardPage("test", wizard);
+ page.convertProject(testProject, monitor, wizard.getProjectID());
+ } catch (CoreException e) {
+ testProject = null;
+ }
+ return testProject;
+ }
+
+ /**
+ * Set the configuration source directory for an Autotools project.
+ * @param project The Autotools project to modify
+ * @param dir The relative project directory to use
+ */
+ public static void setConfigDir(IProject project, String dir) {
+ IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project);
+ IConfiguration c = info.getDefaultConfiguration();
+ ICConfigurationDescription cfgd = ManagedBuildManager.getDescriptionForConfiguration(c);
+ String id = cfgd.getId();
+ IAConfiguration cfg = AutotoolsConfigurationManager.getInstance().getConfiguration(project, id, true);
+ cfg.setConfigToolDirectory(dir);
+// IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project);
+// ITool tool = info.getToolFromOutputExtension("status"); //$NON-NLS-1$
+// IOption[] options = tool.getOptions();
+// try {
+// for (int i = 0; i < options.length; ++i) {
+// if (options[i].getValueType() == IOption.STRING) {
+// String id = options[i].getId();
+// if (id.indexOf("configdir") > 0) { //$NON-NLS-1$
+// options[i].setValue(dir);
+// break;
+// }
+// }
+// }
+// } catch (BuildException e) {
+// // do nothing
+// }
+ }
+
+ private static void importFilesFromZip(ZipFile srcZipFile, IPath destPath, IProgressMonitor monitor) throws InvocationTargetException {
+ ZipFileStructureProvider structureProvider= new ZipFileStructureProvider(srcZipFile);
+ try {
+ ImportOperation op= new ImportOperation(destPath, structureProvider.getRoot(), structureProvider, new ImportOverwriteQuery());
+ op.run(monitor);
+ } catch (InterruptedException e) {
+ // should not happen
+ }
+ }
+
+ private static boolean generateFiles(IPath destPath) {
+ // Get a launcher for the config command
+ CommandLauncher launcher = new CommandLauncher();
+ OutputStream stdout = new ByteArrayOutputStream();
+ OutputStream stderr = new ByteArrayOutputStream();
+
+ IPath runPath = root.getLocation().append(destPath);
+
+ // Run the genfiles.sh shell script which will simulate
+ // running aclocal, autoconf, and automake
+ launcher.showCommand(true);
+ IPath commandPath = new Path("sh");
+ String[] cmdargs = new String[]{"genfiles.sh"};
+ try {
+ Process proc = launcher.execute(commandPath, cmdargs, new String[0],
+ runPath, new NullProgressMonitor());
+ 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) {
+ return false;
+ }
+ } else
+ return false;
+ } catch (CoreException e) {
+ return false;
+ }
+
+ return true;
+ }
+
+ private static void importFilesFromZipAndGenerate(ZipFile srcZipFile, IPath destPath, IProgressMonitor monitor) throws InvocationTargetException {
+ importFilesFromZip(srcZipFile, destPath, monitor);
+ if (!generateFiles(destPath))
+ throw new InvocationTargetException(new Exception("Unsuccessful test file generation"));
+ }
+
+ private static class ImportOverwriteQuery implements IOverwriteQuery {
+ public String queryOverwrite(String file) {
+ return ALL;
+ }
+ }
+
+ /**
+ * Adds a source container to a IProject.
+ * @param jproject The parent project
+ * @param containerName The name of the new source container
+ * @return The handle to the new source container
+ * @throws CoreException Creation failed
+ */
+ public static IContainer addSourceContainer(IProject jproject, String containerName) throws CoreException {
+ return addSourceContainer(jproject, containerName, new Path[0]);
+ }
+
+ /**
+ * Adds a source container to a IProject.
+ * @param jproject The parent project
+ * @param containerName The name of the new source container
+ * @param exclusionFilters Exclusion filters to set
+ * @return The handle to the new source container
+ * @throws CoreException Creation failed
+ */
+ public static IContainer addSourceContainer(IProject jproject, String containerName, IPath[] exclusionFilters) throws CoreException {
+ return addSourceContainer(jproject, containerName, new Path[0], exclusionFilters);
+ }
+
+ /**
+ * Adds a source container to a IProject.
+ * @param jproject The parent project
+ * @param containerName The name of the new source container
+ * @param inclusionFilters Inclusion filters to set
+ * @param exclusionFilters Exclusion filters to set
+ * @return The handle to the new source container
+ * @throws CoreException Creation failed
+ */
+ public static IContainer addSourceContainer(IProject jproject, String containerName, IPath[] inclusionFilters, IPath[] exclusionFilters) throws CoreException {
+ IProject project= jproject.getProject();
+ IContainer container= null;
+ if (containerName == null || containerName.length() == 0) {
+ container= project;
+ } else {
+ IFolder folder= project.getFolder(containerName);
+ if (!folder.exists()) {
+ CoreUtility.createFolder(folder, false, true, null);
+ }
+ container= folder;
+ }
+
+ return container;
+ }
+
+ /**
+ * Adds a source container to a IProject and imports all files contained
+ * in the given ZIP file.
+ * @param project The parent project
+ * @param containerName Name of the source container
+ * @param zipFile Archive to import
+ * @param containerEncoding encoding for the generated source container
+ * @param generate true if configuration files need to be pre-generated
+ * @param exclusionFilters Exclusion filters to set
+ * @return The handle to the new source container
+ * @throws InvocationTargetException Creation failed
+ * @throws CoreException Creation failed
+ * @throws IOException Creation failed
+ */
+ public static IContainer addSourceContainerWithImport(IProject project, String containerName, File zipFile, String containerEncoding, boolean generate, IPath[] exclusionFilters) throws InvocationTargetException, CoreException, IOException {
+ ZipFile file= new ZipFile(zipFile);
+ try {
+// IPackageFragmentRoot root= addSourceContainer(jproject, containerName, exclusionFilters);
+// ((IContainer) root.getCorrespondingResource()).setDefaultCharset(containerEncoding, null);
+ IContainer root= addSourceContainer(project, containerName, exclusionFilters);
+ if (generate)
+ importFilesFromZipAndGenerate(file, root.getFullPath(), null);
+ else
+ importFilesFromZip(file, root.getFullPath(), null);
+ return root;
+ } finally {
+ if (file != null) {
+ file.close();
+ }
+ }
+ }
+
+ /**
+ * Adds a source container to a IProject and imports all files contained
+ * in the given ZIP file and generates configuration files if needed.
+ * @param project The parent project
+ * @param containerName Name of the source container
+ * @param path path of zipFile Archive to import
+ * @param containerEncoding encoding for the generated source container
+ * @param generate true if configuration files need to be pre-generated
+ * @return The handle to the new source container
+ * @throws InvocationTargetException Creation failed
+ * @throws CoreException Creation failed
+ * @throws IOException Creation failed
+ */
+ public static IContainer addSourceContainerWithImport(IProject project, String containerName, Path zipFilePath, String containerEncoding, boolean generate) throws InvocationTargetException, CoreException, IOException {
+ File zipFile = new File(FileLocator.toFileURL(FileLocator.find(AutotoolsTestsPlugin.getDefault().getBundle(), zipFilePath, null)).getFile());
+ return addSourceContainerWithImport(project, containerName, zipFile, containerEncoding, generate, null);
+ }
+
+ /**
+ * Adds a source container to a IProject and imports all files contained
+ * in the given ZIP file.
+ * @param project The parent project
+ * @param containerName Name of the source container
+ * @param path path of zipFile Archive to import
+ * @param containerEncoding encoding for the generated source container
+ * @return The handle to the new source container
+ * @throws InvocationTargetException Creation failed
+ * @throws CoreException Creation failed
+ * @throws IOException Creation failed
+ */
+ public static IContainer addSourceContainerWithImport(IProject project, String containerName, Path zipFilePath, String containerEncoding) throws InvocationTargetException, CoreException, IOException {
+ return addSourceContainerWithImport(project, containerName, zipFilePath, containerEncoding, false);
+ }
+
+ /**
+ * Create an empty file for a project.
+ * @param project The project to create the file for
+ * @param filename The name of the new file
+ * @return the created file
+ * @throws CoreException
+ */
+ public IFile createEmptyFile(IProject project, String filename) throws CoreException {
+ IFile emptyFile = project.getFile(filename);
+ emptyFile.create(null, false, null);
+ return emptyFile;
+ }
+
+ /**
+ * Create a file for a project and initialize the contents.
+ * @param project The project to create a file for
+ * @param filename Name of the new file
+ * @param contents String containing the initial contents of the file
+ * @return the created file
+ * @throws CoreException
+ */
+ public IFile createFile(IProject project, String filename, String contents) throws CoreException {
+ IFile file = project.getFile(filename);
+ file.create(null, false, null);
+ file.setContents(new ByteArrayInputStream(contents.getBytes()), false, false, null);
+ return file;
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/Resources.properties b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/Resources.properties
new file mode 100644
index 0000000000..72d197e262
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/Resources.properties
@@ -0,0 +1,2 @@
+ProjectTools.ErrorDialog.Title="Project Creation Error"
+ProjectTools.Exist.Error="Project already exists" \ No newline at end of file
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/autoconf/AutoconfTests.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/autoconf/AutoconfTests.java
new file mode 100644
index 0000000000..566b8669eb
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/autoconf/AutoconfTests.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.tests.autoconf;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+public class AutoconfTests {
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite(
+ "Test for org.eclipse.linuxtools.cdt.autotools.core.tests.autoconf");
+ //$JUnit-BEGIN$
+ suite.addTestSuite(TestMacroParser.class);
+ suite.addTestSuite(TestTokenizer.class);
+ suite.addTestSuite(TestShellParser.class);
+ //$JUnit-END$
+ return suite;
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/autoconf/BaseParserTest.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/autoconf/BaseParserTest.java
new file mode 100644
index 0000000000..d61e810b88
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/autoconf/BaseParserTest.java
@@ -0,0 +1,268 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.tests.autoconf;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.jface.text.Document;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.AutoconfElement;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.AutoconfMacroDetector;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.AutoconfMacroElement;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.AutoconfParser;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.IAutoconfErrorHandler;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.IAutoconfMacroValidator;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.ParseException;
+
+
+import junit.framework.TestCase;
+
+public abstract class BaseParserTest extends TestCase {
+
+ private IAutoconfErrorHandler errorHandler;
+ protected List errors;
+ private IAutoconfMacroValidator macroValidator;
+ private Set macroNames;
+ private AutoconfMacroDetector macroDetector;
+
+ public BaseParserTest() {
+ super();
+ }
+
+ public BaseParserTest(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ errors = new ArrayList();
+ this.errorHandler = new IAutoconfErrorHandler() {
+
+ public void handleError(ParseException exception) {
+ assertNotNull(exception);
+ errors.add(exception);
+ }
+
+ };
+
+ this.macroDetector = new AutoconfMacroDetector();
+
+ macroNames = new HashSet/*<String>*/();
+ this.macroValidator = new IAutoconfMacroValidator() {
+
+ public void validateMacroCall(AutoconfMacroElement element)
+ throws ParseException {
+ assertNotNull(element);
+ assertNotNull(element.getName());
+ assertNotNull(element.getChildren());
+ macroNames.add(element.getName());
+ }
+
+ };
+ }
+
+ protected void tearDown() throws Exception {
+ }
+
+ protected IDocument createDocument(String text) {
+ return new Document(text);
+ }
+
+ /**
+ * Parse the document with no error or macro handlers
+ * @param parser
+ * @param document
+ * @return root
+ */
+ protected AutoconfElement parseNoHandlers(IDocument document) {
+ AutoconfParser parser = new AutoconfParser(null, null, null);
+ AutoconfElement root = parser.parse(document);
+ assertNotNull(root);
+ return root;
+ }
+
+ /**
+ * Parse the document with the standard error or macro handlers,
+ * cleared out before use
+ * @param parser
+ * @param document
+ * @return root
+ */
+ protected AutoconfElement parseWithHandlers(IDocument document) {
+ AutoconfParser parser = new AutoconfParser(errorHandler, macroDetector, macroValidator);
+
+ errors.clear();
+ macroNames.clear();
+
+ AutoconfElement root = parser.parse(document);
+ assertNotNull(root);
+ return root;
+ }
+
+ /**
+ * Parse the document in 'string' twice, once without any handlers and once with the standard error or macro handlers,
+ * cleared out before use
+ * @param string
+ * @return root
+ */
+ protected AutoconfElement parse(String string) {
+ AutoconfElement tree = parse(string, false);
+ return tree;
+ }
+
+ protected AutoconfElement parse(String string, boolean allowErrors) {
+ IDocument document = createDocument(string);
+ AutoconfElement root1 = parseNoHandlers(document);
+ assertNotNull(root1);
+ AutoconfElement root2 = parseWithHandlers(document);
+ assertNotNull(root2);
+
+ validateSourceTree(root1);
+ validateSourceTree(root2);
+
+ // TODO: check root1 == root2
+
+ // ensure the doc wasn't changed (sanity)
+ assertEquals(string, document.get());
+
+ if (!allowErrors) {
+ if (errors.size() > 0)
+ fail("got errors" + errors.get(0));
+ }
+ else
+ assertTrue(errors.size() > 0);
+
+ return root2;
+ }
+
+ protected void checkError(String msgKey) {
+ for (Iterator iter = errors.iterator(); iter.hasNext(); ) {
+ ParseException exc = (ParseException) iter.next();
+ if (exc.getMessage().contains(msgKey))
+ return;
+ }
+ String any = "";
+ if (errors.size() > 0)
+ any = ", but saw " + errors.get(0).toString();
+ fail("did not find error: " + msgKey + any );
+ }
+
+ protected void checkError(String msgKey, int line) {
+ ParseException possible = null;
+ int distance = 999;
+ for (Iterator iter = errors.iterator(); iter.hasNext(); ) {
+ ParseException exc = (ParseException) iter.next();
+ if (exc.getMessage().contains(msgKey)) {
+ int curDistance = Math.abs(possible.getLineNumber() - line);
+ if (possible == null || curDistance < distance) {
+ possible = exc;
+ distance = curDistance;
+ }
+ if (exc.getLineNumber() == line)
+ return;
+ }
+ }
+ if (possible == null)
+ fail("did not find any error: " + msgKey);
+ else
+ fail("did not find error: " + msgKey + " on line: " + line +", but found one at " + possible.getLineNumber());
+ }
+
+ /**
+ * Make sure the source ranges for the tree are sane:
+ * <p>
+ * <li>document set
+ * <li>line numbers, columns valid
+ * <li>children encompassed in parent
+ * <li>siblings non-overlapping
+ * @param element
+ */
+ protected void validateSourceTree(AutoconfElement element) {
+ validateSourceElement(element);
+ AutoconfElement[] kids = element.getChildren();
+ for (int i = 0; i < kids.length; i++) {
+ if (kids[i].getStartOffset() < element.getStartOffset()
+ || kids[i].getEndOffset() > element.getEndOffset())
+ fail(describeElement(kids[i]) + " not inside parent " + describeElement(element));
+ validateSourceTree(kids[i]);
+ }
+ for (int i = 0; i < kids.length - 1; i++) {
+ AutoconfElement kid1 = kids[i];
+ AutoconfElement kid2 = kids[i + 1];
+ if (kid1.getEndOffset() > kid2.getStartOffset())
+ fail(describeElement(kid1) + " overlaps " + describeElement(kid2));
+ }
+ }
+
+ /**
+ * Make sure the source ranges for the element are sane:
+ * <p>
+ * <li>document set
+ * <li>line numbers, columns valid
+ * @param element
+ */
+ private void validateSourceElement(AutoconfElement element) {
+ if (element.getDocument() == null)
+ fail("no document for " + describeElement(element));
+ if (element.getStartOffset() < 0)
+ fail("no start offset for " + describeElement(element));
+ if (element.getEndOffset() < 0)
+ fail("no end offset for " + describeElement(element));
+ if (element.getStartOffset() > element.getEndOffset())
+ fail("invalid range (start > end) for " + describeElement(element));
+ }
+
+ private String describeElement(AutoconfElement element) {
+ return element.getClass().getSimpleName() + " <<" + element.getSource() + ">>";
+ }
+
+ protected void assertEqualSource(String text, AutoconfElement element) {
+ assertEquals(text, element.getSource());
+ }
+
+ /** Check that a tree has the given structure. 'elements' is a flattened
+ * representation of the tree, where each node represents one level deeper
+ * in the tree, except for 'null' which backs out one level.
+ * @param tree
+ * @param elements
+ */
+ protected void assertTreeStructure(AutoconfElement tree, String[] elements) {
+ // if fails, the elements[] array is missing final nulls
+ assertEquals(elements.length, assertTreeStructure(tree, elements, 0));
+ }
+
+ private int assertTreeStructure(AutoconfElement tree, String[] elements,
+ int elementIdx) {
+ AutoconfElement[] kids = tree.getChildren();
+ for (int j = 0; j < kids.length; j++) {
+ if (elementIdx >= elements.length || elements[elementIdx] == null) {
+ fail("extra children in " + tree + " at " + kids[j]);
+ }
+ if (!kids[j].getName().equals(elements[elementIdx]))
+ fail("did not match " + elements[elementIdx] + ", instead got " + kids[j].getClass().getSimpleName() + "=" + kids[j].getName());
+
+ elementIdx++;
+ if (kids[j].getChildren().length > 0) {
+ elementIdx = assertTreeStructure(kids[j], elements, elementIdx);
+ if (elementIdx >= elements.length)
+ fail("Missing null in elements list, or invalid tree hierarchy");
+ if (elements[elementIdx] != null) {
+ fail("not enough children in " + tree);
+ }
+ elementIdx++;
+ }
+ }
+ return elementIdx;
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/autoconf/TestMacroParser.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/autoconf/TestMacroParser.java
new file mode 100644
index 0000000000..7bcf950a31
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/autoconf/TestMacroParser.java
@@ -0,0 +1,266 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.cdt.autotools.tests.autoconf;
+
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.AutoconfEditorMessages;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.AutoconfElement;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.AutoconfIfElement;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.AutoconfMacroArgumentElement;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.AutoconfMacroElement;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.AutoconfParser;
+
+
+/**
+ * Test parsing with macros
+ * @author eswartz
+ *
+ */
+public class TestMacroParser extends BaseParserTest {
+
+ public void testEmpty() throws Exception {
+ parse("");
+ }
+
+ public void testComments() throws Exception {
+ //
+ String text =
+ "dnl first line\n" +
+ "dnl second line\n";
+ AutoconfElement root = parse(text);
+ Object[] kids = root.getChildren();
+ // these are stripped
+ assertEquals(0, kids.length);
+ assertTreeStructure(root, new String[] {});
+ }
+
+ public void testMacroParsing1() throws Exception {
+ //
+ String text =
+ "AC_REQUIRE([AM_SANITY_CHECK])\n" +
+ "";
+ AutoconfElement root = parse(text);
+ assertTreeStructure(root, new String[] { "AC_REQUIRE", "AM_SANITY_CHECK", null });
+
+ AutoconfElement[] kids = root.getChildren();
+ assertEquals(1, kids.length);
+ assertTrue(kids[0] instanceof AutoconfMacroElement);
+ AutoconfMacroElement macro = (AutoconfMacroElement) kids[0];
+ assertEquals("AC_REQUIRE", macro.getName());
+ assertEquals(1, macro.getParameterCount());
+
+ AutoconfElement[] args = macro.getChildren();
+ assertEquals(1, args.length);
+ assertTrue(args[0] instanceof AutoconfMacroArgumentElement);
+
+ assertEquals("AM_SANITY_CHECK", ((AutoconfMacroArgumentElement)args[0]).getName());
+ assertEquals("AM_SANITY_CHECK", macro.getParameter(0));
+
+ // keep quotes in source
+ assertEqualSource("[AM_SANITY_CHECK]", args[0]);
+ assertEqualSource("AC_REQUIRE([AM_SANITY_CHECK])", macro);
+ }
+
+ public void testMacroParsing2() throws Exception {
+ //
+ String text =
+ "AC_TWO_ARGS(first,second)\n" +
+ "";
+ AutoconfElement root = parse(text);
+ assertTreeStructure(root, new String[] { "AC_TWO_ARGS", "first", "second", null });
+
+ AutoconfElement[] kids = root.getChildren();
+ assertEquals(1, kids.length);
+ assertTrue(kids[0] instanceof AutoconfMacroElement);
+ AutoconfMacroElement macro = (AutoconfMacroElement) kids[0];
+ assertEquals("AC_TWO_ARGS", macro.getName());
+ assertEquals(2, macro.getParameterCount());
+
+ AutoconfElement[] args = macro.getChildren();
+ assertEquals(2, args.length);
+ assertTrue(args[0] instanceof AutoconfMacroArgumentElement);
+ assertEquals("first", ((AutoconfMacroArgumentElement)args[0]).getName());
+ assertTrue(args[1] instanceof AutoconfMacroArgumentElement);
+ assertEquals("second", ((AutoconfMacroArgumentElement)args[1]).getName());
+ assertEquals("first", macro.getParameter(0));
+ assertEquals("second", macro.getParameter(1));
+
+ assertEqualSource("first", args[0]);
+ assertEqualSource("second", args[1]);
+ assertEqualSource("AC_TWO_ARGS(first,second)", macro);
+ }
+
+ public void testMacroParsing3() throws Exception {
+ //
+ String text =
+ "AC_ONE_ARG( [quoted( arg ), second] )\n" +
+ "";
+ AutoconfElement root = parse(text);
+ assertTreeStructure(root, new String[] { "AC_ONE_ARG", "quoted( arg ), second", null });
+
+ AutoconfElement[] kids = root.getChildren();
+ assertEquals(1, kids.length);
+ assertTrue(kids[0] instanceof AutoconfMacroElement);
+ AutoconfMacroElement macro = (AutoconfMacroElement) kids[0];
+ assertEquals("AC_ONE_ARG", macro.getName());
+
+ AutoconfElement[] args = macro.getChildren();
+ assertEquals(1, macro.getParameterCount());
+ assertEquals(1, args.length);
+ assertTrue(args[0] instanceof AutoconfMacroArgumentElement);
+
+ // spaces removed from outermost arguments, but not inner
+ assertEquals("quoted( arg ), second", ((AutoconfMacroArgumentElement)args[0]).getName());
+ assertEquals("quoted( arg ), second", macro.getParameter(0));
+
+ assertEqualSource("[quoted( arg ), second]", args[0]);
+ assertEqualSource("AC_ONE_ARG( [quoted( arg ), second] )", macro);
+ }
+
+ public void testMacroParsing4() throws Exception {
+ //
+ String text =
+ "AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],\r\n" +
+ " [AM_AUTOMAKE_VERSION([1.4-p6])])\r\n" +
+ "\r\n" +
+ "";
+ AutoconfElement root = parse(text);
+ AutoconfElement[] kids = root.getChildren();
+ assertEquals(1, kids.length);
+ assertTrue(kids[0] instanceof AutoconfMacroElement);
+ AutoconfMacroElement macro = (AutoconfMacroElement) kids[0];
+ assertEquals("AC_DEFUN", macro.getName());
+
+ // spaces and quotes dropped
+ assertEquals(2, macro.getParameterCount());
+ assertEquals("AM_SET_CURRENT_AUTOMAKE_VERSION", macro.getParameter(0));
+ assertEquals("AM_AUTOMAKE_VERSION([1.4-p6])", macro.getParameter(1));
+
+ // no spaces in source either, but quotes kept
+ assertEqualSource("[AM_SET_CURRENT_AUTOMAKE_VERSION]", macro.getChildren()[0]);
+ assertEqualSource("[AM_AUTOMAKE_VERSION([1.4-p6])]", macro.getChildren()[1]);
+ }
+
+ public void testMacroParsing5() throws Exception {
+ // check that complex shell constructs don't throw off the
+ // parser, and also that we don't mistake shell tokens in a macro argument
+ String arg2 =
+ "AC_MSG_CHECKING(for working $2)\n" +
+ "# Run test in a subshell; some versions of sh will print an error if\n" +
+ "# an executable is not found, even if stderr is redirected.\n" +
+ "# Redirect stdin to placate older versions of autoconf. Sigh.\n" +
+ "if ($2 --version) < /dev/null > /dev/null 2>&1; then\n" +
+ " $1=$2\n" +
+ " AC_MSG_RESULT(found)\n" +
+ "else\n" +
+ " $1=\"$3/missing $2\"\n" +
+ " AC_MSG_RESULT(missing)\n" +
+ "fi\n" +
+ "AC_SUBST($1)";
+ String text =
+ "AC_DEFUN([AM_MISSING_PROG],\n" +
+ "[" + arg2 + "])\n" +
+ "";
+ AutoconfElement root = parse(text);
+ assertTreeStructure(root, new String[] {
+ "AC_DEFUN",
+ "AM_MISSING_PROG",
+ arg2,
+ null,
+ });
+ AutoconfElement[] kids = root.getChildren();
+ assertEquals(1, kids.length);
+ assertTrue(kids[0] instanceof AutoconfMacroElement);
+ AutoconfMacroElement macro = (AutoconfMacroElement) kids[0];
+ assertEquals("AC_DEFUN", macro.getName());
+ assertEquals("AM_MISSING_PROG", macro.getVar());
+
+ // spaces dropped
+ assertEquals(2, macro.getParameterCount());
+ assertEquals("AM_MISSING_PROG", macro.getParameter(0));
+
+ // be sure complex arguments aren't mangled
+ assertEquals(arg2, macro.getParameter(1));
+ assertEqualSource("[" + arg2 + "]", macro.getChildren()[1]);
+
+ }
+
+ public void testMacroParsing6() throws Exception {
+ // empty arguments
+ String text =
+ "AC_DEFUN( ,\n" +
+ ")\n";
+ AutoconfElement root = parse(text);
+ AutoconfElement[] kids = root.getChildren();
+ assertEquals(1, kids.length);
+ assertTrue(kids[0] instanceof AutoconfMacroElement);
+ AutoconfMacroElement macro = (AutoconfMacroElement) kids[0];
+ assertEquals("AC_DEFUN", macro.getName());
+ assertEquals("", macro.getVar());
+
+ // spaces dropped
+ assertEquals(2, macro.getParameterCount());
+ assertEquals("", macro.getParameter(0));
+ assertEquals("", macro.getParameter(1));
+
+ assertEqualSource("", macro.getChildren()[0]);
+ assertEqualSource("", macro.getChildren()[1]);
+ }
+
+ public void testWithErrorUnmatchedLeftParen() {
+ String text =
+ "AC_BAD_MACRO(\n";
+
+ AutoconfElement root = parse(text, true);
+ assertEquals(1, root.getChildren().length);
+ assertTrue(root.getChildren()[0] instanceof AutoconfMacroElement);
+ checkError(AutoconfEditorMessages.getString(AutoconfParser.UNMATCHED_LEFT_PARENTHESIS));
+ }
+ public void testWithErrorUnmatchedRightParen() {
+ String text =
+ "AC_BAD_MACRO())\n";
+
+ AutoconfElement root = parse(text, true);
+ assertEquals(1, root.getChildren().length);
+ assertTrue(root.getChildren()[0] instanceof AutoconfMacroElement);
+ checkError(AutoconfEditorMessages.getString(AutoconfParser.UNMATCHED_RIGHT_PARENTHESIS));
+ }
+ public void testNoFalseUnmatchedRightParen() {
+ String text =
+ "AC_BAD_MACRO()\n" +
+ "(\n"+
+ "cd foo;\n"+
+ "if test -f myfile; then exit 1; fi\n"+
+ ")\n";
+
+ // nothing but the macro and 'if' is detected as meaningful
+ AutoconfElement root = parse(text);
+ assertEquals(2, root.getChildren().length);
+ assertTrue(root.getChildren()[0] instanceof AutoconfMacroElement);
+ assertTrue(root.getChildren()[1] instanceof AutoconfIfElement);
+ }
+
+ public void testNestedMacro() {
+ String text =
+ "AC_1(AC_2())\n";
+
+ AutoconfElement root = parse(text);
+ assertEquals(1, root.getChildren().length);
+ assertTrue(root.getChildren()[0] instanceof AutoconfMacroElement);
+ AutoconfMacroElement ac1 = (AutoconfMacroElement) root.getChildren()[0];
+ assertEquals(1, ac1.getChildren().length);
+ assertTrue(ac1.getChildren()[0] instanceof AutoconfMacroArgumentElement);
+ AutoconfMacroArgumentElement ac2 = (AutoconfMacroArgumentElement) ac1.getChildren()[0];
+ // one empty argument
+ assertEquals(1, ac2.getChildren().length);
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/autoconf/TestShellParser.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/autoconf/TestShellParser.java
new file mode 100644
index 0000000000..764e239999
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/autoconf/TestShellParser.java
@@ -0,0 +1,437 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.cdt.autotools.tests.autoconf;
+
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.AutoconfEditorMessages;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.AutoconfCaseConditionElement;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.AutoconfCaseElement;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.AutoconfElement;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.AutoconfParser;
+
+/**
+ * @author eswartz
+ *
+ */
+public class TestShellParser extends BaseParserTest {
+
+ public void testHERE() {
+ String HERE_TEXT =
+ "\n"+
+ "while true; do \n"+
+ "AM_INIT_AUTOMAKE([confusion], [$2], EOF)\n"+
+ "done\n";
+ String text = "cat <<EOF"+
+ HERE_TEXT +
+ "EOF\n" +
+ "blah";
+ AutoconfElement tree = parse(text);
+
+ // only see a macro call, not a loop
+ assertTreeStructure(tree, new String[] { "AM_INIT_AUTOMAKE", "confusion", "$2", "EOF", null });
+ }
+
+ public void testHERE2() {
+ String HERE_TEXT =
+ "\n"+
+ "while true; do \n"+
+ "AM_INIT_AUTOMAKE([confusion], [$2], EOF)\n"+
+ "done\n";
+ String text = "cat <<-EOF"+
+ HERE_TEXT +
+ "EOF\n" +
+ "blah";
+ AutoconfElement tree = parse(text);
+
+ // only see a macro call, not a loop
+ assertTreeStructure(tree, new String[] { "AM_INIT_AUTOMAKE", "confusion", "$2", "EOF", null });
+ }
+
+
+ public void testIf0() {
+ String text = "# comment\n"+
+ "\tif true; then\n" +
+ "\t\tfoo;\n"+
+ "\tfi\n";
+ AutoconfElement tree = parse(text);
+ assertTreeStructure(tree, new String[] { "if" });
+ }
+
+ public void testIf1() {
+ String text = "# comment\n"+
+ "\tif true; then\n" +
+ "\t\tAC_SOMETHING();\n"+
+ "\tfi\n";
+ AutoconfElement tree = parse(text);
+ assertTreeStructure(tree, new String[] { "if", "AC_SOMETHING", "", null, null });
+ }
+
+
+ public void testIfElse0() {
+ String text = "# comment\n"+
+ "\tif true; then\n" +
+ "\t\tfoo;\n"+
+ "\telse\n"+
+ "\t\tbar;\n"+
+ "\tfi\n";
+ AutoconfElement tree = parse(text);
+ assertTreeStructure(tree, new String[] { "if", "else", null });
+ }
+
+ public void testIfElse1() {
+ String text = "# comment\n"+
+ "\tif true; then\n" +
+ "\t\tAC_ONE(...);\n"+
+ "\telse\n"+
+ "\t\tAC_TWO(AC_THREE());\n"+
+ "\tfi\n";
+ AutoconfElement tree = parse(text);
+ assertTreeStructure(tree, new String[] {
+ "if",
+ "AC_ONE",
+ "...",
+ null,
+ "else",
+ "AC_TWO",
+ "AC_THREE",
+ "AC_THREE",
+ "",
+ null,
+ null,
+ null,
+ null,
+ null});
+
+ AutoconfElement[] kids = tree.getChildren();
+ assertEqualSource("AC_ONE(...)", kids[0].getChildren()[0]);
+ assertEqualSource("AC_TWO(AC_THREE())", kids[0].getChildren()[1].getChildren()[0]);
+ }
+ public void testIf2() {
+ String text =
+ "if blah\n" +
+ "then fi\n";
+ AutoconfElement tree = parse(text);
+ assertTreeStructure(tree, new String[] { "if" });
+ }
+
+ public void testIfElif() {
+ String text = "# comment\n"+
+ "\tif true; then\n" +
+ "\t\tAC_ONE(...);\n"+
+ "\telif false; then \n"+
+ "\t\tAC_TWO(...);\n"+
+ "\tfi\n";
+ AutoconfElement tree = parse(text);
+ assertTreeStructure(tree, new String[] {
+ "if",
+ "AC_ONE",
+ "...",
+ null,
+ "elif",
+ "AC_TWO",
+ "...",
+ null,
+ null,
+ null });
+ }
+
+ public void testIfErr1() {
+ String text =
+ "if then fi\n";
+ AutoconfElement tree = parse(text, true);
+ assertEquals(1, errors.size());
+ checkError(AutoconfEditorMessages.getFormattedString(AutoconfParser.INVALID_SPECIFIER, "then"));
+ assertTreeStructure(tree, new String[] { "if" });
+ }
+ public void testIfErr2() {
+ String text =
+ "if true; do fi\n";
+ AutoconfElement tree = parse(text, true);
+ assertEquals(1, errors.size());
+ checkError(AutoconfEditorMessages.getString(AutoconfParser.INVALID_DO));
+ assertTreeStructure(tree, new String[] { "if" });
+ }
+ public void testIfErr3() {
+ String text =
+ "if; else bar; fi\n";
+ AutoconfElement tree = parse(text, true);
+ assertEquals(1, errors.size());
+ checkError(AutoconfEditorMessages.getFormattedString(AutoconfParser.MISSING_SPECIFIER, "then"));
+ assertTreeStructure(tree, new String[] { "if", "else", null });
+ }
+ public void testIfErr4() {
+ String text =
+ "if true; then stmt fi\n";
+ AutoconfElement tree = parse(text, true);
+ assertEquals(1, errors.size());
+ checkError(AutoconfEditorMessages.getFormattedString(AutoconfParser.INVALID_TERMINATION, "fi"));
+ assertTreeStructure(tree, new String[] { "if" });
+ }
+ public void testIfErr5() {
+ String text =
+ "if true; then\n";
+ AutoconfElement tree = parse(text, true);
+ assertEquals(1, errors.size());
+ checkError(AutoconfEditorMessages.getFormattedString(AutoconfParser.UNTERMINATED_CONSTRUCT, "if"));
+ assertTreeStructure(tree, new String[] { "if" });
+ }
+ public void testIfErr6() {
+ String text =
+ "if true; then foo; else\n";
+ AutoconfElement tree = parse(text, true);
+ assertEquals(2, errors.size());
+ checkError(AutoconfEditorMessages.getFormattedString(AutoconfParser.UNTERMINATED_CONSTRUCT, "if"));
+ checkError(AutoconfEditorMessages.getFormattedString(AutoconfParser.UNTERMINATED_CONSTRUCT, "else"));
+ assertTreeStructure(tree, new String[] { "if", "else", null });
+ }
+ public void testWhile() {
+ String text =
+ "while true; do foo; done\n";
+ AutoconfElement tree = parse(text);
+ assertTreeStructure(tree, new String[] { "while" });
+ }
+ public void testWhile2() {
+ String text =
+ "while true\n" +
+ "do\n"+
+ "AC_SOMETHING(...); done\n";
+ AutoconfElement tree = parse(text);
+ assertTreeStructure(tree, new String[] { "while", "AC_SOMETHING", "...", null, null });
+ }
+ public void testWhileErr() {
+ String text =
+ "while; AC_SOMETHING(...) done\n";
+ AutoconfElement tree = parse(text, true);
+ assertEquals(2, errors.size());
+ checkError(AutoconfEditorMessages.getFormattedString(AutoconfParser.MISSING_SPECIFIER, "do"));
+ checkError(AutoconfEditorMessages.getFormattedString(AutoconfParser.INVALID_TERMINATION, "done"));
+ assertTreeStructure(tree, new String[] { "while", "AC_SOMETHING", "...", null, null });
+ }
+ public void testWhileErr2() {
+ String text =
+ "while true; do AC_SOMETHING(...)\n";
+ AutoconfElement tree = parse(text, true);
+ assertEquals(1, errors.size());
+ checkError(AutoconfEditorMessages.getFormattedString(AutoconfParser.UNTERMINATED_CONSTRUCT, "while"));
+ assertTreeStructure(tree, new String[] { "while", "AC_SOMETHING", "...", null, null });
+ }
+
+ public void testCase() {
+ String text =
+ "case $VAL in\n"+
+ "linux-*-*) AC_FIRST($VAL) ; true ;;\n"+
+ "bsd-* | macosx-*) : ;;\n"+
+ "*) echo \"I dunno $VAL\";;\n"+
+ "esac\n";
+ AutoconfElement tree = parse(text, false);
+ assertTreeStructure(tree, new String[] {
+ "case",
+ "linux-*-*",
+ "AC_FIRST",
+ "$VAL",
+ null,
+ null,
+ "bsd-* | macosx-*",
+ "*",
+ null
+ });
+
+ AutoconfElement[] kids = tree.getChildren();
+ assertEquals(1, kids.length);
+ assertTrue(kids[0] instanceof AutoconfCaseElement);
+
+ AutoconfCaseElement caseEl = (AutoconfCaseElement) kids[0];
+ assertEqualSource(text.substring(0, text.length()-1), caseEl);
+
+ assertEquals(3, caseEl.getChildren().length);
+
+ assertTrue(caseEl.getChildren()[0] instanceof AutoconfCaseConditionElement);
+ assertTrue(caseEl.getChildren()[1] instanceof AutoconfCaseConditionElement);
+ assertTrue(caseEl.getChildren()[2] instanceof AutoconfCaseConditionElement);
+
+ AutoconfCaseConditionElement caseCond = (AutoconfCaseConditionElement) caseEl.getChildren()[0];
+ assertEquals("linux-*-*) AC_FIRST($VAL) ; true ;;", caseCond.getSource());
+ assertEquals(1, caseCond.getChildren().length);
+ assertEqualSource("AC_FIRST($VAL)", caseCond.getChildren()[0]);
+
+ caseCond = (AutoconfCaseConditionElement) caseEl.getChildren()[1];
+ assertEquals("bsd-* | macosx-*) : ;;", caseCond.getSource());
+ assertEquals(0, caseCond.getChildren().length);
+
+ caseCond = (AutoconfCaseConditionElement) caseEl.getChildren()[2];
+ assertEquals("*) echo \"I dunno $VAL\";;", caseCond.getSource());
+ assertEquals(0, caseCond.getChildren().length);
+
+ }
+
+ public void testCaseErr() {
+ String text =
+ "case $VAL; linux-*-*) AC_FIRST($VAL) ; true esac\n";
+ AutoconfElement tree = parse(text, true);
+ assertEquals(2, errors.size());
+ checkError(AutoconfEditorMessages.getString(AutoconfParser.INVALID_IN));
+ checkError(AutoconfEditorMessages.getFormattedString(AutoconfParser.INVALID_TERMINATION, "esac"));
+
+ assertTreeStructure(tree, new String[] { "case", "linux-*-*", "AC_FIRST", "$VAL", null, null, null });
+
+ AutoconfElement[] kids = tree.getChildren();
+ AutoconfCaseElement caseEl = (AutoconfCaseElement) kids[0];
+ AutoconfCaseConditionElement caseCond = (AutoconfCaseConditionElement) caseEl.getChildren()[0];
+ // goofed up, but ok
+ assertEquals("linux-*-*) AC_FIRST($VAL) ; true esac", caseCond.getSource());
+ assertEqualSource("AC_FIRST($VAL)", caseCond.getChildren()[0]);
+
+ }
+ public void testCaseErr2() {
+ String text =
+ "case $VAL in\n";
+ AutoconfElement tree = parse(text, true);
+ assertEquals(1, errors.size());
+ checkError(AutoconfEditorMessages.getFormattedString(AutoconfParser.UNTERMINATED_CONSTRUCT, "case"));
+
+ assertTreeStructure(tree, new String[] { "case" });
+
+ }
+
+ public void testForIn() {
+ // don't get upset by 'in'
+ String text =
+ "for VAL in 1 2 3 4; do echo $VAL; done\n";
+ AutoconfElement tree = parse(text, false);
+
+ assertTreeStructure(tree, new String[] { "for" });
+ AutoconfElement[] kids = tree.getChildren();
+
+ AutoconfElement forEl = kids[0];
+ assertEqualSource(text.substring(0, text.length()-1), forEl);
+
+ }
+
+ public void testForDo() {
+ // don't get upset by parentheses
+ String text =
+ "for (( AC_1; AC_2(); AC_3(...) )); do echo $VAL; done\n";
+ AutoconfElement tree = parse(text, false);
+
+ assertTreeStructure(tree, new String[] { "for", "AC_1", "AC_2", "", null, "AC_3", "...", null, null });
+
+ }
+
+ public void testUntil() {
+ String text =
+ "until false; do AC_SOMETHING(...); done\n";
+ AutoconfElement tree = parse(text, false);
+ assertTreeStructure(tree, new String[] { "until", "AC_SOMETHING", "...", null, null });
+
+
+ }
+ public void testSelect() {
+ String text =
+ "select VAR in 1 2 3; do AC_SOMETHING(...); done\n"+
+ "select VAR; do AC_SOMETHING; done\n";
+
+ AutoconfElement tree = parse(text, false);
+ assertTreeStructure(tree, new String[] {
+ "select",
+ "AC_SOMETHING",
+ "...",
+ null,
+ null,
+ "select",
+ "AC_SOMETHING",
+ null
+ });
+ }
+
+ public void testComplex1() {
+ String text =
+ "AM_INIT_AUTOMAKE([foo1], 1.96)\n" +
+ "while true; do \n" +
+ " var=shift;\n" +
+ " if [ test -f \"$var\"] ; then\n"+
+ " AC_SOMETHING($var);\n"+
+ " fi\n"+
+ "done;\n"+
+ "AM_GENERATE(Makefile)\n";
+ AutoconfElement tree = parse(text, false);
+ assertTreeStructure(tree, new String[] {
+ "AM_INIT_AUTOMAKE",
+ "foo1",
+ "1.96",
+ null,
+ "while",
+ "if",
+ "AC_SOMETHING",
+ "$var",
+ null,
+ null,
+ null,
+ "AM_GENERATE",
+ "Makefile",
+ null
+ });
+ }
+
+ public void testComplex2() {
+ String text =
+ "if true; then\n" +
+ "AC_CANONICAL_HOST\n" +
+ "else\n" +
+ "case foo in \n" +
+ " 3) 1 ;;\n" +
+ "esac;\n" +
+ "fi\n";
+ AutoconfElement tree = parse(text, false);
+ assertTreeStructure(tree, new String[] {
+ "if",
+ "AC_CANONICAL_HOST",
+ "else",
+ "case",
+ "3",
+ null,
+ null,
+ null
+ });
+ }
+
+ public void testEarlyClose() {
+ String text =
+ "if true; then foo ; fi\n"+
+ "fi\n"+
+ "while true; do done;\n";
+ AutoconfElement tree = parse(text, true);
+ assertTreeStructure(tree, new String[] {
+ "if",
+ "while"
+ });
+ }
+
+ public void testOverlapping() {
+ String text =
+ "for foo\n"+
+ "if bar\n";
+ AutoconfElement tree = parse(text, true);
+ assertTreeStructure(tree, new String[] {
+ "for",
+ "if"
+ });
+ }
+
+ public void testDollar() {
+ // dollars guard keywords
+ String text =
+ "if [ $if == 3 ] ; then $for; fi\n";
+ AutoconfElement tree = parse(text);
+ assertTreeStructure(tree, new String[] {
+ "if"
+ });
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/autoconf/TestTokenizer.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/autoconf/TestTokenizer.java
new file mode 100644
index 0000000000..03f4d6312e
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/autoconf/TestTokenizer.java
@@ -0,0 +1,486 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.cdt.autotools.tests.autoconf;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.eclipse.jface.text.Document;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.AutoconfTokenizer;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.IAutoconfErrorHandler;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.ITokenConstants;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.ParseException;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.Token;
+
+
+/**
+ * Test autoconf tokenizer. The tokenizer mainly is used to detect boundaries and keywords
+ * and is not a full shell tokenizer.
+ * @author eswartz
+ *
+ */
+public class TestTokenizer extends TestCase {
+
+ private ArrayList tokenizerErrors;
+
+ /* (non-Javadoc)
+ * @see junit.framework.TestCase#setUp()
+ */
+ protected void setUp() throws Exception {
+ }
+
+ /* (non-Javadoc)
+ * @see junit.framework.TestCase#tearDown()
+ */
+ protected void tearDown() throws Exception {
+ }
+
+ protected IDocument createDocument(String text) {
+ return new Document(text);
+ }
+
+ protected List/*<Token>*/tokenize(IDocument document) {
+ return tokenize(document, false);
+ }
+
+ protected List/*<Token>*/tokenize(IDocument document, boolean isM4Mode) {
+ tokenizerErrors = new ArrayList();
+ AutoconfTokenizer tokenizer = new AutoconfTokenizer(document, new IAutoconfErrorHandler() {
+
+ public void handleError(ParseException exception) {
+ tokenizerErrors.add(exception);
+ }
+
+ });
+ tokenizer.setM4Context(isM4Mode);
+
+ List/*<Token>*/ tokens = tokenize(tokenizer);
+ return tokens;
+ }
+
+ protected List/*<Token>*/tokenize(AutoconfTokenizer tokenizer) {
+ List/*<Token>*/tokens = new ArrayList();
+ while (true) {
+ Token token = tokenizer.readToken();
+ if (token.getType() == ITokenConstants.EOF)
+ break;
+ tokens.add(token);
+ }
+ return tokens;
+ }
+
+ protected void checkNoErrors() {
+ assertEquals(0, tokenizerErrors.size());
+ }
+ public void testEmpty() {
+ IDocument document = createDocument("");
+ List tokens = tokenize(document, false);
+ checkNoErrors();
+ assertEquals(0, tokens.size());
+ }
+
+ public void testEOL1() {
+ IDocument document = createDocument("\n");
+ List tokens = tokenize(document, false);
+ checkNoErrors();
+ assertEquals(1, tokens.size());
+ checkToken((Token) tokens.get(0), document, ITokenConstants.EOL, "\n");
+ }
+
+ public void testEOL2() {
+ IDocument document = createDocument("\r\n");
+ List tokens = tokenize(document, false);
+ checkNoErrors();
+ assertEquals(1, tokens.size());
+ checkToken((Token) tokens.get(0), document, ITokenConstants.EOL, "\r\n");
+ }
+
+ public void testEOL3() {
+ IDocument document = createDocument("\n\r\n\n");
+ List tokens = tokenize(document, false);
+ checkNoErrors();
+ assertEquals(3, tokens.size());
+ checkToken((Token) tokens.get(0), document, ITokenConstants.EOL, "\n");
+ checkToken((Token) tokens.get(1), document, ITokenConstants.EOL, "\r\n");
+ checkToken((Token) tokens.get(2), document, ITokenConstants.EOL, "\n");
+ }
+
+ public void testShellText() {
+ // default mode is shell
+ String text = "random\nstuff\n";
+ IDocument document = createDocument(text);
+ List tokens = tokenize(document, false);
+ checkNoErrors();
+ assertEquals(4, tokens.size());
+ checkToken((Token) tokens.get(0), document, ITokenConstants.WORD,
+ "random");
+ checkToken((Token) tokens.get(1), document, ITokenConstants.EOL, "\n");
+ checkToken((Token) tokens.get(2), document, ITokenConstants.WORD,
+ "stuff");
+ checkToken((Token) tokens.get(3), document, ITokenConstants.EOL, "\n");
+ }
+
+ public void testShellTokens() {
+ // default mode is shell
+ String text = "while true; do ls; done\n";
+ IDocument document = createDocument(text);
+ List tokens = tokenize(document, false);
+ checkNoErrors();
+ assertEquals(8, tokens.size());
+ checkToken((Token) tokens.get(0), document, ITokenConstants.SH_WHILE,
+ "while");
+ checkToken((Token) tokens.get(1), document, ITokenConstants.WORD,
+ "true");
+ checkToken((Token) tokens.get(2), document, ITokenConstants.SEMI, ";");
+ checkToken((Token) tokens.get(3), document, ITokenConstants.SH_DO, "do");
+ checkToken((Token) tokens.get(4), document, ITokenConstants.WORD, "ls");
+ checkToken((Token) tokens.get(5), document, ITokenConstants.SEMI, ";");
+ checkToken((Token) tokens.get(6), document, ITokenConstants.SH_DONE,
+ "done");
+ checkToken((Token) tokens.get(7), document, ITokenConstants.EOL, "\n");
+ }
+
+ public void testShellTokens2() {
+ // don't misread partial tokens
+ String text = "while_stuff incase";
+ IDocument document = createDocument(text);
+ List tokens = tokenize(document, false);
+ checkNoErrors();
+ assertEquals(2, tokens.size());
+ checkToken((Token) tokens.get(0), document, ITokenConstants.WORD,
+ "while_stuff");
+ checkToken((Token) tokens.get(1), document, ITokenConstants.WORD,
+ "incase");
+ }
+
+ public void testShellTokens3() {
+ // don't interpret m4 strings in shell mode
+ String text = "`foo'";
+ IDocument document = createDocument(text);
+ List tokens = tokenize(document, false);
+ assertEquals(1, tokenizerErrors.size());
+ assertEquals(1, tokens.size());
+ checkToken((Token) tokens.get(0), document, ITokenConstants.SH_STRING_BACKTICK, "foo'", 5);
+ }
+
+ public void testShellTokens4() {
+ String text = "echo $if $((foo)) $\n";
+ IDocument document = createDocument(text);
+ List tokens = tokenize(document, false);
+ checkNoErrors();
+ assertEquals(11, tokens.size());
+ checkToken((Token) tokens.get(0), document, ITokenConstants.WORD, "echo");
+ checkToken((Token) tokens.get(1), document, ITokenConstants.SH_DOLLAR, "$");
+ // dollar guards keywords, but the tokenizer doesn't know this
+ checkToken((Token) tokens.get(2), document, ITokenConstants.SH_IF, "if");
+ checkToken((Token) tokens.get(3), document, ITokenConstants.SH_DOLLAR, "$");
+ checkToken((Token) tokens.get(4), document, ITokenConstants.LPAREN, "(");
+ checkToken((Token) tokens.get(5), document, ITokenConstants.LPAREN, "(");
+ checkToken((Token) tokens.get(6), document, ITokenConstants.WORD, "foo");
+ checkToken((Token) tokens.get(7), document, ITokenConstants.RPAREN, ")");
+ checkToken((Token) tokens.get(8), document, ITokenConstants.RPAREN, ")");
+ checkToken((Token) tokens.get(9), document, ITokenConstants.SH_DOLLAR, "$");
+ checkToken((Token) tokens.get(10), document, ITokenConstants.EOL, "\n");
+
+ }
+
+ public void testShellTokens5() {
+ String text = "while do select for until done\n";
+ IDocument document = createDocument(text);
+ List tokens = tokenize(document, false);
+ checkNoErrors();
+ assertEquals(7, tokens.size());
+ checkToken((Token) tokens.get(0), document, ITokenConstants.SH_WHILE, "while");
+ checkToken((Token) tokens.get(1), document, ITokenConstants.SH_DO, "do");
+ checkToken((Token) tokens.get(2), document, ITokenConstants.SH_SELECT, "select");
+ checkToken((Token) tokens.get(3), document, ITokenConstants.SH_FOR, "for");
+ checkToken((Token) tokens.get(4), document, ITokenConstants.SH_UNTIL, "until");
+ checkToken((Token) tokens.get(5), document, ITokenConstants.SH_DONE, "done");
+ checkToken((Token) tokens.get(6), document, ITokenConstants.EOL, "\n");
+
+ }
+
+ public void testShellComments() {
+ // comments are stripped and ignored in the shell mode
+ String text = "for # while case\n";
+ IDocument document = createDocument(text);
+ List tokens = tokenize(document, false);
+ checkNoErrors();
+ assertEquals(2, tokens.size());
+ checkToken((Token) tokens.get(0), document, ITokenConstants.SH_FOR,
+ "for");
+ checkToken((Token) tokens.get(1), document, ITokenConstants.EOL, "\n");
+ }
+
+ public void testShellComments2() {
+ // comments are stripped and ignored in the shell mode
+ String text = "# while case\n" + "#for x in 3\n" + "\n";
+ IDocument document = createDocument(text);
+ List tokens = tokenize(document, false);
+ checkNoErrors();
+ assertEquals(3, tokens.size());
+ checkToken((Token) tokens.get(0), document, ITokenConstants.EOL, "\n");
+ checkToken((Token) tokens.get(1), document, ITokenConstants.EOL, "\n");
+ checkToken((Token) tokens.get(2), document, ITokenConstants.EOL, "\n");
+ }
+
+ public void testM4Tokens0() {
+ String text = "while_stuff incase";
+ IDocument document = createDocument(text);
+ List tokens = tokenize(document, true);
+ checkNoErrors();
+ assertEquals(2, tokens.size());
+ checkToken((Token) tokens.get(0), document, ITokenConstants.WORD,
+ "while_stuff");
+ checkToken((Token) tokens.get(1), document, ITokenConstants.WORD,
+ "incase");
+ }
+
+ public void testShellStrings() {
+ String QUOTED =
+ "ls -la \"*.c\"";
+ String text = "echo `" + QUOTED + "`\n";
+ IDocument document = createDocument(text);
+ List tokens = tokenize(document, false);
+ checkNoErrors();
+ assertEquals(3, tokens.size());
+ checkToken((Token) tokens.get(0), document, ITokenConstants.WORD,
+ "echo");
+ checkToken((Token) tokens.get(1), document, ITokenConstants.SH_STRING_BACKTICK,
+ QUOTED, QUOTED.length() + 2);
+ checkToken((Token) tokens.get(2), document, ITokenConstants.EOL, "\n");
+ }
+ public void testShellStrings2() {
+ String QUOTED =
+ "ls -la 'space file'";
+ String text = "echo \"" + QUOTED + "\"\n";
+ IDocument document = createDocument(text);
+ List tokens = tokenize(document, false);
+ checkNoErrors();
+ assertEquals(3, tokens.size());
+ checkToken((Token) tokens.get(0), document, ITokenConstants.WORD,
+ "echo");
+ checkToken((Token) tokens.get(1), document, ITokenConstants.SH_STRING_DOUBLE,
+ QUOTED, QUOTED.length() + 2);
+ checkToken((Token) tokens.get(2), document, ITokenConstants.EOL, "\n");
+ }
+ public void testShellStrings3() {
+ String QUOTED =
+ "echo \"*.c\" | sed s/[a-z]/[A-Z]/g";
+ String text = "echo '" + QUOTED + "'\n";
+ IDocument document = createDocument(text);
+ List tokens = tokenize(document, false);
+ checkNoErrors();
+ assertEquals(3, tokens.size());
+ checkToken((Token) tokens.get(0), document, ITokenConstants.WORD,
+ "echo");
+ checkToken((Token) tokens.get(1), document, ITokenConstants.SH_STRING_SINGLE,
+ QUOTED, QUOTED.length() + 2);
+ checkToken((Token) tokens.get(2), document, ITokenConstants.EOL, "\n");
+ }
+ public void testM4Tokens1() {
+ String text = "define(`hi\', `HI\')\n";
+ IDocument document = createDocument(text);
+ List tokens = tokenize(document, true);
+ checkNoErrors();
+ assertEquals(7, tokens.size());
+ checkToken((Token) tokens.get(0), document, ITokenConstants.WORD,
+ "define");
+ checkToken((Token) tokens.get(1), document, ITokenConstants.LPAREN, "(");
+ // strings are unquoted in token text
+ checkToken((Token) tokens.get(2), document, ITokenConstants.M4_STRING,
+ "hi", 4);
+ checkToken((Token) tokens.get(3), document, ITokenConstants.COMMA, ",");
+ checkToken((Token) tokens.get(4), document, ITokenConstants.M4_STRING,
+ "HI", 4);
+ checkToken((Token) tokens.get(5), document, ITokenConstants.RPAREN, ")");
+ checkToken((Token) tokens.get(6), document, ITokenConstants.EOL, "\n");
+ }
+
+ public void testM4Comments() {
+ String text = "dnl # comment\n";
+ IDocument document = createDocument(text);
+ List tokens = tokenize(document, true);
+ checkNoErrors();
+ assertEquals(2, tokens.size());
+ checkToken((Token) tokens.get(0), document, ITokenConstants.WORD, "dnl");
+ checkToken((Token) tokens.get(1), document, ITokenConstants.M4_COMMENT,
+ "# comment\n");
+ }
+
+ public void testM4Comments2() {
+ String text = "dnl /* word(`quoted')\n" + "*/\n";
+ IDocument document = createDocument(text);
+ AutoconfTokenizer tokenizer = createTokenizer(document);
+ tokenizer.setM4Context(true);
+ tokenizer.setM4Comment("/*", "*/");
+
+ List tokens = tokenize(tokenizer);
+ assertEquals(3, tokens.size());
+ checkToken((Token) tokens.get(0), document, ITokenConstants.WORD, "dnl");
+ checkToken((Token) tokens.get(1), document, ITokenConstants.M4_COMMENT,
+ "/* word(`quoted')\n*/");
+ checkToken((Token) tokens.get(2), document, ITokenConstants.EOL, "\n");
+ }
+
+ public void testM4Strings1() {
+ // double quotes only removes one level of quotes
+ String text = "``double''\n";
+ IDocument document = createDocument(text);
+ AutoconfTokenizer tokenizer = createTokenizer(document);
+ tokenizer.setM4Context(true);
+
+ List tokens = tokenize(tokenizer);
+ assertEquals(2, tokens.size());
+ checkToken((Token) tokens.get(0), document, ITokenConstants.M4_STRING,
+ "`double'", 8 + 1 + 1);
+ checkToken((Token) tokens.get(1), document, ITokenConstants.EOL, "\n");
+ }
+
+ public void testM4Strings2() {
+ String text = "myword(!!boundary==)\n";
+ IDocument document = createDocument(text);
+ AutoconfTokenizer tokenizer = createTokenizer(document);
+ tokenizer.setM4Context(true);
+ tokenizer.setM4Quote("!!", "==");
+
+ List tokens = tokenize(tokenizer);
+ assertEquals(5, tokens.size());
+ checkToken((Token) tokens.get(0), document, ITokenConstants.WORD,
+ "myword");
+ checkToken((Token) tokens.get(1), document, ITokenConstants.LPAREN, "(");
+ checkToken((Token) tokens.get(2), document, ITokenConstants.M4_STRING,
+ "boundary", 8 + 2 + 2);
+ checkToken((Token) tokens.get(3), document, ITokenConstants.RPAREN, ")");
+ checkToken((Token) tokens.get(4), document, ITokenConstants.EOL, "\n");
+ }
+
+ public void testM4Tokens2() {
+ // dollar is not seen in m4 mode (only important when expanding)
+ String text = "define(foo,$1)\n";
+ IDocument document = createDocument(text);
+ AutoconfTokenizer tokenizer = createTokenizer(document);
+ tokenizer.setM4Context(true);
+
+ List tokens = tokenize(tokenizer);
+ assertEquals(8, tokens.size());
+ checkToken((Token) tokens.get(0), document, ITokenConstants.WORD,
+ "define");
+ checkToken((Token) tokens.get(1), document, ITokenConstants.LPAREN, "(");
+ checkToken((Token) tokens.get(2), document, ITokenConstants.WORD, "foo");
+ checkToken((Token) tokens.get(3), document, ITokenConstants.COMMA, ",");
+ checkToken((Token) tokens.get(4), document, ITokenConstants.TEXT, "$");
+ checkToken((Token) tokens.get(5), document, ITokenConstants.TEXT, "1");
+ checkToken((Token) tokens.get(6), document, ITokenConstants.RPAREN, ")");
+ checkToken((Token) tokens.get(7), document, ITokenConstants.EOL, "\n");
+ }
+
+ public void testM4QuoteNesting() {
+ String quote = "this is `nested\'!";
+ String text = "`" + quote +"'\n";
+ IDocument document = createDocument(text);
+ AutoconfTokenizer tokenizer = createTokenizer(document);
+ tokenizer.setM4Context(true);
+
+ List tokens = tokenize(tokenizer);
+ assertEquals(2, tokens.size());
+ checkToken((Token) tokens.get(0), document, ITokenConstants.M4_STRING,
+ quote, quote.length() + 2);
+ checkToken((Token) tokens.get(1), document, ITokenConstants.EOL, "\n");
+
+ }
+
+ public void testMixedContext() {
+ String text = "AM_INIT([arg])if true\n";
+ IDocument document = createDocument(text);
+ AutoconfTokenizer tokenizer = createTokenizer(document);
+ tokenizer.setM4Context(false);
+ tokenizer.setM4Quote("[", "]");
+
+ Token token;
+ token = tokenizer.readToken();
+ checkToken(token, document, ITokenConstants.WORD, "AM_INIT");
+
+ // "hey, that's a macro"
+ tokenizer.setM4Context(true);
+
+ token = tokenizer.readToken();
+ checkToken(token, document, ITokenConstants.LPAREN, "(");
+ token = tokenizer.readToken();
+ checkToken(token, document, ITokenConstants.M4_STRING, "arg", 5);
+ token = tokenizer.readToken();
+ checkToken(token, document, ITokenConstants.RPAREN, ")");
+
+ // "check it's not a dangling paren"
+ // it'll still be an m4 word
+ token = tokenizer.readToken();
+ checkToken(token, document, ITokenConstants.WORD, "if");
+
+ // push back token
+ tokenizer.unreadToken(token);
+
+ // "done reading macro"
+ tokenizer.setM4Context(false);
+
+ // "get shell stuff"
+ token = tokenizer.readToken();
+ checkToken(token, document, ITokenConstants.SH_IF, "if");
+ token = tokenizer.readToken();
+ checkToken(token, document, ITokenConstants.WORD, "true");
+
+ token = tokenizer.readToken();
+ checkToken(token, document, ITokenConstants.EOL, "\n");
+
+ checkToken(tokenizer.readToken(), document, ITokenConstants.EOF);
+
+ }
+
+ private AutoconfTokenizer createTokenizer(IDocument document) {
+ return new AutoconfTokenizer(document, new IAutoconfErrorHandler() {
+
+ public void handleError(ParseException exception) {
+ fail(exception.toString());
+ }
+
+ });
+ }
+
+ private void checkToken(Token token, IDocument document, int type) {
+ assertEquals(type, token.getType());
+ assertSame(document, token.getDocument());
+ assertTrue(token.getOffset() >= 0);
+ assertTrue(token.getType() == ITokenConstants.EOF || token.getLength() > 0);
+ assertEquals(document.get().substring(token.getOffset(),
+ token.getOffset() + token.getLength()), token.getText());
+ }
+
+ private void checkToken(Token token, IDocument document, int type,
+ String text) {
+ assertEquals(type, token.getType());
+ assertSame(document, token.getDocument());
+ assertTrue(token.getOffset() >= 0);
+ assertEquals(text, token.getText());
+ assertEquals(text.length(), token.getLength());
+ }
+
+ private void checkToken(Token token, IDocument document, int type,
+ String text, int length) {
+ assertEquals(type, token.getType());
+ assertSame(document, token.getDocument());
+ assertTrue(token.getOffset() >= 0);
+ assertEquals(text, token.getText());
+ assertEquals(length, token.getLength());
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/editors/AutomakeColourizationTests.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/editors/AutomakeColourizationTests.java
new file mode 100644
index 0000000000..4bc8017bed
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/editors/AutomakeColourizationTests.java
@@ -0,0 +1,215 @@
+/*******************************************************************************
+ * Copyright (c) 2006 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.tests.editors;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ITypedRegion;
+import org.eclipse.jface.text.TextAttribute;
+import org.eclipse.jface.text.rules.IToken;
+import org.eclipse.jface.text.rules.Token;
+import org.eclipse.linuxtools.cdt.autotools.tests.AutotoolsTestsPlugin;
+import org.eclipse.linuxtools.cdt.autotools.tests.ProjectTools;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake.AutomakeDocumentProvider;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake.AutomakeEditor;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake.AutomakefileCodeScanner;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake.AutomakefileSourceConfiguration;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.preferences.ColorManager;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbench;
+
+
+public class AutomakeColourizationTests extends TestCase {
+
+ ProjectTools tools;
+ private IProject project;
+ private IFile makefileAmFile;
+
+ static String makefileAmContents =
+ "# This is a comment" + "\n" +
+ "if CONDITION" + "\n" +
+ "MACRO = case1" + "\n" +
+ "else" + "\n" +
+ "MACRO = case2" + "\n" +
+ "$(MACRO)" + "\n" +
+ "${MACRO}" + "\n" +
+ "";
+ private IWorkbench workbench;
+ private AutomakefileCodeScanner codeScanner;
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ tools = new ProjectTools();
+ if (!ProjectTools.setup())
+ fail("could not perform basic project workspace setup");
+
+ project = ProjectTools.createProject("testProjectACT");
+
+ if(project == null) {
+ fail("Unable to create test project");
+ }
+
+ project.open(new NullProgressMonitor());
+
+ makefileAmFile = tools.createFile(project, "Makefile.am", makefileAmContents);
+ workbench = AutotoolsTestsPlugin.getDefault().getWorkbench();
+
+ IEditorPart openEditor = org.eclipse.ui.ide.IDE.openEditor(workbench
+ .getActiveWorkbenchWindow().getActivePage(), makefileAmFile,
+ true);
+
+ AutomakeEditor automakeEditor = (AutomakeEditor) openEditor;
+ AutomakeDocumentProvider docProvider = automakeEditor.getAutomakefileDocumentProvider();
+ IDocument automakeDocument = docProvider.getDocument(openEditor.getEditorInput());
+ AutomakefileSourceConfiguration automakeSourceViewerConfig = automakeEditor.getAutomakeSourceViewerConfiguration();
+
+ ITypedRegion region = automakeDocument.getPartition(0);
+
+ codeScanner = automakeSourceViewerConfig.getAutomakeCodeScanner();
+ codeScanner.setRange(automakeDocument, region.getOffset(), region.getLength());
+ }
+
+ IToken getNextToken() {
+ return codeScanner.nextToken();
+ }
+
+ public void testAutomakeEditorColourization() throws Exception {
+ // # This is a comment
+ IToken token0 = getNextToken();
+ assertTrue(token0 instanceof Token);
+ assertEquals(codeScanner.getTokenLength(), 20);
+ assertEquals(codeScanner.getTokenOffset(), 0);
+
+ Token token = (Token) token0;
+ TextAttribute ta = (TextAttribute) token.getData();
+ assertEquals(ColorManager.MAKE_COMMENT_RGB, ((Color) ta.getForeground()).getRGB());
+
+ // if CONDITION
+ token0 = getNextToken();
+ assertTrue(token0 instanceof Token);
+ assertEquals(codeScanner.getTokenLength(), 2);
+ assertEquals(codeScanner.getTokenOffset(), 20);
+
+ token = (Token) token0;
+ TextAttribute attribute = (TextAttribute) token.getData();
+ assertEquals(ColorManager.MAKE_KEYWORD_RGB, ((Color) attribute.getForeground()).getRGB());
+
+ // blank space between "if" and "CONDITION"
+ token0 = getNextToken();
+ assertTrue(token0 instanceof Token);
+ assertEquals(codeScanner.getTokenLength(), 1);
+ assertEquals(codeScanner.getTokenOffset(), 22);
+
+ token = (Token) token0;
+ attribute = (TextAttribute) token.getData();
+ assertNull(attribute);
+
+ // if CONDITION
+ token0 = getNextToken();
+ assertTrue(token0 instanceof Token);
+ assertEquals(codeScanner.getTokenLength(), 9);
+ assertEquals(codeScanner.getTokenOffset(), 23);
+
+ token = (Token) token0;
+ attribute = (TextAttribute) token.getData();
+ assertEquals(ColorManager.MAKE_DEFAULT_RGB, ((Color) attribute.getForeground()).getRGB());
+
+ // line break
+ token0 = getNextToken();
+ assertTrue(token0 instanceof Token);
+ assertEquals(codeScanner.getTokenLength(), 1);
+ assertEquals(codeScanner.getTokenOffset(), 32);
+
+ token = (Token) token0;
+ attribute = (TextAttribute) token.getData();
+ assertNull(attribute);
+
+ // MACRO = case1
+ token0 = getNextToken();
+ assertTrue(token0 instanceof Token);
+ assertEquals(codeScanner.getTokenLength(), 14);
+ assertEquals(codeScanner.getTokenOffset(), 33);
+
+ token = (Token) token0;
+ attribute = (TextAttribute) token.getData();
+ assertEquals(ColorManager.MAKE_MACRO_DEF_RGB, ((Color) attribute.getForeground()).getRGB());
+
+ // else
+ token0 = getNextToken();
+ assertTrue(token0 instanceof Token);
+ assertEquals(codeScanner.getTokenLength(), 4);
+ assertEquals(codeScanner.getTokenOffset(), 47);
+
+ token = (Token) token0;
+ attribute = (TextAttribute) token.getData();
+ assertEquals(ColorManager.MAKE_KEYWORD_RGB, ((Color) attribute.getForeground()).getRGB());
+
+ // line break
+ token0 = getNextToken();
+ assertTrue(token0 instanceof Token);
+ assertEquals(codeScanner.getTokenLength(), 1);
+ assertEquals(codeScanner.getTokenOffset(), 51);
+
+ token = (Token) token0;
+ attribute = (TextAttribute) token.getData();
+ assertNull(attribute);
+
+ // MACRO = case2
+ token0 = getNextToken();
+ assertTrue(token0 instanceof Token);
+ assertEquals(codeScanner.getTokenLength(), 14);
+ assertEquals(codeScanner.getTokenOffset(), 52);
+
+ token = (Token) token0;
+ attribute = (TextAttribute) token.getData();
+ assertEquals(ColorManager.MAKE_MACRO_DEF_RGB, ((Color) attribute.getForeground()).getRGB());
+
+ // $(MACRO)
+ token0 = getNextToken();
+ assertTrue(token0 instanceof Token);
+ assertEquals(codeScanner.getTokenLength(), 8);
+ assertEquals(codeScanner.getTokenOffset(), 66);
+
+ token = (Token) token0;
+ attribute = (TextAttribute) token.getData();
+ assertEquals(ColorManager.MAKE_MACRO_REF_RGB, ((Color) attribute.getForeground()).getRGB());
+
+ // line break
+ token0 = getNextToken();
+ assertTrue(token0 instanceof Token);
+ assertEquals(codeScanner.getTokenLength(), 1);
+ assertEquals(codeScanner.getTokenOffset(), 74);
+
+ token = (Token) token0;
+ attribute = (TextAttribute) token.getData();
+ assertNull(attribute);
+
+ // ${MACRO}
+ token0 = getNextToken();
+ assertTrue(token0 instanceof Token);
+ assertEquals(codeScanner.getTokenLength(), 8);
+ assertEquals(codeScanner.getTokenOffset(), 75);
+
+ token = (Token) token0;
+ attribute = (TextAttribute) token.getData();
+ assertEquals(ColorManager.MAKE_MACRO_REF_RGB, ((Color) attribute.getForeground()).getRGB());
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ project.delete(true, false, ProjectTools.getMonitor());
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/editors/AutomakeEditorTests.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/editors/AutomakeEditorTests.java
new file mode 100644
index 0000000000..01ee1fb0a5
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/editors/AutomakeEditorTests.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2006 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.tests.editors;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.linuxtools.cdt.autotools.tests.AutotoolsTestsPlugin;
+import org.eclipse.linuxtools.cdt.autotools.tests.ProjectTools;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake.AutomakeEditor;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbench;
+
+
+public class AutomakeEditorTests extends TestCase {
+
+ ProjectTools tools;
+ private IProject project;
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ tools = new ProjectTools();
+ if (!ProjectTools.setup())
+ fail("could not perform basic project workspace setup");
+ }
+
+ public void testAutomakeEditorAssociation() throws Exception {
+ project = ProjectTools.createProject("testProjectAET");
+
+ if(project == null) {
+ fail("Unable to create test project");
+ }
+
+ project.open(new NullProgressMonitor());
+
+ IFile makefileAmFile = tools.createEmptyFile(project, "Makefile.am");
+
+ IWorkbench workbench = AutotoolsTestsPlugin.getDefault().getWorkbench();
+
+ IEditorPart openEditor = org.eclipse.ui.ide.IDE.openEditor(workbench
+ .getActiveWorkbenchWindow().getActivePage(), makefileAmFile,
+ true);
+ assertTrue(openEditor instanceof AutomakeEditor);
+
+ project.delete(true, false, ProjectTools.getMonitor());
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/editors/AutomakeTextHoverTest.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/editors/AutomakeTextHoverTest.java
new file mode 100644
index 0000000000..5f86843445
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/editors/AutomakeTextHoverTest.java
@@ -0,0 +1,210 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2007 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.tests.editors;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.linuxtools.cdt.autotools.tests.AutotoolsTestsPlugin;
+import org.eclipse.linuxtools.cdt.autotools.tests.ProjectTools;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake.AutomakeDocumentProvider;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake.AutomakeEditor;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake.AutomakeTextHover;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake.AutomakefileSourceConfiguration;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbench;
+
+
+public class AutomakeTextHoverTest extends TestCase {
+
+ ProjectTools tools;
+ private IProject project;
+ private IFile makefileAmFile;
+ private AutomakeTextHover textHover;
+ private AutomakeEditor automakeEditor;
+ private IDocument automakeDocument;
+
+ static String makefileAmContents =
+ // There are 6 characters from line beginning to
+ // the space after the echo
+ // ie. '\techo ' == 6 characters
+ "MACRO = case1" + "\n" +
+ // 14
+ "target1:" + "\n" +
+ // 23 (before the tab)
+ // 32 is after the M in MACRO
+ "\t" + "echo $(MACRO)" + "\n" +
+ // 38 (before the tab)
+ "\t" + "echo $@" + "\n" +
+ "\n" +
+ // 48
+ "target2: target1" + "\n" +
+ // 65 (before the tab)
+ "\t" + "echo ${MACRO}" + "\n" +
+ // 80 (before the tab)
+ "\t" + "echo $@" + "\n" +
+ // 89 (before the tab)
+ "\t" + "echo $<" + "\n" +
+ "\n" +
+ // 99
+ "target3: target1 target2" + "\n" +
+ // 124 (before the tab)
+ "\t" + "echo $?" + "\n" +
+ "";
+ private IWorkbench workbench;
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ tools = new ProjectTools();
+ if (!ProjectTools.setup())
+ fail("could not perform basic project workspace setup");
+
+ project = ProjectTools.createProject("testProjectATHT");
+
+ if(project == null) {
+ fail("Unable to create test project");
+ }
+
+ project.open(new NullProgressMonitor());
+
+ makefileAmFile = tools.createFile(project, "Makefile.am", makefileAmContents);
+ workbench = AutotoolsTestsPlugin.getDefault().getWorkbench();
+
+ IEditorPart openEditor = org.eclipse.ui.ide.IDE.openEditor(workbench
+ .getActiveWorkbenchWindow().getActivePage(), makefileAmFile,
+ true);
+
+ automakeEditor = (AutomakeEditor) openEditor;
+ AutomakeDocumentProvider docProvider = automakeEditor.getAutomakefileDocumentProvider();
+ automakeDocument = docProvider.getDocument(openEditor.getEditorInput());
+ AutomakefileSourceConfiguration automakeSourceViewerConfig = automakeEditor.getAutomakeSourceViewerConfiguration();
+ textHover = (AutomakeTextHover) automakeSourceViewerConfig.getTextHover(null, "");
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ project.delete(true, false, ProjectTools.getMonitor());
+ }
+
+ public void testGetHoverInfoTargetName1() {
+ IRegion hoverRegion = textHover.getHoverRegion(automakeEditor.getAutomakeSourceViewer(), 45);
+ if (hoverRegion == null)
+ fail("Null hoverRegion");
+ // hover between the $ and the @ in target1
+ assertEquals(44, hoverRegion.getOffset());
+ assertEquals(2, hoverRegion.getLength());
+ try {
+ assertEquals("$@", automakeDocument.get(hoverRegion.getOffset(),
+ hoverRegion.getLength()));
+ } catch (BadLocationException e) {
+ fail("BadLocationException");
+ e.printStackTrace();
+ }
+ assertEquals("target1", textHover.getHoverInfo(
+ automakeEditor.getAutomakeSourceViewer(), hoverRegion));
+ }
+
+ public void testGetHoverInfoTargetName2() {
+ // hover between the $ and the @ in target2
+ IRegion hoverRegion = textHover.getHoverRegion(automakeEditor.getAutomakeSourceViewer(), 87);
+ if (hoverRegion == null)
+ fail("Null hoverRegion");
+ assertEquals(86, hoverRegion.getOffset());
+ assertEquals(2, hoverRegion.getLength());
+ try {
+ assertEquals("$@", automakeDocument.get(hoverRegion.getOffset(),
+ hoverRegion.getLength()));
+ } catch (BadLocationException e) {
+ fail("BadLocationException");
+ e.printStackTrace();
+ }
+ assertEquals("target2", textHover.getHoverInfo(
+ automakeEditor.getAutomakeSourceViewer(), hoverRegion));
+ }
+
+ public void testGetHoverInfoForTargetDependency() {
+ // hover between the $ and the < in target2
+ IRegion hoverRegion = textHover.getHoverRegion(automakeEditor.getAutomakeSourceViewer(), 96);
+ if (hoverRegion == null)
+ fail("Null hoverRegion");
+ assertEquals(95, hoverRegion.getOffset());
+ assertEquals(2, hoverRegion.getLength());
+ try {
+ assertEquals("$<", automakeDocument.get(hoverRegion.getOffset(),
+ hoverRegion.getLength()));
+ } catch (BadLocationException e) {
+ fail("BadLocationException");
+ e.printStackTrace();
+ }
+ assertEquals("target1", textHover.getHoverInfo(
+ automakeEditor.getAutomakeSourceViewer(), hoverRegion));
+ }
+
+ public void testGetHoverInfoForTargetDependencies() {
+ // hover between the $ and the ? in target3
+ IRegion hoverRegion = textHover.getHoverRegion(automakeEditor.getAutomakeSourceViewer(), 131);
+ if (hoverRegion == null)
+ fail("Null hoverRegion");
+ assertEquals(130, hoverRegion.getOffset());
+ assertEquals(2, hoverRegion.getLength());
+ try {
+ assertEquals("$?", automakeDocument.get(hoverRegion.getOffset(),
+ hoverRegion.getLength()));
+ } catch (BadLocationException e) {
+ fail("BadLocationException");
+ e.printStackTrace();
+ }
+ assertEquals("target1 target2", textHover.getHoverInfo(
+ automakeEditor.getAutomakeSourceViewer(), hoverRegion));
+ }
+
+ public void testGetHoverForMacro1() {
+ IRegion hoverRegion = textHover.getHoverRegion(automakeEditor.getAutomakeSourceViewer(), 32);
+ if (hoverRegion == null)
+ fail("Null hoverRegion");
+ // hover between the M and the A in the first $(MACRO) reference
+ assertEquals(31, hoverRegion.getOffset());
+ assertEquals(5, hoverRegion.getLength());
+ try {
+ assertEquals("MACRO", automakeDocument.get(hoverRegion.getOffset(),
+ hoverRegion.getLength()));
+ } catch (BadLocationException e) {
+ fail("BadLocationException");
+ e.printStackTrace();
+ }
+ assertEquals("case1", textHover.getHoverInfo(
+ automakeEditor.getAutomakeSourceViewer(), hoverRegion));
+ }
+
+ public void testGetHoverForMacro2() {
+ // hover between the M and the A in the ${MACRO} reference in target2
+ IRegion hoverRegion = textHover.getHoverRegion(automakeEditor.getAutomakeSourceViewer(), 74);
+ if (hoverRegion == null)
+ fail("Null hoverRegion");
+ assertEquals(73, hoverRegion.getOffset());
+ assertEquals(5, hoverRegion.getLength());
+ try {
+ assertEquals("MACRO", automakeDocument.get(hoverRegion.getOffset(),
+ hoverRegion.getLength()));
+ } catch (BadLocationException e) {
+ fail("BadLocationException");
+ e.printStackTrace();
+ }
+ assertEquals("case1", textHover.getHoverInfo(
+ automakeEditor.getAutomakeSourceViewer(), hoverRegion));
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/editors/EditorTests.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/editors/EditorTests.java
new file mode 100644
index 0000000000..308129fb05
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/src/org/eclipse/linuxtools/cdt/autotools/tests/editors/EditorTests.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.tests.editors;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+public class EditorTests {
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite(
+ "Test for org.eclipse.linuxtools.cdt.autotools.core.tests.editors");
+ //$JUnit-BEGIN$
+ suite.addTestSuite(AutomakeColourizationTests.class);
+ suite.addTestSuite(AutomakeTextHoverTest.class);
+ suite.addTestSuite(AutomakeEditorTests.class);
+ //$JUnit-END$
+ return suite;
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/test.xml b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/test.xml
new file mode 100644
index 0000000000..2cdb85daf2
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/test.xml
@@ -0,0 +1,75 @@
+<?xml version="1.0"?>
+
+<project name="testsuite" default="run" basedir=".">
+ <property name="classname" value="org.eclipse.linuxtools.cdt.autotools.tests.AllAutotoolsTests" />
+ <property name="autoconf_classname" value="org.eclipse.linuxtools.cdt.autotools.tests.autoconf.AutoconfTests" />
+ <property name="editors_classname" value="org.eclipse.linuxtools.cdt.autotools.tests.editors.EditorTests" />
+
+ <!-- The property ${eclipse-home} should be passed into this script -->
+ <!-- Set a meaningful default value for when it is not. -->
+ <property name="eclipse-home" value="${basedir}/../.." />
+
+ <!-- sets the properties eclipse-home, and library-file -->
+ <property name="plugin-name" value="org.eclipse.linuxtools.cdt.autotools.tests" />
+ <property name="library-file" value="${eclipse-home}/dropins/${subProjectName2}/plugins/org.eclipse.test/library.xml" />
+
+ <!-- This target holds all initialization code that needs to be done for -->
+ <!-- all tests that are to be run. Initialization for individual tests -->
+ <!-- should be done within the body of the suite target. -->
+ <target name="init">
+ <tstamp />
+ <delete>
+ <fileset dir="${eclipse-home}" includes="org*.xml" />
+ </delete>
+ </target>
+
+ <!-- This target defines the tests that need to be run. -->
+ <target name="suite">
+ <property name="autotools-folder" value="${eclipse-home}/autotools_folder" />
+ <delete dir="${autotools-folder}" quiet="true" />
+ <echo message="Calling ui-test in ${library-file} with eclipse-home = ${eclipse-home} and library-file = ${library-file}"/>
+ <ant target="ui-test" antfile="${library-file}" dir="${eclipse-home}">
+ <property name="data-dir" value="${autotools-folder}" />
+ <property name="plugin-name" value="${plugin-name}" />
+ <property name="classname" value="${classname}" />
+ </ant>
+ </target>
+
+ <target name="autoconf_suite">
+ <property name="autoconf-folder" value="${eclipse-home}/autoconf_folder" />
+ <delete dir="${autoconf-folder}" quiet="true" />
+ <ant target="ui-test" antfile="${library-file}" dir="${eclipse-home}">
+ <property name="data-dir" value="${autoconf-folder}" />
+ <property name="plugin-name" value="${plugin-name}" />
+ <property name="classname" value="${autoconf_classname}" />
+ </ant>
+ </target>
+
+ <target name="editors_suite">
+ <property name="editors-folder" value="${eclipse-home}/editors_folder" />
+ <delete dir="${editors-folder}" quiet="true" />
+ <ant target="ui-test" antfile="${library-file}" dir="${eclipse-home}">
+ <property name="data-dir" value="${editors-folder}" />
+ <property name="plugin-name" value="${plugin-name}" />
+ <property name="classname" value="${editors_classname}" />
+ </ant>
+ </target>
+
+ <!-- This target holds code to cleanup the testing environment after -->
+ <!-- after all of the tests have been run. You can use this target to -->
+ <!-- delete temporary files that have been created. -->
+ <target name="cleanup">
+ <mkdir dir="${results}/consolelogs" />
+ <copy failonerror="false" file="${eclipse-home}/results/${classname}.txt" tofile="${results}/consolelogs/${classname}_${platform}.metadata.log.txt" />
+ </target>
+
+ <!-- This target runs the test suite. Any actions that need to happen -->
+ <!-- after all the tests have been run should go here. -->
+ <target name="run" depends="init,suite,autoconf_suite,editors_suite,cleanup">
+ <ant target="collect" antfile="${library-file}" dir="${eclipse-home}">
+ <property name="includes" value="org*.xml" />
+ <property name="output-file" value="${plugin-name}.xml" />
+ </ant>
+ </target>
+
+</project>
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/zip/project1.zip b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/zip/project1.zip
new file mode 100644
index 0000000000..4a51e51f9b
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/zip/project1.zip
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/zip/project2.zip b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/zip/project2.zip
new file mode 100644
index 0000000000..98319d436e
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.tests/zip/project2.zip
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui.tests/.classpath b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui.tests/.classpath
new file mode 100644
index 0000000000..ad32c83a78
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui.tests/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui.tests/.project b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui.tests/.project
new file mode 100644
index 0000000000..256be3dca9
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui.tests/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.linuxtools.cdt.autotools.ui.tests</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui.tests/.settings/org.eclipse.jdt.core.prefs b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui.tests/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000000..7dd8708156
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui.tests/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,8 @@
+#Thu Mar 25 17:32:29 EDT 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui.tests/ChangeLog b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui.tests/ChangeLog
new file mode 100644
index 0000000000..9f4d1580d5
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui.tests/ChangeLog
@@ -0,0 +1,60 @@
+2010-05-06 Jeff Johnston <jjohnstn@redhat.com>
+
+ * build.properties: Remove non-existent test.xml references.
+ * META-INF/MANIFEST.MF: Mark plug-in as singleton.
+
+2010-05-05 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/tests/SetConfigurationParameter.java (canBuildWithConfigParm): Wait until
+ a.out is created before looking at config.status as we could end up looking at config.status while it is being created.
+ (newConfigCopiesParms): Don't assume that active configuration will be set in configuration list.
+
+2010-04-29 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/tests/SetConfigurationParameter.java (canBuildWithConfigParm): Add
+ waiting period before testing existence of created file to ensure action has run on a slower system.
+ (newConfigCopiesParms): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/tests/TestToolActions.java (canAccessAutoconf): Ditto.
+ (canAccessAutomake): Ditto.
+ (canReconfigureProject): Ditto.
+ (canAccessAutoreconf): Ditto.
+ (canAccessAclocal): Ditto.
+ * plugin.properties: Change provider to Eclipse instead of Eclipse.org.
+ * META-INF/MANIFEST.MF: Add BundleLocalization statement so plugin.properties gets
+ used.
+
+2010-04-22 Jeff Johnston <jjohnstn@redhat.com>
+
+ * plugin.properties: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/tests/AllTests.java: New file.
+ * build.properties: Make plugin.properties part of binary build.
+ * META-INF/MANIFEST.MF: Change Java requirement to 1.5.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/tests/Activator.java: Add copyright notice.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/tests/SetConfigurationParameter.java (beforeClass): Close
+ Welcome view optionally if it exists. Also hard-wire keyboard to EN_US.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/tests/TestToolActions.java (beforeClass): Ditto.
+ (sleep): Close Eclipse.
+
+2010-04-19 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/tests/TestToolActions.java (canAccessAutoheader): New test.
+ (canAccessAutomake): Ditto.
+ (canReconfigureProject): Ditto.
+ (canAccessLibtoolize): Ditto.
+ (canAccessAutoreconf): Ditto.
+
+2010-04-15 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/tests/TestToolActions.java: New file.
+ (canAccessAutomake): New test.
+
+2010-04-12 Jeff Johnston <jjohnstn@redhat.com>
+
+ Initial check-in.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/tests/Activator.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/tests/SetConfigurationParameter.java: New file.
+ * build.properties: New file.
+ * .project: New file.
+ * .classpath: New file.
+ * .settings: New file.
+ * META-INF/MANIFEST.MF: New file. \ No newline at end of file
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui.tests/META-INF/MANIFEST.MF b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui.tests/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..976e1e1091
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,30 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %bundleName
+Bundle-SymbolicName: org.eclipse.linuxtools.cdt.autotools.ui.tests;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.eclipse.linuxtools.cdt.autotools.ui.tests.Activator
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.swtbot.eclipse.core;bundle-version="2.0.0",
+ org.eclipse.swtbot.eclipse.finder;bundle-version="2.0.0",
+ org.eclipse.swtbot.junit4_x;bundle-version="2.0.0",
+ org.eclipse.swtbot.swt.finder;bundle-version="2.0.0",
+ org.hamcrest;bundle-version="1.1.0",
+ org.junit4;bundle-version="4.5.0",
+ org.apache.log4j;bundle-version="1.2.13",
+ org.eclipse.core.resources;bundle-version="3.5.1",
+ org.eclipse.linuxtools.cdt.autotools.core;bundle-version="1.0.0",
+ org.eclipse.linuxtools.cdt.autotools.ui;bundle-version="1.0.0",
+ org.eclipse.cdt.core;bundle-version="5.1.1",
+ org.eclipse.cdt.launch;bundle-version="6.0.0",
+ org.eclipse.cdt.make.core;bundle-version="6.0.0",
+ org.eclipse.cdt.make.ui;bundle-version="6.0.1",
+ org.eclipse.cdt.managedbuilder.core;bundle-version="6.0.0",
+ org.eclipse.cdt.managedbuilder.gnu.ui;bundle-version="5.0.100",
+ org.eclipse.cdt.managedbuilder.ui;bundle-version="5.1.0",
+ org.eclipse.cdt.ui;bundle-version="5.1.1"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-Vendor: %provider
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui.tests/build.properties b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui.tests/build.properties
new file mode 100644
index 0000000000..aa10a0e845
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui.tests/build.properties
@@ -0,0 +1,9 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.properties
+src.includes = src/,\
+ META-INF/,\
+ plugin.properties
+individualSourceBundles=true
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui.tests/plugin.properties b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui.tests/plugin.properties
new file mode 100644
index 0000000000..ed7fdac860
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui.tests/plugin.properties
@@ -0,0 +1,12 @@
+#################################################################################
+# Copyright (c) 2010 Red Hat, Inc.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Red Hat Incorporated - initial API and implementation
+#################################################################################
+bundleName=Autotools UI Tests Plug-in (Incubation)
+provider=Eclipse \ No newline at end of file
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui.tests/src/org/eclipse/linuxtools/cdt/autotools/ui/tests/Activator.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui.tests/src/org/eclipse/linuxtools/cdt/autotools/ui/tests/Activator.java
new file mode 100644
index 0000000000..6f0b5ff650
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui.tests/src/org/eclipse/linuxtools/cdt/autotools/ui/tests/Activator.java
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.tests;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.linuxtools.cdt.autotools.ui.tests";
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui.tests/src/org/eclipse/linuxtools/cdt/autotools/ui/tests/AllTests.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui.tests/src/org/eclipse/linuxtools/cdt/autotools/ui/tests/AllTests.java
new file mode 100644
index 0000000000..0b2b6e06ad
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui.tests/src/org/eclipse/linuxtools/cdt/autotools/ui/tests/AllTests.java
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.tests;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+@RunWith(Suite.class)
+@Suite.SuiteClasses({
+ SetConfigurationParameter.class,
+ TestToolActions.class,
+})
+public class AllTests {
+ // needed for this class to compile
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui.tests/src/org/eclipse/linuxtools/cdt/autotools/ui/tests/SetConfigurationParameter.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui.tests/src/org/eclipse/linuxtools/cdt/autotools/ui/tests/SetConfigurationParameter.java
new file mode 100644
index 0000000000..d1aa9ec370
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui.tests/src/org/eclipse/linuxtools/cdt/autotools/ui/tests/SetConfigurationParameter.java
@@ -0,0 +1,515 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.tests;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.eclipse.cdt.ui.newui.UIMessages;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectNature;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
+import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
+import org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotCheckBox;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotCombo;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotRadio;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotText;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+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;
+
+@RunWith(SWTBotJunit4ClassRunner.class)
+public class SetConfigurationParameter {
+
+ private static SWTWorkbenchBot bot;
+
+ @BeforeClass
+ public static void beforeClass() throws Exception {
+ SWTBotPreferences.KEYBOARD_LAYOUT = "EN_US";
+ bot = new SWTWorkbenchBot();
+ // Close the Welcome view if it exists
+ try {
+ bot.viewByTitle("Welcome").close();
+ // Turn off automatic building by default
+ } catch (Exception e) {
+ // do nothing
+ }
+ // Turn off automatic building by default
+ bot.menu("Window").menu("Preferences").click();
+ SWTBotShell shell = bot.shell("Preferences");
+ shell.activate();
+ bot.tree().expandNode("General").select("Workspace");
+ SWTBotCheckBox buildAuto = bot.checkBox("Build automatically");
+ if (buildAuto != null && buildAuto.isChecked())
+ buildAuto.click();
+ bot.button("Apply").click();
+ // Ensure that the C/C++ perspective is chosen automatically
+ // and doesn't require user intervention
+ bot.tree().expandNode("General").select("Perspectives");
+ SWTBotRadio radio = bot.radio("Always open");
+ if (radio != null && !radio.isSelected())
+ radio.click();
+ bot.button("OK").click();
+ }
+
+ @Test
+ // Verify we can create a sample Autotools project using the New C Project UI
+ public void canCreateANewAutotoolsProject() throws Exception {
+ bot.menu("File").menu("New").menu("Project...").click();
+
+ SWTBotShell shell = bot.shell("New Project");
+ shell.activate();
+ bot.tree().expandNode("C/C++").select("C Project");
+ bot.button("Next >").click();
+
+ bot.textWithLabel("Project name:").setText("GnuProject0");
+ bot.tree().expandNode("GNU Autotools").select("Hello World ANSI C Autotools Project");
+
+ bot.button("Finish").click();
+
+ IWorkspace workspace = ResourcesPlugin.getWorkspace();
+ assertTrue(workspace != null);
+ IWorkspaceRoot root = workspace.getRoot();
+ assertTrue(root != null);
+ IProject project = root.getProject("GnuProject0");
+ assertTrue(project != null);
+ IProjectNature nature = project.getNature("org.eclipse.linuxtools.cdt.autotools.core.autotoolsNatureV2");
+ assertTrue(nature != null);
+ }
+
+ @Test
+ // Verify we can set a configuration parameter and that it is recorded in
+ // the .autotools file for the project
+ public void canSetConfigParm() throws Exception {
+ SWTBotView view = bot.viewByTitle("Project Explorer");
+ view.bot().tree().select("GnuProject0");
+ bot.menu("Project", 1).menu("Properties").click();
+ SWTBotShell shell = bot.shell("Properties for GnuProject0");
+ shell.activate();
+ bot.tree().expandNode("Autotools").select("Configure Settings");
+ bot.treeWithLabel("Configure Settings").expandNode("configure").select("Advanced");
+ // Set the configure parameters to be --enable-jeff via user-defined options
+ SWTBotText text = bot.textWithLabel("Additional command-line options");
+ text.typeText("--enable-jeff");
+ bot.button("OK").click();
+ IWorkspace workspace = ResourcesPlugin.getWorkspace();
+ assertTrue(workspace != null);
+ IWorkspaceRoot root = workspace.getRoot();
+ assertTrue(root != null);
+ IProject project = root.getProject("GnuProject0");
+ assertTrue(project != null);
+ IPath path = project.getLocation();
+ path = path.append(".autotools");
+ File f = new File(path.toOSString());
+ assertTrue(f.exists());
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ DocumentBuilder db = dbf.newDocumentBuilder();
+ Document d = db.parse(f);
+ Element e = d.getDocumentElement();
+ // Get the stored configuration data
+ NodeList cfgs = e.getElementsByTagName("configuration"); // $NON-NLS-1$
+ assertEquals(1, cfgs.getLength());
+ Node n = cfgs.item(0);
+ NodeList l = n.getChildNodes();
+ // Verify user field in .autotools file is set to --enable-jeff
+ boolean foundUser = false;
+ for (int y = 0; y < l.getLength(); ++y) {
+ Node child = l.item(y);
+ if (child.getNodeName().equals("option")) { // $NON-NLS-1$
+ NamedNodeMap optionAttrs = child.getAttributes();
+ Node idNode = optionAttrs.getNamedItem("id"); // $NON-NLS-1$
+ Node valueNode = optionAttrs.getNamedItem("value"); // $NON-NLS-1$
+ assertTrue(idNode != null);
+ assertTrue(valueNode != null);
+ String id = idNode.getNodeValue();
+ String value = valueNode.getNodeValue();
+ if (id.equals("user")) {
+ foundUser = true;
+ assertEquals(value, "--enable-jeff");
+ }
+ }
+ }
+ assertTrue(foundUser);
+ }
+
+ @Test
+ // Verify we can build the project with a configuration parameter and that
+ // the configuration parameter can be found in the config.status file.
+ public void canBuildWithConfigParm() throws Exception {
+ SWTBotView view = bot.viewByTitle("Project Explorer");
+ view.bot().tree().select("GnuProject0");
+ bot.menu("Project", 1).menu("Build Project").click();
+ IWorkspace workspace = ResourcesPlugin.getWorkspace();
+ assertTrue(workspace != null);
+ IWorkspaceRoot root = workspace.getRoot();
+ assertTrue(root != null);
+ IProject project = root.getProject("GnuProject0");
+ assertTrue(project != null);
+ IPath path = project.getLocation();
+ // We need to wait until the a.out file is created so
+ // sleep a bit and look for it...give up after 120 seconds
+ for (int i = 0; i < 240; ++i) {
+ bot.sleep(500);
+ File f = new File(path.append("src/a.out").toOSString());
+ if (f.exists())
+ break;
+ }
+ File f = new File(path.append("config.status").toOSString());
+ assertTrue(f.exists());
+ BufferedReader r = new BufferedReader(new FileReader(f));
+ int ch;
+ boolean optionFound = false;
+ // Read config.status and look for the string --enable-jeff
+ // which is a simple verification that the option was used in the
+ // configure step.
+ while ((ch = r.read()) != -1) {
+ if (ch == '-') {
+ char[] buf = new char[12];
+ r.mark(100);
+ int count = r.read(buf);
+ if (count < 12)
+ break;
+ String s = new String(buf);
+ if (s.equals("-enable-jeff")) {
+ optionFound = true;
+ break;
+ } else {
+ r.reset();
+ }
+ }
+ }
+ assertTrue(optionFound);
+ }
+
+ @Test
+ // Verify a new configuration will copy the configuration parameters
+ // of its base configuration.
+ public void newConfigCopiesParms() throws Exception {
+ SWTBotView view = bot.viewByTitle("Project Explorer");
+ view.bot().tree().select("GnuProject0");
+ bot.menu("Project", 1).menu("Build Configurations").menu("Manage...").click();
+ SWTBotShell shell = bot.shell("GnuProject0: Manage Configurations");
+ shell.activate();
+ bot.button("New...").click();
+ shell = bot.shell("Create New Configuration");
+ shell.activate();
+ SWTBotText t = bot.textWithLabel("Name:");
+ t.typeText("debug");
+ SWTBotRadio radio = bot.radio("Existing configuration");
+ if (!radio.isSelected())
+ radio.click();
+ bot.button("OK").click();
+ shell = bot.shell("GnuProject0: Manage Configurations");
+ shell.activate();
+ bot.button("New...").click();
+ shell = bot.shell("Create New Configuration");
+ shell.activate();
+ t = bot.textWithLabel("Name:");
+ t.typeText("default");
+ radio = bot.radio("Default configuration");
+ if (!radio.isSelected())
+ radio.click();
+ bot.button("OK").click();
+ shell = bot.shell("GnuProject0: Manage Configurations");
+ shell.activate();
+ SWTBotTable table = bot.table();
+ assertTrue(table.containsItem("debug"));
+ table.getTableItem("debug").select();
+ bot.button("Set Active").click();
+ bot.button("OK").click();
+ // Verify the debug configuration is active and has a user parameter: --enable-jeff
+ view = bot.viewByTitle("Project Explorer");
+ view.bot().tree().select("GnuProject0");
+ bot.menu("Project", 1).menu("Properties").click();
+ shell = bot.shell("Properties for GnuProject0");
+ shell.activate();
+ bot.tree().expandNode("Autotools").select("Configure Settings");
+ SWTBotCombo configs = bot.comboBoxWithLabel(UIMessages.getString("AbstractPage.6"));
+ configs.setFocus();
+ String[] items = configs.items();
+ for (int i = 0; i < items.length; ++i) {
+ if (items[i].contains("debug") && items[i].contains("Active"))
+ configs.setSelection(i);
+ }
+ assertTrue(configs.getText().contains("debug"));
+ bot.treeWithLabel("Configure Settings").expandNode("configure").select("Advanced");
+ SWTBotText text = bot.textWithLabel("Additional command-line options");
+ String val = text.getText();
+ assertEquals(val, "--enable-jeff");
+ // Verify that the build directory for the new configuration has been
+ // switched to build-debug
+ bot.tree().expandNode("C/C++ Build").select();
+ String buildDir = bot.textWithLabel("Build directory:").getText();
+ assertTrue(buildDir.endsWith("build-debug"));
+ // Verify the default configuration has no user setting
+ bot.tree().expandNode("Autotools").select("Configure Settings");
+ configs = bot.comboBoxWithLabel(UIMessages.getString("AbstractPage.6"));
+ configs.setSelection("default");
+ bot.treeWithLabel("Configure Settings").expandNode("configure").select("Advanced");
+ text = bot.textWithLabel("Additional command-line options");
+ val = text.getText();
+ assertEquals(val, "");
+ bot.button("OK").click();
+ // Build the project again and verify we get a build-debug directory
+ view = bot.viewByTitle("Project Explorer");
+ view.bot().tree().select("GnuProject0");
+ bot.menu("Project", 1).menu("Build Project").click();
+ IWorkspace workspace = ResourcesPlugin.getWorkspace();
+ assertTrue(workspace != null);
+ IWorkspaceRoot root = workspace.getRoot();
+ assertTrue(root != null);
+ IProject project = root.getProject("GnuProject0");
+ assertTrue(project != null);
+ IPath path = project.getLocation();
+ // We need to wait until the config.status file is created so
+ // sleep a bit and look for it...give up after 20 seconds
+ for (int i = 0; i < 40; ++i) {
+ bot.sleep(500);
+ File f = new File(path.append("build-debug/src/a.out").toOSString());
+ if (f.exists())
+ break;
+ }
+ File f = new File(path.append("build-debug/config.status").toOSString());
+ assertTrue(f.exists());
+ BufferedReader r = new BufferedReader(new FileReader(f));
+ int ch;
+ boolean optionFound = false;
+ // Read config.status and look for the string --enable-jeff
+ // which is a simple verification that the option was used in the
+ // configure step.
+ while ((ch = r.read()) != -1) {
+ if (ch == '-') {
+ char[] buf = new char[12];
+ r.mark(100);
+ int count = r.read(buf);
+ if (count < 12)
+ break;
+ String s = new String(buf);
+ if (s.equals("-enable-jeff")) {
+ optionFound = true;
+ break;
+ } else {
+ r.reset();
+ }
+ }
+ }
+ assertTrue(optionFound);
+ // Verify we cleaned out the top-level build directory (i.e. that there
+ // is no config.status there anymore).
+ path = project.getLocation().append("config.status");
+ f = new File(path.toOSString());
+ assertTrue(!f.exists());
+ path = project.getLocation().append(".autotools");
+ f = new File(path.toOSString());
+ assertTrue(f.exists());
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ DocumentBuilder db = dbf.newDocumentBuilder();
+ Document d = db.parse(f);
+ Element e = d.getDocumentElement();
+ // Get the stored configuration data
+ NodeList cfgs = e.getElementsByTagName("configuration"); // $NON-NLS-1$
+ assertEquals(3, cfgs.getLength());
+ int foundUser = 0;
+ for (int x = 0; x < cfgs.getLength(); ++x) {
+ Node n = cfgs.item(x);
+ NodeList l = n.getChildNodes();
+ // Verify two of the user fields in .autotools file are set to --enable-jeff
+ for (int y = 0; y < l.getLength(); ++y) {
+ Node child = l.item(y);
+ if (child.getNodeName().equals("option")) { // $NON-NLS-1$
+ NamedNodeMap optionAttrs = child.getAttributes();
+ Node idNode = optionAttrs.getNamedItem("id"); // $NON-NLS-1$
+ Node valueNode = optionAttrs.getNamedItem("value"); // $NON-NLS-1$
+ assertTrue(idNode != null);
+ assertTrue(valueNode != null);
+ String id = idNode.getNodeValue();
+ String value = valueNode.getNodeValue();
+ if (id.equals("user")) {
+ if (value.equals("--enable-jeff"))
+ ++foundUser;
+ }
+ }
+ }
+ }
+ assertEquals(foundUser, 2);
+ }
+
+ @Test
+ // Verify we can do a double rename of configurations, renaming one configuration to
+ // another and then cancel without changing configuration settings.
+ public void doubleRenameCancel() throws Exception {
+ SWTBotView view = bot.viewByTitle("Project Explorer");
+ view.bot().tree().select("GnuProject0");
+ bot.menu("Project", 1).menu("Properties").click();
+ SWTBotShell shell = bot.shell("Properties for GnuProject0");
+ shell.activate();
+ bot.tree().expandNode("Autotools").select("Configure Settings");
+ SWTBotCombo configs = bot.comboBoxWithLabel(UIMessages.getString("AbstractPage.6"));
+ assertTrue(configs.getText().contains("debug"));
+ bot.button("Manage Configurations...").click();
+ shell = bot.shell("GnuProject0: Manage Configurations");
+ shell.activate();
+ bot.table().select("debug");
+ // Rename "debug" to "release" and rename "default" to "debug".
+ // The settings should follow the rename operation.
+ bot.button("Rename...").click();
+ shell = bot.shell("Rename Configuration");
+ shell.activate();
+ SWTBotText text = bot.textWithLabel("Name:");
+ text.setText("");
+ text.typeText("release");
+ bot.button("OK").click();
+ shell = bot.shell("GnuProject0: Manage Configurations");
+ shell.activate();
+ bot.table().select("default");
+ bot.button("Rename...").click();
+ shell = bot.shell("Rename Configuration");
+ shell.activate();
+ text = bot.textWithLabel("Name:");
+ text.setText("");
+ text.typeText("debug");
+ bot.button("OK").click();
+ shell = bot.shell("GnuProject0: Manage Configurations");
+ shell.activate();
+ bot.button("OK").click();
+ // Verify that "release" has --enable-jeff set and that
+ // the new "debug" configuration has no user setting.
+ shell = bot.shell("Properties for GnuProject0");
+ shell.activate();
+ configs = bot.comboBoxWithLabel(UIMessages.getString("AbstractPage.6"));
+ bot.treeWithLabel("Configure Settings").expandNode("configure").select("Advanced");
+ text = bot.textWithLabel("Additional command-line options");
+ String setting = text.getText();
+ assertEquals("--enable-jeff", setting);
+ configs.setFocus();
+ configs.setSelection("debug");
+ bot.treeWithLabel("Configure Settings").expandNode("configure").select("Advanced");
+ text = bot.textWithLabel("Additional command-line options");
+ setting = text.getText();
+ assertEquals("", setting);
+ bot.button("Cancel").click();
+ // Cancel and then verify that "debug" is back to normal with
+ // --enable-jeff set and that "default" is back to normal with
+ // no user setting.
+ view = bot.viewByTitle("Project Explorer");
+ view.bot().tree().select("GnuProject0");
+ bot.menu("Project", 1).menu("Properties").click();
+ shell = bot.shell("Properties for GnuProject0");
+ shell.activate();
+ bot.tree().expandNode("Autotools").select("Configure Settings");
+ configs = bot.comboBoxWithLabel(UIMessages.getString("AbstractPage.6"));
+ assertTrue(configs.getText().contains("debug"));
+ bot.treeWithLabel("Configure Settings").expandNode("configure").select("Advanced");
+ text = bot.textWithLabel("Additional command-line options");
+ setting = text.getText();
+ assertEquals("--enable-jeff", setting);
+ configs.setFocus();
+ configs.setSelection("default");
+ assertTrue(configs.getText().contains("default"));
+ bot.treeWithLabel("Configure Settings").expandNode("configure").select("Advanced");
+ text = bot.textWithLabel("Additional command-line options");
+ setting = text.getText();
+ assertEquals("", setting);
+ bot.button("OK").click();
+ }
+
+ @Test
+ // Verify we can do a double rename of configurations, renaming one configuration to
+ // another and inheriting the settings properly.
+ public void doubleRenameOk() throws Exception {
+ SWTBotView view = bot.viewByTitle("Project Explorer");
+ view.bot().tree().select("GnuProject0");
+ bot.menu("Project", 1).menu("Properties").click();
+ SWTBotShell shell = bot.shell("Properties for GnuProject0");
+ shell.activate();
+ bot.tree().expandNode("Autotools").select("Configure Settings");
+ SWTBotCombo configs = bot.comboBoxWithLabel(UIMessages.getString("AbstractPage.6"));
+ assertTrue(configs.getText().contains("debug"));
+ bot.button("Manage Configurations...").click();
+ shell = bot.shell("GnuProject0: Manage Configurations");
+ shell.activate();
+ bot.table().select("debug");
+ // Rename "debug" to "release" and rename "default" to "debug".
+ // The settings should follow the rename operation.
+ bot.button("Rename...").click();
+ shell = bot.shell("Rename Configuration");
+ shell.activate();
+ SWTBotText text = bot.textWithLabel("Name:");
+ text.setText("");
+ text.typeText("release");
+ bot.button("OK").click();
+ shell = bot.shell("GnuProject0: Manage Configurations");
+ shell.activate();
+ bot.table().select("default");
+ bot.button("Rename...").click();
+ shell = bot.shell("Rename Configuration");
+ shell.activate();
+ text = bot.textWithLabel("Name:");
+ text.setText("");
+ text.typeText("debug");
+ bot.button("OK").click();
+ shell = bot.shell("GnuProject0: Manage Configurations");
+ shell.activate();
+ bot.button("OK").click();
+ shell = bot.shell("Properties for GnuProject0");
+ shell.activate();
+ bot.button("OK").click();
+ // Verify changes have taken effect permanently
+ view = bot.viewByTitle("Project Explorer");
+ view.bot().tree().select("GnuProject0");
+ bot.menu("Project", 1).menu("Properties").click();
+ shell = bot.shell("Properties for GnuProject0");
+ shell.activate();
+ bot.tree().expandNode("Autotools").select("Configure Settings");
+ configs = bot.comboBoxWithLabel(UIMessages.getString("AbstractPage.6"));
+ assertTrue(configs.getText().contains("release"));
+ assertTrue(configs.getText().contains("Active"));
+ bot.treeWithLabel("Configure Settings").expandNode("configure").select("Advanced");
+ text = bot.textWithLabel("Additional command-line options");
+ String setting = text.getText();
+ assertEquals("--enable-jeff", setting);
+ configs.setFocus();
+ configs.setSelection("debug");
+ assertTrue(configs.getText().contains("debug"));
+ bot.treeWithLabel("Configure Settings").expandNode("configure").select("Advanced");
+ text = bot.textWithLabel("Additional command-line options");
+ setting = text.getText();
+ assertEquals("", setting);
+ bot.button("OK").click();
+ }
+
+ @AfterClass
+ public static void sleep() {
+ bot.sleep(4000);
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui.tests/src/org/eclipse/linuxtools/cdt/autotools/ui/tests/TestToolActions.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui.tests/src/org/eclipse/linuxtools/cdt/autotools/ui/tests/TestToolActions.java
new file mode 100644
index 0000000000..7c1a111d06
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui.tests/src/org/eclipse/linuxtools/cdt/autotools/ui/tests/TestToolActions.java
@@ -0,0 +1,449 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.tests;
+
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+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.IPath;
+import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
+import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
+import org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotCheckBox;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotRadio;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+@RunWith(SWTBotJunit4ClassRunner.class)
+public class TestToolActions {
+ private static SWTWorkbenchBot bot;
+
+ @BeforeClass
+ public static void beforeClass() throws Exception {
+ SWTBotPreferences.KEYBOARD_LAYOUT = "EN_US";
+ bot = new SWTWorkbenchBot();
+ // Close the Welcome view if it exists
+ try {
+ bot.viewByTitle("Welcome").close();
+ // Turn off automatic building by default
+ } catch (Exception e) {
+ // do nothing
+ }
+ bot.menu("Window").menu("Preferences").click();
+ SWTBotShell shell = bot.shell("Preferences");
+ shell.activate();
+ bot.tree().expandNode("General").select("Workspace");
+ SWTBotCheckBox buildAuto = bot.checkBox("Build automatically");
+ if (buildAuto != null && buildAuto.isChecked())
+ buildAuto.click();
+ bot.button("Apply").click();
+ // Ensure that the C/C++ perspective is chosen automatically
+ // and doesn't require user intervention
+ bot.tree().expandNode("General").select("Perspectives");
+ SWTBotRadio radio = bot.radio("Always open");
+ if (radio != null && !radio.isSelected())
+ radio.click();
+ bot.button("OK").click();
+ bot.menu("File").menu("New").menu("Project...").click();
+
+ shell = bot.shell("New Project");
+ shell.activate();
+ bot.tree().expandNode("C/C++").select("C Project");
+ bot.button("Next >").click();
+
+ bot.textWithLabel("Project name:").setText("GnuProject1");
+ bot.tree().expandNode("GNU Autotools").select("Hello World ANSI C Autotools Project");
+
+ bot.button("Finish").click();
+ }
+
+ @Test
+ // Verify we can access the aclocal tool
+ public void canAccessAclocal() throws Exception {
+ IWorkspace workspace = ResourcesPlugin.getWorkspace();
+ assertTrue(workspace != null);
+ IWorkspaceRoot root = workspace.getRoot();
+ assertTrue(root != null);
+ IProject project = root.getProject("GnuProject1");
+ assertTrue(project != null);
+ IPath path = project.getLocation();
+ // Verify configure does not exist initially
+ path = path.append("aclocal.m4");
+ File f = new File(path.toOSString());
+ assertTrue(!f.exists());
+ SWTBotView view = bot.viewByTitle("Project Explorer");
+ view.bot().tree().select("GnuProject1");
+ bot.menu("Project", 1).menu("Invoke Autotools").menu("Invoke Aclocal").click();
+ SWTBotShell shell = bot.shell("Aclocal Options");
+ shell.activate();
+ bot.text(0).typeText("--help");
+ bot.button("OK").click();
+ bot.sleep(1000);
+ SWTBotView consoleView = bot.viewByTitle("Console");
+ consoleView.setFocus();
+ String output = consoleView.bot().styledText().getText();
+ // Verify we got some help output to the console
+ Pattern p = Pattern.compile(".*Invoking aclocal in.*GnuProject1.*aclocal --help.*Usage: aclocal.*", Pattern.DOTALL);
+ Matcher m = p.matcher(output);
+ assertTrue(m.matches());
+ // Verify we still don't have an aclocal.m4 file yet
+ f = new File(path.toOSString());
+ assertTrue(!f.exists());
+ // Now lets run aclocal for our hello world project which hasn't had any
+ // autotool files generated yet.
+ view = bot.viewByTitle("Project Explorer");
+ view.bot().tree().select("GnuProject1");
+ bot.menu("Project", 1).menu("Invoke Autotools").menu("Invoke Aclocal").click();
+ shell = bot.shell("Aclocal Options");
+ shell.activate();
+ bot.button("OK").click();
+ bot.sleep(1000);
+ consoleView = bot.viewByTitle("Console");
+ consoleView.setFocus();
+ output = consoleView.bot().styledText().getText();
+ p = Pattern.compile(".*Invoking aclocal in.*GnuProject1.*aclocal.*", Pattern.DOTALL);
+ m = p.matcher(output);
+ assertTrue(m.matches());
+ // We need to wait until the aclocal.m4 file is created so
+ // sleep a bit and look for it...give up after 20 seconds
+ for (int i = 0; i < 40; ++i) {
+ bot.sleep(500);
+ f = new File(path.toOSString());
+ if (f.exists())
+ break;
+ }
+ // Verify we now have an aclocal.m4 file created
+ assertTrue(f.exists());
+ }
+
+ @Test
+ // Verify we can access the autoconf tool
+ public void canAccessAutoconf() throws Exception {
+ IWorkspace workspace = ResourcesPlugin.getWorkspace();
+ assertTrue(workspace != null);
+ IWorkspaceRoot root = workspace.getRoot();
+ assertTrue(root != null);
+ IProject project = root.getProject("GnuProject1");
+ assertTrue(project != null);
+ IPath path = project.getLocation();
+ // Verify configure does not exist initially
+ path = path.append("configure");
+ File f = new File(path.toOSString());
+ assertTrue(!f.exists());
+ SWTBotView view = bot.viewByTitle("Project Explorer");
+ view.bot().tree().select("GnuProject1");
+ bot.menu("Project", 1).menu("Invoke Autotools").menu("Invoke Autoconf").click();
+ bot.sleep(1000);
+ SWTBotView consoleView = bot.viewByTitle("Console");
+ consoleView.setFocus();
+ String output = consoleView.bot().styledText().getText();
+ // Verify we got some help output to the console
+ Pattern p = Pattern.compile(".*Invoking autoconf in.*GnuProject1.*autoconf.*", Pattern.DOTALL);
+ Matcher m = p.matcher(output);
+ assertTrue(m.matches());
+ // We need to wait until the configure file is created so
+ // sleep a bit and look for it...give up after 20 seconds
+ for (int i = 0; i < 40; ++i) {
+ bot.sleep(500);
+ f = new File(path.toOSString());
+ if (f.exists())
+ break;
+ }
+ // Verify we now have a configure script
+ f = new File(path.toOSString());
+ assertTrue(f.exists());
+ // Now lets delete the configure file and run autoconf from the project explorer
+ // menu directly from the configure.ac file.
+ assertTrue(f.delete());
+ view = bot.viewByTitle("Project Explorer");
+ SWTBotTreeItem node = view.bot().tree().expandNode("GnuProject1").getNode("configure.ac");
+ node.setFocus();
+ node.select().contextMenu("Invoke Autoconf").click();
+ bot.sleep(1000);
+ consoleView = bot.viewByTitle("Console");
+ consoleView.setFocus();
+ output = consoleView.bot().styledText().getText();
+ p = Pattern.compile(".*Invoking autoconf in.*GnuProject1.*autoconf.*", Pattern.DOTALL);
+ m = p.matcher(output);
+ assertTrue(m.matches());
+ // We need to wait until the configure file is created so
+ // sleep a bit and look for it...give up after 20 seconds
+ for (int i = 0; i < 40; ++i) {
+ bot.sleep(500);
+ f = new File(path.toOSString());
+ if (f.exists())
+ break;
+ }
+ // Verify we now have a configure script again
+ f = new File(path.toOSString());
+ assertTrue(f.exists());
+ }
+
+ @Test
+ // Verify we can access the automake tool
+ public void canAccessAutomake() throws Exception {
+ IWorkspace workspace = ResourcesPlugin.getWorkspace();
+ assertTrue(workspace != null);
+ IWorkspaceRoot root = workspace.getRoot();
+ assertTrue(root != null);
+ IProject project = root.getProject("GnuProject1");
+ assertTrue(project != null);
+ IPath path = project.getLocation();
+ // Verify configure does not exist initially
+ IPath path2 = path.append("src/Makefile.in");
+ path = path.append("Makefile.in");
+ File f = new File(path.toOSString());
+ assertTrue(!f.exists());
+ File f2 = new File(path2.toOSString());
+ assertTrue(!f2.exists());
+ SWTBotView view = bot.viewByTitle("Project Explorer");
+ view.bot().tree().select("GnuProject1");
+ bot.menu("Project", 1).menu("Invoke Autotools").menu("Invoke Automake").click();
+ SWTBotShell shell = bot.shell("Automake Options");
+ shell.activate();
+ bot.text(0).typeText("--help");
+ bot.button("OK").click();
+ bot.sleep(1000);
+ SWTBotView consoleView = bot.viewByTitle("Console");
+ consoleView.setFocus();
+ String output = consoleView.bot().styledText().getText();
+ // Verify we got some help output to the console
+ Pattern p = Pattern.compile(".*Invoking automake in.*GnuProject1.*automake --help.*Usage:.*", Pattern.DOTALL);
+ Matcher m = p.matcher(output);
+ assertTrue(m.matches());
+ // Verify we still don't have Makefile.in files yet
+ f = new File(path.toOSString());
+ assertTrue(!f.exists());
+ f2 = new File(path2.toOSString());
+ assertTrue(!f2.exists());
+ // Now lets run automake for our hello world project which hasn't had any
+ // Makefile.in files generated yet.
+ view = bot.viewByTitle("Project Explorer");
+ view.bot().tree().select("GnuProject1");
+ bot.menu("Project", 1).menu("Invoke Autotools").menu("Invoke Automake").click();
+ shell = bot.shell("Automake Options");
+ shell.activate();
+ bot.text(0).typeText("--add-missing"); // need this to successfully run here
+ bot.text(1).typeText("Makefile src/Makefile");
+ bot.button("OK").click();
+ bot.sleep(2000);
+ consoleView = bot.viewByTitle("Console");
+ consoleView.setFocus();
+ output = consoleView.bot().styledText().getText();
+ p = Pattern.compile(".*Invoking automake in.*GnuProject1.*automake --add-missing Makefile src/Makefile.*", Pattern.DOTALL);
+ m = p.matcher(output);
+ assertTrue(m.matches());
+ // We need to wait until the Makefile.in files are created so
+ // sleep a bit and look for it...give up after 20 seconds
+ for (int i = 0; i < 40; ++i) {
+ bot.sleep(500);
+ f = new File(path.toOSString());
+ f2 = new File(path2.toOSString());
+ if (f.exists() && f2.exists())
+ break;
+ }
+ // Verify we now have Makefile.in files created
+ f = new File(path.toOSString());
+ assertTrue(f.exists());
+ f2 = new File(path2.toOSString());
+ assertTrue(f2.exists());
+ }
+
+ @Test
+ // Verify we can access the libtoolize tool
+ public void canAccessLibtoolize() throws Exception {
+ IWorkspace workspace = ResourcesPlugin.getWorkspace();
+ assertTrue(workspace != null);
+ IWorkspaceRoot root = workspace.getRoot();
+ assertTrue(root != null);
+ IProject project = root.getProject("GnuProject1");
+ assertTrue(project != null);
+ SWTBotView view = bot.viewByTitle("Project Explorer");
+ view.bot().tree().select("GnuProject1");
+ bot.menu("Project", 1).menu("Invoke Autotools").menu("Invoke Libtoolize").click();
+ SWTBotShell shell = bot.shell("Libtoolize Options");
+ shell.activate();
+ bot.text(0).typeText("--help");
+ bot.button("OK").click();
+ bot.sleep(1000);
+ SWTBotView consoleView = bot.viewByTitle("Console");
+ consoleView.setFocus();
+ String output = consoleView.bot().styledText().getText();
+ // Verify we got some help output to the console
+ Pattern p = Pattern.compile(".*Invoking libtoolize in.*GnuProject1.*libtoolize --help.*Usage: libtoolize.*", Pattern.DOTALL);
+ Matcher m = p.matcher(output);
+ assertTrue(m.matches());
+ }
+
+ @Test
+ // Verify we can access the libtoolize tool
+ public void canAccessAutoheader() throws Exception {
+ IWorkspace workspace = ResourcesPlugin.getWorkspace();
+ assertTrue(workspace != null);
+ IWorkspaceRoot root = workspace.getRoot();
+ assertTrue(root != null);
+ IProject project = root.getProject("GnuProject1");
+ assertTrue(project != null);
+ SWTBotView view = bot.viewByTitle("Project Explorer");
+ view.bot().tree().select("GnuProject1");
+ bot.menu("Project", 1).menu("Invoke Autotools").menu("Invoke Autoheader").click();
+ SWTBotShell shell = bot.shell("Autoheader Options");
+ shell.activate();
+ bot.text(0).typeText("--help");
+ bot.button("OK").click();
+ bot.sleep(1000);
+ SWTBotView consoleView = bot.viewByTitle("Console");
+ consoleView.setFocus();
+ String output = consoleView.bot().styledText().getText();
+ // Verify we got some help output to the console
+ Pattern p = Pattern.compile(".*Invoking autoheader in.*GnuProject1.*autoheader --help.*Usage:.*autoheader.*", Pattern.DOTALL);
+ Matcher m = p.matcher(output);
+ assertTrue(m.matches());
+ }
+
+ @Test
+ // Verify we can access the autoreconf tool
+ public void canAccessAutoreconf() throws Exception {
+ IWorkspace workspace = ResourcesPlugin.getWorkspace();
+ assertTrue(workspace != null);
+ IWorkspaceRoot root = workspace.getRoot();
+ assertTrue(root != null);
+ IProject project = root.getProject("GnuProject1");
+ assertTrue(project != null);
+ IPath path = project.getLocation();
+ // Remove a number of generated files
+ File f = new File(path.append("src/Makefile.in").toOSString());
+ if (f.exists())
+ f.delete();
+ f = new File(path.append("Makefile.in").toOSString());
+ if (f.exists())
+ f.delete();
+ f = new File(path.append("configure").toOSString());
+ if (f.exists())
+ f.delete();
+ f = new File(path.append("config.status").toOSString());
+ if (f.exists())
+ f.delete();
+ f = new File(path.append("config.sub").toOSString());
+ if (f.exists())
+ f.delete();
+ SWTBotView view = bot.viewByTitle("Project Explorer");
+ view.bot().tree().select("GnuProject1");
+ bot.menu("Project", 1).menu("Invoke Autotools").menu("Invoke Autoreconf").click();
+ SWTBotShell shell = bot.shell("Autoreconf Options");
+ shell.activate();
+ bot.text(0).typeText("--help");
+ bot.button("OK").click();
+ bot.sleep(1000);
+ SWTBotView consoleView = bot.viewByTitle("Console");
+ consoleView.setFocus();
+ String output = consoleView.bot().styledText().getText();
+ // Verify we got some help output to the console
+ Pattern p = Pattern.compile(".*Invoking autoreconf in.*GnuProject1.*autoreconf --help.*Usage: .*autoreconf.*", Pattern.DOTALL);
+ Matcher m = p.matcher(output);
+ assertTrue(m.matches());
+ view = bot.viewByTitle("Project Explorer");
+ view.bot().tree().select("GnuProject1");
+ bot.menu("Project", 1).menu("Invoke Autotools").menu("Invoke Autoreconf").click();
+ shell = bot.shell("Autoreconf Options");
+ shell.activate();
+ bot.text(0).typeText("-i");
+ bot.button("OK").click();
+ // We need to wait until the Makefile.in file is created so
+ // sleep a bit and look for it...give up after 20 seconds
+ for (int i = 0; i < 40; ++i) {
+ bot.sleep(500);
+ f = new File(path.append("Makefile.in").toOSString());
+ if (f.exists())
+ break;
+ }
+ // Verify a number of generated files now exist
+ f = new File(path.append("src/Makefile.in").toOSString());
+ assertTrue(f.exists());
+ f = new File(path.append("Makefile.in").toOSString());
+ assertTrue(f.exists());
+ f = new File(path.append("configure").toOSString());
+ assertTrue(f.exists());
+ f = new File(path.append("config.status").toOSString());
+ assertTrue(!f.exists()); //shouldn't have run configure
+ f = new File(path.append("config.sub").toOSString());
+ assertTrue(f.exists());
+ }
+
+ @Test
+ // Verify we can access the autoreconf tool
+ public void canReconfigureProject() throws Exception {
+ IWorkspace workspace = ResourcesPlugin.getWorkspace();
+ assertTrue(workspace != null);
+ IWorkspaceRoot root = workspace.getRoot();
+ assertTrue(root != null);
+ IProject project = root.getProject("GnuProject1");
+ assertTrue(project != null);
+ IPath path = project.getLocation();
+ // Remove a number of generated files
+ File f = new File(path.append("src/Makefile.in").toOSString());
+ if (f.exists())
+ f.delete();
+ f = new File(path.append("Makefile.in").toOSString());
+ if (f.exists())
+ f.delete();
+ f = new File(path.append("configure").toOSString());
+ if (f.exists())
+ f.delete();
+ f = new File(path.append("config.status").toOSString());
+ if (f.exists())
+ f.delete();
+ f = new File(path.append("config.sub").toOSString());
+ if (f.exists())
+ f.delete();
+ SWTBotView view = bot.viewByTitle("Project Explorer");
+ view.bot().tree().select("GnuProject1");
+ bot.menu("Project", 1).menu("Reconfigure Project").click();
+ // We need to wait until the config.status file is created so
+ // sleep a bit and look for it...give up after 40 seconds
+ for (int i = 0; i < 40; ++i) {
+ bot.sleep(500);
+ f = new File(path.append("config.status").toOSString());
+ if (f.exists())
+ break;
+ }
+ // Verify a number of generated files now exist
+ f = new File(path.append("src/Makefile.in").toOSString());
+ assertTrue(f.exists());
+ f = new File(path.append("Makefile.in").toOSString());
+ assertTrue(f.exists());
+ f = new File(path.append("configure").toOSString());
+ assertTrue(f.exists());
+ f = new File(path.append("config.status").toOSString());
+ assertTrue(f.exists());
+ f = new File(path.append("config.sub").toOSString());
+ assertTrue(f.exists());
+ }
+
+ @AfterClass
+ public static void sleep() {
+ bot.sleep(2000);
+ bot.menu("File").menu("Exit").click();
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/.classpath b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/.classpath
new file mode 100644
index 0000000000..ad32c83a78
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/.project b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/.project
new file mode 100644
index 0000000000..7356f5231a
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.linuxtools.cdt.autotools.ui</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/.settings/org.eclipse.jdt.core.prefs b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000000..137c164367
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,8 @@
+#Tue Oct 06 15:50:25 EDT 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/ChangeLog b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/ChangeLog
new file mode 100644
index 0000000000..4803f8355d
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/ChangeLog
@@ -0,0 +1,543 @@
+2010-04-22 Jeff Johnston <jjohnstn@redhat.com>
+
+ * META-INF/MANIFEST.MF: Switch to J2SE-1.5.
+
+2010-04-09 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #307258
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileEditor.java (isTabsToSpacesConversionEnabled):
+ Add override method so tabs are not converted within the Automake editor.
+
+2010-03-15 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/ConvertToAutotoolsProjectWizardPage.java (convertProject): Move
+ creation of Autotools configuration to bottom as we must ensure that an ICConfigurationDescription
+ has been set up for the default configuration and we can't do this manually ourselves.
+
+2010-03-12 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #304005
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsCategoryPropertyOptionPage.java (createFieldEditors):
+ Specify minimum length of 20 for text entry windows.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsConfigurePropertyPage.java (cfgChanged): Store configuration
+ descriptor for possible later usage.
+ (getConfiguration): Changed to use id rather than name.
+ (getAllConfigurationData): New method.
+ (getCfgd): New method.
+ (AutotoolsConfigurePropertyPage): No longer implement ICloneCfgListener interface. No longer keep track of temporary configuration
+ list. This is now done by AutotoolsConfigurationManager.
+ (cloneCfg): Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsConfigurePropertyTab.java (createEditArea): Comment out
+ minimum size setting.
+ (setValues): Remove resizing.
+ (syncClones): New method.
+ (createControls): Sync all clones and clear the temporary configuration list.
+ (updateData): Get configuration description.
+ (performApply): Call AutotoolsConfigurationManager to do apply passing the Configuration Description list for
+ the page instead of calling performOk.
+ (getAutotoolsCfg): Change to use id rather than name.
+ (performCancel): Call AutotoolsConfigurationManager to clear temporary configuration list.
+ (performOK): Changed to use new calls to AutotoolsConfigurationManager.
+ (specificResize): Removed.
+ (calcExtra): Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/AutotoolsBuildWizardHandler.java (convertProject): Create
+ configuration by id not name.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/ConvertToAutotoolsProjectWizardPage.java (convertProject): Ditto.
+
+2010-02-25 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsConfigurePropertyPage.java (cloneCfg): If
+ clonee is null, assign new configuration to clonee variable to avoid NPE.
+
+2010-02-24 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #303613
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/Resources.properties: Fix message
+ issued for autoreconf.
+
+2009-12-01 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #296616
+ * META-INF/MANIFEST.MF: Revert dependency on org.eclipse.linuxtools.cdt.autotools plugin which
+ causes a dependency loop.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/ConvertToAutotoolsProjectWizardPage.java (convertProject):
+ Change code to use new removeOldAutotoolsNature method in AutotoolsNewProjectNature class.
+
+2009-12-01 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #296616
+ * META-INF/MANIFEST.MF: Add dependency on org.eclipse.linuxtools.cdt.autotools plugin.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/ConvertToAutotoolsProjectWizardPage.java (convertProject):
+ Remove old Autotools nature from existing project.
+
+2009-11-17 Jeff Johnston <jjohnstn@redhat.com>
+
+ * templates/projecttemplates/HelloWorldCAutotoolsProject/template.xml: Make sure COPYING file
+ is copied over as part of template.
+ * templates/projecttemplates/HelloWorldCPPAutotoolsProject/template.xml: Ditto.
+
+2009-11-11 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/Resources.properties: Fix conversion wizard messages
+ to not mention CVS or repository.
+
+2009-11-04 Jeff Johnston <jjohnstn@redhat.com>
+
+ * META-INF/MANIFEST.MF: Fix dependencies to support CDT 6.0.0 and up.
+
+2009-11-02 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/text/hover/AutoconfTextHover.java: Clean up warning.
+ * plugin.xml: Add back conversion wizard which is needed to convert from old Autotools project
+ to new as well as convert a Std Makefile project over.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsConfigurePropertyPage.java: Remove
+ the override logic and use the base AbstractPage plus some additions.
+ (cfgChanged): Change this to be a place-holder for future usage.
+ (getConfiguration): Add any configuration we create to the cfgs list.
+ (isSingle): Return true.
+ (AutotoolsConfigurePropertyPage): Changed to only set cfgs.
+ (cloneCfg): Changed to only access cfgs local variable.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsConfigurePropertyTab.java (performOK):
+ Change to get IConfiguration list and then for each IConfiguration, get the IAConfiguration from
+ the parent page. This allows the parent page to only have to track cloned and special Autotools
+ configurations as opposed to knowing the entire list.
+
+2009-10-29 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/EditorUtility.java (getWorkingCopy): Clean up.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsPropertyMessages.java: Change to reference
+ bundle using class name rather than by string.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/text/hover/AutoconfTextHover.java (getHoverDoc): Add compatibility
+ support for old projects which use compatiblity plugin.
+ (getDefaultAutomakeMacrosVer): New method.
+ (getDefaultAutoconfMacrosVer): Ditto.
+ (getLocalAutoconfMacrosDocName): Ditto.
+ (getLocalAutomakeMacrosDocName): Ditto.
+ (getHoverDoc): Change to use new interfaces.
+ (getAMDoc): Change to try local files.
+ (getACDoc): Ditto.
+
+2009-10-27 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/AutotoolsBuildWizardHandler.java: New file.
+ * META-INF/MANIFEST.MF: Change dependencies to match CDT 6.0.1.
+ * plugin.properties: Add new strings as needed.
+ * plugin.xml: Fix Autotools sub-pages which had been removed. Also comment out GNU Autotools-specific
+ project wizards and conversion wizards. These are all done under the C/C++ Wizards now.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/AutotoolsUIPluginImages.java: Clean up AutotoolsPlugin reference.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/MakeUIImages.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/EditorUtility.java (getWorkingCopy): Change to
+ use new findSharedWorkingCopy API since old public one has been removed from the CDT.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsConfigurePropertyPage.java (handleConfigSelection):
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/AutotoolsBuildWizard.java (createItems): Use the new
+ AutotoolsBuildWizardHandler so we get proper project conversion in the CDT C and C++ Conversion Wizards.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/AutotoolsWizardMessages.properties: Add new message.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/ConvertToAutotoolsProjectWizard.java: Clean up unused
+ imports.
+
+2009-10-20 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/ConvertToAutotoolsProjectWizard.java (doRun): Remove
+ commented section.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/ConvertToAutotoolsProjectWizardPage.java (convertProject): Add
+ creation of default Autotools configuration.
+
+2009-10-20 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsBuildPropertyPage.java (createControls): Remove
+ scanner discovery option which is no longer pertinent.
+ (initialize): Ditto.
+ (performOK): Ditto.
+
+2009-10-15 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/AutotoolsUIPluginImages.java (static initializer): Make sure
+ we are referencing icons folder for this plug-in, not AutotoolsPlugin.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/HTMLTextPresenter.java (updatePresentation): Fix references to
+ AutotoolsPlugin that should be AutotoolsUIPlugin.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/MakeUIImages.java (static initializer): Ditto.
+ (makeIconFileURL): Ditto.
+
+2009-10-15 Jeff Johnston <jjohnstn@redhat.com>
+
+ * plugin.xml: Fix Automake editor content-type typo.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/ConvertToAutotoolsProjectWizard.java (doRun): Put
+ back code to do conversion.
+
+2009-10-13 Jeff Johnston <jjohnstn@redhat.com>
+
+ * META-INF/MANIFEST.MF: Add export of packages and allow org.eclipse.linuxtools.cdt.autotools.tests
+ plug-in to see them.
+
+2009-10-09 Jeff Johnston <jjohnstn@redhat.com>
+
+ Refactoring of org.eclipse.linuxtools.cdt.autotools into org.eclipse.linuxtools.cdt.autotools.core
+ and org.eclipse.linuxtools.cdt.autotools.ui.
+
+ * .classpath: New file.
+ * .project: New file.
+ * .settings/org.eclipse.jdt.core.prefs: New file.
+ * build.properties: New file.
+ * icons/ac16/acmacro_arg_obj.gif: New file.
+ * icons/ac16/acmacro_obj.gif: New file.
+ * icons/ac16/ammacro_obj.gif: New file.
+ * icons/ac16/case_obj.gif: New file.
+ * icons/ac16/condition_obj.gif: New file.
+ * icons/ac16/convert_normal.gif: New file.
+ * icons/ac16/elif_obj.gif: New file.
+ * icons/ac16/else_obj.gif: New file.
+ * icons/ac16/for_obj.gif: New file.
+ * icons/ac16/if_obj.gif: New file.
+ * icons/ac16/while_obj.gif: New file.
+ * icons/autoconf.gif: New file.
+ * icons/automake.gif: New file.
+ * icons/dlcl16/build_configs.gif: New file.
+ * icons/dlcl16/config_category.gif: New file.
+ * icons/dlcl16/config_tool.gif: New file.
+ * icons/dlcl16/newc_app.gif: New file.
+ * icons/dlcl16/newcc_app.gif: New file.
+ * icons/dlcl16/open_include.gif: New file.
+ * icons/dtool16/alphab_sort_co.gif: New file.
+ * icons/dtool16/build_menu.gif: New file.
+ * icons/dtool16/convert-normal.gif: New file.
+ * icons/dtool16/make.gif: New file.
+ * icons/dtool16/makefile.gif: New file.
+ * icons/dtool16/newc_app.gif: New file.
+ * icons/dtool16/newcc_app.gif: New file.
+ * icons/dtool16/segment_edit.gif: New file.
+ * icons/dtool16/target_add.gif: New file.
+ * icons/dtool16/target_build.gif: New file.
+ * icons/dtool16/target_delete.gif: New file.
+ * icons/dtool16/target_edit.gif: New file.
+ * icons/dtool16/update_old.gif: New file.
+ * icons/elcl16/build_configs.gif: New file.
+ * icons/elcl16/config_category.gif: New file.
+ * icons/elcl16/config_tool.gif: New file.
+ * icons/elcl16/newc_app.gif: New file.
+ * icons/elcl16/newcc_app.gif: New file.
+ * icons/elcl16/open_include.gif: New file.
+ * icons/etool16/alphab_sort_co.gif: New file.
+ * icons/etool16/build_menu.gif: New file.
+ * icons/etool16/convert_normal.gif: New file.
+ * icons/etool16/make.gif: New file.
+ * icons/etool16/makefile.gif: New file.
+ * icons/etool16/newc_app.gif: New file.
+ * icons/etool16/newcc_app.gif: New file.
+ * icons/etool16/segment_edit.gif: New file.
+ * icons/etool16/target_add.gif: New file.
+ * icons/etool16/target_build.gif: New file.
+ * icons/etool16/target_delete.gif: New file.
+ * icons/etool16/target_edit.gif: New file.
+ * icons/etool16/target_filter.gif: New file.
+ * icons/etool16/update_old.gif: New file.
+ * icons/obj16/acmacro_obj.gif: New file.
+ * icons/obj16/command_obj.gif: New file.
+ * icons/obj16/define_obj.gif: New file.
+ * icons/obj16/environment_obj.gif: New file.
+ * icons/obj16/envvar_obj.gif: New file.
+ * icons/obj16/error_obj.gif: New file.
+ * icons/obj16/fatalerror_obj.gif: New file.
+ * icons/obj16/hfolder_obj.gif: New file.
+ * icons/obj16/include_obj.gif: New file.
+ * icons/obj16/info_obj.gif: New file.
+ * icons/obj16/irule_obj.gif: New file.
+ * icons/obj16/lib_obj.gif: New file.
+ * icons/obj16/macro_obj.gif: New file.
+ * icons/obj16/relation_obj.gif: New file.
+ * icons/obj16/target_obj.gif: New file.
+ * icons/obj16/trule_obj.gif: New file.
+ * icons/obj16/warning_obj.gif: New file.
+ * icons/sample.gif: New file.
+ * META-INF/MANIFEST.MF: New file.
+ * plugin.properties: New file.
+ * plugin.xml: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/AutotoolsUIPlugin.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfAnnotationHover.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfCodeScanner.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfDocumentProvider.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfDocumentSetupParticipant.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfEditor.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfEditorMacroValidator.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfEditorMessages.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfEditorMessages.properties: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfErrorHandler.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfIdentifierRule.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfKeywordDetector.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfM4WordDetector.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacro.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroCodeScanner.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroContentAssistProcessor.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroDamagerRepairer.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroParameterListValidator.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroPartitionRule.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroProposalContextInformation.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroRule.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroWordDetector.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfPartitioner.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfPartitionScanner.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfPKGWordDetector.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfReconcilingStrategy.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfSourceViewerConfiguration.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfWhitespaceDetector.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfWordDetector.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/IAutotoolEditorActionDefinitionIds.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/IAutotoolHelpContextIds.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/IAutotoolsEditor.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/InlineDataRule.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/MultilineRuleDamagerRepairer.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/outline/AutoconfContentOutlinePage.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/outline/AutoconfContentProvider.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/outline/AutoconfLabelProvider.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/ParseException.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfCaseConditionElement.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfCaseElement.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfElement.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfElifElement.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfElseElement.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfForElement.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfIfElement.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfMacroArgumentElement.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfMacroDetector.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfMacroElement.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfOutlineErrorHandler.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfParser.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfRootElement.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfSelectElement.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfTokenizer.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfUntilElement.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfWhileElement.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/IAutoconfErrorHandler.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/IAutoconfMacroDetector.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/IAutoconfMacroValidator.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/IMacroDetector.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/ITokenConstants.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/ParseException.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/Token.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/RecursiveSingleLineRule.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/RestrictedEndOfLineRule.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/Resources.properties: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/AbstractAutotoolsCPropertyTab.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/AbstractAutotoolsHandler.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/AbstractTargetAction.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/AclocalHandler.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/AutoconfHandler.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/AutoheaderHandler.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/AutomakeHandler.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/AutoreconfHandler.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeAclocalAction.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeAction.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeAutoconfAction.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeAutoheaderAction.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeAutomakeAction.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeAutoreconfAction.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeLibtoolizeAction.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeMessages.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeMessages.properties: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/LibtoolizeHandler.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/ReconfigureAction.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/ReconfigureHandler.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/SingleInputDialog.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/TwoInputDialog.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/AutotoolsConsole.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/AutotoolsUIPluginImages.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/CBuildStepsConsole.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/CConfigureConsole.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/Console.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/ConsoleMessages.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/ConsoleMessages.properties: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/CWordFinder.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/autoconf/ProjectionFileUpdater.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AbstractElementListSelectionDialog.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AbstractMakefile.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AbstractMakefileCodeScanner.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AddBuildTargetAction.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ArchiveTarget.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutoconfSubstRule.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeCompletionProcessor.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeConfigMacro.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeDocumentProvider.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeEditor.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeEditorFactory.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeErrorHandler.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Automakefile.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakefileCodeScanner.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakefileContentOutlinePage.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakefileReconcilingStrategy.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakefileSourceConfiguration.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakefileUtil.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeIfElse.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeMacroDefinitionRule.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeMacroReferenceRule.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeTextHover.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeWordDetector.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/BadDirective.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Command.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Comment.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/CompletionProposalComparator.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Conditional.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/DefaultRule.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/DefineVariable.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/DeleteOnErrorRule.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Directive.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/EditorUtility.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ElementListSelectionDialog.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Else.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/EmptyLine.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Endef.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Endif.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ExportAllVariablesRule.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ExportVariable.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ExternalEditorInput.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ExternalEditorInputFactory.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/GNUAutomakefile.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/GNUMakefileConstants.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/GNUMakefileUtil.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/GNUTargetRule.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/GNUVariableDef.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/IAutomakeConditional.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/If.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Ifdef.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Ifeq.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Ifndef.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Ifneq.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/IgnoreRule.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/IMakefileDocumentProvider.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/IMakefileEditorActionDefinitionIds.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Include.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/InferenceRule.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/IntermediateRule.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/IReconcilingParticipant.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ISelectionValidator.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ITranslationUnitEditorInput.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/LexicalSortingAction.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/LowResolutionTimeRule.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MacroDefinition.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MacroDefinitionRule.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MacroReferenceRule.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileAnnotationHover.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileCodeScanner.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileCompletionProcessor.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakeFileConstants.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileContentOutlinePage.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileDocumentProvider.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileDocumentSetupParticipant.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileEditor.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileEditorActionContributor.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileEditorPreferenceConstants.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileEditorTogglePresentationAction.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileMessages.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakeFileMessages.properties: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefilePartitionScanner.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileReader.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileReconcilingStrategy.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileSourceConfiguration.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileStorageDocumentProvider.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileTextHover.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileWordDetector.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MessageLine.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/NotParallelRule.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/NullMakefile.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/OpenDeclarationAction.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/OpenIncludeAction.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/OverrideDefine.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/OverrideVariable.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Parent.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/PhonyRule.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/PosixMakefileUtil.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/PosixRule.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/PreciousRule.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ProjectionMakefileUpdater.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Rule.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/SccsGetRule.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/SecondaryRule.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/SelectionList.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/SelectionStatusDialog.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/SilentRule.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/SpecialRule.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/StaticTargetRule.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/StatusInfo.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/StatusTool.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/StringMatcher.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/SuffixesRule.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Target.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/TargetRule.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/TargetVariable.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Terminal.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/TwoArrayQuickSort.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/UnExport.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Util.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/VariableDefinition.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/VPath.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/WordPartDetector.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/WorkingCopyManager.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/ErrorParserBlock.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/FileRelevance.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/HTML2TextReader.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/HTMLPrinter.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/HTMLTextPresenter.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/LineBreakingReader.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/LocationAdapter.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/MakeUIImages.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/MakeUIMessages.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/MakeUIMessages.properties: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/MessageLine.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/OptionalMessageDialog.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/AbstractEditorPreferencePage.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/AutoconfEditorPreferencePage.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/AutomakeEditorPreferencePage.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/AutotoolsEditorPreferenceConstants.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/AutotoolsPreferencePage.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/AutotoolsPreferencesMessages.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/AutotoolsPreferencesMessages.properties: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/ColorEditor.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/ColorManager.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/OverlayPreferenceStore.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/StatusInfo.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/TabFolderLayout.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AbstractConfigurePropertyOptionsPage.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsBuildPropertyPage.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsCategoryPropertyOptionPage.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsConfigurePrefStore.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsConfigurePropertyPage.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsConfigurePropertyTab.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsEditorPropertyTab.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsGeneralPropertyPage.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsHeadPropertyPage.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsPropertyManager.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsPropertyMessages.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsPropertyMessages.properties: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsToolPropertyOptionPage.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsToolsPropertyTab.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/IProjectPropertyListener.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/IPropertyChangeManager.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/ToolListContentProvider.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/ToolListElement.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/ToolListLabelProvider.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/ResourceLookup.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/ResourceLookupTree.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/SingleCharReader.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/SubstitutionTextReader.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/text/hover/AutoconfPrototype.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/text/hover/AutoconfTextHover.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/text/hover/HoverMessages.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/text/hover/HoverMessages.properties: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/AutotoolsBuildWizard.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/AutotoolsNewCCProjectWizardV2.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/AutotoolsNewCProjectWizardV2.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/AutotoolsWizardMessages.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/AutotoolsWizardMessages.properties: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/ConfigurationContentProvider.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/ConfigurationLabelProvider.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/ConvertToAutotoolsProjectWizard.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/ConvertToAutotoolsProjectWizardPage.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/CProjectPlatformPage.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/ManagedProjectOptionBlock.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/NewAutotoolsProjectOptionPage.java: New file.
+ * templates/projecttemplates/EmptyProject/template.properties: New file.
+ * templates/projecttemplates/EmptyProject/template.xml: New file.
+ * templates/projecttemplates/HelloWorldCAutotoolsProject/src: New file.
+ * templates/projecttemplates/HelloWorldCAutotoolsProject/template.properties: New file.
+ * templates/projecttemplates/HelloWorldCAutotoolsProject/template.xml: New file.
+ * templates/projecttemplates/HelloWorldCPPAutotoolsProject/src: New file.
+ * templates/projecttemplates/HelloWorldCPPAutotoolsProject/template.properties: New file.
+ * templates/projecttemplates/HelloWorldCPPAutotoolsProject/template.xml: \ No newline at end of file
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/META-INF/MANIFEST.MF b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..7ec9cd2b37
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/META-INF/MANIFEST.MF
@@ -0,0 +1,38 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name.0
+Bundle-SymbolicName: org.eclipse.linuxtools.cdt.autotools.ui;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.eclipse.linuxtools.cdt.autotools.ui.AutotoolsUIPlugin
+Bundle-Localization: plugin
+Bundle-Vendor: %provider
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.linuxtools.cdt.autotools.core;bundle-version="1.0.0",
+ org.eclipse.cdt.make.core;bundle-version="6.0.0",
+ org.eclipse.cdt.core;bundle-version="5.1.0",
+ org.eclipse.core.resources;bundle-version="3.5.0",
+ org.eclipse.cdt.managedbuilder.core;bundle-version="6.0.0",
+ org.eclipse.jface.text;bundle-version="3.5.0",
+ org.eclipse.ui.editors;bundle-version="3.5.0",
+ org.eclipse.cdt.ui;bundle-version="5.1.0",
+ org.eclipse.help;bundle-version="3.4.0",
+ org.eclipse.ui.ide;bundle-version="3.5.0",
+ org.eclipse.cdt.managedbuilder.ui;bundle-version="5.1.0",
+ org.eclipse.core.filesystem;bundle-version="1.2.0",
+ org.eclipse.cdt.make.ui;bundle-version="6.0.0",
+ org.eclipse.ui.views;bundle-version="3.4.0"
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
+Export-Package: org.eclipse.linuxtools.cdt.autotools.ui,
+ org.eclipse.linuxtools.cdt.autotools.ui.editors,
+ org.eclipse.linuxtools.cdt.autotools.ui.editors.outline,
+ org.eclipse.linuxtools.cdt.autotools.ui.editors.parser,
+ org.eclipse.linuxtools.internal.cdt.autotools.ui;x-friends:="org.eclipse.linuxtools.cdt.autotools.tests",
+ org.eclipse.linuxtools.internal.cdt.autotools.ui.actions;x-friends:="org.eclipse.linuxtools.cdt.autotools.tests",
+ org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.autoconf;x-friends:="org.eclipse.linuxtools.cdt.autotools.tests",
+ org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;x-friends:="org.eclipse.linuxtools.cdt.autotools.tests",
+ org.eclipse.linuxtools.internal.cdt.autotools.ui.preferences;x-friends:="org.eclipse.linuxtools.cdt.autotools.tests",
+ org.eclipse.linuxtools.internal.cdt.autotools.ui.properties;x-friends:="org.eclipse.linuxtools.cdt.autotools.tests",
+ org.eclipse.linuxtools.internal.cdt.autotools.ui.text.hover;x-friends:="org.eclipse.linuxtools.cdt.autotools.tests",
+ org.eclipse.linuxtools.internal.cdt.autotools.ui.wizards;x-friends:="org.eclipse.linuxtools.cdt.autotools.tests"
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/build.properties b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/build.properties
new file mode 100644
index 0000000000..b5179fa03c
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/build.properties
@@ -0,0 +1,8 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ plugin.properties,\
+ templates/,\
+ icons/
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/ac16/acmacro_arg_obj.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/ac16/acmacro_arg_obj.gif
new file mode 100644
index 0000000000..fa1765ec5a
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/ac16/acmacro_arg_obj.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/ac16/acmacro_obj.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/ac16/acmacro_obj.gif
new file mode 100644
index 0000000000..d90a51c022
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/ac16/acmacro_obj.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/ac16/ammacro_obj.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/ac16/ammacro_obj.gif
new file mode 100644
index 0000000000..91c4c93ab5
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/ac16/ammacro_obj.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/ac16/case_obj.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/ac16/case_obj.gif
new file mode 100644
index 0000000000..5a15a79b1b
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/ac16/case_obj.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/ac16/condition_obj.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/ac16/condition_obj.gif
new file mode 100644
index 0000000000..1be9094053
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/ac16/condition_obj.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/ac16/convert_normal.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/ac16/convert_normal.gif
new file mode 100644
index 0000000000..0b693cb5f6
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/ac16/convert_normal.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/ac16/elif_obj.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/ac16/elif_obj.gif
new file mode 100644
index 0000000000..f34581acb0
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/ac16/elif_obj.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/ac16/else_obj.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/ac16/else_obj.gif
new file mode 100644
index 0000000000..a441bef7dc
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/ac16/else_obj.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/ac16/for_obj.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/ac16/for_obj.gif
new file mode 100644
index 0000000000..11d3d8da1e
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/ac16/for_obj.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/ac16/if_obj.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/ac16/if_obj.gif
new file mode 100644
index 0000000000..86550fe9f4
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/ac16/if_obj.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/ac16/while_obj.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/ac16/while_obj.gif
new file mode 100644
index 0000000000..240749472c
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/ac16/while_obj.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/autoconf.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/autoconf.gif
new file mode 100644
index 0000000000..98afb3e2f0
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/autoconf.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/automake.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/automake.gif
new file mode 100644
index 0000000000..57df70ec64
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/automake.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dlcl16/build_configs.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dlcl16/build_configs.gif
new file mode 100644
index 0000000000..f0404659bb
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dlcl16/build_configs.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dlcl16/config_category.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dlcl16/config_category.gif
new file mode 100644
index 0000000000..cd837b147b
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dlcl16/config_category.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dlcl16/config_tool.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dlcl16/config_tool.gif
new file mode 100644
index 0000000000..4539ebd91f
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dlcl16/config_tool.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dlcl16/newc_app.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dlcl16/newc_app.gif
new file mode 100644
index 0000000000..a8353f6375
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dlcl16/newc_app.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dlcl16/newcc_app.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dlcl16/newcc_app.gif
new file mode 100644
index 0000000000..9ed7487c24
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dlcl16/newcc_app.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dlcl16/open_include.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dlcl16/open_include.gif
new file mode 100644
index 0000000000..b902fca49e
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dlcl16/open_include.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dtool16/alphab_sort_co.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dtool16/alphab_sort_co.gif
new file mode 100644
index 0000000000..a0245485d5
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dtool16/alphab_sort_co.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dtool16/build_menu.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dtool16/build_menu.gif
new file mode 100644
index 0000000000..825d4c15fb
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dtool16/build_menu.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dtool16/convert-normal.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dtool16/convert-normal.gif
new file mode 100644
index 0000000000..580eac5896
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dtool16/convert-normal.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dtool16/make.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dtool16/make.gif
new file mode 100644
index 0000000000..496f46b674
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dtool16/make.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dtool16/makefile.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dtool16/makefile.gif
new file mode 100644
index 0000000000..a66cba4228
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dtool16/makefile.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dtool16/newc_app.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dtool16/newc_app.gif
new file mode 100644
index 0000000000..a8353f6375
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dtool16/newc_app.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dtool16/newcc_app.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dtool16/newcc_app.gif
new file mode 100644
index 0000000000..9ed7487c24
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dtool16/newcc_app.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dtool16/segment_edit.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dtool16/segment_edit.gif
new file mode 100644
index 0000000000..8cbaa857b7
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dtool16/segment_edit.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dtool16/target_add.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dtool16/target_add.gif
new file mode 100644
index 0000000000..92003c4d62
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dtool16/target_add.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dtool16/target_build.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dtool16/target_build.gif
new file mode 100644
index 0000000000..f545148573
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dtool16/target_build.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dtool16/target_delete.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dtool16/target_delete.gif
new file mode 100644
index 0000000000..5bff52281b
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dtool16/target_delete.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dtool16/target_edit.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dtool16/target_edit.gif
new file mode 100644
index 0000000000..5e4b501b7d
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dtool16/target_edit.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dtool16/update_old.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dtool16/update_old.gif
new file mode 100644
index 0000000000..1f378279aa
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/dtool16/update_old.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/elcl16/build_configs.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/elcl16/build_configs.gif
new file mode 100644
index 0000000000..c4c76d0008
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/elcl16/build_configs.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/elcl16/config_category.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/elcl16/config_category.gif
new file mode 100644
index 0000000000..ee7c485243
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/elcl16/config_category.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/elcl16/config_tool.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/elcl16/config_tool.gif
new file mode 100644
index 0000000000..c984fba703
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/elcl16/config_tool.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/elcl16/newc_app.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/elcl16/newc_app.gif
new file mode 100644
index 0000000000..23b0284f84
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/elcl16/newc_app.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/elcl16/newcc_app.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/elcl16/newcc_app.gif
new file mode 100644
index 0000000000..4b39411daf
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/elcl16/newcc_app.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/elcl16/open_include.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/elcl16/open_include.gif
new file mode 100644
index 0000000000..b902fca49e
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/elcl16/open_include.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/etool16/alphab_sort_co.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/etool16/alphab_sort_co.gif
new file mode 100644
index 0000000000..7d27529b64
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/etool16/alphab_sort_co.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/etool16/build_menu.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/etool16/build_menu.gif
new file mode 100644
index 0000000000..ab543f4d49
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/etool16/build_menu.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/etool16/convert_normal.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/etool16/convert_normal.gif
new file mode 100644
index 0000000000..0b693cb5f6
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/etool16/convert_normal.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/etool16/make.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/etool16/make.gif
new file mode 100644
index 0000000000..def312aa12
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/etool16/make.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/etool16/makefile.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/etool16/makefile.gif
new file mode 100644
index 0000000000..7afb4948ba
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/etool16/makefile.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/etool16/newc_app.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/etool16/newc_app.gif
new file mode 100644
index 0000000000..23b0284f84
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/etool16/newc_app.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/etool16/newcc_app.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/etool16/newcc_app.gif
new file mode 100644
index 0000000000..4b39411daf
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/etool16/newcc_app.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/etool16/segment_edit.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/etool16/segment_edit.gif
new file mode 100644
index 0000000000..1b50ff8d67
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/etool16/segment_edit.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/etool16/target_add.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/etool16/target_add.gif
new file mode 100644
index 0000000000..7fe9625c8a
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/etool16/target_add.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/etool16/target_build.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/etool16/target_build.gif
new file mode 100644
index 0000000000..174965f26b
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/etool16/target_build.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/etool16/target_delete.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/etool16/target_delete.gif
new file mode 100644
index 0000000000..b853d62333
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/etool16/target_delete.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/etool16/target_edit.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/etool16/target_edit.gif
new file mode 100644
index 0000000000..65b97a547f
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/etool16/target_edit.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/etool16/target_filter.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/etool16/target_filter.gif
new file mode 100644
index 0000000000..5340ec9f41
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/etool16/target_filter.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/etool16/update_old.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/etool16/update_old.gif
new file mode 100644
index 0000000000..c40724d98b
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/etool16/update_old.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/acmacro_obj.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/acmacro_obj.gif
new file mode 100644
index 0000000000..98afb3e2f0
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/acmacro_obj.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/command_obj.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/command_obj.gif
new file mode 100644
index 0000000000..7b3a92e090
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/command_obj.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/define_obj.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/define_obj.gif
new file mode 100644
index 0000000000..87d583e1dd
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/define_obj.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/environment_obj.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/environment_obj.gif
new file mode 100644
index 0000000000..3150162350
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/environment_obj.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/envvar_obj.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/envvar_obj.gif
new file mode 100644
index 0000000000..0f07692697
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/envvar_obj.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/error_obj.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/error_obj.gif
new file mode 100644
index 0000000000..0bc60689c6
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/error_obj.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/fatalerror_obj.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/fatalerror_obj.gif
new file mode 100644
index 0000000000..75a92755b2
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/fatalerror_obj.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/hfolder_obj.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/hfolder_obj.gif
new file mode 100644
index 0000000000..b98b817279
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/hfolder_obj.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/include_obj.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/include_obj.gif
new file mode 100644
index 0000000000..612067c1f9
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/include_obj.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/info_obj.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/info_obj.gif
new file mode 100644
index 0000000000..745b884ff0
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/info_obj.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/irule_obj.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/irule_obj.gif
new file mode 100644
index 0000000000..975d7894b6
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/irule_obj.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/lib_obj.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/lib_obj.gif
new file mode 100644
index 0000000000..cb55e33b5e
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/lib_obj.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/macro_obj.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/macro_obj.gif
new file mode 100644
index 0000000000..fdde5fbb95
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/macro_obj.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/relation_obj.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/relation_obj.gif
new file mode 100644
index 0000000000..edbd8a3551
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/relation_obj.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/target_obj.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/target_obj.gif
new file mode 100644
index 0000000000..def312aa12
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/target_obj.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/trule_obj.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/trule_obj.gif
new file mode 100644
index 0000000000..dd261127c8
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/trule_obj.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/warning_obj.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/warning_obj.gif
new file mode 100644
index 0000000000..1e5f5eb367
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/obj16/warning_obj.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/sample.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/sample.gif
new file mode 100644
index 0000000000..34fb3c9d8c
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/icons/sample.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/plugin.properties b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/plugin.properties
new file mode 100644
index 0000000000..6a64207ece
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/plugin.properties
@@ -0,0 +1,174 @@
+#################################################################################
+# Copyright (c) 2006, 2008, 2009 Red Hat, Inc.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Red Hat Incorporated - initial API and implementation
+#################################################################################
+ConvertWizard.description=Convert to C/C++ Autotools Project
+ConvertWizard.name = Convert to a C/C++ Autotools Project
+
+NewCProjectV2.description=GNU C Autotools Project
+NewCCProjectV2.description=GNU C++ Autotools Project
+NewCWizardV2.name=GNU C Autotools Project
+NewCCWizardV2.name=GNU C++ Autotools Project
+
+Autotools.wizard.name=GNU Autotools Build Wizard
+
+Autoconf.editor.name=Autoconf Editor
+
+BuildProperty.value.name.default=Default;
+BuildProperty.type.name.autotools=GNU Autotools
+
+PreferenceAutotools.name=Autotools
+PreferenceAutomakeEditor.name=Automake Editor
+PreferenceAutoconfEditor.name=Autoconf Editor
+
+PropertyAutotools.name=Autotools
+PropertyAutotools.general.name=General
+PropertyAutotools.configure.name=Configure Settings
+PropertyTabEditor.name=Editors
+AutotoolsBuildPropertyTab.name=Behaviour
+AutotoolsEditorsPropertyTab.name=Editors
+AutotoolsToolsPropertyTab.name=Tools Settings
+AutotoolsConfigurePropertyTab.name=Configure Settings
+
+PropertyTabEditor.tooltip=Set options for Autotools-specific editors
+PropertyTabBuild.tooltip=Set additional Autotools build options
+
+Makefile.builder.name=Autotools Makefile Generator
+Autotools.projecttype.name=GNU Autotools
+AutotoolsNature.name=Autotools Project Nature
+AutotoolsNewNature.name=Autotools Project Nature V2
+Configuration.build.name=Build (GNU)
+Autotools.targetplatform.name=GNU Autotools Target Platform
+Autotools.gnu.toolchain.name=GNU Autotools Toolchain
+Configure.outputType=Configure Output (config.status)
+Autogen.outputType=Autogen Output (configure)
+
+CommandCategorySource.name=Source
+CommandCategorySource.description=Source commands
+CommandCategoryTools.name=Tools
+CommandCategoryTools.description=Autotool tools
+ShowTooltip.name=Show Tooltip Description
+ShowTooltip.description=Shows the tooltip description for the element at the cursor
+
+# Scope and Key Commands
+ACeditor.scope.name=Autoconf Editor
+ACeditor.scope.description=Editor for Autoconf Configuration Source Files
+
+Tool.configure=configure
+
+OptionCategory.configure.general=General
+Option.configure.name=Name
+Option.configure.builddir=Build directory
+Option.configure.builddir.tip=Subdirectory off of project where build will occur
+Option.configure.configdir=Configure tool directory
+Option.configure.configdir.tip=Subdirectory off of project containing configure scripts
+Option.configure.cache_file=Name of configuration cache file (--cache-file)
+Option.configure.cache_file.tip=Specify the name of the configuration cache file [config.cache]
+Option.configure.no_create=Turn off file creation <not advised> (--no-create)
+Option.configure.no_create.tip=This tells configuration not to generate the output files as part of configuration
+Option.configure.quiet=Turn off checking messages (--quiet)
+Option.configure.quiet.tip=This turns off "checking ..." style messages from the configuration console output
+Option.configure.help=Display help contents of top-level configuration (--help)
+Option.configure.help.tip=Ask configuration file to display its help documentation
+Option.configure.version=Display version of autotools used to create configuration (--version)
+Option.configure.version.tip=This outputs the version of the Autotools used to create the configuration files
+
+OptionCategory.configure.platform=Platform Specifiers
+Option.configure.host=Host platform (--host)
+Option.configure.host.tip=Platform that project will run on
+Option.configure.target=Target platform (--target)
+Option.configure.target.tip=Platform that project will target output for
+Option.configure.build=Build platform (--build)
+Option.configure.build.tip=Platform where project is being built
+
+OptionCategory.configure.directories=Directory specifiers
+Option.configure.prefix=Arch-independent install directory (--prefix)
+Option.configure.prefix.tip=Place where architecture-independent files are installed [/usr/local]
+Option.configure.exec_prefix=Arch-dependent install directory (--exec-prefix)
+Option.configure.exec_prefix.tip=Place where architecture-dependent files are installed [PREFIX]
+Option.configure.libdir=Object code library directory (--libdir)
+Option.configure.libdir.tip=Place where object code libraries are installed [EPREFIX/lib]
+Option.configure.bindir=User executable directory (--bindir)
+Option.configure.bindir.tip=Place where binary executables are installed [EPREFIX/bin]
+Option.configure.sbindir=System admin executable directory (--sbindir)
+Option.configure.sbindir.tip=Place where system admin executables are installed [EPREFIX/sbin]
+Option.configure.includedir=C Header file directory (--includdir)
+Option.configure.includedir.tip=Place where header files will be installed [PREFIX/include]
+Option.configure.datadir=Read-only architecture-independent data (--datadir)
+Option.configure.datadir.tip=Place where read-only architecture-independent data is installed [PREFIX/share]
+Option.configure.sysconfdir=Read-only single-machine data directory (--syconfdir)
+Option.configure.sysconfdir.tip=Place where read-only single-machine data is stored [PREFIX/etc]
+Option.configure.infodir=Info file documentation directory (--infodir)
+Option.configure.infodir.tip=Place where info files are installed [PREFIX/info]
+Option.configure.mandir=Man file documentation directory (--mandir)
+Option.configure.mandir.tip=Place where man file documentation is installed [PREFIX/man]
+Option.configure.srcdir=Sources directory (--srcdir)
+Option.configure.srcdir.tip=Place where configure can find sources [configure directory or ..]
+Option.configure.localstatedir=Modifiable single-machine data directory (--localstatedir)
+Option.configure.localstatedir.tip=Place where modifiable single-machine data is installed [PREFIX/var]
+Option.configure.sharedstatedir=Modifiable architecture-independent data directory (--sharedstatedir)
+Option.configure.sharedstatedir.tip=Place where modifiable architecture-independent data is installed [PREFIX/com}
+Option.configure.libexecdir=Program executable directory (--libexecdir)
+Option.configure.libexecdir=Place where program executables will be installed [EPREFIX/libexec]
+Option.configure.oldincludedir=Non-gcc C header file directory (--oldincludedir)
+Option.configure.oldincludedir.tip=Place where non-gcc C header files are installed [/usr/include]
+
+OptionCategory.configure.filenames=File-name transformations
+Option.configure.program_prefix=Installed program prefix (--program-prefix)
+Option.configure.program_prefix.tip=Prepend PREFIX to the beginning of installed program names
+Option.configure.program_suffix=Installed program suffix (--program-suffix)
+Option.configure.program_suffix.tip=Append SUFFIX to the end of installed program names
+Option.configure.program_transform_name=Installed program name transform (--program-transform-name)
+Option.configure.program_transform_name.tip=A sed string used to transform installed program names
+
+OptionCategory.configure.features=Features and packages
+Option.configure.enable_maintainer_mode=Enable maintainer mode (--enable-maintainer-mode)
+Option.configure.enable_maintainer_mode.tip=Specify this to have Makefiles generated with checks for Autotool configuration file changes
+Option.configure.user=User-specified configuration options
+Option.configure.user.tip=Specify one or more configuration options (e.g. --enable-FEATURE, --disable-FEATURE, or --with-PACKAGE)
+
+Tool.autogen = autogen.sh
+
+OptionCategory.autogen.general=Options
+Option.autogen.user=Command line options
+Option.autogen.user.tip=Specify options to pass to the top-level autogen.sh script
+
+RedHatVendor.name = Red Hat
+Bundle-Name.0 = Autotools UI Plug-in (Incubation)
+provider=Eclipse
+InvokeAutotools.label = Invoke Autotools
+InvokeAutotools.mnemonic = I
+InvokeAutoconf.label = Invoke Autoconf
+InvokeAutoconf.mnemonic = c
+InvokeAutoconf.description = Run autoconf in the selected directory
+InvokeAutoheader.label = Invoke Autoheader
+InvokeAutoheader.mnemonic = h
+InvokeAutoheader.description = Run autoheader from the selected directory
+InvokeAutomake.label = Invoke Automake
+InvokeAutomake.mnemonic = m
+InvokeAutomake.description = Run automake from the selected directory
+InvokeAutoreconf.label = Invoke Autoreconf
+InvokeAutoreconf.mnemonic = r
+InvokeAutoreconf.description = Run autoreconf from the selected directory
+InvokeAclocal.label = Invoke Aclocal
+InvokeAclocal.mnemonic = l
+InvokeAclocal.description = Run aclocal from the selected directory
+InvokeLibtoolize.label = Invoke Libtoolize
+InvokeLibtoolize.mnemonic = t
+InvokeLibtoolize.description = Run libtoolize in the selected directory
+Reconfigure.label = Reconfigure Project
+Reconfigure.mnemonic = f
+Reconfigure.description = Run configuration scripts for project
+DynamicBuild.label = Dynamic Build Info
+GetIncludePath.label = Get Include Path
+GetDefinedSymbols.label = Get Defined Symbols
+IncludesOption.name = includes
+SymbolsOption.name = symbols
+AutomakeEditor.name = AutomakeEditor
+Automake.name = automake \ No newline at end of file
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/plugin.xml b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/plugin.xml
new file mode 100644
index 0000000000..5dbeb1d06a
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/plugin.xml
@@ -0,0 +1,740 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+
+ <extension
+ point="org.eclipse.ui.newWizards">
+ <wizard
+ category="org.eclipse.cdt.ui.newCWizards"
+ class="org.eclipse.linuxtools.internal.cdt.autotools.ui.wizards.ConvertToAutotoolsProjectWizard"
+ finalPerspective="org.eclipse.cdt.ui.CPerspective"
+ hasPages="true"
+ icon="icons/ac16/convert_normal.gif"
+ id="org.eclipse.linuxtools.cdt.autotools.ui.wizards.conversionWizard"
+ name="%ConvertWizard.name">
+ <description>
+ %ConvertWizard.description
+ </description>
+ <selection class="org.eclipse.core.resources.IProject"/>
+ </wizard>
+ <!--
+ <wizard
+ category="org.eclipse.cdt.ui.newCWizards"
+ class="org.eclipse.linuxtools.internal.cdt.autotools.ui.wizards.AutotoolsNewCProjectWizardV2"
+ finalPerspective="org.eclipse.cdt.ui.CPerspective"
+ hasPages="true"
+ icon="icons/elcl16/newc_app.gif"
+ id="org.eclipse.linuxtools.cdt.autotools.ui.wizard.c.v2"
+ name="%NewCWizardV2.name"
+ project="true">
+ <description>
+ %NewCProjectV2.description
+ </description>
+ <selection
+ class="org.eclipse.core.resources.IProject">
+ </selection>
+ </wizard>
+ <wizard
+ category="org.eclipse.cdt.ui.newCWizards"
+ class="org.eclipse.linuxtools.internal.cdt.autotools.ui.wizards.AutotoolsNewCCProjectWizardV2"
+ finalPerspective="org.eclipse.cdt.ui.CPerspective"
+ hasPages="true"
+ icon="icons/elcl16/newcc_app.gif"
+ id="org.eclipse.linuxtools.cdt.autotools.ui.wizard.cc.v2"
+ name="%NewCCWizardV2.name"
+ project="true">
+ <description>
+ %NewCCProjectV2.description
+ </description>
+ <selection
+ class="org.eclipse.core.resources.IProject">
+ </selection>
+ </wizard>
+ -->
+ </extension>
+ <!--
+ <extension
+ point="org.eclipse.ui.navigator.navigatorContent">
+ <commonWizard
+ associatedExtensionId="org.eclipse.cdt.ui.navigator.content"
+ menuGroupId="org.eclipse.cdt.ui.newProject"
+ type="new"
+ wizardId="org.eclipse.linuxtools.cdt.autotools.ui.wizards.conversionWizard">
+ <enablement>
+ <and>
+ <adapt type="org.eclipse.core.resources.IProject" />
+ <not>
+ <adapt type="org.eclipse.core.resources.IProject" >
+ <test
+ property="org.eclipse.core.resources.projectNature"
+ value="org.eclipse.linuxtools.cdt.autotools.core.autotoolsNatureV2"/>
+ </adapt>
+ </not>
+ </and>
+ </enablement>
+ </commonWizard>
+ </extension>
+ <extension
+ point="org.eclipse.ui.navigator.viewer">
+ <viewerContentBinding viewerId="org.eclipse.ui.navigator.ProjectExplorer">
+ <includes>
+ <contentExtension pattern="org.eclipse.linuxtools.cdt.autotools.ui.wizards.*"/>
+ </includes>
+ </viewerContentBinding>
+ </extension>
+ -->
+ <extension
+ id="org.eclipse.linuxtools.cdt.autotools.ui.popup1"
+ point="org.eclipse.ui.popupMenus">
+ <objectContribution
+ adaptable="true"
+ id="org.eclipse.linuxtools.cdt.autotools.ui.objectContribution.autoconf"
+ nameFilter="configure.ac"
+ objectClass="org.eclipse.core.resources.IResource">
+ <action
+ class="org.eclipse.linuxtools.internal.cdt.autotools.ui.actions.InvokeAutoconfAction"
+ enablesFor="1"
+ id="org.eclipse.linuxtools.cdt.autotools.ui.action.autoconf1"
+ label="%InvokeAutoconf.label"
+ menubarPath="additions">
+ </action>
+ </objectContribution>
+ <objectContribution
+ adaptable="true"
+ id="org.eclipse.linuxtools.cdt.autotools.ui.objectContribution.autoconf2"
+ nameFilter="configure.in"
+ objectClass="org.eclipse.core.resources.IResource">
+ <action
+ class="org.eclipse.linuxtools.internal.cdt.autotools.ui.actions.InvokeAutoconfAction"
+ enablesFor="1"
+ id="org.eclipse.linuxtools.cdt.autotools.ui.action2"
+ label="%InvokeAutoconf.label"
+ menubarPath="additions">
+ </action>
+ </objectContribution>
+ </extension>
+ <extension
+ point="org.eclipse.cdt.core.CBuildConsole">
+ <CBuildConsole
+ class="org.eclipse.linuxtools.internal.cdt.autotools.ui.CConfigureConsole"
+ id="org.eclipse.linuxtools.cdt.autotools.ui.configureConsole"/>
+ <CBuildConsole
+ class="org.eclipse.linuxtools.internal.cdt.autotools.ui.CBuildStepsConsole"
+ id="org.eclipse.linuxtools.cdt.autotools.ui.buildStepsConsole">
+ </CBuildConsole>
+ <CBuildConsole
+ class="org.eclipse.linuxtools.internal.cdt.autotools.ui.AutotoolsConsole"
+ id="org.eclipse.linuxtools.cdt.autotools.ui.autotoolsConsole">
+ </CBuildConsole>
+ </extension>
+ <extension point="org.eclipse.core.contenttype.contentTypes">
+ <!-- declares a content type for automake files -->
+ <content-type id="org.eclipse.linuxtools.cdt.autotools.ui.automake" name="%Automake.name"
+ base-type="org.eclipse.core.runtime.text"
+ priority="high"/>
+ </extension>
+ <extension point="org.eclipse.core.contenttype.contentTypes">
+ <file-association
+ content-type="org.eclipse.linuxtools.cdt.autotools.ui.automake"
+ file-names="Makefile.am"
+ file-extensions="am"/>
+ </extension>
+ <extension
+ point="org.eclipse.ui.editors">
+ <editor
+ class="org.eclipse.linuxtools.cdt.autotools.ui.editors.AutoconfEditor"
+ contributorClass="org.eclipse.ui.texteditor.BasicTextEditorActionContributor"
+ default="true"
+ extensions="m4"
+ filenames="configure.in,configure.ac"
+ icon="icons/autoconf.gif"
+ id="org.eclipse.linuxtools.cdt.autotools.ui.editor.autoconf"
+ name="%Autoconf.editor.name"/>
+ </extension>
+ <extension
+ id="org.eclipse.cdt.make.editor"
+ name="MakefileEditor"
+ point="org.eclipse.ui.editors">
+ <editor
+ name="%AutomakeEditor.name"
+ icon="icons/automake.gif"
+ contributorClass="org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake.MakefileEditorActionContributor"
+ class="org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake.AutomakeEditor"
+ id="org.eclipse.linuxtools.cdt.autotools.ui.editors.AutomakeEditor"
+ filenames="Makefile.am,Makefile.in">
+ <contentTypeBinding contentTypeId="org.eclipse.linuxtools.cdt.autotools.ui.automake"/>
+ </editor>
+ </extension>
+ <extension
+ point="org.eclipse.ui.contexts">
+ <context
+ description="%ACeditor.scope.description"
+ id="org.eclipse.linuxtools.cdt.autotools.ui.editor.scope"
+ name="%ACeditor.scope.name"
+ parentId="org.eclipse.ui.textEditorScope"/>
+ </extension>
+ <extension
+ point="org.eclipse.ui.bindings">
+ <key
+ commandId="org.eclipse.linuxtools.cdt.autotools.ui.editors.text.show.tooltip"
+ contextId="org.eclipse.linuxtools.cdt.autotools.ui.editor.scope"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+ sequence="F2"/>
+ </extension>
+ <extension
+ point="org.eclipse.ui.commands">
+ <category
+ description="%CommandCategorySource.description"
+ id="org.eclipse.linuxtools.cdt.ui.category.source"
+ name="%CommandCategorySource.name"/>
+ <command
+ categoryId="org.eclipse.linuxtools.cdt.ui.category.source"
+ description="%ShowTooltip.description"
+ id="org.eclipse.linuxtools.cdt.autotools.ui.editors.text.show.tooltip"
+ name="%ShowTooltip.name"/>
+ </extension>
+ <extension
+ id="parsefileerror"
+ name="Autotools Parse Error Marker"
+ point="org.eclipse.core.resources.markers">
+ <super type="org.eclipse.core.resources.problemmarker"/>
+ <super type="org.eclipse.core.resources.textmarker"/>
+ <persistent value="true"/>
+ </extension>
+ <extension
+ id="outlineparsefileerror"
+ name="Autotools Outline Page Parse Error"
+ point="org.eclipse.core.resources.markers">
+ <super type="org.eclipse.core.resources.problemmarker"/>
+ <super type="org.eclipse.core.resources.textmarker"/>
+ <persistent value="true"/>
+ </extension>
+ <extension
+ id="org.eclipse.linuxtools.cdt.autoconf.docsetup"
+ name="Autoconf Editor Setup"
+ point="org.eclipse.core.filebuffers.documentSetup">
+ <participant
+ class="org.eclipse.linuxtools.cdt.autotools.ui.editors.AutoconfDocumentSetupParticipant"
+ extensions="m4"
+ fileNames="configure.in,configure.ac"/>
+ </extension>
+ <extension
+ point="org.eclipse.ui.preferencePages">
+ <page
+ category="org.eclipse.cdt.ui.preferences.CPluginPreferencePage"
+ class="org.eclipse.linuxtools.internal.cdt.autotools.ui.preferences.AutotoolsPreferencePage"
+ id="org.eclipse.linuxtools.cdt.autotools.ui.preferences1"
+ name="%PreferenceAutotools.name">
+ </page>
+ <page
+ category="org.eclipse.linuxtools.cdt.autotools.ui.preferences1"
+ class="org.eclipse.linuxtools.internal.cdt.autotools.ui.preferences.AutomakeEditorPreferencePage"
+ id="org.eclipse.linuxtools.cdt.autotools.ui.preferences.automake.editor1"
+ name="%PreferenceAutomakeEditor.name">
+ </page>
+ <page
+ category="org.eclipse.linuxtools.cdt.autotools.ui.preferences1"
+ class="org.eclipse.linuxtools.internal.cdt.autotools.ui.preferences.AutoconfEditorPreferencePage"
+ id="org.eclipse.linuxtools.cdt.autotools.ui.preferences.autoconf.editor1"
+ name="%PreferenceAutoconfEditor.name">
+ </page>
+ </extension>
+ <extension
+ point="org.eclipse.cdt.ui.cPropertyTab">
+ <tab
+ class="org.eclipse.linuxtools.internal.cdt.autotools.ui.properties.AutotoolsBuildPropertyPage"
+ icon="icons/autoconf.gif"
+ name="%AutotoolsBuildPropertyTab.name"
+ parent="org.eclipse.linuxtools.internal.cdt.autotools.ui.properties.AutotoolsHeadPropertyPage"
+ tooltip="%PropertyTabBuild.tooltip"
+ weight="002">
+ </tab>
+ <tab
+ class="org.eclipse.linuxtools.internal.cdt.autotools.ui.properties.AutotoolsEditorPropertyTab"
+ name="%AutotoolsEditorsPropertyTab.name"
+ parent="org.eclipse.linuxtools.internal.cdt.autotools.ui.properties.AutotoolsGeneralPropertyPage">
+ </tab>
+ <tab
+ class="org.eclipse.linuxtools.internal.cdt.autotools.ui.properties.AutotoolsToolsPropertyTab"
+ name="%AutotoolsToolsPropertyTab.name"
+ parent="org.eclipse.linuxtools.internal.cdt.autotools.ui.properties.AutotoolsGeneralPropertyPage">
+ </tab>
+ <tab
+ class="org.eclipse.linuxtools.internal.cdt.autotools.ui.properties.AutotoolsConfigurePropertyTab"
+ name="%AutotoolsConfigurePropertyTab.name"
+ parent="org.eclipse.linuxtools.internal.cdt.autotools.ui.properties.AutotoolsConfigurePropertyPage">
+ </tab>
+ </extension>
+ <extension
+ point="org.eclipse.ui.propertyPages">
+ <page
+ class="org.eclipse.linuxtools.internal.cdt.autotools.ui.properties.AutotoolsHeadPropertyPage"
+ id="org.eclipse.linuxtools.cdt.autotools.ui.propertypage"
+ name="%PropertyAutotools.name"
+ >
+ <filter
+ name="projectNature"
+ value="org.eclipse.linuxtools.cdt.autotools.core.autotoolsNatureV2">
+ </filter>
+ <enabledWhen>
+ <or>
+ <instanceof value="org.eclipse.core.resources.IProject"/>
+ <instanceof value="org.eclipse.cdt.core.model.ICProject"/>
+
+ <instanceof value="org.eclipse.core.resources.IFolder"/>
+ <instanceof value="org.eclipse.cdt.core.model.ICContainer"/>
+
+ <instanceof value="org.eclipse.cdt.core.model.ITranslationUnit"/>
+ <instanceof value="org.eclipse.core.resources.IFile"/>
+ </or>
+ </enabledWhen>
+ </page>
+ <page
+ category="org.eclipse.linuxtools.cdt.autotools.ui.propertypage"
+ class="org.eclipse.linuxtools.internal.cdt.autotools.ui.properties.AutotoolsGeneralPropertyPage"
+ id="org.eclipse.linuxtools.cdt.autotools.ui.propertypage2"
+ name="%PropertyAutotools.general.name">
+ <filter
+ name="projectNature"
+ value="org.eclipse.linuxtools.cdt.autotools.core.autotoolsNatureV2">
+ </filter>
+ </page>
+ <page
+ category="org.eclipse.linuxtools.cdt.autotools.ui.propertypage"
+ class="org.eclipse.linuxtools.internal.cdt.autotools.ui.properties.AutotoolsConfigurePropertyPage"
+ id="org.eclipse.linuxtools.cdt.autotools.ui.propertypage3"
+ name="%PropertyAutotools.configure.name">
+ <filter
+ name="projectNature"
+ value="org.eclipse.linuxtools.cdt.autotools.core.autotoolsNatureV2">
+ </filter>
+ </page>
+ </extension>
+ <extension
+ point="org.eclipse.ui.menus">
+ <menuContribution
+ locationURI="menu:project?after=additions">
+ <menu
+ id="invokeAutotools"
+ label="%InvokeAutotools.label"
+ mnemonic="%InvokeAutotools.mnemonic">
+ <visibleWhen
+ checkEnabled="false">
+ <and>
+ <count
+ value="1">
+ </count>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <adapt
+ type="org.eclipse.core.resources.IResource">
+ <test
+ property="org.eclipse.core.resources.projectNature"
+ value="org.eclipse.linuxtools.cdt.autotools.core.autotoolsNatureV2">
+ </test>
+ </adapt>
+ </iterate>
+ </and>
+ </visibleWhen>
+ </menu>
+ </menuContribution>
+ </extension>
+ <extension
+ point="org.eclipse.ui.menus">
+ <menuContribution
+ locationURI="menu:project?after=additions">
+ <command
+ commandId="org.eclipse.linuxtools.cdt.autotools.ui.command.reconfigure"
+ id="reconfigure"
+ label="%Reconfigure.label"
+ mnemonic="%Reconfigure.mnemonic"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <and>
+ <count
+ value="1">
+ </count>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <adapt
+ type="org.eclipse.core.resources.IResource">
+ <test
+ property="org.eclipse.core.resources.projectNature"
+ value="org.eclipse.linuxtools.cdt.autotools.core.autotoolsNatureV2">
+ </test>
+ </adapt>
+ </iterate>
+ </and>
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ </extension>
+ <extension
+ point="org.eclipse.ui.menus">
+ <menuContribution
+ locationURI="menu:invokeAutotools">
+ <command
+ commandId="org.eclipse.linuxtools.cdt.autotools.ui.command.autoconf"
+ id="autoconf"
+ label="%InvokeAutoconf.label"
+ mnemonic="%InvokeAutoconf.mnemonic"
+ style="push">
+ </command>
+ <command
+ commandId="org.eclipse.linuxtools.cdt.autotools.ui.command.autoheader"
+ id="autoheader"
+ label="%InvokeAutoheader.label"
+ mnemonic="%InvokeAutoheader.mnemonic"
+ style="push">
+ </command>
+ <command
+ commandId="org.eclipse.linuxtools.cdt.autotools.ui.command.automake"
+ id="automake"
+ label="%InvokeAutomake.label"
+ mnemonic="%InvokeAutomake.mnemonic"
+ style="push">
+ </command>
+ <command
+ commandId="org.eclipse.linuxtools.cdt.autotools.ui.command.autoreconf"
+ id="autoreconf"
+ label="%InvokeAutoreconf.label"
+ mnemonic="%InvokeAutoreconf.mnemonic"
+ style="push">
+ </command>
+ <command
+ commandId="org.eclipse.linuxtools.cdt.autotools.ui.command.aclocal"
+ id="aclocal"
+ label="%InvokeAclocal.label"
+ mnemonic="%InvokeAclocal.mnemonic"
+ style="push">
+ </command>
+ <command
+ commandId="org.eclipse.linuxtools.cdt.autotools.ui.command.libtoolize"
+ id="libtoolize"
+ label="%InvokeLibtoolize.label"
+ mnemonic="%InvokeLibtoolize.mnemonic"
+ style="push">
+ </command>
+ </menuContribution>
+ </extension>
+ <extension
+ id="org.eclipse.linuxtools.cdt.autotools.ui.commands"
+ name="Autoconf"
+ point="org.eclipse.ui.commands">
+ <category
+ id="org.eclipse.linuxtools.cdt.autotools.ui.category.invokeAutotools"
+ name="%InvokeAutotools.label">
+ </category>
+ <command
+ categoryId="org.eclipse.linuxtools.cdt.autotools.ui.category.invokeAutotools"
+ description="%InvokeAutoconf.description"
+ id="org.eclipse.linuxtools.cdt.autotools.ui.command.autoconf"
+ name="%InvokeAutoconf.label">
+ </command>
+ <command
+ categoryId="org.eclipse.linuxtools.cdt.autotools.ui.category.invokeAutotools"
+ description="%InvokeAutoheader.description"
+ id="org.eclipse.linuxtools.cdt.autotools.ui.command.autoheader"
+ name="%InvokeAutoheader.label">
+ </command>
+ <command
+ categoryId="org.eclipse.linuxtools.cdt.autotools.ui.category.invokeAutotools"
+ description="%InvokeAutomake.description"
+ id="org.eclipse.linuxtools.cdt.autotools.ui.command.automake"
+ name="%InvokeAutomake.label">
+ </command>
+ <command
+ categoryId="org.eclipse.linuxtools.cdt.autotools.ui.category.invokeAutotools"
+ description="%InvokeAutoreconf.description"
+ id="org.eclipse.linuxtools.cdt.autotools.ui.command.autoreconf"
+ name="%InvokeAutoreconf.label">
+ </command>
+ <command
+ categoryId="org.eclipse.linuxtools.cdt.autotools.ui.category.invokeAutotools"
+ description="%InvokeAclocal.description"
+ id="org.eclipse.linuxtools.cdt.autotools.ui.command.aclocal"
+ name="%InvokeAclocal.label">
+ </command>
+ <command
+ categoryId="org.eclipse.linuxtools.cdt.autotools.ui.category.invokeAutotools"
+ description="%InvokeLibtoolize.description"
+ id="org.eclipse.linuxtools.cdt.autotools.ui.command.libtoolize"
+ name="%InvokeLibtoolize.label">
+ </command>
+ <command
+ categoryId="org.eclipse.linuxtools.cdt.autotools.ui.category.invokeAutotools"
+ description="%Reconfigure.description"
+ id="org.eclipse.linuxtools.cdt.autotools.ui.command.reconfigure"
+ name="%Reconfigure.label">
+ </command>
+ </extension>
+ <extension
+ point="org.eclipse.ui.handlers">
+ <handler
+ class="org.eclipse.linuxtools.internal.cdt.autotools.ui.actions.AutoconfHandler"
+ commandId="org.eclipse.linuxtools.cdt.autotools.ui.command.autoconf">
+ <activeWhen>
+ <with
+ variable="selection">
+ <count
+ value="1">
+ </count>
+ <iterate
+ operator="and">
+ <adapt
+ type="org.eclipse.core.resources.IResource">
+ </adapt>
+ </iterate>
+ </with>
+ </activeWhen>
+ <enabledWhen>
+ <with
+ variable="selection">
+ <count
+ value="1">
+ </count>
+ <iterate
+ operator="and">
+ <adapt
+ type="org.eclipse.core.resources.IResource">
+ </adapt>
+ </iterate>
+ </with>
+ </enabledWhen>
+ </handler>
+ <handler
+ class="org.eclipse.linuxtools.internal.cdt.autotools.ui.actions.AutoheaderHandler"
+ commandId="org.eclipse.linuxtools.cdt.autotools.ui.command.autoheader">
+ <activeWhen>
+ <with
+ variable="selection">
+ <count
+ value="1">
+ </count>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <adapt
+ type="org.eclipse.core.resources.IResource">
+ </adapt>
+ </iterate>
+ </with>
+ </activeWhen>
+ <enabledWhen>
+ <with
+ variable="selection">
+ <count
+ value="1">
+ </count>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <adapt
+ type="org.eclipse.core.resources.IResource">
+ </adapt>
+ </iterate>
+ </with>
+ </enabledWhen>
+ </handler>
+ <handler
+ class="org.eclipse.linuxtools.internal.cdt.autotools.ui.actions.AutomakeHandler"
+ commandId="org.eclipse.linuxtools.cdt.autotools.ui.command.automake">
+ <activeWhen>
+ <with
+ variable="selection">
+ <count
+ value="1">
+ </count>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <adapt
+ type="org.eclipse.core.resources.IResource">
+ </adapt>
+ </iterate>
+ </with>
+ </activeWhen>
+ <enabledWhen>
+ <with
+ variable="selection">
+ <count
+ value="1">
+ </count>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <adapt
+ type="org.eclipse.core.resources.IResource">
+ </adapt>
+ </iterate>
+ </with>
+ </enabledWhen>
+ </handler>
+ <handler
+ class="org.eclipse.linuxtools.internal.cdt.autotools.ui.actions.AutoreconfHandler"
+ commandId="org.eclipse.linuxtools.cdt.autotools.ui.command.autoreconf">
+ <activeWhen>
+ <with
+ variable="selection">
+ <count
+ value="1">
+ </count>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <adapt
+ type="org.eclipse.core.resources.IResource">
+ </adapt>
+ </iterate>
+ </with>
+ </activeWhen>
+ <enabledWhen>
+ <with
+ variable="selection">
+ <count
+ value="1">
+ </count>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <adapt
+ type="org.eclipse.core.resources.IResource">
+ </adapt>
+ </iterate>
+ </with>
+ </enabledWhen>
+ </handler>
+ <handler
+ class="org.eclipse.linuxtools.internal.cdt.autotools.ui.actions.AclocalHandler"
+ commandId="org.eclipse.linuxtools.cdt.autotools.ui.command.aclocal">
+ <activeWhen>
+ <with
+ variable="selection">
+ <count
+ value="1">
+ </count>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <adapt
+ type="org.eclipse.core.resources.IResource">
+ </adapt>
+ </iterate>
+ </with>
+ </activeWhen>
+ <enabledWhen>
+ <with
+ variable="selection">
+ <count
+ value="1">
+ </count>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <adapt
+ type="org.eclipse.core.resources.IResource">
+ </adapt>
+ </iterate>
+ </with>
+ </enabledWhen>
+ </handler>
+ <handler
+ class="org.eclipse.linuxtools.internal.cdt.autotools.ui.actions.LibtoolizeHandler"
+ commandId="org.eclipse.linuxtools.cdt.autotools.ui.command.libtoolize">
+ <activeWhen>
+ <with
+ variable="selection">
+ <count
+ value="1">
+ </count>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <adapt
+ type="org.eclipse.core.resources.IResource">
+ </adapt>
+ </iterate>
+ </with>
+ </activeWhen>
+ <enabledWhen>
+ <with
+ variable="selection">
+ <count
+ value="1">
+ </count>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <adapt
+ type="org.eclipse.core.resources.IResource">
+ </adapt>
+ </iterate>
+ </with>
+ </enabledWhen>
+ </handler>
+ <handler
+ class="org.eclipse.linuxtools.internal.cdt.autotools.ui.actions.ReconfigureHandler"
+ commandId="org.eclipse.linuxtools.cdt.autotools.ui.command.reconfigure">
+ <activeWhen>
+ <with
+ variable="selection">
+ <count
+ value="1">
+ </count>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <adapt
+ type="org.eclipse.core.resources.IResource">
+ </adapt>
+ </iterate>
+ </with>
+ </activeWhen>
+ <enabledWhen>
+ <with
+ variable="selection">
+ <count
+ value="1">
+ </count>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <adapt
+ type="org.eclipse.core.resources.IResource">
+ </adapt>
+ </iterate>
+ </with>
+ </enabledWhen>
+ </handler>
+ </extension>
+ <extension
+ point="org.eclipse.cdt.core.templates">
+ <template
+ id="org.eclipse.linuxtools.cdt.autotools.ui.template.emptyProject"
+ location="templates/projecttemplates/EmptyProject/template.xml"
+ projectType="org.eclipse.linuxtools.cdt.autotools.core.projectType">
+ </template>
+ <template
+ filterPattern=".*gcc"
+ id="org.eclipse.linuxtools.cdt.autotools.ui.template.helloWorldCProject"
+ location="templates/projecttemplates/HelloWorldCAutotoolsProject/template.xml"
+ projectType="org.eclipse.linuxtools.cdt.autotools.core.projectType">
+ </template>
+ <template
+ filterPattern=".*g\+\+"
+ id="org.eclipse.linuxtools.cdt.autotools.ui.template.helloWorldCPPProject"
+ location="templates/projecttemplates/HelloWorldCPPAutotoolsProject/template.xml"
+ projectType="org.eclipse.linuxtools.cdt.autotools.core.projectType">
+ </template>
+ </extension>
+ <extension
+ point="org.eclipse.cdt.ui.CDTWizard">
+ <wizard
+ class="org.eclipse.linuxtools.internal.cdt.autotools.ui.wizards.AutotoolsBuildWizard"
+ name="%Autotools.wizard.name">
+ </wizard>
+ </extension>
+</plugin>
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/AutotoolsUIPlugin.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/AutotoolsUIPlugin.java
new file mode 100644
index 0000000000..0f80ceeee9
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/AutotoolsUIPlugin.java
@@ -0,0 +1,257 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui;
+
+import java.lang.reflect.InvocationTargetException;
+import java.text.MessageFormat;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+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;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.jface.resource.ImageDescriptor;
+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;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class AutotoolsUIPlugin extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.linuxtools.cdt.autotools.ui"; //$NON-NLS-1$
+
+ // The shared instance
+ private static AutotoolsUIPlugin plugin;
+
+ private ResourceBundle resourceBundle;
+
+ /**
+ * The constructor.
+ */
+ public AutotoolsUIPlugin() {
+ plugin = this;
+ try {
+ resourceBundle = ResourceBundle.getBundle(PLUGIN_ID + ".Resources"); //$NON-NLS-1$
+ } catch (MissingResourceException x) {
+ resourceBundle = null;
+ }
+
+ }
+
+ public static String getPluginId() {
+ return PLUGIN_ID;
+ }
+
+ 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().getBundle().getSymbolicName();
+ }
+
+ /**
+ * This method is called upon plug-in activation
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ }
+
+ /**
+ * This method is called when the plug-in is stopped
+ */
+ public void stop(BundleContext context) throws Exception {
+ super.stop(context);
+ plugin = null;
+ }
+
+ /**
+ * Returns the shared instance.
+ */
+ public static AutotoolsUIPlugin getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Returns active shell.
+ */
+ public static Shell getActiveWorkbenchShell() {
+ IWorkbenchWindow window = getDefault().getWorkbench().getActiveWorkbenchWindow();
+ if (window != null) {
+ return window.getShell();
+ }
+ return null;
+ }
+
+ /**
+ * Returns the string from the plugin's resource bundle,
+ * or 'key' if not found.
+ *
+ * @param key the message key
+ * @return the resource bundle message
+ */
+ public static String getResourceString(String key) {
+ ResourceBundle bundle = AutotoolsUIPlugin.getDefault().getResourceBundle();
+ try {
+ return bundle.getString(key);
+ } catch (MissingResourceException e) {
+ return key;
+ }
+ }
+
+ /**
+ * Returns the string from the plugin's resource bundle,
+ * or 'key' if not found.
+ *
+ * @param key the message key
+ * @param args an array of substituition strings
+ * @return the resource bundle message
+ */
+ public static String getFormattedString(String key, String[] args) {
+ return MessageFormat.format(getResourceString(key), (Object[])args);
+ }
+
+ /**
+ * Returns the plugin's resource bundle,
+ */
+ public ResourceBundle getResourceBundle() {
+ return resourceBundle;
+ }
+
+ /**
+ * Returns an image descriptor for the image file at the given
+ * plug-in relative path.
+ *
+ * @param path the path
+ * @return the image descriptor
+ */
+ public static ImageDescriptor getImageDescriptor(String path) {
+ return AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path);
+ }
+
+ 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, AutotoolsUIPlugin.getUniqueIdentifier(), -1, "Internal Error: ", t); //$NON-NLS-1$
+ }
+ ErrorDialog.openError(shell, title, message, status);
+ }
+
+ /**
+ * Returns the workspace instance.
+ */
+ public static IWorkspace getWorkspace() {
+ return ResourcesPlugin.getWorkspace();
+ }
+
+ /**
+ * Returns the active workbench window or <code>null</code> if none
+ */
+ public static IWorkbenchWindow getActiveWorkbenchWindow() {
+ return getDefault().getWorkbench().getActiveWorkbenchWindow();
+ }
+
+ /**
+ * Returns the active workbench page or <code>null</code> if none.
+ */
+ public static IWorkbenchPage getActivePage() {
+ IWorkbenchWindow window= getActiveWorkbenchWindow();
+ if (window != null) {
+ return window.getActivePage();
+ }
+ return null;
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/Resources.properties b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/Resources.properties
new file mode 100644
index 0000000000..84ce7c0bf6
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/Resources.properties
@@ -0,0 +1,105 @@
+#################################################################################
+# Copyright (c) 2006, 2007, 2009 Red Hat, Inc.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Red Hat Incorporated - initial API and implementation
+# IBM Rational Software - ManagedMakeMessages copied to AutotoolsMakefileBuilder
+#################################################################################
+MakeCWizard.title=C/Make Project
+MakeCWizard.description=Create a New C Project using 'make' to build it
+
+WARNING_UNSUPPORTED_CONFIGURATION=Warning: unsupported configuration
+
+AutotoolsMakefileBuilder.message.finished=Build complete for project {0}
+AutotoolsMakefileBuilder.message.stopped=Build stopped
+AutotoolsMakefileBuilder.type.clean=Clean-only build
+AutotoolsMakefileBuilder.message.clean.deleting.output=Removing build artifacts from {0}
+AutotoolsMakefileBuilder.message.console.header=**** {0} of configuration {1} for project {2} ****
+
+MakeGenerator.makefile.built=Makefile built
+MakeGenerator.refresh=Refresh
+MakeGenerator.refresh.error=Refresh error
+MakeGenerator.generation.error=Configuration failed with error
+MakeGenerator.configuring=Configuring
+MakeGenerator.make.message=Invoking {0} for project {1}
+MakeGenerator.config.error=Error {0} occurred while running {1}
+MakeGenerator.createdir.error=Error creating build directory: {0}
+MakeGenerator.run.config.status=Running config.status in build directory: {0}
+MakeGenerator.makefile.cvs=Invoking Makefile.cvs in build directory: {0}
+MakeGenerator.autogen.sh=Invoking autogen.sh in build directory: {0}
+MakeGenerator.autoreconf=Invoking autoreconf in directory: {0}
+MakeGenerator.gen.makefile=Generating Makefile in build directory: {0}
+MakeGenerator.clean.builddir=Cleaning build directory: {0}
+MakeGenerator.gen.configure=Generating configure
+MakeGenerator.unsupportedConfig=Warning: unsupported configuration {0}
+MakeGenerator.success=[Operation successful]
+MakeGenerator.didnt.generate=No Makefile generated
+MakeGenerator.refresh.MakeTargets=Refreshing Make Targets
+
+BuildDir.apply=Build directory already in use
+BuildDir.default=Default build directory to unused value?
+BuildDir.yes=Yes
+BuildDir.no=No
+
+WizardAutotoolsProjectConversion.title=Convert to C/C++ Autotools Project
+WizardAutotoolsProjectConversion.description=Convert an existing Project to a C/C++ Autotools Project
+WizardAutotoolsProjectConversion.message.add_nature=Adding C/C++ Autotools Managed Project Nature
+WizardAutotoolsProjectConversion.message.add_builder=Adding C/C++ Autotools Managed Project Builder
+WizardMakeProjectConversion.monitor.convertingToMakeProject=Converting Project...
+WizardAutotoolsConversion=C/C++ Autotools Conversion
+WizardAutotoolsConversion.windowTitle=Conversion to a C/C++ Autotools Project
+WizardAutotoolsConversion.config.title=Select a configuration
+WizardAutotoolsConversion.config.desc=Select the configuration you wish to deploy on
+WizardAutotoolsConversion.options.title=Additional Project Settings
+WizardAutotoolsConversion.options.desc=Define the inter-project dependencies, if any.
+WizardAutotoolsConversion.message.save=Saving new build options
+
+WizardAutotoolsNewCProject.title=Autotools C Project
+WizardAutotoolsNewCProject.description=Create a new C Autotools project
+WizardAutotoolsNewCProject.monitor.creatingProject=Creating Project...
+WizardAutotoolsNewCProject.windowTitle=GNU Autotools C Project
+WizardAutotoolsNewCProject.config.title=Select a configuration
+WizardAutotoolsNewCProject.config.desc=Select the configuration you wish to deploy on
+WizardAutotoolsNewCProject.options.title=Additional Project Settings
+WizardAutotoolsNewCProject.options.desc=Define the inter-project dependencies, if any.
+WizardAutotoolsNewCProject.message.save=Saving new build options
+
+WizardAutotoolsNewCProjectV2.title=Autotools C Project V2
+WizardAutotoolsNewCProjectV2.description=Create a new C Autotools project
+WizardAutotoolsNewCProjectV2.monitor.creatingProject=Creating Project...
+WizardAutotoolsNewCProjectV2.windowTitle=GNU Autotools C Project V2
+WizardAutotoolsNewCProjectV2.config.title=Select a configuration
+WizardAutotoolsNewCProjectV2.config.desc=Select the configuration you wish to deploy on
+WizardAutotoolsNewCProjectV2.options.title=Additional Project Settings
+WizardAutotoolsNewCProjectV2.options.desc=Define the inter-project dependencies, if any.
+WizardAutotoolsNewCProjectV2.message.save=Saving new build options
+
+WizardAutotoolsNewCCProject.title=Autotools C++ Project
+WizardAutotoolsNewCCProject.description=Create a new C++ Autotools project
+WizardAutotoolsNewCCProject.monitor.creatingProject=Creating Project...
+WizardAutotoolsNewCCProject.windowTitle=GNU Autotools C++ Project
+WizardAutotoolsNewCCProject.config.title=Select a configuration
+WizardAutotoolsNewCCProject.config.desc=Select the configuration you wish to deploy on
+WizardAutotoolsNewCCProject.options.title=Additional Project Settings
+WizardAutotoolsNewCCProject.options.desc=Define the inter-project dependencies, if any.
+WizardAutotoolsNewCCProject.message.save=Saving new build options
+
+
+BuildTargetDialog.title.buildTarget=Build Special Targets
+BuildTargetDialog.title.makeTargetsFor=Make targets for
+BuildTargetDialog.button.build=Build
+
+TargetListViewer.button.add=Add...
+TargetListViewer.button.remove=Remove
+TargetListViewer.button.edit=Edit...
+TargetListViewer.label.target=Target
+TargetListViewer.label.location=Location
+TargetListViewer.exception.error=Error
+TargetListViewer.exception.message=An error occurred performing the selected action
+
+AutotoolsPreferencePage.useAutotoolsFileScanner.label=Use make -w for includepath scanning
+MakeTargetPreferencePage.buildTargetInBackground.label=Build target in background
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfAnnotationHover.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfAnnotationHover.java
new file mode 100644
index 0000000000..444cef3511
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfAnnotationHover.java
@@ -0,0 +1,202 @@
+/*******************************************************************************
+ * Copyright (c) 2000 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * QNX Software System
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors;
+
+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.DefaultInformationControl;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IInformationControl;
+import org.eclipse.jface.text.IInformationControlCreator;
+import org.eclipse.jface.text.Position;
+import org.eclipse.jface.text.source.IAnnotationHover;
+import org.eclipse.jface.text.source.IAnnotationHoverExtension;
+import org.eclipse.jface.text.source.IAnnotationModel;
+import org.eclipse.jface.text.source.ILineRange;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.jface.text.source.LineRange;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.HTMLPrinter;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.texteditor.MarkerAnnotation;
+
+
+public class AutoconfAnnotationHover implements IAnnotationHover, IAnnotationHoverExtension {
+
+ /**
+ * 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<IMarker> select(List<IMarker> exactMatch, List<IMarker> including) {
+ return exactMatch;
+ }
+
+ /**
+ * Returns one marker which includes the ruler's line of activity.
+ */
+ @SuppressWarnings("unchecked")
+ protected List<IMarker> getMarkersForLine(ISourceViewer viewer, int line) {
+
+ IDocument document= viewer.getDocument();
+ IAnnotationModel model= viewer.getAnnotationModel();
+
+ if (model == null)
+ return null;
+
+ List<IMarker> exact= new ArrayList<IMarker>();
+ List<IMarker> including= new ArrayList<IMarker>();
+
+ 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<IMarker> markers= getMarkersForLine(sourceViewer, lineNumber);
+ if (markers != null && markers.size() > 0) {
+
+ 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<String> messages= new ArrayList<String>();
+
+ Iterator<IMarker> 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<String> messages) {
+ StringBuffer buffer= new StringBuffer();
+ HTMLPrinter.addPageProlog(buffer);
+ HTMLPrinter.addParagraph(buffer, HTMLPrinter.convertToHTMLContent(AutoconfEditorMessages.getString("AutoconfAnnotationHover.multipleMarkers"))); //$NON-NLS-1$
+
+ HTMLPrinter.startBulletList(buffer);
+ Iterator<String> e= messages.iterator();
+ while (e.hasNext())
+ HTMLPrinter.addBullet(buffer, HTMLPrinter.convertToHTMLContent((String) e.next()));
+ HTMLPrinter.endBulletList(buffer);
+
+ HTMLPrinter.addPageEpilog(buffer);
+ return buffer.toString();
+ }
+
+ // IAnnotationHoverExtension members
+ // We need to use the extension to get a Hover Control Creator which
+ // handles html.
+
+
+ public IInformationControlCreator getHoverControlCreator() {
+ return new IInformationControlCreator() {
+ public IInformationControl createInformationControl(Shell parent) {
+ return new DefaultInformationControl(parent, false);
+ }
+ };
+ }
+
+ public boolean canHandleMouseCursor() {
+ return false;
+ }
+
+ public ILineRange getHoverLineRange(ISourceViewer viewer, int lineNumber) {
+ return new LineRange(lineNumber, 1);
+ }
+
+ public Object getHoverInfo(ISourceViewer sourceViewer, ILineRange lineRange, int visibleNumberOfLines) {
+ return getHoverInfo(sourceViewer, lineRange.getStartLine());
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfCodeScanner.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfCodeScanner.java
new file mode 100644
index 0000000000..51e7e9eeec
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfCodeScanner.java
@@ -0,0 +1,256 @@
+/*******************************************************************************
+ * Copyright (c) 2006 Red Hat, Inc., (c) 2008 NOKIA Inc
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ * Ed Swartz (NOKIA) - updates
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.resource.StringConverter;
+import org.eclipse.jface.text.TextAttribute;
+import org.eclipse.jface.text.rules.EndOfLineRule;
+import org.eclipse.jface.text.rules.IRule;
+import org.eclipse.jface.text.rules.IToken;
+import org.eclipse.jface.text.rules.RuleBasedScanner;
+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.WordRule;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.linuxtools.cdt.autotools.core.AutotoolsPlugin;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.preferences.AutotoolsEditorPreferenceConstants;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.preferences.ColorManager;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.RGB;
+
+
+public class AutoconfCodeScanner extends RuleBasedScanner {
+
+ private Map<String, IToken> fTokenMap= new HashMap<String, IToken>();
+ private String[] fPropertyNamesColor;
+
+ /**
+ * Preference keys for boolean preferences which are <code>true</code>,
+ * iff the corresponding token should be rendered bold.
+ */
+ private String[] fPropertyNamesBold;
+ /**
+ * Preference keys for boolean preferences which are <code>true</code>,
+ * iff the corresponding token should be rendered italic.
+ */
+ private String[] fPropertyNamesItalic;
+
+ private static String[] keywords = {
+ "case", "do", "done", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ "esac", "if", "elif", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ "else", "fi", "for", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ "in", "then" }; //$NON-NLS-1$ //$NON-NLS-2$
+
+ public static final String[] fTokenProperties = new String[] {
+ ColorManager.AUTOCONF_COMMENT_COLOR,
+ ColorManager.AUTOCONF_KEYWORD_COLOR,
+ ColorManager.AUTOCONF_ACMACRO_COLOR,
+ ColorManager.AUTOCONF_AMMACRO_COLOR,
+ ColorManager.AUTOCONF_VAR_REF_COLOR,
+ ColorManager.AUTOCONF_VAR_SET_COLOR,
+ ColorManager.AUTOCONF_CODESEQ_COLOR,
+ ColorManager.AUTOCONF_DEFAULT_COLOR,
+ };
+
+ public AutoconfCodeScanner() {
+
+ initialize();
+
+ IToken other= getToken(ColorManager.AUTOCONF_DEFAULT_COLOR);
+ IToken keyword = getToken(ColorManager.AUTOCONF_KEYWORD_COLOR);
+ IToken comment= getToken(ColorManager.AUTOCONF_COMMENT_COLOR);
+ IToken string = getToken(ColorManager.AUTOCONF_DEFAULT_COLOR);
+ IToken varRef = getToken(ColorManager.AUTOCONF_VAR_REF_COLOR);
+ IToken acmacro = getToken(ColorManager.AUTOCONF_ACMACRO_COLOR);
+ IToken ammacro = getToken(ColorManager.AUTOCONF_AMMACRO_COLOR);
+ IToken code = getToken(ColorManager.AUTOCONF_CODESEQ_COLOR);
+
+ List<IRule> rules= new ArrayList<IRule>();
+
+ // Add rule for single line comments.
+ rules.add(new EndOfLineRule("dnl", comment)); //$NON-NLS-1$
+ rules.add(new EndOfLineRule("#", comment, '\\')); //$NON-NLS-1$
+
+ // Add special recursive rule for strings which allows variable
+ // references to be internally tokenized.
+ RecursiveSingleLineRule stringRule =
+ new RecursiveSingleLineRule("\"", "\"", string, '\\'); //$NON-NLS-1$ //$NON-NLS-2$
+ stringRule.addRule(new SingleLineRule("${", "}", varRef)); //$NON-NLS-1$ //$NON-NLS-2$
+ rules.add(stringRule);
+
+ // Add rule for variable references
+ rules.add(new SingleLineRule("${", "}", varRef)); //$NON-NLS-1$ //$NON-NLS-2$
+ // Add rule for strings
+ rules.add(new SingleLineRule("\"", "\"", string, '\\')); //$NON-NLS-1$ //$NON-NLS-2$
+
+ // Add rule for PKG_ macros
+ rules.add(new AutoconfMacroRule("PKG_", new AutoconfPKGWordDetector(), acmacro)); //$NON-NLS-1$
+
+ // Add rule for AC_ macros
+ rules.add(new AutoconfMacroRule("AC_", new AutoconfMacroWordDetector(), acmacro)); //$NON-NLS-1$
+
+ // Add rule for AM_ macros
+ rules.add(new AutoconfMacroRule("AM_", new AutoconfMacroWordDetector(), ammacro)); //$NON-NLS-1$
+
+ // Add rule for m4_ macros
+ rules.add(new AutoconfMacroRule("m4_", new AutoconfM4WordDetector(), acmacro)); //$NON-NLS-1$
+
+ // Add rule for code sequences starting with <<EOF and ending with EOF
+ rules.add(new InlineDataRule(code));
+
+ // Add word rule for keywords.
+ WordRule wordRule= new WordRule(new AutoconfWordDetector(), Token.UNDEFINED);
+ for (int i= 0; i < keywords.length; i++)
+ wordRule.addWord(keywords[i], keyword);
+ rules.add(wordRule);
+
+ // Add word rule for identifier.
+ rules.add(new AutoconfIdentifierRule(other));
+
+ // Make sure we don't treat "\#" as comment start.
+ rules.add(new SingleLineRule("\\#", null, Token.UNDEFINED));
+
+ rules.add(new WhitespaceRule(new AutoconfWhitespaceDetector()));
+
+ setDefaultReturnToken(other);
+
+ IRule[] result= new IRule[rules.size()];
+ rules.toArray(result);
+ setRules(result);
+ }
+
+ protected Token getToken(String key) {
+ return (Token) fTokenMap.get(key);
+ }
+
+ private void addToken(String colorKey, String boldKey, String italicKey) {
+ fTokenMap.put(colorKey, new Token(createTextAttribute(colorKey, boldKey, italicKey)));
+ }
+
+ protected String[] getTokenProperties() {
+ return fTokenProperties;
+ }
+
+ 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(fPropertyNamesBold[i]) || property.equals(fPropertyNamesItalic[i]))
+ return i;
+ }
+ }
+ return -1;
+ }
+
+ /*
+ * @see ITokenScanner#nextToken()
+ */
+ public IToken nextToken() {
+ return super.nextToken();
+ }
+
+ 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(event, token);
+ else if (fPropertyNamesBold[index].equals(p))
+ adaptToStyleChange(event, token, SWT.BOLD);
+ else if (fPropertyNamesItalic[index].equals(p))
+ adaptToStyleChange(event, token, SWT.ITALIC);
+ }
+
+ protected void adaptToColorChange(PropertyChangeEvent event, Token token) {
+ 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) {
+ TextAttribute attr= (TextAttribute) token.getData();
+ token.setData(new TextAttribute(ColorManager.getDefault().getColor(rgb), attr.getBackground(), attr.getStyle()));
+ }
+ }
+
+ protected void adaptToStyleChange(PropertyChangeEvent event, Token token, int styleAttribute) {
+ if (token == null) {
+ return;
+ }
+ boolean eventValue= false;
+ Object value= event.getNewValue();
+ if (value instanceof Boolean) {
+ eventValue= ((Boolean) value).booleanValue();
+ } else if (IPreferenceStore.TRUE.equals(value)) {
+ eventValue= true;
+ }
+
+ TextAttribute attr= (TextAttribute) token.getData();
+ boolean activeValue= (attr.getStyle() & styleAttribute) == styleAttribute;
+ if (activeValue != eventValue) {
+ token.setData(new TextAttribute(attr.getForeground(), attr.getBackground(), eventValue ? attr.getStyle() | styleAttribute : attr.getStyle() & ~styleAttribute));
+ }
+ }
+
+ protected TextAttribute createTextAttribute(String colorID, String boldKey, String italicKey) {
+ Color color= null;
+ if (colorID != null) {
+ color= AutoconfEditor.getPreferenceColor(colorID);
+ }
+ IPreferenceStore store= AutotoolsPlugin.getDefault().getPreferenceStore();
+ int style= store.getBoolean(boldKey) ? SWT.BOLD : SWT.NORMAL;
+ if (store.getBoolean(italicKey)) {
+ style |= SWT.ITALIC;
+ }
+ return new TextAttribute(color, null, style);
+ }
+
+ /**
+ * Must be called after the constructor has been called.
+ */
+ public final void initialize() {
+
+ fPropertyNamesColor= getTokenProperties();
+ int length= fPropertyNamesColor.length;
+ fPropertyNamesBold= new String[length];
+ fPropertyNamesItalic= new String[length];
+
+ for (int i= 0; i < length; i++) {
+ fPropertyNamesBold[i]= fPropertyNamesColor[i] + AutotoolsEditorPreferenceConstants.EDITOR_BOLD_SUFFIX;
+ fPropertyNamesItalic[i]= fPropertyNamesColor[i] + AutotoolsEditorPreferenceConstants.EDITOR_ITALIC_SUFFIX;
+ addToken(fPropertyNamesColor[i], fPropertyNamesBold[i], fPropertyNamesItalic[i]);
+ }
+ }
+
+ /*
+ * @see ICharacterScanner#unread()
+ */
+ public void unread() {
+ --fOffset;
+ fColumn = UNDEFINED;
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfDocumentProvider.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfDocumentProvider.java
new file mode 100644
index 0000000000..dd7c38c51d
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfDocumentProvider.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2007 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors;
+
+import java.util.Iterator;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.ui.editors.text.TextFileDocumentProvider;
+
+public class AutoconfDocumentProvider extends TextFileDocumentProvider {
+
+ @SuppressWarnings("unchecked")
+ public void shutdown() {
+ Iterator e= getConnectedElementsIterator();
+ while (e.hasNext())
+ disconnect(e.next());
+ }
+
+ public void connect(Object element) throws CoreException {
+ super.connect(element);
+ // Remove all error markers for file as we will parse
+ // from scratch.
+// AutoconfErrorHandler h = new AutoconfErrorHandler(getDocument(element));
+// h.removeAllExistingMarkers();
+ }
+
+ public IDocument getDocument(Object element) {
+ FileInfo info= (FileInfo) getFileInfo(element);
+ if (info != null)
+ return info.fTextFileBuffer.getDocument();
+ return getParentProvider().getDocument(element);
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfDocumentSetupParticipant.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfDocumentSetupParticipant.java
new file mode 100644
index 0000000000..a3d0b1b91d
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfDocumentSetupParticipant.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors;
+
+import org.eclipse.core.filebuffers.IDocumentSetupParticipant;
+import org.eclipse.jface.text.DocumentEvent;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IDocumentExtension3;
+import org.eclipse.jface.text.IDocumentListener;
+
+public class AutoconfDocumentSetupParticipant implements
+ IDocumentSetupParticipant, IDocumentListener {
+
+ public void setup(IDocument document) {
+ AutoconfPartitioner partitioner =
+ new AutoconfPartitioner(
+ new AutoconfPartitionScanner(),
+ AutoconfPartitionScanner.AUTOCONF_PARTITION_TYPES);
+ partitioner.connect(document, 1);
+ if (document instanceof IDocumentExtension3) {
+ IDocumentExtension3 extension3= (IDocumentExtension3) document;
+ extension3.setDocumentPartitioner(AutoconfEditor.AUTOCONF_PARTITIONING, partitioner);
+ } else {
+ document.setDocumentPartitioner(partitioner);
+ }
+// document.addDocumentListener(this);
+ }
+
+ /*
+ * @see IDocumentListener#documentAboutToBeChanged(DocumentEvent)
+ */
+
+ public void documentAboutToBeChanged(DocumentEvent e) {
+ // do nothing
+ }
+
+ /*
+ * @see IDocumentListener#documentChanged(DocumentEvent)
+ */
+ public void documentChanged(DocumentEvent e) {
+ // do nothing
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfEditor.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfEditor.java
new file mode 100644
index 0000000000..a65cb24ee1
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfEditor.java
@@ -0,0 +1,787 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2007, 2009 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors;
+
+import java.util.ResourceBundle;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.ListenerList;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.jface.text.AbstractInformationControlManager;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.DefaultInformationControl;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IInformationControl;
+import org.eclipse.jface.text.IInformationControlCreator;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITextHover;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.ITextViewerExtension;
+import org.eclipse.jface.text.ITextViewerExtension2;
+import org.eclipse.jface.text.ITextViewerExtension4;
+import org.eclipse.jface.text.ITextViewerExtension5;
+import org.eclipse.jface.text.Region;
+import org.eclipse.jface.text.TextUtilities;
+import org.eclipse.jface.text.information.IInformationProvider;
+import org.eclipse.jface.text.information.IInformationProviderExtension;
+import org.eclipse.jface.text.information.IInformationProviderExtension2;
+import org.eclipse.jface.text.information.InformationPresenter;
+import org.eclipse.jface.text.rules.RuleBasedScanner;
+import org.eclipse.jface.text.source.IAnnotationHover;
+import org.eclipse.jface.text.source.IAnnotationHoverExtension;
+import org.eclipse.jface.text.source.ILineRange;
+import org.eclipse.jface.text.source.IOverviewRuler;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.jface.text.source.ISourceViewerExtension3;
+import org.eclipse.jface.text.source.IVerticalRuler;
+import org.eclipse.jface.text.source.IVerticalRulerInfo;
+import org.eclipse.jface.text.source.projection.ProjectionAnnotationModel;
+import org.eclipse.jface.text.source.projection.ProjectionSupport;
+import org.eclipse.jface.text.source.projection.ProjectionViewer;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.linuxtools.cdt.autotools.core.AutotoolsPlugin;
+import org.eclipse.linuxtools.cdt.autotools.ui.AutotoolsUIPlugin;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.outline.AutoconfContentOutlinePage;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.AutoconfElement;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.AutoconfMacroDetector;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.AutoconfParser;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.IAutoconfMacroValidator;
+import org.eclipse.linuxtools.internal.cdt.autotools.core.AutotoolsPropertyConstants;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.autoconf.ProjectionFileUpdater;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake.IReconcilingParticipant;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake.MakefileEditorPreferenceConstants;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.preferences.AutoconfEditorPreferencePage;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.preferences.AutotoolsEditorPreferenceConstants;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.preferences.ColorManager;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.properties.AutotoolsPropertyManager;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.properties.IProjectPropertyListener;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.editors.text.EditorsUI;
+import org.eclipse.ui.editors.text.TextEditor;
+import org.eclipse.ui.texteditor.ChainedPreferenceStore;
+import org.eclipse.ui.texteditor.ContentAssistAction;
+import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds;
+import org.eclipse.ui.texteditor.ResourceAction;
+import org.eclipse.ui.texteditor.TextEditorAction;
+import org.eclipse.ui.texteditor.TextOperationAction;
+import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
+
+
+public class AutoconfEditor extends TextEditor implements IAutotoolsEditor, IProjectPropertyListener {
+
+ public final static String AUTOCONF_PARTITIONING= "autoconf_partitioning"; //$NON-NLS-1$
+
+
+ private AutoconfPartitionScanner fPartitionScanner;
+ private RuleBasedScanner fCodeScanner;
+ private RuleBasedScanner fMacroCodeScanner;
+ private static AutoconfDocumentProvider fDocumentProvider;
+ private AutoconfElement rootElement;
+ private AutoconfContentOutlinePage outlinePage;
+ private AutoconfParser fParser;
+ private IEditorInput input;
+ private IProject fProject;
+
+ /** The information provider used to present focusable information shells. */
+ private InformationPresenter fInformationPresenter;
+ /**
+ * This editor's projection support
+ */
+
+ ProjectionSupport fProjectionSupport;
+ ProjectionFileUpdater fProjectionFileUpdater;
+
+ /**
+ * Reconciling listeners
+ */
+ private ListenerList fReconcilingListeners= new ListenerList(ListenerList.IDENTITY);
+
+
+ public AutoconfEditor() {
+ super();
+ }
+
+ /**
+ * Adapted source viewer for CEditor
+ */
+
+ public class AdaptedSourceViewer extends ProjectionViewer implements ITextViewerExtension {
+
+
+ public AdaptedSourceViewer(Composite parent, IVerticalRuler ruler,
+ IOverviewRuler overviewRuler, boolean showsAnnotation, int styles) {
+ super(parent, ruler, overviewRuler, showsAnnotation, styles);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.source.ISourceViewer#setRangeIndication(int, int, boolean)
+ */
+ public void setRangeIndication(int offset, int length, boolean moveCursor) {
+ // Fixin a bug in the ProjectViewer implemenation
+ // PR: https://bugs.eclipse.org/bugs/show_bug.cgi?id=72914
+ if (isProjectionMode()) {
+ super.setRangeIndication(offset, length, moveCursor);
+ } else {
+ super.setRangeIndication(offset, length, false);
+ }
+ }
+ }
+
+ protected void initializeEditor() {
+ super.initializeEditor();
+ setDocumentProvider(getAutoconfDocumentProvider());
+ IPreferenceStore[] stores = new IPreferenceStore[2];
+ stores[0] = AutotoolsPlugin.getDefault().getPreferenceStore();
+ stores[1] = EditorsUI.getPreferenceStore();
+ ChainedPreferenceStore chainedStore = new ChainedPreferenceStore(stores);
+ setPreferenceStore(chainedStore);
+ setSourceViewerConfiguration(new AutoconfSourceViewerConfiguration(chainedStore, this));
+ AutotoolsEditorPreferenceConstants.initializeDefaultValues(stores[0]);
+ AutoconfEditorPreferencePage.initDefaults(stores[0]);
+ }
+
+ public static AutoconfDocumentProvider getAutoconfDocumentProvider() {
+ if (fDocumentProvider == null)
+ fDocumentProvider= new AutoconfDocumentProvider();
+ return fDocumentProvider;
+ }
+
+ public AutoconfElement getRootElement() {
+ return rootElement;
+ }
+
+ public void setRootElement(AutoconfElement element) {
+ rootElement = element;
+ }
+
+ public ISourceViewer getViewer() {
+ return getSourceViewer();
+ }
+
+ protected IDocument getInputDocument()
+ {
+ IDocument document = getDocumentProvider().getDocument(input);
+ return document;
+ }
+
+ protected void doSetInput(IEditorInput newInput) throws CoreException
+ {
+ // If this editor is for a project file, remove this editor as a property
+ // change listener.
+ if (fProject != null)
+ AutotoolsPropertyManager.getDefault().removeProjectPropertyListener(fProject, this);
+ this.fProject = null;
+ super.doSetInput(newInput);
+ this.input = newInput;
+
+ if (input instanceof IFileEditorInput) {
+ IFile f = ((IFileEditorInput)input).getFile();
+ fProject = f.getProject();
+ // This is a project file. We want to be notified if the Autoconf editor
+ // properties are changed such that the macro versions are changed.
+ AutotoolsPropertyManager.getDefault().addProjectPropertyListener(fProject, this);
+ }
+ getOutlinePage().setInput(input);
+ try
+ {
+ IDocument document = getInputDocument();
+
+ setRootElement(reparseDocument(document, newInput));
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ public Object getAdapter(Class required) {
+ if (ProjectionAnnotationModel.class.equals(required)) {
+ if (fProjectionSupport != null) {
+ Object result = fProjectionSupport.getAdapter(getSourceViewer(), required);
+ if (result != null) {
+ return result;
+ }
+ }
+ } else if (IContentOutlinePage.class.equals(required)) {
+ return getOutlinePage();
+ }
+ return super.getAdapter(required);
+ }
+
+
+ public AutoconfContentOutlinePage getOutlinePage() {
+ if (outlinePage == null) {
+ outlinePage= new AutoconfContentOutlinePage(this);
+ if (getEditorInput() != null)
+ outlinePage.setInput(getEditorInput());
+ }
+ return outlinePage;
+ }
+
+ /**
+ * Return a scanner for creating Autoconf partitions.
+ *
+ * @return a scanner for creating Autoconf partitions
+ */
+ public AutoconfParser getAutoconfParser() {
+ if (fParser == null) {
+ AutoconfErrorHandler errorHandler = new AutoconfErrorHandler(input);
+ IAutoconfMacroValidator macroValidator = new AutoconfEditorMacroValidator(this);
+ fParser = new AutoconfParser(errorHandler, new AutoconfMacroDetector(), macroValidator);
+ }
+ return fParser;
+ }
+
+ /**
+ * Return a scanner for creating Autoconf partitions.
+ *
+ * @return a scanner for creating Autoconf partitions
+ */
+ public AutoconfPartitionScanner getAutoconfPartitionScanner() {
+ if (fPartitionScanner == null)
+ fPartitionScanner= new AutoconfPartitionScanner();
+ return fPartitionScanner;
+ }
+
+ /**
+ * Returns the Autoconf code scanner.
+ *
+ * @return the Autoconf code scanner
+ */
+ public RuleBasedScanner getAutoconfCodeScanner() {
+ if (fCodeScanner == null)
+ fCodeScanner= new AutoconfCodeScanner();
+ return fCodeScanner;
+ }
+
+ /**
+ * Returns the Autoconf code scanner.
+ *
+ * @return the Autoconf code scanner
+ */
+ public RuleBasedScanner getAutoconfMacroCodeScanner() {
+ if (fMacroCodeScanner == null)
+ fMacroCodeScanner= new AutoconfMacroCodeScanner();
+ return fMacroCodeScanner;
+ }
+
+ /**
+ * Returns the preference color, identified by the given preference.
+ */
+ public static Color getPreferenceColor(String key) {
+ return ColorManager.getDefault().getColor(PreferenceConverter.getColor(AutotoolsPlugin.getDefault().getPreferenceStore(), key));
+ }
+
+ public void handleProjectPropertyChanged(IProject project, String property) {
+ if (property.equals(AutotoolsPropertyConstants.AUTOCONF_MACRO_VERSIONING)) {
+ ISourceViewer sourceViewer= getSourceViewer();
+ if (sourceViewer == null)
+ return;
+ handleVersionChange(sourceViewer);
+ }
+ }
+
+ /**
+ * Handle the case whereby the Autoconf or Automake macro versions to use
+ * for this project are changed in which case we want to invalidate and reparse
+ * the document.
+ *
+ * @param sourceViewer
+ */
+ protected void handleVersionChange(ISourceViewer sourceViewer) {
+ sourceViewer.invalidateTextPresentation();
+ try {
+ IDocument document = getInputDocument();
+
+ setRootElement(reparseDocument(document, getEditorInput()));
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ private AutoconfElement reparseDocument(IDocument document,
+ IEditorInput editorInput) {
+ AutoconfParser parser = getAutoconfParser();
+ ((AutoconfErrorHandler)parser.getErrorHandler()).removeAllExistingMarkers();
+ return parser.parse(document);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.texteditor.AbstractTextEditor#handlePreferenceStoreChanged(org.eclipse.jface.util.PropertyChangeEvent)
+ */
+ protected void handlePreferenceStoreChanged(PropertyChangeEvent event) {
+ ISourceViewer sourceViewer= getSourceViewer();
+ if (sourceViewer == null)
+ return;
+
+ String property = event.getProperty();
+
+ AutoconfCodeScanner scanner = (AutoconfCodeScanner)getAutoconfCodeScanner();
+ if (scanner != null) {
+ if (scanner.affectsBehavior(event)) {
+ scanner.adaptToPreferenceChange(event);
+ sourceViewer.invalidateTextPresentation();
+ }
+ }
+
+ if (AutotoolsEditorPreferenceConstants.AUTOCONF_VERSION.equals(property) ||
+ AutotoolsEditorPreferenceConstants.AUTOMAKE_VERSION.equals(property)) {
+ handleVersionChange(sourceViewer);
+ } else if (AutotoolsEditorPreferenceConstants.EDITOR_FOLDING_ENABLED.equals(property)) {
+ if (sourceViewer instanceof ProjectionViewer) {
+ ProjectionViewer projectionViewer= (ProjectionViewer) sourceViewer;
+ if (fProjectionFileUpdater != null)
+ fProjectionFileUpdater.uninstall();
+ // either freshly enabled or provider changed
+ fProjectionFileUpdater= new ProjectionFileUpdater();
+ if (fProjectionFileUpdater != null) {
+ fProjectionFileUpdater.install(this, projectionViewer);
+ }
+ }
+ return;
+ }
+
+ super.handlePreferenceStoreChanged(event);
+ }
+
+ /**
+ * Information provider used to present focusable information shells.
+ *
+ * @since 3.1.1
+ */
+ private static final class InformationProvider implements IInformationProvider, IInformationProviderExtension, IInformationProviderExtension2 {
+
+ private IRegion fHoverRegion;
+ private Object fHoverInfo;
+ private IInformationControlCreator fControlCreator;
+
+ InformationProvider(IRegion hoverRegion, Object hoverInfo, IInformationControlCreator controlCreator) {
+ fHoverRegion= hoverRegion;
+ fHoverInfo= hoverInfo;
+ fControlCreator= controlCreator;
+ }
+ /*
+ * @see org.eclipse.jface.text.information.IInformationProvider#getSubject(org.eclipse.jface.text.ITextViewer, int)
+ */
+ public IRegion getSubject(ITextViewer textViewer, int invocationOffset) {
+ return fHoverRegion;
+ }
+ /*
+ * @see org.eclipse.jface.text.information.IInformationProvider#getInformation(org.eclipse.jface.text.ITextViewer, org.eclipse.jface.text.IRegion)
+ */
+ public String getInformation(ITextViewer textViewer, IRegion subject) {
+ return fHoverInfo.toString();
+ }
+
+ /*
+ * @see org.eclipse.jface.text.information.IInformationProviderExtension#getInformation2(org.eclipse.jface.text.ITextViewer, org.eclipse.jface.text.IRegion)
+ * @since 3.2
+ */
+ public Object getInformation2(ITextViewer textViewer, IRegion subject) {
+ return fHoverInfo;
+ }
+ /*
+ * @see org.eclipse.jface.text.information.IInformationProviderExtension2#getInformationPresenterControlCreator()
+ */
+ public IInformationControlCreator getInformationPresenterControlCreator() {
+ return fControlCreator;
+ }
+ }
+
+ /**
+ * This action behaves in two different ways: If there is no current text
+ * hover, the tooltip is displayed using information presenter. If there is
+ * a current text hover, it is converted into a information presenter in
+ * order to make it sticky.
+ * @since 3.1.1
+ */
+ class InformationDispatchAction extends TextEditorAction {
+
+ /** The wrapped text operation action. */
+ private final TextOperationAction fTextOperationAction;
+
+ /**
+ * Creates a dispatch action.
+ *
+ * @param resourceBundle the resource bundle
+ * @param prefix the prefix
+ * @param textOperationAction the text operation action
+ */
+ public InformationDispatchAction(ResourceBundle resourceBundle, String prefix, final TextOperationAction textOperationAction) {
+ super(resourceBundle, prefix, AutoconfEditor.this);
+ if (textOperationAction == null)
+ throw new IllegalArgumentException();
+ fTextOperationAction= textOperationAction;
+ }
+
+ /*
+ * @see org.eclipse.jface.action.IAction#run()
+ */
+ public void run() {
+
+ ISourceViewer sourceViewer= getSourceViewer();
+ if (sourceViewer == null) {
+ fTextOperationAction.run();
+ return;
+ }
+
+ if (sourceViewer instanceof ITextViewerExtension4) {
+ ITextViewerExtension4 extension4= (ITextViewerExtension4) sourceViewer;
+ if (extension4.moveFocusToWidgetToken())
+ return;
+ }
+
+ if (sourceViewer instanceof ITextViewerExtension2) {
+ // does a text hover exist?
+ ITextHover textHover= ((ITextViewerExtension2) sourceViewer).getCurrentTextHover();
+ if (textHover != null && makeTextHoverFocusable(sourceViewer, textHover))
+ return;
+ }
+
+ if (sourceViewer instanceof ISourceViewerExtension3) {
+ // does an annotation hover exist?
+ IAnnotationHover annotationHover= ((ISourceViewerExtension3) sourceViewer).getCurrentAnnotationHover();
+ if (annotationHover != null && makeAnnotationHoverFocusable(sourceViewer, annotationHover))
+ return;
+ }
+
+ // otherwise, just display the tooltip
+ //fTextOperationAction.run();
+ }
+
+ /**
+ * Tries to make a text hover focusable (or "sticky").
+ *
+ * @param sourceViewer the source viewer to display the hover over
+ * @param textHover the hover to make focusable
+ * @return <code>true</code> if successful, <code>false</code> otherwise
+ */
+ @SuppressWarnings("deprecation")
+ private boolean makeTextHoverFocusable(ISourceViewer sourceViewer, ITextHover textHover) {
+ Point hoverEventLocation= ((ITextViewerExtension2) sourceViewer).getHoverEventLocation();
+ int offset= computeOffsetAtLocation(sourceViewer, hoverEventLocation.x, hoverEventLocation.y);
+ if (offset == -1)
+ return false;
+
+ try {
+ IRegion hoverRegion= textHover.getHoverRegion(sourceViewer, offset);
+ if (hoverRegion == null)
+ return false;
+
+ String hoverInfo= textHover.getHoverInfo(sourceViewer, hoverRegion);
+
+ IInformationControlCreator controlCreator= null;
+ if (textHover instanceof IInformationProviderExtension2)
+ controlCreator= ((IInformationProviderExtension2)textHover).getInformationPresenterControlCreator();
+
+ IInformationProvider informationProvider= new InformationProvider(hoverRegion, hoverInfo, controlCreator);
+
+ fInformationPresenter.setOffset(offset);
+ fInformationPresenter.setAnchor(AbstractInformationControlManager.ANCHOR_BOTTOM);
+ fInformationPresenter.setMargins(6, 6); // default values from AbstractInformationControlManager
+ String contentType= TextUtilities.getContentType(sourceViewer.getDocument(), AutoconfPartitionScanner.AUTOCONF_MACRO, offset, true);
+ fInformationPresenter.setInformationProvider(informationProvider, contentType);
+ fInformationPresenter.showInformation();
+
+ return true;
+
+ } catch (BadLocationException e) {
+ return false;
+ }
+ }
+
+ /**
+ * Tries to make an annotation hover focusable (or "sticky").
+ *
+ * @param sourceViewer the source viewer to display the hover over
+ * @param annotationHover the hover to make focusable
+ * @return <code>true</code> if successful, <code>false</code> otherwise
+ */
+ private boolean makeAnnotationHoverFocusable(ISourceViewer sourceViewer, IAnnotationHover annotationHover) {
+ IVerticalRulerInfo info= getVerticalRuler();
+ int line= info.getLineOfLastMouseButtonActivity();
+ if (line == -1)
+ return false;
+
+ try {
+
+ // compute the hover information
+ Object hoverInfo;
+ if (annotationHover instanceof IAnnotationHoverExtension) {
+ IAnnotationHoverExtension extension= (IAnnotationHoverExtension) annotationHover;
+ ILineRange hoverLineRange= extension.getHoverLineRange(sourceViewer, line);
+ if (hoverLineRange == null)
+ return false;
+ final int maxVisibleLines= Integer.MAX_VALUE; // allow any number of lines being displayed, as we support scrolling
+ hoverInfo= extension.getHoverInfo(sourceViewer, hoverLineRange, maxVisibleLines);
+ } else {
+ hoverInfo= annotationHover.getHoverInfo(sourceViewer, line);
+ }
+
+ // hover region: the beginning of the concerned line to place the control right over the line
+ IDocument document= sourceViewer.getDocument();
+ int offset= document.getLineOffset(line);
+ String contentType= TextUtilities.getContentType(document, AutoconfPartitionScanner.AUTOCONF_MACRO, offset, true);
+
+ IInformationControlCreator controlCreator= null;
+
+// /*
+// * XXX: This is a hack to avoid API changes at the end of 3.2,
+// * and should be fixed for 3.3, see: https://bugs.eclipse.org/bugs/show_bug.cgi?id=137967
+// */
+// if ("org.eclipse.jface.text.source.projection.ProjectionAnnotationHover".equals(annotationHover.getClass().getName())) { //$NON-NLS-1$
+// controlCreator= new IInformationControlCreator() {
+// public IInformationControl createInformationControl(Shell shell) {
+// int shellStyle= SWT.RESIZE | SWT.TOOL | getOrientation();
+// int style= SWT.V_SCROLL | SWT.H_SCROLL;
+// return new SourceViewerInformationControl(shell, shellStyle, style);
+// }
+// };
+//
+// } else {
+ if (annotationHover instanceof IInformationProviderExtension2)
+ controlCreator= ((IInformationProviderExtension2) annotationHover).getInformationPresenterControlCreator();
+ else if (annotationHover instanceof IAnnotationHoverExtension)
+ controlCreator= ((IAnnotationHoverExtension) annotationHover).getHoverControlCreator();
+// }
+
+ IInformationProvider informationProvider= new InformationProvider(new Region(offset, 0), hoverInfo, controlCreator);
+
+ fInformationPresenter.setOffset(offset);
+ fInformationPresenter.setAnchor(AbstractInformationControlManager.ANCHOR_RIGHT);
+ fInformationPresenter.setMargins(4, 0); // AnnotationBarHoverManager sets (5,0), minus SourceViewer.GAP_SIZE_1
+ fInformationPresenter.setInformationProvider(informationProvider, contentType);
+ fInformationPresenter.showInformation();
+
+ return true;
+
+ } catch (BadLocationException e) {
+ return false;
+ }
+ }
+
+ // modified version from TextViewer
+ private int computeOffsetAtLocation(ITextViewer textViewer, int x, int y) {
+
+ StyledText styledText= textViewer.getTextWidget();
+ IDocument document= textViewer.getDocument();
+
+ if (document == null)
+ return -1;
+
+ try {
+ int widgetOffset= styledText.getOffsetAtLocation(new Point(x, y));
+ Point p= styledText.getLocationAtOffset(widgetOffset);
+ if (p.x > x)
+ widgetOffset--;
+
+ if (textViewer instanceof ITextViewerExtension5) {
+ ITextViewerExtension5 extension= (ITextViewerExtension5) textViewer;
+ return extension.widgetOffset2ModelOffset(widgetOffset);
+ } else {
+ IRegion visibleRegion= textViewer.getVisibleRegion();
+ return widgetOffset + visibleRegion.getOffset();
+ }
+ } catch (IllegalArgumentException e) {
+ return -1;
+ }
+
+ }
+ }
+
+ /**
+ * Adds the given listener.
+ * Has no effect if an identical listener was not already registered.
+ *
+ * @param listener The reconcile listener to be added
+ */
+ public final void addReconcilingParticipant(IReconcilingParticipant listener) {
+ synchronized (fReconcilingListeners) {
+ fReconcilingListeners.add(listener);
+ }
+ }
+
+ /**
+ * Removes the given listener.
+ * Has no effect if an identical listener was not already registered.
+ *
+ * @param listener the reconcile listener to be removed
+ */
+ final void removeReconcilingParticipant(IReconcilingParticipant listener) {
+ synchronized (fReconcilingListeners) {
+ fReconcilingListeners.remove(listener);
+ }
+ }
+
+ /*
+ */
+ public void reconciled() {
+ // Notify listeners
+ Object[] listeners = fReconcilingListeners.getListeners();
+ for (int i = 0, length= listeners.length; i < length; ++i) {
+ ((IReconcilingParticipant)listeners[i]).reconciled();
+ }
+ }
+
+ /**
+ * Determines is folding enabled.
+ * @return <code>true</code> if folding is enabled, <code>false</code> otherwise.
+ */
+ boolean isFoldingEnabled() {
+ return AutotoolsPlugin.getDefault().getPreferenceStore().getBoolean(MakefileEditorPreferenceConstants.EDITOR_FOLDING_ENABLED);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.editors.text.TextEditor#initializeKeyBindingScopes()
+ */
+ protected void initializeKeyBindingScopes() {
+ setKeyBindingScopes(new String [] { AutotoolsUIPlugin.getUniqueIdentifier() + ".editor.scope" } ); //$NON-NLS-1$
+ }
+
+
+ /**
+ * @see org.eclipse.ui.texteditor.AbstractTextEditor#createActions()
+ */
+ protected void createActions() {
+ super.createActions();
+ // TODO: Figure out how to do this later.
+// fFoldingGroup= new FoldingActionGroup(this, getSourceViewer());
+
+ // Sticky hover support
+ ResourceAction resAction= new TextOperationAction(AutoconfEditorMessages.getResourceBundle(), "ShowToolTip.", this, ISourceViewer.INFORMATION, true); //$NON-NLS-1$
+ resAction= new InformationDispatchAction(AutoconfEditorMessages.getResourceBundle(), "ShowToolTip.", (TextOperationAction) resAction); //$NON-NLS-1$
+ resAction.setActionDefinitionId(IAutotoolEditorActionDefinitionIds.SHOW_TOOLTIP);
+ setAction("ShowToolTip", resAction); //$NON-NLS-1$
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(resAction, IAutotoolHelpContextIds.SHOW_TOOLTIP_ACTION);
+
+ // Content assist
+ Action action = new ContentAssistAction(AutoconfEditorMessages.getResourceBundle(), "ContentAssistProposal.", this); //$NON-NLS-1$
+ action.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
+ setAction("ContentAssistProposal", action); //$NON-NLS-1$
+ markAsStateDependentAction("ContentAssistProposal", true); //$NON-NLS-1$
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(action, IAutotoolHelpContextIds.CONTENT_ASSIST);
+ }
+
+ /**
+ * The <code>AbstractTextEditor</code> implementation of this
+ * <code>IWorkbenchPart</code> 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.
+
+ * @param parent Parent composite of the control.
+ */
+ public void createPartControl(Composite parent) {
+ super.createPartControl(parent);
+
+ // Sticky hover support
+ IInformationControlCreator informationControlCreator= new IInformationControlCreator() {
+ public IInformationControl createInformationControl(Shell shell) {
+ return new DefaultInformationControl(shell, true);
+ }
+ };
+
+ fInformationPresenter= new InformationPresenter(informationControlCreator);
+ fInformationPresenter.setSizeConstraints(60, 10, true, true);
+ fInformationPresenter.install(getSourceViewer());
+ fInformationPresenter.setDocumentPartitioning(AutoconfPartitionScanner.AUTOCONF_MACRO);
+
+ ProjectionViewer projectionViewer= (ProjectionViewer) getSourceViewer();
+
+ fProjectionSupport= new ProjectionSupport(projectionViewer, getAnnotationAccess(), getSharedColors());
+ fProjectionSupport.addSummarizableAnnotationType("org.eclipse.ui.workbench.texteditor.error"); //$NON-NLS-1$
+ fProjectionSupport.addSummarizableAnnotationType("org.eclipse.ui.workbench.texteditor.warning"); //$NON-NLS-1$
+ fProjectionSupport.install();
+
+ if (isFoldingEnabled())
+ projectionViewer.doOperation(ProjectionViewer.TOGGLE);
+
+ fProjectionFileUpdater= new ProjectionFileUpdater();
+ if (fProjectionFileUpdater != null) {
+ fProjectionFileUpdater.install(this, projectionViewer);
+ fProjectionFileUpdater.initialize();
+ }
+
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IAutotoolHelpContextIds.AC_EDITOR_VIEW);
+
+ // TODO: Do we need the following two lines?
+// fEditorSelectionChangedListener= new EditorSelectionChangedListener();
+// fEditorSelectionChangedListener.install(getSelectionProvider());
+ }
+
+ protected ISourceViewer createSourceViewer(Composite parent, IVerticalRuler ruler, int styles) {
+ ISourceViewer viewer = new AdaptedSourceViewer(parent, ruler, getOverviewRuler(), isOverviewRulerVisible(), styles);
+
+ // ensure decoration support has been created and configured.
+ getSourceViewerDecorationSupport(viewer);
+
+ return viewer;
+ }
+
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IWorkbenchPart#dispose()
+ */
+ public void dispose() {
+ if (fProjectionFileUpdater != null) {
+ fProjectionFileUpdater.uninstall();
+ fProjectionFileUpdater= null;
+ }
+ if (fProject != null) {
+ AutotoolsPropertyManager.getDefault().removeProjectPropertyListener(fProject, this);
+ }
+ super.dispose();
+ }
+
+ /*
+ * @see org.eclipse.ui.texteditor.AbstractTextEditor#performRevert()
+ */
+ protected void performRevert() {
+ ProjectionViewer projectionViewer= (ProjectionViewer) getSourceViewer();
+ projectionViewer.setRedraw(false);
+ try {
+
+ boolean projectionMode= projectionViewer.isProjectionMode();
+ if (projectionMode) {
+ projectionViewer.disableProjection();
+ if (fProjectionFileUpdater != null)
+ fProjectionFileUpdater.uninstall();
+ }
+
+ super.performRevert();
+
+ if (projectionMode) {
+ if (fProjectionFileUpdater != null)
+ fProjectionFileUpdater.install(this, projectionViewer);
+ projectionViewer.enableProjection();
+ }
+
+ } finally {
+ projectionViewer.setRedraw(true);
+ }
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfEditorMacroValidator.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfEditorMacroValidator.java
new file mode 100644
index 0000000000..bae46a945f
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfEditorMacroValidator.java
@@ -0,0 +1,101 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat Corporation, (c) 2008 Nokia Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ * Ed Swartz (Nokia) - refactoring
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.cdt.autotools.ui.editors;
+
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.linuxtools.cdt.autotools.core.AutotoolsPlugin;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.AutoconfMacroElement;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.IAutoconfMacroValidator;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.ParseException;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.preferences.AutotoolsEditorPreferenceConstants;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.text.hover.AutoconfPrototype;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.text.hover.AutoconfTextHover;
+
+
+/**
+ * Validate a macro call by checking against the stored macro prototypes
+ */
+public class AutoconfEditorMacroValidator implements IAutoconfMacroValidator {
+ public final String AUTOCONF_MACRO_ARGS_TOO_FEW = "AutoconfMacroArgsTooFew"; //$NON-NLS-1$
+ public final String AUTOCONF_MACRO_ARGS_TOO_MANY = "AutoconfMacroArgsTooMany"; //$NON-NLS-1$
+
+ private AutoconfEditor fEditor;
+
+ public AutoconfEditorMacroValidator(AutoconfEditor autoconfEditor) {
+ fEditor = autoconfEditor;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.IAutoconfMacroValidator#validateMacroCall(org.eclipse.linuxtools.cdt.autotools.core.ui.editors.parser.AutoconfMacroElement)
+ */
+ public void validateMacroCall(AutoconfMacroElement macro)
+ throws ParseException {
+ AutoconfPrototype p = AutoconfTextHover.getPrototype(macro.getName(), fEditor);
+ if (p != null) {
+ boolean tooFew = false;
+ boolean tooMany = false;
+ boolean justRight = false;
+ int parms = macro.getParameterCount();
+ int numPrototypes = p.getNumPrototypes();
+ int minParms = 0;
+ int maxParms = 0;
+ for (int i = 0; i < numPrototypes; ++i) {
+ if (parms < p.getMinParms(i)) {
+ tooFew = true;
+ minParms = p.getMinParms(i);
+ } else if (parms > p.getMaxParms(i)) {
+ tooMany = true;
+ maxParms = p.getMaxParms(i);
+ } else {
+ justRight = true;
+ break;
+ }
+ }
+
+ int length = macro.getEndOffset() - macro.getStartOffset();
+ int start = macro.getStartOffset();
+ int end = macro.getEndOffset();
+ int lineNumber = 0;
+ try {
+ lineNumber = macro.getDocument().getLineOfOffset(start);
+ } catch (BadLocationException e) {
+
+ }
+
+ if (!justRight) {
+ if (tooFew) {
+ String formatString = AutoconfEditorMessages.getFormattedString(AUTOCONF_MACRO_ARGS_TOO_FEW,
+ AutotoolsPlugin.getDefault().getPreferenceStore().getString(AutotoolsEditorPreferenceConstants.AUTOCONF_VERSION),
+ p.getName(), Integer.toString(minParms));
+ throw new ParseException(
+ formatString,
+ start, end,
+ lineNumber, 0, length,
+ IMarker.SEVERITY_WARNING);
+ } else if (tooMany) {
+ String formatString = AutoconfEditorMessages.getFormattedString(AUTOCONF_MACRO_ARGS_TOO_MANY,
+ AutotoolsPlugin.getDefault().getPreferenceStore().getString(AutotoolsEditorPreferenceConstants.AUTOCONF_VERSION),
+ p.getName(), Integer.toString(maxParms));
+ throw new ParseException(
+ formatString,
+ start, end,
+ lineNumber, 0, length,
+ IMarker.SEVERITY_WARNING);
+ }
+ }
+ }
+
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfEditorMessages.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfEditorMessages.java
new file mode 100644
index 0000000000..d1f6f14e3d
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfEditorMessages.java
@@ -0,0 +1,117 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.cdt.autotools.ui.editors;
+
+import java.text.MessageFormat;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+
+/**
+ * AutoconfEditorMessages
+ */
+public class AutoconfEditorMessages {
+
+ private static final String RESOURCE_BUNDLE= AutoconfEditorMessages.class.getName();
+
+ private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE);
+
+ private AutoconfEditorMessages() {
+ }
+
+ public static ResourceBundle getResourceBundle() {
+ return fgResourceBundle;
+ }
+
+ 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
+ * @since 3.0
+ */
+ 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 the arguments
+ *
+ * @param key the string used to get the bundle value, must not be null
+ * @since 3.0
+ */
+ public static String getFormattedString(String key, Object arg1, Object arg2) {
+ String format= null;
+ try {
+ format= fgResourceBundle.getString(key);
+ } catch (MissingResourceException e) {
+ return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$
+ }
+ if (arg1 == null)
+ arg1= ""; //$NON-NLS-1$
+ if (arg2 == null)
+ arg2= ""; //$NON-NLS-1$
+ return MessageFormat.format(format, new Object[] { arg1, arg2 });
+ }
+
+ /**
+ * Gets a string from the resource bundle and formats it with the arguments
+ *
+ * @param key the string used to get the bundle value, must not be null
+ * @since 3.0
+ */
+ public static String getFormattedString(String key, Object arg1, Object arg2, Object arg3) {
+ String format= null;
+ try {
+ format= fgResourceBundle.getString(key);
+ } catch (MissingResourceException e) {
+ return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$
+ }
+ if (arg1 == null)
+ arg1= ""; //$NON-NLS-1$
+ if (arg2 == null)
+ arg2= ""; //$NON-NLS-1$
+ if (arg3 == null)
+ arg3= ""; //$NON-NLS-1$
+ return MessageFormat.format(format, new Object[] { arg1, arg2, arg3 });
+ }
+
+ /**
+ * 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
+ * @since 3.0
+ */
+ public static String getFormattedString(String key, boolean arg) {
+ String format= null;
+ try {
+ format= fgResourceBundle.getString(key);
+ } catch (MissingResourceException e) {
+ return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$
+ }
+ return MessageFormat.format(format, new Object[] { new Boolean(arg) });
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfEditorMessages.properties b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfEditorMessages.properties
new file mode 100644
index 0000000000..692d0649fb
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfEditorMessages.properties
@@ -0,0 +1,47 @@
+#################################################################################
+# Copyright (c) 2007 Red Hat, Inc., (c) 2008 Nokia Inc
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Red Hat Incorporated - initial API and implementation
+# Nokia Inc - refactoring
+#################################################################################
+UnmatchedRightParenthesis=Unmatched right parenthesis
+UnmatchedLeftParenthesis=Unmatched left parenthesis
+UnmatchedRightQuote=Unmatched right quote, expected {0}
+UnmatchedLeftQuote=Unmatched left quote, expected {0}
+UnmatchedCloseComment=Unmatched end of comment, expected {0}
+UnterminatedString=Unterminated string, expected {0}
+
+AutoconfMacroArgsTooFew=The autoconf version {0} definition of macro "{1}" requires at least {2} arguments
+AutoconfMacroArgsTooMany=The autoconf version {0} definition of macro "{1}" may have a maximum of {2} arguments
+M4MacroArgsTooFew=The m4 macro "{0}" requires at least {1} arguments
+M4MacroArgsTooMany=The m4 macro "{0}" may have a maximum of {1} arguments
+MissingSpecifier=Missing "{0}" specifier
+InvalidSpecifier=The specifier "{0}" should be separated from condition by semicolon or newline
+InvalidTermination=The specifier "{0}" should appear after semicolon or newline
+UnterminatedConstruct=This "{0}" construct is unterminated
+MissingCondition=Missing condition for {0} specifier
+InvalidElif=The "elif" keyword should appear in an "if" or "elif" construct
+InvalidElse=The "else" keyword should appear in an "if" or "elif" construct
+InvalidFi=The "fi" keyword should terminate an "if", "elif", or "else" construct
+InvalidEsac=The "esac" keyword should terminate a "case" statement
+InvalidDone=The "done" keyword should terminate a "for", "while", "until", or "select" statement
+InvalidDo=The "do" keyword should appear in a "for", "while", "until", or "select" statement
+InvalidThen=The "then" keyword should appear in an "if" or "elif" statement
+InvalidIn=The "in" keyword should appear in a "case" statement
+UnterminatedCaseCondition=Case condition is not terminated before "esac" keyword
+ImproperCaseCondition=Case condition expected to end with ")"
+UnterminatedInlineDocument=Inline document started with "<<" is unterminated
+IncompleteInlineMarker=Inline document marker has incomplete quote
+MissingInlineMarker=Inline document specification is missing end marker
+AutoconfAnnotationHover.multipleMarkers=Multiple markers at this line
+
+ShowToolTip.label=Show T&ooltip Description
+ContentAssistProposal.label=Co&ntent Assist
+ContentAssistProposal.tooltip=Content Assist
+ContentAssistProposal.description=Content Assist
+
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfErrorHandler.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfErrorHandler.java
new file mode 100644
index 0000000000..14ea7f8d97
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfErrorHandler.java
@@ -0,0 +1,213 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.eclipse.cdt.core.model.ICModelMarker;
+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.AnnotationModel;
+import org.eclipse.linuxtools.cdt.autotools.ui.AutotoolsUIPlugin;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.IAutoconfErrorHandler;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.ParseException;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.texteditor.MarkerAnnotation;
+import org.eclipse.ui.texteditor.MarkerUtilities;
+
+
+public class AutoconfErrorHandler implements IAutoconfErrorHandler {
+
+ public static final String PARSE_ERROR_MARKER_ID = AutotoolsUIPlugin.PLUGIN_ID
+ + ".parsefileerror"; //$NON-NLS-1$
+
+ private Map<Position, MarkerAnnotation> annotations = new HashMap<Position, MarkerAnnotation>();
+ private AnnotationModel fAnnotationModel;
+
+ public AutoconfErrorHandler(IEditorInput input) {
+ this.fAnnotationModel = (AnnotationModel)AutoconfEditor.getAutoconfDocumentProvider().getAnnotationModel(input);
+ }
+
+ private class AutoconfMarker implements IMarker {
+ private Map<String, Object> attributes;
+ private String type;
+ private long id;
+
+ public void delete() throws CoreException {
+ // TODO Auto-generated method stub
+
+ }
+ public boolean equals(Object obj) {
+ // TODO Auto-generated method stub
+ return super.equals(obj);
+ }
+ public boolean exists() {
+ // TODO Auto-generated method stub
+ return true;
+ }
+ @SuppressWarnings("unchecked")
+ public Object getAdapter(Class adapter) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+ public Object getAttribute(String attributeName) throws CoreException {
+ return attributes.get(attributeName);
+ }
+ public boolean getAttribute(String attributeName, boolean defaultValue) {
+ Object o = attributes.get(attributeName);
+ if (o != null && o instanceof Boolean)
+ return ((Boolean)o).booleanValue();
+ return defaultValue;
+ }
+ public int getAttribute(String attributeName, int defaultValue) {
+ Object o = attributes.get(attributeName);
+ if (o != null && o instanceof Integer)
+ return ((Integer)o).intValue();
+ return defaultValue;
+ }
+ public String getAttribute(String attributeName, String defaultValue) {
+ Object o = attributes.get(attributeName);
+ if (o != null && o instanceof String)
+ return (String)o;
+ return defaultValue;
+ }
+ public Map<String, Object> getAttributes() throws CoreException {
+ return attributes;
+ }
+ public Object[] getAttributes(String[] attributeNames)
+ throws CoreException {
+ Collection<Object> c = attributes.values();
+ return c.toArray();
+ }
+ public long getCreationTime() throws CoreException {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+ public long getId() {
+ return id;
+ }
+ public IResource getResource() {
+ return null;
+ }
+ public String getType() throws CoreException {
+ return type;
+ }
+ public boolean isSubtypeOf(String superType) throws CoreException {
+ if (superType.equals(type))
+ return true;
+ return false;
+ }
+ public void setAttribute(String attributeName, boolean value)
+ throws CoreException {
+ Boolean b = new Boolean(value);
+ attributes.put(attributeName, b);
+ }
+ public void setAttribute(String attributeName, int value)
+ throws CoreException {
+ Integer i = new Integer(value);
+ attributes.put(attributeName, i);
+ }
+ public void setAttribute(String attributeName, Object value)
+ throws CoreException {
+ attributes.put(attributeName, value);
+ }
+ @SuppressWarnings("unchecked")
+ public void setAttributes(Map map) throws CoreException {
+ attributes.putAll(map);
+ }
+ public void setAttributes(String[] attributeNames, Object[] values)
+ throws CoreException {
+ for (int i = 0; i < attributeNames.length; ++i) {
+ attributes.put(attributeNames[i], values[i]);
+ }
+ }
+ protected Object clone() throws CloneNotSupportedException {
+ // TODO Auto-generated method stub
+ return super.clone();
+ }
+ public AutoconfMarker(String type, long id) {
+ this.type = type;
+ this.id = id;
+ this.attributes = new HashMap<String, Object>();
+ }
+ }
+ private IMarker createMarker(Map<String, Object> attributes, String markerType) throws CoreException {
+ IMarker marker= new AutoconfMarker(markerType, -1);
+ marker.setAttributes(attributes);
+ return marker;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.linuxtools.cdt.autotools.ui.editors.IAutoconfErrorHandler#handleError(org.eclipse.linuxtools.cdt.autotools.core.ui.editors.parser.ParseException)
+ */
+ public void handleError(ParseException e) {
+
+ int lineNumber = e.getLineNumber();
+
+ Map<String, Object> map = new HashMap<String, Object>();
+ MarkerUtilities.setLineNumber(map, lineNumber);
+ MarkerUtilities.setMessage(map, e.getMessage());
+ map.put(IMarker.MESSAGE, e.getMessage());
+ map.put(IMarker.LOCATION, Integer.valueOf(lineNumber));
+
+ Integer charStart = new Integer(e.getStartOffset());
+ if (charStart != null) {
+ map.put(IMarker.CHAR_START, charStart);
+ }
+ Integer charEnd = new Integer(e.getEndOffset());
+ if (charEnd != null) {
+ map.put(IMarker.CHAR_END, charEnd);
+ }
+
+ // FIXME: add severity level
+ map.put(IMarker.SEVERITY, new Integer(e.getSeverity()));
+
+ try {
+ IMarker marker = createMarker(map, ICModelMarker.C_MODEL_PROBLEM_MARKER);
+
+ MarkerAnnotation annotation = new MarkerAnnotation(marker);
+ Position p = new Position(charStart.intValue(),charEnd.intValue() - charStart.intValue());
+ fAnnotationModel.addAnnotation(annotation, p);
+ annotations.put(p, annotation);
+ } catch (CoreException ce) {
+ // do nothing
+ }
+ return;
+ }
+
+ public void removeAllExistingMarkers()
+ {
+ fAnnotationModel.removeAllAnnotations();
+ annotations.clear();
+ }
+
+ @SuppressWarnings("unchecked")
+ public void removeExistingMarkers(int offset, int length)
+ {
+ Iterator i = fAnnotationModel.getAnnotationIterator();
+ while (i.hasNext()) {
+ Annotation annotation = (Annotation)i.next();
+ Position p = fAnnotationModel.getPosition(annotation);
+ int pStart = p.getOffset();
+ if (pStart >= offset && pStart < (offset + length)) {
+ // Remove directly from model instead of using
+ // iterator so position will be removed from document.
+ fAnnotationModel.removeAnnotation(annotation);
+ }
+ }
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfIdentifierRule.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfIdentifierRule.java
new file mode 100644
index 0000000000..4306541d85
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfIdentifierRule.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 20009 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors;
+
+import org.eclipse.core.runtime.Assert;
+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.Token;
+
+public class AutoconfIdentifierRule implements IPredicateRule {
+
+ private IToken fToken;
+ private String fExtraChars = "_${@"; //$NON-NLS-1$
+
+ public AutoconfIdentifierRule(IToken token) {
+ Assert.isNotNull(token);
+ fToken = token;
+ }
+
+ public IToken getSuccessToken() {
+ return fToken;
+ }
+
+ /*
+ * @see IRule#evaluate(ICharacterScanner)
+ */
+ public IToken evaluate(ICharacterScanner scanner) {
+ return evaluate(scanner, false);
+ }
+
+ /*
+ * @see IPredicateRule#evaluate(ICharacterScanner, resume)
+ */
+ public IToken evaluate(ICharacterScanner scanner, boolean resume) {
+ int c = scanner.read();
+ if (Character.isLetterOrDigit((char)c) || fExtraChars.indexOf((char)c) >= 0) {
+ do {
+ c = scanner.read();
+ } while (Character.isLetterOrDigit((char)c) || fExtraChars.indexOf((char)c) >= 0);
+ scanner.unread();
+ return fToken;
+ }
+ scanner.unread();
+ return Token.UNDEFINED;
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfKeywordDetector.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfKeywordDetector.java
new file mode 100644
index 0000000000..4007042879
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfKeywordDetector.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2006 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors;
+
+import org.eclipse.jface.text.rules.IWordDetector;
+
+public class AutoconfKeywordDetector implements IWordDetector {
+
+ /**
+ * @see IWordDetector#isWordPart(character)
+ */
+ public boolean isWordPart(char character) {
+ return (Character.isLetter(character) && Character.isLowerCase(character));
+ }
+
+ /**
+ * @see IWordDetector#isWordStart(char)
+ */
+ public boolean isWordStart(char character) {
+ return (Character.isLetter(character) && Character.isLowerCase(character));
+ }
+
+}
+
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfM4WordDetector.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfM4WordDetector.java
new file mode 100644
index 0000000000..2d4059da14
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfM4WordDetector.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2006 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors;
+
+import org.eclipse.jface.text.rules.IWordDetector;
+
+public class AutoconfM4WordDetector implements IWordDetector {
+
+ public boolean isWordPart(char c) {
+ // TODO Auto-generated method stub
+ return (Character.isLetter(c) ||
+ Character.isDigit(c) || c == '_');
+ }
+
+ public boolean isWordStart(char c) {
+ // TODO Auto-generated method stub
+ return (c == 'm');
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacro.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacro.java
new file mode 100644
index 0000000000..ced0c8844b
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacro.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors;
+
+public class AutoconfMacro implements Comparable<Object> {
+ protected String name;
+ protected String parms;
+
+ public AutoconfMacro(String name, String parms) {
+ this.name = name;
+ this.parms = parms;
+ }
+ public String getName() {
+ return name;
+ }
+ public String getTemplate() {
+ return name + (hasParms() ? "()" : ""); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ public String getParms() {
+ return parms;
+ }
+ public boolean hasParms() {
+ return (parms.length() > 0);
+ }
+ public int compareTo (Object x) {
+ AutoconfMacro y = (AutoconfMacro)x;
+ return getName().compareTo(y.getName());
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroCodeScanner.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroCodeScanner.java
new file mode 100644
index 0000000000..f0a088b627
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroCodeScanner.java
@@ -0,0 +1,277 @@
+/*******************************************************************************
+ * Copyright (c) 2006 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.resource.StringConverter;
+import org.eclipse.jface.text.TextAttribute;
+import org.eclipse.jface.text.rules.IRule;
+import org.eclipse.jface.text.rules.IToken;
+import org.eclipse.jface.text.rules.RuleBasedScanner;
+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.WordRule;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.linuxtools.cdt.autotools.core.AutotoolsPlugin;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.preferences.AutotoolsEditorPreferenceConstants;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.preferences.ColorManager;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.RGB;
+
+
+public class AutoconfMacroCodeScanner extends RuleBasedScanner {
+
+ private Map<String, IToken> fTokenMap= new HashMap<String, IToken>();
+ private String[] fPropertyNamesColor;
+
+ private int quoteLevel;
+
+ /**
+ * Preference keys for boolean preferences which are <code>true</code>,
+ * iff the corresponding token should be rendered bold.
+ */
+ private String[] fPropertyNamesBold;
+ /**
+ * Preference keys for boolean preferences which are <code>true</code>,
+ * iff the corresponding token should be rendered italic.
+ */
+ private String[] fPropertyNamesItalic;
+
+ private static String[] keywords = {
+ "case", "do", "done", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ "esac", "if", "elif", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ "else", "fi", "for", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ "in", "then" }; //$NON-NLS-1$ //$NON-NLS-2$
+
+ public static final String[] fTokenProperties = new String[] {
+ ColorManager.AUTOCONF_COMMENT_COLOR,
+ ColorManager.AUTOCONF_KEYWORD_COLOR,
+ ColorManager.AUTOCONF_ACMACRO_COLOR,
+ ColorManager.AUTOCONF_AMMACRO_COLOR,
+ ColorManager.AUTOCONF_VAR_REF_COLOR,
+ ColorManager.AUTOCONF_VAR_SET_COLOR,
+ ColorManager.AUTOCONF_CODESEQ_COLOR,
+ ColorManager.AUTOCONF_DEFAULT_COLOR,
+ };
+
+ public AutoconfMacroCodeScanner() {
+
+ initialize();
+
+ IToken other= getToken(ColorManager.AUTOCONF_DEFAULT_COLOR);
+ IToken keyword = getToken(ColorManager.AUTOCONF_KEYWORD_COLOR);
+ IToken comment= getToken(ColorManager.AUTOCONF_COMMENT_COLOR);
+ IToken string = getToken(ColorManager.AUTOCONF_DEFAULT_COLOR);
+ IToken varRef = getToken(ColorManager.AUTOCONF_VAR_REF_COLOR);
+ IToken acmacro = getToken(ColorManager.AUTOCONF_ACMACRO_COLOR);
+ IToken ammacro = getToken(ColorManager.AUTOCONF_AMMACRO_COLOR);
+ IToken code = getToken(ColorManager.AUTOCONF_CODESEQ_COLOR);
+
+ List<IRule> rules= new ArrayList<IRule>();
+
+ // Add rule for single line comments.
+ rules.add(new RestrictedEndOfLineRule("dnl", "[]", comment)); //$NON-NLS-1$
+ rules.add(new RestrictedEndOfLineRule("#", "[]", comment, '\\')); //$NON-NLS-1$
+
+ // Add special recursive rule for strings which allows variable
+ // references to be internally tokenized.
+ RecursiveSingleLineRule stringRule =
+ new RecursiveSingleLineRule("\"", "\"", string, '\\'); //$NON-NLS-1$ //$NON-NLS-2$
+ stringRule.addRule(new SingleLineRule("${", "}", varRef)); //$NON-NLS-1$ //$NON-NLS-2$
+ rules.add(stringRule);
+
+ // Add rule for variable references
+ rules.add(new SingleLineRule("${", "}", varRef)); //$NON-NLS-1$ //$NON-NLS-2$
+ // Add rule for strings
+ rules.add(new SingleLineRule("\"", "\"", string, '\\')); //$NON-NLS-1$ //$NON-NLS-2$
+
+ // Add rule for AC_ macros
+ rules.add(new AutoconfMacroRule("AC_", new AutoconfMacroWordDetector(), acmacro)); //$NON-NLS-1$
+
+ // Add rule for AM_ macros
+ rules.add(new AutoconfMacroRule("AM_", new AutoconfMacroWordDetector(), ammacro)); //$NON-NLS-1$
+
+ // Add rule for m4_ macros
+ rules.add(new AutoconfMacroRule("m4_", new AutoconfM4WordDetector(), acmacro)); //$NON-NLS-1$
+
+ // Add rule for code sequences starting with <<EOF and ending with EOF
+ rules.add(new InlineDataRule(code));
+
+ // Add word rule for keywords.
+ WordRule wordRule= new WordRule(new AutoconfWordDetector(), other);
+ for (int i= 0; i < keywords.length; i++)
+ wordRule.addWord(keywords[i], keyword);
+ rules.add(wordRule);
+
+ // Add word rule for identifier.
+ rules.add(new AutoconfIdentifierRule(other));
+
+ // Make sure we don't treat "\#" as comment start.
+ rules.add(new SingleLineRule("\\#", null, Token.UNDEFINED));
+
+ rules.add(new WhitespaceRule(new AutoconfWhitespaceDetector()));
+
+ IRule[] result= new IRule[rules.size()];
+ rules.toArray(result);
+ setRules(result);
+ }
+
+ /*
+ * @see ITokenScanner#nextToken()
+ */
+ public IToken nextToken() {
+ int ch = read();
+ if (ch == '[') {
+ incQuoteLevel();
+ return getToken(ColorManager.AUTOCONF_DEFAULT_COLOR);
+ } else if (ch == ']') {
+ decQuoteLevel();
+ return getToken(ColorManager.AUTOCONF_DEFAULT_COLOR);
+ }
+ unread();
+ return super.nextToken();
+ }
+
+ protected Token getToken(String key) {
+ return (Token) fTokenMap.get(key);
+ }
+
+ private void addToken(String colorKey, String boldKey, String italicKey) {
+ fTokenMap.put(colorKey, new Token(createTextAttribute(colorKey, boldKey, italicKey)));
+ }
+
+ protected String[] getTokenProperties() {
+ return fTokenProperties;
+ }
+
+ 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(fPropertyNamesBold[i]) || property.equals(fPropertyNamesItalic[i]))
+ return i;
+ }
+ }
+ return -1;
+ }
+
+ public void incQuoteLevel() {
+ ++quoteLevel;
+ }
+
+ public void decQuoteLevel() {
+ --quoteLevel;
+ }
+
+ public void resetQuoteLevel() {
+ quoteLevel = 0;
+ }
+
+ public int getQuoteLevel() {
+ return quoteLevel;
+ }
+
+ 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(event, token);
+ else if (fPropertyNamesBold[index].equals(p))
+ adaptToStyleChange(event, token, SWT.BOLD);
+ else if (fPropertyNamesItalic[index].equals(p))
+ adaptToStyleChange(event, token, SWT.ITALIC);
+ }
+
+ protected void adaptToColorChange(PropertyChangeEvent event, Token token) {
+ 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) {
+ TextAttribute attr= (TextAttribute) token.getData();
+ token.setData(new TextAttribute(ColorManager.getDefault().getColor(rgb), attr.getBackground(), attr.getStyle()));
+ }
+ }
+
+ protected void adaptToStyleChange(PropertyChangeEvent event, Token token, int styleAttribute) {
+ if (token == null) {
+ return;
+ }
+ boolean eventValue= false;
+ Object value= event.getNewValue();
+ if (value instanceof Boolean) {
+ eventValue= ((Boolean) value).booleanValue();
+ } else if (IPreferenceStore.TRUE.equals(value)) {
+ eventValue= true;
+ }
+
+ TextAttribute attr= (TextAttribute) token.getData();
+ boolean activeValue= (attr.getStyle() & styleAttribute) == styleAttribute;
+ if (activeValue != eventValue) {
+ token.setData(new TextAttribute(attr.getForeground(), attr.getBackground(), eventValue ? attr.getStyle() | styleAttribute : attr.getStyle() & ~styleAttribute));
+ }
+ }
+
+ protected TextAttribute createTextAttribute(String colorID, String boldKey, String italicKey) {
+ Color color= null;
+ if (colorID != null) {
+ color= AutoconfEditor.getPreferenceColor(colorID);
+ }
+ IPreferenceStore store= AutotoolsPlugin.getDefault().getPreferenceStore();
+ int style= store.getBoolean(boldKey) ? SWT.BOLD : SWT.NORMAL;
+ if (store.getBoolean(italicKey)) {
+ style |= SWT.ITALIC;
+ }
+ return new TextAttribute(color, null, style);
+ }
+
+ /**
+ * Must be called after the constructor has been called.
+ */
+ public final void initialize() {
+
+ resetQuoteLevel();
+ fPropertyNamesColor= getTokenProperties();
+ int length= fPropertyNamesColor.length;
+ fPropertyNamesBold= new String[length];
+ fPropertyNamesItalic= new String[length];
+
+ for (int i= 0; i < length; i++) {
+ fPropertyNamesBold[i]= fPropertyNamesColor[i] + AutotoolsEditorPreferenceConstants.EDITOR_BOLD_SUFFIX;
+ fPropertyNamesItalic[i]= fPropertyNamesColor[i] + AutotoolsEditorPreferenceConstants.EDITOR_ITALIC_SUFFIX;
+ addToken(fPropertyNamesColor[i], fPropertyNamesBold[i], fPropertyNamesItalic[i]);
+ }
+ }
+
+ /*
+ * @see ICharacterScanner#unread()
+ */
+ public void unread() {
+ --fOffset;
+ fColumn = UNDEFINED;
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroContentAssistProcessor.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroContentAssistProcessor.java
new file mode 100644
index 0000000000..b1c9590a01
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroContentAssistProcessor.java
@@ -0,0 +1,120 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2009 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors;
+
+import java.util.ArrayList;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.contentassist.CompletionProposal;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.text.contentassist.IContextInformation;
+import org.eclipse.jface.text.contentassist.IContextInformationValidator;
+import org.eclipse.jface.text.rules.ICharacterScanner;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.text.hover.AutoconfTextHover;
+
+
+public class AutoconfMacroContentAssistProcessor implements
+ IContentAssistProcessor {
+
+ protected ICharacterScanner scanner;
+ protected AutoconfEditor editor;
+
+ public AutoconfMacroContentAssistProcessor(ICharacterScanner scanner, AutoconfEditor editor) {
+ this.scanner = scanner;
+ this.editor = editor;
+ }
+
+ private int computeMacroStart(IDocument document, int offset) {
+ try {
+ while (Character.isJavaIdentifierPart(document.getChar(offset - 1))) {
+ --offset;
+ }
+ } catch (BadLocationException e) {
+ // Do nothing
+ }
+ return offset;
+ }
+
+ public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer,
+ int offset) {
+
+ IDocument document = viewer.getDocument();
+ String prefix = ""; //$NON-NLS-1$
+ AutoconfMacro[] macros = AutoconfTextHover.getMacroList(editor);
+ try {
+ int macroStart = computeMacroStart(document, offset);
+ if (macroStart < offset) {
+ prefix = prefix + document.get(macroStart, offset - macroStart);
+ }
+ } catch (BadLocationException e) {
+ // Do nothing. Leave prefix empty.
+ }
+ ICompletionProposal[] result = null;
+ if (macros != null) {
+ ArrayList<ICompletionProposal> validList = new ArrayList<ICompletionProposal>();
+ for (int i = 0; i < macros.length; ++i) {
+ String name = macros[i].getName();
+ if (name.length() >= prefix.length()) {
+ if (name.startsWith(prefix)) {
+ String template = macros[i].getTemplate();
+ int cursorPos = template.length();
+ int prefixLen = prefix.length();
+ if (template.charAt(template.length() - 1) == ')')
+ cursorPos -= 1;
+ AutoconfMacroProposalContextInformation ci = null;
+ if (macros[i].hasParms()) {
+ // Provide parameter info as context information that
+ // is tied to the completion proposal.
+ ci = new AutoconfMacroProposalContextInformation(macros[i].getParms(), macros[i].getParms());
+ ci.setContextInformationPosition(offset - prefixLen + cursorPos - 1);
+ }
+ ICompletionProposal cp = new CompletionProposal(template, offset - prefixLen, prefixLen, cursorPos, null,
+ name, ci, AutoconfTextHover.getIndexedInfo(name, editor));
+ validList.add(cp);
+ }
+ }
+ }
+ result = new ICompletionProposal[validList.size()];
+ result = (ICompletionProposal[])validList.toArray(result);
+ }
+ return result;
+ }
+
+ public IContextInformation[] computeContextInformation(ITextViewer viewer,
+ int offset) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public char[] getCompletionProposalAutoActivationCharacters() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public char[] getContextInformationAutoActivationCharacters() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public IContextInformationValidator getContextInformationValidator() {
+ // TODO Auto-generated method stub
+ return new AutoconfMacroParameterListValidator();
+ }
+
+ public String getErrorMessage() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroDamagerRepairer.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroDamagerRepairer.java
new file mode 100644
index 0000000000..c6ead68df8
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroDamagerRepairer.java
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors;
+
+import org.eclipse.jface.text.DocumentEvent;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITypedRegion;
+import org.eclipse.jface.text.TextPresentation;
+import org.eclipse.jface.text.rules.DefaultDamagerRepairer;
+import org.eclipse.jface.text.rules.ITokenScanner;
+
+public class AutoconfMacroDamagerRepairer extends DefaultDamagerRepairer {
+
+ public final static String UNMATCHED_RIGHT_PARENTHESIS = "UnmatchedRightParenthesis"; //$NON-NLS-1$
+ public final static String UNMATCHED_LEFT_PARENTHESIS = "UnmatchedLeftParenthesis"; //$NON-NLS-1$
+ public final static String UNMATCHED_RIGHT_QUOTE = "UnmatchedRightQuote"; //$NON-NLS-1$
+ public final static String UNMATCHED_LEFT_QUOTE = "UnmatchedLeftQuote"; //$NON-NLS-1$
+
+ /**
+ * Creates a damager/repairer that uses the given scanner. The scanner may not be <code>null</code>
+ * and is assumed to return only token that carry text attributes.
+ *
+ * @param scanner the token scanner to be used, may not be <code>null</code>
+ */
+ public AutoconfMacroDamagerRepairer(ITokenScanner scanner) {
+ super(scanner);
+ }
+
+ /*
+ * @see IPresentationDamager#getDamageRegion(ITypedRegion, DocumentEvent, boolean)
+ */
+ public IRegion getDamageRegion(ITypedRegion partition, DocumentEvent e, boolean documentPartitioningChanged) {
+ // In the case of a partition with multiline rules, we will punt to
+ // reparse the entire partition because we don't know if the line being
+ // edited is in the middle of an area covered by a multiline rule. In
+ // such a case, we need to back up and find the start sequence of the
+ // rule. It is easiest to just reparse the whole partition.
+ return partition;
+ }
+
+ /*
+ * @see IPresentationRepairer#createPresentation(TextPresentation, ITypedRegion)
+ */
+ public void createPresentation(TextPresentation presentation, ITypedRegion region) {
+
+// int offset = region.getOffset();
+// int length = region.getLength();
+
+ super.createPresentation(presentation, region);
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroParameterListValidator.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroParameterListValidator.java
new file mode 100644
index 0000000000..f59fbc53e9
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroParameterListValidator.java
@@ -0,0 +1,215 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors;
+
+import org.eclipse.core.runtime.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;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.StyleRange;
+
+/**
+ * This class provides the macro call parameter parsing for the Autoconf Editor hover
+ * It is modified from the CDT class CParameterListValidator
+ *
+ * @author jjohnstn
+ *
+ */
+public class AutoconfMacroParameterListValidator implements IContextInformationValidator, IContextInformationPresenter {
+ private int fPosition;
+ private ITextViewer fViewer;
+ private IContextInformation fInformation;
+
+ private int fCurrentParameter;
+
+ public AutoconfMacroParameterListValidator() {
+ }
+
+ /**
+ * @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 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);
+
+ // There are two nesting levels to worry about. Arguments can be
+ // quoted with [] which means to treat the contents as one arg.
+ // As well, macro calls can be nested within macro calls so we
+ // have to handle parentheses.
+ int macroQuotingLevel = 0; // Pertaining to '[' and ']' quoted args.
+ int macroNestingLevel = -1; // Set to -1 to take into account first ( for function call
+ int charCount = 0;
+ while (start < end) {
+ char curr = document.getChar(start++);
+ switch (curr) {
+ case 'd':
+ if (start < end - 2) {
+ char next= document.getChar(start);
+ if (next == 'n') {
+ // a comment starts, advance to the comment end
+ next = document.getChar(start + 1);
+ if (next == 'l')
+ // dnl-comment: nothing to do anymore on this line
+ start= end;
+ }
+ }
+ break;
+ case '"':
+ case '\'':
+ start= getStringEnd(document, start, end, curr);
+ break;
+ default:
+ if ('[' == curr)
+ ++ macroQuotingLevel;
+ else if (']' == curr)
+ -- macroQuotingLevel;
+ if (macroQuotingLevel != 0)
+ break;
+ if (considerNesting) {
+ if ('(' == curr)
+ ++ macroNestingLevel;
+ else if (')' == curr) {
+ -- macroNestingLevel;
+ }
+ if (macroNestingLevel != 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/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroPartitionRule.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroPartitionRule.java
new file mode 100644
index 0000000000..49b05661c0
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroPartitionRule.java
@@ -0,0 +1,148 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2007 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors;
+
+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.IWhitespaceDetector;
+import org.eclipse.jface.text.rules.IWordDetector;
+import org.eclipse.jface.text.rules.Token;
+
+
+public class AutoconfMacroPartitionRule implements IPredicateRule {
+ /**
+ * The default token to be returned on success and if nothing else has been
+ * specified.
+ */
+ protected IToken token;
+
+ private IWordDetector generalMacroWordDetector;
+ private IWordDetector m4MacroWordDetector;
+ protected IWordDetector fDetector;
+ protected IWhitespaceDetector fWsDetector = new AutoconfWhitespaceDetector();
+
+ /** The column constraint */
+ protected int fColumn = UNDEFINED;
+
+ /** Internal setting for the un-initialized column constraint */
+ protected static final int UNDEFINED = -1;
+
+ /** Buffer used for pattern detection */
+ private StringBuffer fBuffer = new StringBuffer();
+
+ public AutoconfMacroPartitionRule(IToken inToken) {
+ token = inToken;
+ generalMacroWordDetector = new AutoconfMacroWordDetector();
+ m4MacroWordDetector = new AutoconfM4WordDetector();
+ }
+
+ public IToken getSuccessToken() {
+ return token;
+ }
+
+ protected void matchParentheses(ICharacterScanner scanner) {
+ boolean finished = false;
+ int depth = 1;
+ int quoteDepth = 0;
+ int c = scanner.read();
+ while (!finished && c != ICharacterScanner.EOF) {
+ if (c == '[') {
+ ++quoteDepth;
+ }
+ else if (c == ']') {
+ --quoteDepth;
+ if (quoteDepth < 0)
+ finished = true;
+ }
+ if (quoteDepth == 0) {
+ if (c == ')') {
+ --depth;
+ if (depth <= 0)
+ finished = true;
+ }
+ else if (c == '(') {
+ ++depth;
+ }
+ }
+ c = scanner.read();
+ }
+ }
+
+ public IToken evaluate(ICharacterScanner scanner, boolean resume) {
+// if (resume)
+// return Token.UNDEFINED;
+ return evaluate(scanner);
+ }
+
+ public IToken evaluate(ICharacterScanner scanner) {
+ int c = scanner.read();
+ fBuffer.setLength(0);
+
+ fBuffer.append((char)c);
+ if (c == 'A') {
+ c = scanner.read();
+ fBuffer.append((char)c);
+ if (c != 'C' && c != 'H' && c != 'M') {
+ unreadBuffer(scanner);
+ return Token.UNDEFINED;
+ }
+ fDetector = generalMacroWordDetector;
+ } else if (c == 'm') {
+ c = scanner.read();
+ fBuffer.append((char)c);
+ if (c != 4) {
+ unreadBuffer(scanner);
+ return Token.UNDEFINED;
+ }
+ fDetector = m4MacroWordDetector;
+ } else {
+ unreadBuffer(scanner);
+ return Token.UNDEFINED;
+ }
+
+ c = scanner.read();
+ while (c != ICharacterScanner.EOF
+ && fDetector.isWordPart((char) c)) {
+ fBuffer.append((char) c);
+ c = scanner.read();
+ }
+
+ if (c != ICharacterScanner.EOF) {
+ if (c == ';' || fWsDetector.isWhitespace((char)c)) {
+ // We are done
+ }
+ else if (c == '(') {
+ matchParentheses(scanner);
+ }
+ else {
+ scanner.unread();
+ unreadBuffer(scanner);
+ return Token.UNDEFINED;
+ }
+ }
+
+ scanner.unread();
+ return 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();
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroProposalContextInformation.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroProposalContextInformation.java
new file mode 100644
index 0000000000..e549af6aa7
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroProposalContextInformation.java
@@ -0,0 +1,104 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corp. - Rational Software - initial implementation
+ *******************************************************************************/
+/*
+ * Created on May 6, 2004
+ */
+package org.eclipse.linuxtools.cdt.autotools.ui.editors;
+
+import org.eclipse.jface.text.contentassist.IContextInformation;
+import org.eclipse.jface.text.contentassist.IContextInformationExtension;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * @author aniefer
+ */
+public class AutoconfMacroProposalContextInformation implements IContextInformation, IContextInformationExtension {
+ /** The name of the context */
+ private String fContextDisplayString;
+ /** The information to be displayed */
+ private String fInformationDisplayString;
+ /** The position to display the information */
+ private int fInformationPosition;
+ /** The image to be displayed */
+ private Image fImage;
+
+ /**
+ * Creates a new context information without an image.
+ *
+ * @param contextDisplayString the string to be used when presenting the context
+ * @param informationDisplayString the string to be displayed when presenting the context information
+ */
+ public AutoconfMacroProposalContextInformation(String contextDisplayString, String informationDisplayString) {
+ this(null, contextDisplayString, informationDisplayString);
+ }
+
+ /**
+ * Creates a new context information with an image.
+ *
+ * @param image the image to display when presenting the context information
+ * @param contextDisplayString the string to be used when presenting the context
+ * @param informationDisplayString the string to be displayed when presenting the context information,
+ * may not be <code>null</code>
+ */
+ public AutoconfMacroProposalContextInformation(Image image, String contextDisplayString, String informationDisplayString) {
+ //Assert.isNotNull(informationDisplayString);
+ fImage= image;
+ fContextDisplayString= contextDisplayString;
+ fInformationDisplayString= informationDisplayString;
+ }
+
+ /*
+ * @see IContextInformation#equals(Object)
+ */
+ public boolean equals(Object object) {
+ if (object instanceof IContextInformation) {
+ IContextInformation contextInformation= (IContextInformation) object;
+ boolean equals= fInformationDisplayString.equalsIgnoreCase(contextInformation.getInformationDisplayString());
+ if (fContextDisplayString != null)
+ equals= equals && fContextDisplayString.equalsIgnoreCase(contextInformation.getContextDisplayString());
+ return equals;
+ }
+ return false;
+ }
+
+ /*
+ * @see IContextInformation#getInformationDisplayString()
+ */
+ public String getInformationDisplayString() {
+ return fInformationDisplayString;
+ }
+
+ /*
+ * @see IContextInformation#getImage()
+ */
+ public Image getImage() {
+ return fImage;
+ }
+
+ /*
+ * @see IContextInformation#getContextDisplayString()
+ */
+ public String getContextDisplayString() {
+ if (fContextDisplayString != null)
+ return fContextDisplayString;
+ return fInformationDisplayString;
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.contentassist.IContextInformationExtension#getContextInformationPosition()
+ */
+ public int getContextInformationPosition() {
+ return fInformationPosition;
+ }
+
+ public void setContextInformationPosition( int pos ){
+ fInformationPosition = pos;
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroRule.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroRule.java
new file mode 100644
index 0000000000..caab3d69e9
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroRule.java
@@ -0,0 +1,88 @@
+/*******************************************************************************
+ * Copyright (c) 2006 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors;
+
+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.IWordDetector;
+import org.eclipse.jface.text.rules.Token;
+
+public class AutoconfMacroRule implements IRule {
+ /**
+ * The default token to be returned on success and if nothing else has been
+ * specified.
+ */
+ protected IToken token;
+
+ protected IWordDetector fDetector;
+ protected IWhitespaceDetector fWsDetector = new AutoconfWhitespaceDetector();
+
+ /** The column constraint */
+ protected int fColumn = UNDEFINED;
+
+ /** Internal setting for the un-initialized column constraint */
+ protected static final int UNDEFINED = -1;
+
+ /** Buffer used for pattern detection */
+ private StringBuffer fBuffer = new StringBuffer();
+
+ private String fStartingSequence;
+
+ public AutoconfMacroRule(String startingSequence,
+ IWordDetector detector, IToken inToken) {
+ token = inToken;
+ fDetector = detector;
+ fStartingSequence = startingSequence;
+ }
+
+ public IToken evaluate(ICharacterScanner scanner) {
+ int c = scanner.read();
+ fBuffer.setLength(0);
+
+ for (int i = 0; i < fStartingSequence.length(); i++) {
+ fBuffer.append((char) c);
+ if (fStartingSequence.charAt(i) != c) {
+ unreadBuffer(scanner);
+ return Token.UNDEFINED;
+ }
+ c = scanner.read();
+ }
+
+ while (c != ICharacterScanner.EOF
+ && fDetector.isWordPart((char) c)) {
+ fBuffer.append((char) c);
+ c = scanner.read();
+ }
+
+ if (c != ICharacterScanner.EOF && c != '(' && c != ';'
+ && !fWsDetector.isWhitespace((char)c)) {
+ unreadBuffer(scanner);
+ return Token.UNDEFINED;
+ }
+
+ scanner.unread();
+ return 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();
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroWordDetector.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroWordDetector.java
new file mode 100644
index 0000000000..2a0e0f8a74
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroWordDetector.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2006 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors;
+
+import org.eclipse.jface.text.rules.IWordDetector;
+
+public class AutoconfMacroWordDetector implements IWordDetector {
+
+ public boolean isWordPart(char c) {
+ return ((Character.isLetter(c) && Character.isUpperCase(c)) ||
+ Character.isDigit(c) || c == '_');
+ }
+
+ public boolean isWordStart(char c) {
+ return (c == 'A');
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfPKGWordDetector.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfPKGWordDetector.java
new file mode 100644
index 0000000000..49c923dc8f
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfPKGWordDetector.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2008 NOKIA Inc
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors;
+
+import org.eclipse.jface.text.rules.IWordDetector;
+
+public class AutoconfPKGWordDetector implements IWordDetector {
+
+ public boolean isWordPart(char c) {
+ return ((Character.isLetter(c) && Character.isUpperCase(c)) ||
+ Character.isDigit(c) || c == '_');
+ }
+
+ public boolean isWordStart(char c) {
+ return (c == 'P');
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfPartitionScanner.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfPartitionScanner.java
new file mode 100644
index 0000000000..7dd8f709b6
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfPartitionScanner.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2006 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.text.rules.EndOfLineRule;
+import org.eclipse.jface.text.rules.IPredicateRule;
+import org.eclipse.jface.text.rules.IRule;
+import org.eclipse.jface.text.rules.RuleBasedPartitionScanner;
+import org.eclipse.jface.text.rules.SingleLineRule;
+import org.eclipse.jface.text.rules.Token;
+
+public class AutoconfPartitionScanner extends RuleBasedPartitionScanner {
+
+ public final static String AUTOCONF_MACRO = "autoconf_macro"; //$NON-NLS-1$
+ public final static String AUTOCONF_COMMENT = "autoconf_comment"; //$NON-NLS-1$
+ public final static String[] AUTOCONF_PARTITION_TYPES=
+ new String[] { AUTOCONF_MACRO, AUTOCONF_COMMENT };
+
+ /**
+ * Creates the partitioner and sets up the appropriate rules.
+ */
+ public AutoconfPartitionScanner() {
+ super();
+
+ List<IRule> rules= new ArrayList<IRule>();
+ Token macro = new Token(AUTOCONF_MACRO);
+ Token comment = new Token(AUTOCONF_COMMENT);
+
+ // Add rule for target bodies.
+ rules.add(new AutoconfMacroPartitionRule(macro));
+
+
+ rules.add(new EndOfLineRule("dnl", comment)); //$NON-NLS-1$
+ rules.add(new SingleLineRule("\\#", null, Token.UNDEFINED));
+ rules.add(new EndOfLineRule("#", comment, '\\')); //$NON-NLS-1$
+
+ // We want to process identifiers that might have macro
+ // names inside them.
+ rules.add(new AutoconfIdentifierRule(Token.UNDEFINED));
+
+ IPredicateRule[] result= new IPredicateRule[rules.size()];
+ rules.toArray(result);
+ setPredicateRules(result);
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfPartitioner.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfPartitioner.java
new file mode 100644
index 0000000000..c449f426d5
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfPartitioner.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2009 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ITypedRegion;
+import org.eclipse.jface.text.rules.FastPartitioner;
+import org.eclipse.jface.text.rules.IPartitionTokenScanner;
+
+public class AutoconfPartitioner extends FastPartitioner {
+
+ public AutoconfPartitioner(IPartitionTokenScanner scanner, String[] legalContentTypes) {
+ // TODO Auto-generated constructor stub
+ super(scanner, legalContentTypes);
+ }
+
+ public void connect(IDocument document, int blah) {
+ super.connect(document);
+ }
+
+ // To optionally show partitions, we must do so by overriding the computePartitioning
+ // method. We cannot do it at connect time because the document may be zero length
+ // at the time and we will end up getting default partitioning from then on.
+ public ITypedRegion[] computePartitioning(int offset, int length,
+ boolean includeZeroLength) {
+ ITypedRegion[] regions = super.computePartitioning(offset, length, includeZeroLength);
+ // Uncomment the following line to see partitioning.
+// printPartitions(regions);
+ return regions;
+ }
+
+ public void printPartitions(ITypedRegion[] partitions)
+ {
+ StringBuffer buffer = new StringBuffer();
+
+ for (int i = 0; i < partitions.length; i++)
+ {
+ try
+ {
+ buffer.append("Partition type: " + partitions[i].getType() //$NON-NLS-1$
+ + ", offset: " + partitions[i].getOffset() //$NON-NLS-1$
+ + ", length: " + partitions[i].getLength()); //$NON-NLS-1$
+ buffer.append("\n"); //$NON-NLS-1$
+ buffer.append("Text:\n"); //$NON-NLS-1$
+ buffer.append(super.fDocument.get(partitions[i].getOffset(), partitions[i].getLength()));
+ buffer.append("\n---------------------------\n\n\n"); //$NON-NLS-1$
+ }
+ catch (BadLocationException e)
+ {
+ e.printStackTrace();
+ }
+ }
+ System.out.print(buffer);
+ }
+} \ No newline at end of file
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfReconcilingStrategy.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfReconcilingStrategy.java
new file mode 100644
index 0000000000..b81aead848
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfReconcilingStrategy.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors;
+
+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.linuxtools.cdt.autotools.ui.editors.outline.AutoconfContentOutlinePage;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.AutoconfParser;
+import org.eclipse.ui.texteditor.IDocumentProvider;
+
+
+public class AutoconfReconcilingStrategy implements IReconcilingStrategy {
+
+ AutoconfContentOutlinePage outline;
+ int lastRegionOffset;
+ AutoconfEditor editor;
+ IDocumentProvider documentProvider;
+
+ public AutoconfReconcilingStrategy(AutoconfEditor editor) {
+ outline= editor.getOutlinePage();
+ lastRegionOffset = Integer.MAX_VALUE;
+ this.editor = editor;
+ documentProvider = editor.getDocumentProvider();
+ }
+
+ public void reconcile(IRegion partition) {
+ try {
+ AutoconfParser parser = editor.getAutoconfParser();
+ ((AutoconfErrorHandler)parser.getErrorHandler()).removeAllExistingMarkers();
+ editor.setRootElement(parser.parse(documentProvider.getDocument(editor.getEditorInput())));
+ outline.update();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ public void reconcile(DirtyRegion dirtyRegion, IRegion subRegion) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void setDocument(IDocument document) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfSourceViewerConfiguration.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfSourceViewerConfiguration.java
new file mode 100644
index 0000000000..958cf70ee0
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfSourceViewerConfiguration.java
@@ -0,0 +1,119 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2007 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors;
+
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.text.IDocument;
+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.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.DefaultDamagerRepairer;
+import org.eclipse.jface.text.source.IAnnotationHover;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.text.hover.AutoconfTextHover;
+import org.eclipse.ui.editors.text.TextSourceViewerConfiguration;
+
+
+public class AutoconfSourceViewerConfiguration extends
+ TextSourceViewerConfiguration {
+
+ private ITextHover acHover;
+ private IAnnotationHover aaHover;
+ private AutoconfEditor fEditor;
+
+ public AutoconfSourceViewerConfiguration(IPreferenceStore prefs, AutoconfEditor editor) {
+ super(prefs);
+ fEditor = editor;
+ }
+
+ /*
+ * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getConfiguredDocumentPartitioning(org.eclipse.jface.text.source.ISourceViewer)
+ */
+ public String getConfiguredDocumentPartitioning(ISourceViewer sourceViewer) {
+ return AutoconfEditor.AUTOCONF_PARTITIONING;
+ }
+
+ /*
+ * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getContentAssistant(org.eclipse.jface.text.source.ISourceViewer)
+ */
+ public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
+ ContentAssistant assistant = new ContentAssistant();
+
+ IContentAssistProcessor macroContentAssistProcessor =
+ new AutoconfMacroContentAssistProcessor(new AutoconfMacroCodeScanner(), fEditor);
+ assistant.setContentAssistProcessor(macroContentAssistProcessor, AutoconfPartitionScanner.AUTOCONF_MACRO);
+ assistant.setContentAssistProcessor(macroContentAssistProcessor, IDocument.DEFAULT_CONTENT_TYPE);
+ assistant.enableAutoActivation(true);
+ assistant.setAutoActivationDelay(500);
+ assistant.setProposalPopupOrientation(IContentAssistant.PROPOSAL_OVERLAY);
+ assistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE);
+ assistant.setInformationControlCreator(AutoconfTextHover.getInformationControlCreator());
+
+ return assistant;
+ }
+
+ /* (non-Javadoc)
+ * Method declared on SourceViewerConfiguration
+ */
+ public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
+ return new String[] { IDocument.DEFAULT_CONTENT_TYPE,
+ AutoconfPartitionScanner.AUTOCONF_MACRO,
+ AutoconfPartitionScanner.AUTOCONF_COMMENT};
+ }
+
+ public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) {
+ if (acHover == null)
+ acHover = new AutoconfTextHover(fEditor);
+ return acHover;
+ }
+
+ public IAnnotationHover getAnnotationHover(ISourceViewer sourceViewer) {
+ if (aaHover == null)
+ aaHover = new AutoconfAnnotationHover();
+ return aaHover;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getReconciler(org.eclipse.jface.text.source.ISourceViewer)
+ */
+ public IReconciler getReconciler(ISourceViewer sourceViewer) {
+ MonoReconciler reconciler= new MonoReconciler(new AutoconfReconcilingStrategy(fEditor), false);
+ reconciler.setDelay(1000);
+ reconciler.setProgressMonitor(new NullProgressMonitor());
+ return reconciler;
+ }
+ /* (non-Javadoc)
+ * Method declared on SourceViewerConfiguration
+ */
+ public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
+ PresentationReconciler reconciler = new PresentationReconciler();
+
+ DefaultDamagerRepairer dr= new AutoconfMacroDamagerRepairer(new AutoconfMacroCodeScanner());
+ reconciler.setDamager(dr, AutoconfPartitionScanner.AUTOCONF_MACRO);
+ reconciler.setRepairer(dr, AutoconfPartitionScanner.AUTOCONF_MACRO);
+
+ dr= new DefaultDamagerRepairer(new AutoconfCodeScanner());
+ reconciler.setDamager(dr, AutoconfPartitionScanner.AUTOCONF_COMMENT);
+ reconciler.setRepairer(dr, AutoconfPartitionScanner.AUTOCONF_COMMENT);
+
+ dr= new MultilineRuleDamagerRepairer(new AutoconfCodeScanner());
+ reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE);
+ reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE);
+
+ return reconciler;
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfWhitespaceDetector.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfWhitespaceDetector.java
new file mode 100644
index 0000000000..1219c8d188
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfWhitespaceDetector.java
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * Copyright (c) 2006 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors;
+
+import org.eclipse.jface.text.rules.IWhitespaceDetector;
+
+public class AutoconfWhitespaceDetector implements IWhitespaceDetector {
+
+ public boolean isWhitespace(char c) {
+ return (c == ' ' || c == '\t' || c == '\n' || c == '\r');
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfWordDetector.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfWordDetector.java
new file mode 100644
index 0000000000..1017f97627
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfWordDetector.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2006 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors;
+
+import org.eclipse.jface.text.rules.IWordDetector;
+
+public class AutoconfWordDetector 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/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/IAutotoolEditorActionDefinitionIds.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/IAutotoolEditorActionDefinitionIds.java
new file mode 100644
index 0000000000..74d4f160a7
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/IAutotoolEditorActionDefinitionIds.java
@@ -0,0 +1,17 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2009 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors;
+
+import org.eclipse.linuxtools.cdt.autotools.ui.AutotoolsUIPlugin;
+
+public interface IAutotoolEditorActionDefinitionIds {
+ public static final String SHOW_TOOLTIP = AutotoolsUIPlugin.getUniqueIdentifier() + ".editors.text.show.tooltip"; //$NON-NLS-1$
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/IAutotoolHelpContextIds.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/IAutotoolHelpContextIds.java
new file mode 100644
index 0000000000..cd822f4e23
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/IAutotoolHelpContextIds.java
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2009 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors;
+
+import org.eclipse.linuxtools.cdt.autotools.ui.AutotoolsUIPlugin;
+
+public interface IAutotoolHelpContextIds {
+ public static final String PREFIX = AutotoolsUIPlugin.getUniqueIdentifier();
+ public static final String AC_EDITOR_VIEW = PREFIX + "autoconf_editor"; //$NON-NLS-1$
+ public static final String SHOW_TOOLTIP_ACTION = PREFIX + "show_tooltip_action"; //$NON-NLS-1$
+ public static final String CONTENT_ASSIST = PREFIX + "content_assist"; //$NON-NLS-1$
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/IAutotoolsEditor.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/IAutotoolsEditor.java
new file mode 100644
index 0000000000..0a2c73061b
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/IAutotoolsEditor.java
@@ -0,0 +1,18 @@
+package org.eclipse.linuxtools.cdt.autotools.ui.editors;
+
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake.IReconcilingParticipant;
+import org.eclipse.ui.texteditor.ITextEditor;
+
+
+public interface IAutotoolsEditor extends ITextEditor {
+
+ public Object getAdapter(Class<?> key);
+
+ /**
+ * Adds the given listener.
+ * Has no effect if an identical listener was not already registered.
+ *
+ * @param listener The reconcile listener to be added
+ */
+ public void addReconcilingParticipant(IReconcilingParticipant listener);
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/InlineDataRule.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/InlineDataRule.java
new file mode 100644
index 0000000000..658bae40d5
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/InlineDataRule.java
@@ -0,0 +1,165 @@
+/*******************************************************************************
+ * Copyright (c) 2006 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors;
+
+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.IWordDetector;
+import org.eclipse.jface.text.rules.Token;
+
+public class InlineDataRule implements IRule {
+ /**
+ * The default token to be returned on success and if nothing else has been
+ * specified.
+ */
+ protected IToken token;
+
+ protected IWordDetector fDetector;
+ protected IWhitespaceDetector fWsDetector = new AutoconfWhitespaceDetector();
+
+ /** The column constraint */
+ protected int fColumn = UNDEFINED;
+
+ /** Internal setting for the un-initialized column constraint */
+ protected static final int UNDEFINED = -1;
+
+ /** Buffer used for pattern detection */
+ private StringBuffer fBuffer = new StringBuffer();
+
+ private String fStartingSequence = "<<";
+
+ public InlineDataRule(IToken inToken) {
+ token = inToken;
+ }
+
+ // Confirm an EOL delimeter after already matching first delimeter character.
+ protected boolean confirmDelimeter(ICharacterScanner scanner, char[] delimeter) {
+ int c = scanner.read();
+ StringBuffer buffer = new StringBuffer();
+ buffer.append((char)c);
+ for (int i = 1; i < delimeter.length; ++i) {
+ if (c == delimeter[i]) {
+ c = scanner.read();
+ buffer.append((char)c);
+ } else {
+ for (int j = buffer.length() - 1; j >= 0; j--)
+ scanner.unread();
+ return false;
+ }
+ }
+ scanner.unread();
+ return true;
+ }
+ public IToken evaluate(ICharacterScanner scanner) {
+ int c = scanner.read();
+ fBuffer.setLength(0);
+
+ // Looking for <<WORD or <<-WORD or <<'WORD' at end of line.
+ for (int i = 0; i < fStartingSequence.length(); i++) {
+ fBuffer.append((char) c);
+ if (fStartingSequence.charAt(i) != c) {
+ unreadBuffer(scanner);
+ return Token.UNDEFINED;
+ }
+ c = scanner.read();
+ }
+
+ char[][] lineDelimeters = scanner.getLegalLineDelimiters();
+ StringBuffer endMarkerBuffer = new StringBuffer();
+ if (c == '-') {
+ fBuffer.append((char)c);
+ c = scanner.read();
+ } else if (c == '\'') {
+ fBuffer.append((char)c);
+ c = scanner.read();
+ }
+
+ while (c != ICharacterScanner.EOF &&
+ Character.isJavaIdentifierPart((char)c) &&
+ c != '\'') {
+ fBuffer.append((char)c);
+ endMarkerBuffer.append((char)c);
+ c = scanner.read();
+ }
+
+ if (c == '\'') {
+ fBuffer.append((char)c);
+ c = scanner.read();
+ }
+
+ if (endMarkerBuffer.length() == 0) {
+ unreadBuffer(scanner);
+ return Token.UNDEFINED;
+ }
+
+ // At this point we read until we find id by itself on its own line
+ boolean eol = false;
+ boolean finished = false;
+ boolean foundMarker = false;
+ String endMarker = endMarkerBuffer.toString();
+ while (!finished && c != ICharacterScanner.EOF) {
+ for (int i = 0; i < lineDelimeters.length; ++i) {
+ if (c == lineDelimeters[i][0]) {
+ if (confirmDelimeter(scanner, lineDelimeters[i])) {
+ c = scanner.read();
+ eol = true;
+ break;
+ }
+ }
+ }
+ if (eol) {
+ eol = false;
+ if (foundMarker) {
+ // We get here if we have found the marker by itself
+ // on the line
+ finished = true;
+ } else {
+ foundMarker = false;
+ int j = 0;
+ while (j < endMarker.length()) {
+ if (c == endMarker.charAt(j)) {
+ c = scanner.read();
+ ++j;
+ } else {
+ break;
+ }
+ }
+ if (j == endMarker.length()) {
+ foundMarker = true;
+ }
+ }
+ } else {
+ // otherwise ignore all other characters
+ eol = false;
+ foundMarker = false;
+ c = scanner.read();
+ }
+ }
+
+ // unread last character
+ scanner.unread();
+ return 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();
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/MultilineRuleDamagerRepairer.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/MultilineRuleDamagerRepairer.java
new file mode 100644
index 0000000000..7f9329f68f
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/MultilineRuleDamagerRepairer.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors;
+
+import org.eclipse.jface.text.DocumentEvent;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITypedRegion;
+import org.eclipse.jface.text.rules.DefaultDamagerRepairer;
+import org.eclipse.jface.text.rules.ITokenScanner;
+
+public class MultilineRuleDamagerRepairer extends DefaultDamagerRepairer {
+
+
+ /**
+ * Creates a damager/repairer that uses the given scanner. The scanner may not be <code>null</code>
+ * and is assumed to return only token that carry text attributes.
+ *
+ * @param scanner the token scanner to be used, may not be <code>null</code>
+ */
+ public MultilineRuleDamagerRepairer(ITokenScanner scanner) {
+ super(scanner);
+ }
+
+ /*
+ * @see IPresentationDamager#getDamageRegion(ITypedRegion, DocumentEvent, boolean)
+ */
+ public IRegion getDamageRegion(ITypedRegion partition, DocumentEvent e, boolean documentPartitioningChanged) {
+ // In the case of a partition with multiline rules, we will punt to
+ // reparse the entire partition because we don't know if the line being
+ // edited is in the middle of an area covered by a multiline rule. In
+ // such a case, we need to back up and find the start sequence of the
+ // rule. It is easiest to just reparse the whole partition.
+ return partition;
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/ParseException.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/ParseException.java
new file mode 100644
index 0000000000..d3787ebfb8
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/ParseException.java
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors;
+
+public class ParseException extends Exception {
+
+ static final long serialVersionUID = 1;
+ String message;
+ int severity;
+ int lineNumber;
+ int startColumn;
+ int endColumn;
+ public int getEndColumn() {
+ return endColumn;
+ }
+ public void setEndColumn(int endColumn) {
+ this.endColumn = endColumn;
+ }
+ public int getLineNumber() {
+ return lineNumber;
+ }
+ public void setLineNumber(int lineNumber) {
+ this.lineNumber = lineNumber;
+ }
+ public String getMessage() {
+ return message;
+ }
+ public void setMessage(String message) {
+ this.message = message;
+ }
+ public int getStartColumn() {
+ return startColumn;
+ }
+ public void setStartColumn(int startColumn) {
+ this.startColumn = startColumn;
+ }
+ public ParseException(String message, int lineNumber, int startColumn, int endColumn, int severity) {
+ super();
+ this.message = message;
+ this.lineNumber = lineNumber;
+ this.startColumn = startColumn;
+ this.endColumn = endColumn;
+ this.severity = severity;
+ }
+ public int getSeverity() {
+ return severity;
+ }
+ public void setSeverity(int severity) {
+ this.severity = severity;
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/RecursiveSingleLineRule.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/RecursiveSingleLineRule.java
new file mode 100644
index 0000000000..f5818ab03b
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/RecursiveSingleLineRule.java
@@ -0,0 +1,196 @@
+/*******************************************************************************
+ * Copyright (c) 2006 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors;
+
+import java.util.ArrayList;
+
+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;
+
+public class RecursiveSingleLineRule extends SingleLineRule {
+
+ private ArrayList<IRule> rules;
+ private int evalIndex;
+ private int startIndex;
+ private int endIndex;
+ private int endBoundary;
+ private String startSequence;
+ private String endSequence;
+ /**
+ * Creates a rule for the given starting and ending sequence
+ * which, if detected, will return the specified token.
+ *
+ * @param startSequence the pattern's start sequence
+ * @param endSequence the pattern's end sequence
+ * @param token the token to be returned on success
+ */
+ public RecursiveSingleLineRule(String startSequence, String endSequence, IToken token) {
+ this(startSequence, endSequence, token, (char) 0);
+ }
+
+ /**
+ * Creates a rule for the given starting and ending sequence
+ * which, if detected, will return the specified token.
+ * Any character which follows the given escape character
+ * will be ignored.
+ *
+ * @param startSequence the pattern's start sequence
+ * @param endSequence the pattern's end sequence
+ * @param token the token to be returned on success
+ * @param escapeCharacter the escape character
+ */
+ public RecursiveSingleLineRule(String startSequence, String endSequence, IToken token, char escapeCharacter) {
+ this(startSequence, endSequence, token, escapeCharacter, false);
+ }
+
+ /**
+ * Creates a rule for the given starting and ending sequence
+ * which, if detected, will return the specified token. Alternatively, the
+ * line can also be ended with the end of the file.
+ * Any character which follows the given escape character
+ * will be ignored.
+ *
+ * @param startSequence the pattern's start sequence
+ * @param endSequence the pattern's end sequence
+ * @param token the token to be returned on success
+ * @param escapeCharacter the escape character
+ * @param breaksOnEOF indicates whether the end of the file successfully terminates this rule
+ * @since 2.1
+ */
+ public RecursiveSingleLineRule(String startSequence, String endSequence, IToken token, char escapeCharacter, boolean breaksOnEOF) {
+ super(startSequence, endSequence, token, escapeCharacter, breaksOnEOF);
+ this.startSequence = startSequence;
+ this.endSequence = endSequence;
+ rules = new ArrayList<IRule>();
+ startIndex = 0;
+ endIndex = 0;
+ }
+
+ /**
+ * Creates a rule for the given starting and ending sequence
+ * which, if detected, will return the specified token. Alternatively, the
+ * line can also be ended with the end of the file.
+ * Any character which follows the given escape character
+ * will be ignored. In addition, an escape character immediately before an
+ * end of line can be set to continue the line.
+ *
+ * @param startSequence the pattern's start sequence
+ * @param endSequence the pattern's end sequence
+ * @param token the token to be returned on success
+ * @param escapeCharacter the escape character
+ * @param breaksOnEOF indicates whether the end of the file successfully terminates this rule
+ * @param escapeContinuesLine indicates whether the specified escape character is used for line
+ * continuation, so that an end of line immediately after the escape character does not
+ * terminate the line, even if <code>breakOnEOL</code> is true
+ * @since 3.0
+ */
+ public RecursiveSingleLineRule(String startSequence, String endSequence, IToken token, char escapeCharacter, boolean breaksOnEOF, boolean escapeContinuesLine) {
+ super(startSequence, endSequence, token, escapeCharacter, breaksOnEOF, escapeContinuesLine);
+ this.startSequence = startSequence;
+ this.endSequence = endSequence;
+ rules = new ArrayList<IRule>();
+ startIndex = 0;
+ endIndex = 0;
+ }
+
+ public void addRule(SingleLineRule rule) {
+ rules.add(rule);
+ }
+
+ public IToken getSuccessToken() {
+ // We need to be aware of what success token we are referring to.
+ // The current internal rule index will help us determine which
+ // one.
+ if (evalIndex < rules.size()) {
+ SingleLineRule x = (SingleLineRule)rules.get(evalIndex);
+ return x.getSuccessToken();
+ }
+ return super.getSuccessToken();
+ }
+
+ protected void backupScanner(ICharacterScanner scanner, int position) {
+ int count = scanner.getColumn() - position;
+ while (count-- > 0)
+ scanner.unread();
+ }
+
+ public IToken evaluate(ICharacterScanner scanner, boolean resume) {
+ int column = scanner.getColumn();
+ // Check if we are at EOF, in which case rules don't hold
+ if (column < 0)
+ return Token.UNDEFINED;
+ if (!resume) {
+ evalIndex = 0;
+ // Check if we are within outer rule boundaries.
+ if (column >= endIndex || column < startIndex) {
+ // If not, then we should evaluate to see if the
+ // outer rule is true starting at the current position.
+ startIndex = scanner.getColumn();
+ if (super.evaluate(scanner, false) != Token.UNDEFINED) {
+ // Outer rule is true for a section. Now we can
+ // set the boundaries for the internal rules.
+ // End boundary for internal rules is the start of
+ // the end sequence.
+ endIndex = scanner.getColumn();
+ endBoundary = endIndex - endSequence.length();
+ // Back up scanner to just after start sequence.
+ backupScanner(scanner, startIndex + startSequence.length());
+ return super.getSuccessToken();
+ }
+ else
+ // Outer rule doesn't hold.
+ return Token.UNDEFINED;
+ }
+ }
+
+ // At this point, we want to subdivide up the area covered by the
+ // outer rule into success tokens for internal areas separated by
+ // areas of the outer rule.
+
+ int start = scanner.getColumn();
+ column = start;
+ while (column < endBoundary) {
+ while (evalIndex < rules.size()) {
+ SingleLineRule x = (SingleLineRule)rules.get(evalIndex);
+ IToken token = x.evaluate(scanner, false);
+ if (!token.isUndefined()) {
+ // Found internal token. If we had to read to get
+ // to the start of the internal token, then back up
+ // the scanner to the start of the internal token and
+ // return the initial read area as part of an outer token.
+ // Otherwise, return the internal token.
+ if (column == start) {
+ evalIndex = 0;
+ return token;
+ } else {
+ backupScanner(scanner, column);
+ return super.getSuccessToken();
+ }
+ }
+ ++evalIndex;
+ }
+ evalIndex = 0;
+ scanner.read();
+ ++column;
+ }
+
+ // Outside internal area. Read until end of outer area and return
+ // outer token.
+ while (column++ < endIndex)
+ scanner.read();
+ startIndex = 0;
+ endIndex = 0;
+ return super.getSuccessToken();
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/RestrictedEndOfLineRule.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/RestrictedEndOfLineRule.java
new file mode 100644
index 0000000000..80f7904274
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/RestrictedEndOfLineRule.java
@@ -0,0 +1,130 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors;
+
+import java.util.ArrayList;
+
+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;
+
+public class RestrictedEndOfLineRule extends EndOfLineRule {
+
+ private ArrayList<IRule> rules;
+ private int startIndex;
+ private int endIndex;
+ private String startSequence;
+ private String restrictedChars;
+ /**
+ * Creates a rule for the given starting and ending sequence
+ * which, if detected, will return the specified token.
+ *
+ * @param startSequence the pattern's start sequence
+ * @param restrictedChars chars that stop the sequence
+ * @param token the token to be returned on success
+ */
+ public RestrictedEndOfLineRule(String startSequence, String restrictedChars, IToken token) {
+ this(startSequence, restrictedChars, token, (char) 0);
+ }
+
+ /**
+ * Creates a rule for the given starting and ending sequence
+ * which, if detected, will return the specified token.
+ * Any character which follows the given escape character
+ * will be ignored.
+ *
+ * @param startSequence the pattern's start sequence
+ * @param restrictedChars chars that stop the sequence
+ * @param token the token to be returned on success
+ * @param escapeCharacter the escape character
+ */
+ public RestrictedEndOfLineRule(String startSequence, String restrictedChars, IToken token, char escapeCharacter) {
+ this(startSequence, restrictedChars, token, escapeCharacter, false);
+ }
+
+ /**
+ * Creates a rule for the given starting and ending sequence
+ * which, if detected, will return the specified token. Alternatively, the
+ * line can also be ended with the end of the file.
+ * Any character which follows the given escape character
+ * will be ignored.
+ *
+ * @param startSequence the pattern's start sequence
+ * @param restrictedChars chars that stop the sequence
+ * @param token the token to be returned on success
+ * @param escapeCharacter the escape character
+ * @param breaksOnEOF indicates whether the end of the file successfully terminates this rule
+ * @since 2.1
+ */
+ public RestrictedEndOfLineRule(String startSequence, String restrictedChars, IToken token, char escapeCharacter, boolean breaksOnEOF) {
+ super(startSequence, token, escapeCharacter, breaksOnEOF);
+ this.startSequence = startSequence;
+ this.restrictedChars = restrictedChars;
+ rules = new ArrayList<IRule>();
+ startIndex = 0;
+ endIndex = 0;
+ }
+
+
+ public void addRule(SingleLineRule rule) {
+ rules.add(rule);
+ }
+
+
+ protected void backupScanner(ICharacterScanner scanner, int position) {
+ int count = scanner.getColumn() - position;
+ while (count-- > 0)
+ scanner.unread();
+ }
+
+ public IToken evaluate(ICharacterScanner scanner, boolean resume) {
+ int column = scanner.getColumn();
+ // Check if we are at EOF, in which case rules don't hold
+ if (column < 0)
+ return Token.UNDEFINED;
+ if (!resume) {
+ startIndex = scanner.getColumn();
+ if (super.evaluate(scanner, false) != Token.UNDEFINED) {
+ // Outer rule is true for a section. Now we can
+ // set the boundaries for the internal rules.
+ // End boundary for internal rules is the start of
+ // the end sequence.
+ endIndex = scanner.getColumn();
+ // Back up scanner to just after start sequence.
+ backupScanner(scanner, startIndex + startSequence.length());
+ }
+ else
+ // Base rule doesn't hold.
+ return Token.UNDEFINED;
+ }
+
+ // At this point, we want to check for restricted chars in the
+ // token. If we find them, we stop there.
+
+ int start = scanner.getColumn();
+ column = start;
+ while (column < endIndex) {
+ int ch = scanner.read();
+ if (ch == ICharacterScanner.EOF
+ || restrictedChars.indexOf(ch) >= 0) {
+ scanner.unread();
+ return getSuccessToken();
+ }
+ ++column;
+ }
+ startIndex = 0;
+ endIndex = 0;
+ return getSuccessToken();
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/outline/AutoconfContentOutlinePage.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/outline/AutoconfContentOutlinePage.java
new file mode 100644
index 0000000000..1b1d79268b
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/outline/AutoconfContentOutlinePage.java
@@ -0,0 +1,128 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors.outline;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import org.eclipse.jface.viewers.ISelection;
+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.linuxtools.cdt.autotools.ui.editors.AutoconfEditor;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.AutoconfElement;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.ui.views.contentoutline.ContentOutlinePage;
+
+
+public class AutoconfContentOutlinePage extends ContentOutlinePage {
+
+ private ITextEditor editor;
+ private IEditorInput input;
+
+ public AutoconfContentOutlinePage(AutoconfEditor editor) {
+ super();
+ this.editor = editor;
+ }
+
+ public void setInput(IEditorInput editorInput) {
+ this.input = editorInput;
+ update();
+ }
+
+ @SuppressWarnings("unchecked")
+ protected ISelection updateSelection(ISelection sel) {
+ ArrayList<AutoconfElement> newSelection= new ArrayList<AutoconfElement>();
+ if (sel instanceof IStructuredSelection) {
+ Iterator iter= ((IStructuredSelection)sel).iterator();
+ for (;iter.hasNext();) {
+ //ICElement elem= fInput.findEqualMember((ICElement)iter.next());
+ Object o = iter.next();
+ if (o instanceof AutoconfElement) {
+ newSelection.add((AutoconfElement)o);
+ }
+ }
+ }
+ return new StructuredSelection(newSelection);
+ }
+
+ public void update() {
+ //set the input so that the outlines parse can be called
+ //update the tree viewer state
+ 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);
+// if (input != null)
+// viewer.setInput(input);
+// viewer.expandAll();
+// control.setRedraw(true);
+ ISelection sel= viewer.getSelection();
+ viewer.setSelection(updateSelection(sel));
+ viewer.refresh();
+ }
+ }
+ });
+ }
+ }
+ }
+
+ public void createControl(Composite parent) {
+
+ super.createControl(parent);
+
+ TreeViewer viewer= getTreeViewer();
+ viewer.setContentProvider(new AutoconfContentProvider(editor));
+ viewer.setLabelProvider(new AutoconfLabelProvider());
+ viewer.addSelectionChangedListener(this);
+
+ if (input != null)
+ viewer.setInput(input);
+ }
+
+ /*
+ * Change in selection
+ */
+ public void selectionChanged(SelectionChangedEvent event)
+ {
+ super.selectionChanged(event);
+
+ //find out which item in tree viewer we have selected, and set highlight range accordingly
+ ISelection selection = event.getSelection();
+ if (selection.isEmpty()) {
+ editor.resetHighlightRange();
+ } else {
+ AutoconfElement element = (AutoconfElement) ((IStructuredSelection) selection)
+ .getFirstElement();
+
+ try {
+ int offset = element.getStartOffset();
+ int length = element.getEndOffset() - offset;
+ editor.setHighlightRange(offset, length, true);
+ editor.selectAndReveal(offset, length);
+ } catch (IllegalArgumentException x) {
+ editor.resetHighlightRange();
+ }
+ }
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/outline/AutoconfContentProvider.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/outline/AutoconfContentProvider.java
new file mode 100644
index 0000000000..ea2e4db4db
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/outline/AutoconfContentProvider.java
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors.outline;
+
+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.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.AutoconfEditor;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.AutoconfElement;
+import org.eclipse.ui.texteditor.IDocumentProvider;
+import org.eclipse.ui.texteditor.ITextEditor;
+
+
+public class AutoconfContentProvider implements ITreeContentProvider {
+
+ private IDocumentProvider documentProvider;
+ private AutoconfEditor editor;
+ protected final static String SECTION_POSITIONS = "section_positions";
+ protected IPositionUpdater positionUpdater = new DefaultPositionUpdater(SECTION_POSITIONS);
+
+ public AutoconfContentProvider(ITextEditor editor) {
+ if (editor instanceof AutoconfEditor) {
+ this.editor = (AutoconfEditor) editor;
+ }
+ this.documentProvider = editor.getDocumentProvider();
+ }
+
+ public void dispose() {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ if (oldInput != null)
+ {
+ IDocument document = documentProvider.getDocument(oldInput);
+ if (document != null)
+ {
+ try
+ {
+ document.removePositionCategory(SECTION_POSITIONS);
+ }
+ catch (BadPositionCategoryException x)
+ {
+ }
+ document.removePositionUpdater(positionUpdater);
+ }
+ }
+
+ if (newInput != null)
+ {
+ IDocument document = documentProvider.getDocument(newInput);
+ if (document != null)
+ {
+ document.addPositionCategory(SECTION_POSITIONS);
+ document.addPositionUpdater(positionUpdater);
+ }
+ }
+ }
+
+ public Object[] getChildren(Object parentElement) {
+ if (parentElement instanceof AutoconfElement) {
+ AutoconfElement element = (AutoconfElement)parentElement;
+ return element.getChildren();
+ }
+ return new Object[0];
+ }
+
+ public Object getParent(Object element) {
+ return null;
+ }
+
+ public boolean hasChildren(Object element) {
+ if (element instanceof AutoconfElement) {
+ return ((AutoconfElement)element).hasChildren();
+ }
+ return false;
+ }
+
+ public Object[] getElements(Object inputElement) {
+ return this.getChildren(editor.getRootElement());
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/outline/AutoconfLabelProvider.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/outline/AutoconfLabelProvider.java
new file mode 100644
index 0000000000..944718e741
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/outline/AutoconfLabelProvider.java
@@ -0,0 +1,100 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc., (c) 2008 NOKIA Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ * Ed Swartz (NOKIA) - refactoring
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors.outline;
+
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.AutoconfCaseConditionElement;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.AutoconfCaseElement;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.AutoconfElement;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.AutoconfElifElement;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.AutoconfElseElement;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.AutoconfForElement;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.AutoconfIfElement;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.AutoconfMacroArgumentElement;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.AutoconfMacroElement;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.AutoconfSelectElement;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.AutoconfUntilElement;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.AutoconfWhileElement;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.AutotoolsUIPluginImages;
+import org.eclipse.swt.graphics.Image;
+
+
+public class AutoconfLabelProvider implements ILabelProvider {
+
+ public AutoconfLabelProvider() {
+ super();
+ }
+
+ public void addListener(ILabelProviderListener listener) {
+ }
+
+ public void dispose() {
+ }
+
+ public boolean isLabelProperty(Object element, String property) {
+ return false;
+ }
+
+ public void removeListener(ILabelProviderListener listener) {
+ }
+
+ public Image getImage(Object element) {
+ if (element instanceof AutoconfIfElement)
+ return AutotoolsUIPluginImages.get(AutotoolsUIPluginImages.IMG_OBJS_IF);
+ else if (element instanceof AutoconfElseElement)
+ return AutotoolsUIPluginImages.get(AutotoolsUIPluginImages.IMG_OBJS_ELSE);
+ else if (element instanceof AutoconfElifElement)
+ return AutotoolsUIPluginImages.get(AutotoolsUIPluginImages.IMG_OBJS_ELIF);
+ else if (element instanceof AutoconfCaseElement)
+ return AutotoolsUIPluginImages.get(AutotoolsUIPluginImages.IMG_OBJS_CASE);
+ else if (element instanceof AutoconfCaseConditionElement)
+ return AutotoolsUIPluginImages.get(AutotoolsUIPluginImages.IMG_OBJS_CONDITION);
+ else if (element instanceof AutoconfForElement)
+ return AutotoolsUIPluginImages.get(AutotoolsUIPluginImages.IMG_OBJS_FOR);
+ else if (element instanceof AutoconfWhileElement)
+ return AutotoolsUIPluginImages.get(AutotoolsUIPluginImages.IMG_OBJS_WHILE);
+ else if (element instanceof AutoconfUntilElement)
+ return AutotoolsUIPluginImages.get(AutotoolsUIPluginImages.IMG_OBJS_WHILE); // TODO
+ else if (element instanceof AutoconfSelectElement)
+ return AutotoolsUIPluginImages.get(AutotoolsUIPluginImages.IMG_OBJS_WHILE); // TODO
+ else if (element instanceof AutoconfMacroElement)
+ return AutotoolsUIPluginImages.get(AutotoolsUIPluginImages.IMG_OBJS_ACMACRO);
+ else if (element instanceof AutoconfMacroArgumentElement)
+ return AutotoolsUIPluginImages.get(AutotoolsUIPluginImages.IMG_OBJS_ACMACRO_ARG); // TODO
+ return null;
+ }
+
+ public String getText(Object element) {
+ if (element instanceof AutoconfElement) {
+ AutoconfElement e = (AutoconfElement)element;
+ String result;
+ String name = e.getName();
+ if (name.length() > 31)
+ name = name.substring(0, 31) + "...";
+ String var = e.getVar();
+ if (var != null) {
+ if (var.length() > 15)
+ var = var.substring(0, 15) + "...";
+ var = " " + var; //$NON-NLS-1$
+ } else {
+ var = "";
+ }
+ result = (name + var).replaceAll("(\r|\n| |\t|\f)+", " ");
+ return result;
+ } else if (element instanceof String) {
+ return (String) element;
+ }
+ return "";
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfCaseConditionElement.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfCaseConditionElement.java
new file mode 100644
index 0000000000..d06e73d091
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfCaseConditionElement.java
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors.parser;
+
+public class AutoconfCaseConditionElement extends AutoconfElement {
+
+ public AutoconfCaseConditionElement() {
+ super("");
+ }
+
+ public AutoconfCaseConditionElement(String name) {
+ super(name);
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfCaseElement.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfCaseElement.java
new file mode 100644
index 0000000000..c8ad284dd4
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfCaseElement.java
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors.parser;
+
+public class AutoconfCaseElement extends AutoconfElement {
+
+ public AutoconfCaseElement() {
+ super("case"); //$NON-NLS-1$
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfElement.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfElement.java
new file mode 100644
index 0000000000..4a804cb0be
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfElement.java
@@ -0,0 +1,138 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors.parser;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+
+public class AutoconfElement {
+
+ protected String name;
+ protected String var;
+ protected int startOffset;
+ protected int endOffset;
+ protected ArrayList<AutoconfElement> children;
+ protected AutoconfElement parent;
+ private IDocument document;
+
+ public AutoconfElement(String name) {
+ this(name, null);
+ }
+
+ public AutoconfElement(String name, String var) {
+ this.name = name;
+ this.var = var;
+ this.startOffset = 0;
+ this.children = new ArrayList<AutoconfElement>();
+ }
+
+
+ public String toString() {
+ String source = getSource();
+ if (source == null) {
+ StringBuffer kids = new StringBuffer();
+ for (Iterator<AutoconfElement> iterator = children.iterator(); iterator.hasNext();) {
+ AutoconfElement kid = (AutoconfElement) iterator.next();
+ kids.append(kid.toString());
+ kids.append(","); //$NON-NLS-1$
+ }
+ source = kids.toString();
+ }
+ return getClass().getSimpleName() + ": '" + source + "'"; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ public void addChild(AutoconfElement element) {
+ children.add(element);
+ if (element.getParent() == null)
+ element.setParent(this);
+ }
+
+ public void addSibling(AutoconfElement element) {
+ parent.addChild(element);
+ }
+
+ public AutoconfElement getLastChild() {
+ if (hasChildren())
+ return (AutoconfElement)children.get(children.size() - 1);
+ return null;
+ }
+
+ public AutoconfElement getParent() {
+ return parent;
+ }
+
+ public void setParent(AutoconfElement parent) {
+ this.parent = parent;
+ }
+
+ public AutoconfElement[] getChildren() {
+ return (AutoconfElement[]) children.toArray(new AutoconfElement[children.size()]);
+ }
+
+ public boolean hasChildren() {
+ return !children.isEmpty();
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String string) {
+ this.name = string;
+ }
+
+
+ public String getVar() {
+ return var;
+ }
+
+ public void setVar(String value) {
+ var = value;
+ }
+
+ public void setDocument(IDocument document) {
+ this.document = document;
+ }
+
+ public IDocument getDocument() {
+ return document;
+ }
+
+ public void setStartOffset(int offset) {
+ this.startOffset = offset;
+ }
+
+ public int getStartOffset() {
+ return startOffset;
+ }
+
+ public void setEndOffset(int offset) {
+ this.endOffset = offset;
+ }
+
+ public int getEndOffset() {
+ return endOffset;
+ }
+
+ public String getSource() {
+ if (document != null && startOffset >= 0 && endOffset >= startOffset) {
+ try {
+ return document.get(startOffset, endOffset - startOffset);
+ } catch (BadLocationException e) {
+ return null;
+ }
+ }
+ return null;
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfElifElement.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfElifElement.java
new file mode 100644
index 0000000000..a990ea82d5
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfElifElement.java
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors.parser;
+
+public class AutoconfElifElement extends AutoconfElement {
+
+ public AutoconfElifElement() {
+ super("elif"); //$NON-NLS-1$
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfElseElement.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfElseElement.java
new file mode 100644
index 0000000000..bbaa2c2c76
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfElseElement.java
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors.parser;
+
+public class AutoconfElseElement extends AutoconfElement {
+
+ public AutoconfElseElement() {
+ super("else"); //$NON-NLS-1$
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfForElement.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfForElement.java
new file mode 100644
index 0000000000..6b0ffcc9a4
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfForElement.java
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors.parser;
+
+public class AutoconfForElement extends AutoconfElement {
+
+ public AutoconfForElement() {
+ super("for"); //$NON-NLS-1$
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfIfElement.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfIfElement.java
new file mode 100644
index 0000000000..6ad658979c
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfIfElement.java
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors.parser;
+
+public class AutoconfIfElement extends AutoconfElement {
+
+ public AutoconfIfElement() {
+ super("if"); //$NON-NLS-1$
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfMacroArgumentElement.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfMacroArgumentElement.java
new file mode 100644
index 0000000000..96e3e3d5f3
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfMacroArgumentElement.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2009 Nokia Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.cdt.autotools.ui.editors.parser;
+
+/**
+ * This is a macro argument node. It may also hold
+ * other AutoconfMacroElements. The source range includes any quotes around an argument
+ * but the #getName() has them stripped.
+ * @author eswartz
+ *
+ */
+public class AutoconfMacroArgumentElement extends AutoconfElement {
+
+ public AutoconfMacroArgumentElement() {
+ super(""); // //$NON-NLS-N$
+ }
+ public AutoconfMacroArgumentElement(String name) {
+ super(name);
+ }
+ public String getVar() {
+ return super.getVar();
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfMacroDetector.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfMacroDetector.java
new file mode 100644
index 0000000000..b5c1373583
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfMacroDetector.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc., (c) 2008 Nokia Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ * Ed Swartz (Nokia) - refactoring
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.cdt.autotools.ui.editors.parser;
+
+import java.util.regex.Pattern;
+
+/**
+ *
+ */
+public class AutoconfMacroDetector implements IAutoconfMacroDetector {
+
+ private static final Pattern AUTOCONF_MACRO_PATTERN = Pattern.compile("PKG_.*|AC_.*|AM_.*|m4.*"); //$NON-NLS-1$
+
+ /* (non-Javadoc)
+ * @see org.eclipse.linuxtools.cdt.autotools.core.ui.editors.parser.IAutoconfMacroDetector#isMacroIdentifier(java.lang.String)
+ */
+ public boolean isMacroIdentifier(String name) {
+ return AUTOCONF_MACRO_PATTERN.matcher(name).matches();
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfMacroElement.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfMacroElement.java
new file mode 100644
index 0000000000..1168f910cc
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfMacroElement.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ * Ed Swartz (NOKIA Inc) - support standalone parser
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors.parser;
+
+/**
+ * A call to a macro.
+ * <p>
+ * Macro element now stores arguments as AutoconfMacroElement or AutoconfMacroArgument children
+ *
+ */
+public class AutoconfMacroElement extends AutoconfElement {
+
+ public AutoconfMacroElement(String name) {
+ super(name);
+ }
+
+ public String getVar() {
+ if (children.size() > 0)
+ return getParameter(0);
+ else
+ return null;
+ }
+ public int getParameterCount() {
+ return children.size();
+ }
+
+ public String getParameter(int num) {
+ return ((AutoconfElement) children.get(num)).getName();
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfOutlineErrorHandler.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfOutlineErrorHandler.java
new file mode 100644
index 0000000000..e684ab250f
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfOutlineErrorHandler.java
@@ -0,0 +1,136 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors.parser;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.cdt.core.CCorePlugin;
+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.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.linuxtools.cdt.autotools.ui.AutotoolsUIPlugin;
+import org.eclipse.ui.IStorageEditorInput;
+import org.eclipse.ui.texteditor.MarkerUtilities;
+
+
+public class AutoconfOutlineErrorHandler {
+
+ public static final String PARSE_ERROR_MARKER_ID = AutotoolsUIPlugin.PLUGIN_ID
+ + ".outlineparsefileerror"; //$NON-NLS-1$
+
+ private IFile file;
+ private IDocument document;
+
+ public AutoconfOutlineErrorHandler(IStorageEditorInput input, IDocument document)
+ {
+ this.document = document;
+ IWorkspaceRoot root = CCorePlugin.getWorkspace().getRoot();
+ try {
+ IPath absPath = input.getStorage().getFullPath();
+ IPath rootPath = root.getLocation();
+ IPath relPath = new Path("");
+
+ for (int i = 0; i < rootPath.segmentCount(); ++i) {
+ relPath = relPath.append("../"); //$NON-NLS-1$
+ }
+ relPath = relPath.append(absPath);
+ this.file = root.getFileForLocation(relPath);
+ if (this.file == null) {
+ this.file = root.getFile(relPath);
+ }
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public IDocument getDocument() {
+ return document;
+ }
+
+ public void handleError(ParseException e) {
+ if (!file.exists())
+ return;
+
+ int lineNumber = e.getLineNumber();
+
+ Map<String, Object> map = new HashMap<String, Object>();
+ MarkerUtilities.setLineNumber(map, lineNumber);
+ MarkerUtilities.setMessage(map, e.getMessage());
+ map.put(IMarker.MESSAGE, e.getMessage());
+ map.put(IMarker.LOCATION, file.getFullPath().toString());
+
+ Integer charStart = getCharOffset(lineNumber, e.getStartColumn());
+ if (charStart != null) {
+ map.put(IMarker.CHAR_START, charStart);
+ }
+ Integer charEnd = getCharOffset(lineNumber, e.getEndColumn());
+ if (charEnd != null) {
+ map.put(IMarker.CHAR_END, charEnd);
+ }
+
+ // FIXME: add severity level
+ map.put(IMarker.SEVERITY, new Integer(e.getSeverity()));
+
+ try {
+ MarkerUtilities.createMarker(file, map, PARSE_ERROR_MARKER_ID);
+ } catch (CoreException ee) {
+ ee.printStackTrace();
+ }
+ return;
+ }
+
+ public void removeAllExistingMarkers() {
+ if (!file.exists())
+ return;
+
+ try {
+ file.deleteMarkers(PARSE_ERROR_MARKER_ID, true, IResource.DEPTH_ZERO);
+ } catch (CoreException e1) {
+ e1.printStackTrace();
+ }
+ }
+
+ public void removeExistingMarkers(int offset, int length) {
+ if (!file.exists())
+ return;
+
+ try {
+ IMarker[] markers = file.findMarkers(PARSE_ERROR_MARKER_ID, true, IResource.DEPTH_ZERO);
+ // Delete all markers that start in the given document range.
+ for (int i = 0; i < markers.length; ++i) {
+ IMarker marker = markers[i];
+ int charEnd = MarkerUtilities.getCharEnd(marker);
+ int charStart = MarkerUtilities.getCharStart(marker);
+ if (charStart >= offset && charEnd <= (offset + length))
+ marker.delete();
+ }
+ } catch (CoreException e1) {
+ e1.printStackTrace();
+ }
+ }
+
+ private Integer getCharOffset(int lineNumber, int columnNumber) {
+ try {
+ return new Integer(document.getLineOffset(lineNumber) + columnNumber);
+ } catch (BadLocationException e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfParser.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfParser.java
new file mode 100644
index 0000000000..76963f3f40
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfParser.java
@@ -0,0 +1,1042 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 Red Hat, Inc., (c) 2008 Nokia
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ * Ed Swartz (Nokia) - refactoring
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors.parser;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+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.linuxtools.cdt.autotools.ui.editors.AutoconfEditorMessages;
+
+
+/**
+ * Tokenizing autoconf parser, based on original work by Jeff Johnston
+ * @author eswartz
+ */
+public class AutoconfParser {
+
+ public static final String MISSING_SPECIFIER = "MissingSpecifier"; //$NON-NLS-1$
+ public static final String INVALID_SPECIFIER = "InvalidSpecifier"; //$NON-NLS-1$
+ public static final String INVALID_TERMINATION = "InvalidTermination"; //$NON-NLS-1$
+ public static final String UNTERMINATED_CONSTRUCT = "UnterminatedConstruct"; //$NON-NLS-1$
+ public static final String MISSING_CONDITION = "MissingCondition"; //$NON-NLS-1$
+ public static final String INVALID_ELIF = "InvalidElif"; //$NON-NLS-1$
+ public static final String INVALID_ELSE = "InvalidElse"; //$NON-NLS-1$
+ public static final String INVALID_FI = "InvalidFi"; //$NON-NLS-1$
+ public static final String INVALID_DONE = "InvalidDone"; //$NON-NLS-1$
+ public static final String INVALID_ESAC = "InvalidEsac"; //$NON-NLS-1$
+ public static final String INVALID_DO = "InvalidDo"; //$NON-NLS-1$
+ public static final String INVALID_THEN = "InvalidThen"; //$NON-NLS-1$
+ public static final String INVALID_IN = "InvalidIn"; //$NON-NLS-1$
+ public static final String IMPROPER_CASE_CONDITION = "ImproperCaseCondition"; //$NON-NLS-1$
+ public static final String UNTERMINATED_CASE_CONDITION = "UnterminatedCaseCondition"; //$NON-NLS-1$
+ public static final String UNTERMINATED_INLINE_DOCUMENT = "UnterminatedInlineDocument"; //$NON-NLS-1$
+ public static final String INCOMPLETE_INLINE_MARKER="IncompleteInlineMarker"; //$NON-NLS-1$
+ public static final String MISSING_INLINE_MARKER="MissingInlineMarker"; //$NON-NLS-1$
+ public static final String UNMATCHED_RIGHT_PARENTHESIS = "UnmatchedRightParenthesis"; //$NON-NLS-1$
+ public static final String UNMATCHED_LEFT_PARENTHESIS = "UnmatchedLeftParenthesis"; //$NON-NLS-1$
+
+ private IAutoconfErrorHandler errorHandler;
+ private IAutoconfMacroValidator macroValidator;
+ private AutoconfTokenizer tokenizer;
+ private IAutoconfMacroDetector macroDetector;
+
+ private static final String M4_BUILTINS =
+ "define undefine defn pushdef popdef indir builtin ifdef ifelse shift reverse cond " + //$NON-NLS-1$
+ "dumpdef traceon traceoff debugmode debugfile dnl changequote changecom changeword " + //$NON-NLS-1$
+ "m4wrap " + //$NON-NLS-1$
+ "include sinclude divert undivert divnum len index regexp substr translit patsubst " + //$NON-NLS-1$
+ "format incr decr eval syscmd esyscmd sysval mkstemp maketemp errprint m4exit " + //$NON-NLS-1$
+ "__file__ __line__ __program__ "; //$NON-NLS-1$
+
+ private static List<String> m4builtins = new ArrayList<String>();
+ static {
+ m4builtins.addAll(Arrays.asList(M4_BUILTINS.split(" "))); //$NON-NLS-1$
+ }
+
+ /**
+ * Create a parser for autoconf-style sources.
+ * @param errorHandler
+ * @param macroDetector
+ * @param macroValidator
+ */
+ public AutoconfParser(IAutoconfErrorHandler errorHandler,
+ IAutoconfMacroDetector macroDetector,
+ IAutoconfMacroValidator macroValidator) {
+ this.errorHandler = errorHandler;
+ this.macroDetector = macroDetector;
+ this.macroValidator = macroValidator;
+ }
+
+ /**
+ * Parse the given document and produce an AutoconfElement tree
+ * @param errorHandler
+ * @param macroValidator
+ * @param document
+ * @return element tree
+ */
+ public AutoconfElement parse(IDocument document) {
+ return parse(document, true);
+ }
+
+ /**
+ * Parse the given document and produce an AutoconfElement tree,
+ * and control whether the initial quoting style is m4 style (`...')
+ * or autoconf style ([ ... ]).
+ * @param errorHandler
+ * @param macroValidator
+ * @param document
+ * @param useAutoconfQuotes
+ * @return element tree
+ */
+ public AutoconfElement parse(IDocument document, boolean useAutoconfQuotes) {
+ this.tokenizer = new AutoconfTokenizer(document, errorHandler);
+ if (useAutoconfQuotes)
+ tokenizer.setM4Quote("[", "]"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ AutoconfElement root = new AutoconfRootElement();
+ Token eof = parseTopLevel(root);
+
+ root.setStartOffset(0);
+ root.setDocument(document);
+
+ setSourceEnd(root, eof);
+
+ return root;
+ }
+
+
+ static class BlockEndCondition extends Exception {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+ private Token token;
+
+ public BlockEndCondition(Token token) {
+ this.token = token;
+ }
+
+ public Token getToken() {
+ return token;
+ }
+
+ }
+
+ static class ExprEndCondition extends Exception {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+ private Token token;
+
+ public ExprEndCondition(Token token) {
+ this.token = token;
+ }
+
+ public Token getToken() {
+ return token;
+ }
+
+ }
+
+ /**
+ * Parse individual top-level nodes: divide text into macro calls
+ * and recognized shell constructs. Anything else is not accounted for.
+ * @param parent
+ * @return
+ */
+ protected Token parseTopLevel(AutoconfElement parent) {
+ while (true) {
+ try {
+ parseStatement(parent);
+ } catch (BlockEndCondition e) {
+ // don't terminate here; we may have constructs closed too early
+ Token token = tokenizer.peekToken();
+ if (token.getType() == ITokenConstants.EOF)
+ return token;
+ }
+ }
+ }
+
+ /**
+ * Parse a block of nodes, which starts with an expression and contains
+ * subnodes. Divide text into macro calls and recognized shell constructs.
+ * Anything else is not accounted for.
+ * @param parent
+ */
+ protected void parseBlock(AutoconfElement parent, Token open, AutoconfElement block) throws BlockEndCondition {
+ parent.addChild(block);
+
+ setSourceStart(block, open);
+
+ // get the expression part
+ Token token;
+ try {
+ token = parseBlockExpression(open, block);
+ } catch (BlockEndCondition e) {
+ setSourceEndBefore(block, e.getToken());
+ throw e;
+ }
+
+ // parse the block proper
+ if (token.getType() != ITokenConstants.EOF) {
+ while (true) {
+ try {
+ parseStatement(block);
+ } catch (BlockEndCondition e) {
+ setSourceEnd(block, e.getToken());
+ return;
+ }
+ }
+ } else {
+ setSourceEnd(block, token);
+ }
+ }
+
+ private Token parseBlockExpression(Token open, AutoconfElement block) throws BlockEndCondition {
+ Token token;
+ try {
+ if (block instanceof AutoconfIfElement
+ || block instanceof AutoconfElifElement
+ || block instanceof AutoconfCaseElement
+ || block instanceof AutoconfWhileElement) {
+ token = parseExpression(block);
+ } else if (block instanceof AutoconfForElement) {
+ token = parseForExpression(block);
+ } else {
+ // no expression
+ return open;
+ }
+ block.setVar(getTokenSpanTextBetween(open, token));
+ } catch (BlockEndCondition e) {
+ // oops, premature end
+ setSourceEnd(block, e.getToken());
+ throw e;
+ }
+
+ // check for expected token
+ while (true) {
+ token = tokenizer.readToken();
+ if (token.getType() == ITokenConstants.EOF)
+ break;
+ if (token.getType() != ITokenConstants.EOL)
+ break;
+ }
+
+ if (token.getType() == ITokenConstants.SH_DO) {
+ checkBlockValidity(block, token,
+ new Class[] { AutoconfForElement.class, AutoconfWhileElement.class },
+ INVALID_DO);
+ }
+ else if (token.getType() == ITokenConstants.SH_THEN) {
+ checkBlockValidity(block, token,
+ new Class[] { AutoconfIfElement.class, AutoconfElifElement.class },
+ INVALID_THEN);
+ }
+ else {
+ String exp;
+ if (block instanceof AutoconfIfElement || block instanceof AutoconfElifElement)
+ exp = "then";
+ else
+ exp = "do";
+
+ handleError(block, token, AutoconfEditorMessages.getFormattedString(MISSING_SPECIFIER, exp));
+
+ // assume we're still in the block...
+ tokenizer.unreadToken(token);
+ }
+ return token;
+ }
+
+ /**
+ * Parse a case statement. Scoop up statements into case conditional blocks.
+ * <pre>
+ * 'case' EXPR 'in'
+ * { EXPR ')' { STMTS } ';;' }
+ * 'esac'
+ * </pre>
+ * @param parent
+ * @return
+ */
+ protected void parseCaseBlock(AutoconfElement parent, Token open, AutoconfElement block) throws BlockEndCondition {
+ parent.addChild(block);
+
+ setSourceStart(block, open);
+
+ // get the case expression, terminating at 'in'
+ Token token;
+ try {
+ token = parseCaseExpression(block);
+ } catch (BlockEndCondition e) {
+ // oops, premature end
+ setSourceEnd(block, e.getToken());
+ throw e;
+ }
+
+ block.setVar(getTokenSpanTextBetween(open, token));
+
+ // now get the statements, which are themselves blocks... just read statements
+ // that terminate with ';;' and stuff those into blocks.
+
+ while (true) {
+ AutoconfCaseConditionElement condition = new AutoconfCaseConditionElement();
+
+ // skip EOLs and get the first "real" token
+ while (true) {
+ token = tokenizer.readToken();
+ setSourceStart(condition, token);
+ if (token.getType() == ITokenConstants.EOF)
+ break;
+ if (token.getType() == ITokenConstants.EOL)
+ continue;
+ break;
+ }
+
+ if (token.getType() == ITokenConstants.SH_ESAC) {
+ break;
+ }
+
+ try {
+ Token start = token;
+ token = parseCaseExpression(condition);
+ condition.setName(getTokenSpanTextFromUpTo(start, token));
+
+ while (true) {
+ parseStatement(condition);
+ }
+ } catch (BlockEndCondition e) {
+ setSourceEnd(condition, e.getToken());
+
+ if (condition.getSource().length() > 0)
+ block.addChild(condition);
+
+ if (e.getToken().getType() != ITokenConstants.SH_CASE_CONDITION_END) {
+ token = e.getToken();
+ break;
+ }
+ }
+ }
+
+ setSourceEnd(block, token);
+
+ if (token.getType() != ITokenConstants.SH_ESAC) {
+ handleError(parent, token, AutoconfEditorMessages.getFormattedString(UNTERMINATED_CONSTRUCT, block.getName()));
+ }
+ }
+
+ private String getTokenSpanTextBetween(Token open, Token close) {
+ int startOffset = open.getOffset() + open.getLength();
+ int endOffset = close.getOffset();
+ if (open.getDocument() != close.getDocument())
+ return open.getText();
+
+ String text;
+ try {
+ text = open.getDocument().get(startOffset, endOffset - startOffset).trim();
+ } catch (BadLocationException e) {
+ text = open.getText();
+ // TODO: error
+ }
+
+ return text;
+ }
+
+ private String getTokenSpanTextFromUpTo(Token open, Token close) {
+ int startOffset = open.getOffset();
+ int endOffset = close.getOffset();
+ if (open.getDocument() != close.getDocument())
+ return open.getText();
+
+ String text;
+ try {
+ text = open.getDocument().get(startOffset, endOffset - startOffset).trim();
+ } catch (BadLocationException e) {
+ text = open.getText();
+ // TODO: error
+ }
+
+ return text;
+ }
+ private void setSourceStart(AutoconfElement block, Token open) {
+ int offset = open.getOffset();
+ block.setDocument(open.getDocument());
+ block.setStartOffset(offset);
+ }
+
+ private void setSourceEnd(AutoconfElement block, Token close) {
+ int offset = close.getOffset() + close.getLength();
+ if (block.getDocument() != null && block.getDocument() != close.getDocument())
+ throw new IllegalStateException();
+ block.setDocument(close.getDocument());
+ block.setEndOffset(offset);
+ }
+
+ private void setSourceEndBefore(AutoconfElement block, Token close) {
+ int offset = close.getOffset();
+ if (block.getDocument() != null && block.getDocument() != close.getDocument())
+ throw new IllegalStateException();
+ block.setDocument(close.getDocument());
+ block.setEndOffset(offset);
+ }
+
+ /**
+ * Parse a single statement (macro call or a shell construct).
+ * This can recursively invoke parseBlock() or parseStatement() to populate the tree.
+ * Whenever a token terminates a block, we check its validity and then throw BlockEndCondition.
+ * @param parent the parent into which to add statements. The type of this element is used
+ * to validate the legality of block closing tokens.
+ */
+ protected void parseStatement(AutoconfElement parent) throws BlockEndCondition {
+
+ boolean atStart = true;
+
+ while (true) {
+ Token token = tokenizer.readToken();
+
+ switch (token.getType()) {
+ // 0. Check EOF
+ case ITokenConstants.EOF:
+ AutoconfElement element = parent;
+ while (element != null && !(element instanceof AutoconfRootElement)) {
+ handleError(element, token, AutoconfEditorMessages.getFormattedString(UNTERMINATED_CONSTRUCT, element.getName()));
+ element = element.getParent();
+ }
+ throw new BlockEndCondition(token);
+
+
+ // 1. Check for end of statement
+ case ITokenConstants.EOL:
+ case ITokenConstants.SEMI:
+ return;
+
+
+ // 2. Check macro expansions
+ case ITokenConstants.WORD:
+ checkMacro(parent, token);
+ atStart = false;
+ break;
+
+ // Check for shell constructs. These should appear at the start of a line
+ // or after a semicolon. If they don't, just report an error and continue,
+ // to be tolerant of our own lax parsing.
+
+ // 3.a) Check dollar variables
+ case ITokenConstants.SH_DOLLAR:
+ // skip the next token
+ atStart = false;
+ token = tokenizer.readToken();
+ continue;
+
+ // 3.b) Look for if/else/elif/fi constructs,
+ // being tolerant of nesting problems by allowing
+ // stranded else/elif nodes but reporting errors.
+ case ITokenConstants.SH_IF:
+ checkLineStart(parent, token, atStart);
+ parseBlock(parent, token, new AutoconfIfElement());
+ break;
+
+ case ITokenConstants.SH_ELIF:
+ checkLineStart(parent, token, atStart);
+ checkBlockValidity(
+ parent, token,
+ new Class[] { AutoconfIfElement.class, AutoconfElifElement.class },
+ INVALID_ELIF);
+ parseBlock(parent, token, new AutoconfElifElement());
+ token = tokenizer.peekToken();
+ throw new BlockEndCondition(token);
+
+ case ITokenConstants.SH_ELSE:
+ checkLineStart(parent, token, atStart);
+ checkBlockValidity(
+ parent, token,
+ new Class[] { AutoconfIfElement.class, AutoconfElifElement.class },
+ INVALID_ELSE);
+ parseBlock(parent, token, new AutoconfElseElement());
+ token = tokenizer.peekToken();
+ throw new BlockEndCondition(token);
+
+ case ITokenConstants.SH_FI:
+ checkLineStart(parent, token, atStart);
+ checkBlockValidity(
+ parent, token,
+ new Class[] { AutoconfIfElement.class, AutoconfElifElement.class, AutoconfElseElement.class },
+ INVALID_FI);
+ throw new BlockEndCondition(token);
+
+
+ // 4. Look for for/while loops
+ case ITokenConstants.SH_FOR:
+ checkLineStart(parent, token, atStart);
+ parseBlock(parent, token, new AutoconfForElement());
+ break;
+
+ case ITokenConstants.SH_WHILE:
+ checkLineStart(parent, token, atStart);
+ parseBlock(parent, token, new AutoconfWhileElement());
+ break;
+
+ case ITokenConstants.SH_UNTIL:
+ checkLineStart(parent, token, atStart);
+ parseBlock(parent, token, new AutoconfUntilElement());
+ break;
+
+ case ITokenConstants.SH_SELECT:
+ checkLineStart(parent, token, atStart);
+ parseBlock(parent, token, new AutoconfSelectElement());
+ break;
+
+ case ITokenConstants.SH_DONE:
+ checkLineStart(parent, token, atStart);
+ checkBlockValidity(
+ parent, token,
+ new Class[] { AutoconfForElement.class, AutoconfWhileElement.class,
+ AutoconfUntilElement.class, AutoconfSelectElement.class },
+ INVALID_DONE);
+ throw new BlockEndCondition(token);
+
+ // 5. Look for case statements
+ case ITokenConstants.SH_CASE:
+ checkLineStart(parent, token, atStart);
+ parseCaseBlock(parent, token, new AutoconfCaseElement());
+ break;
+
+ case ITokenConstants.SH_CASE_CONDITION_END:
+ checkBlockValidity(
+ parent, token,
+ new Class[] { AutoconfCaseConditionElement.class },
+ IMPROPER_CASE_CONDITION);
+ throw new BlockEndCondition(token);
+
+ case ITokenConstants.SH_ESAC:
+ checkLineStart(parent, token, atStart);
+ checkBlockValidity(
+ parent, token,
+ // note: we don't strictly recurse here, so accept either parent
+ new Class[] { AutoconfCaseElement.class, AutoconfCaseConditionElement.class },
+ INVALID_ESAC);
+ throw new BlockEndCondition(token);
+
+
+ // 6. Check for HERE documents
+ case ITokenConstants.SH_HERE:
+ case ITokenConstants.SH_HERE_DASH:
+
+ parseHERE(parent, token);
+ break;
+ }
+ }
+ }
+
+ private void checkLineStart(AutoconfElement parent, Token token, boolean atStart) {
+ if (!atStart) {
+ handleError(parent, token, AutoconfEditorMessages.getFormattedString(INVALID_TERMINATION, token.getText()));
+ }
+ }
+
+ /**
+ * Parse the Here document, whose control token is provided (SH_HERE or SH_HERE_DASH).
+ * Contents are thrown away except for any macro calls.
+ * @param parent
+ * @param controlToken
+ */
+ private void parseHERE(AutoconfElement parent, Token controlToken) {
+ Token token = tokenizer.readToken();
+ if (token.getType() == ITokenConstants.EOL || token.getType() == ITokenConstants.EOF) {
+ handleError(parent, token,
+ AutoconfEditorMessages.getString(INCOMPLETE_INLINE_MARKER));
+
+ } else {
+ String hereTag = token.getText();
+
+ boolean atEOL = false;
+ while (true) {
+ token = tokenizer.readToken();
+ if (token.getType() == ITokenConstants.EOF) {
+ handleError(parent, token, AutoconfEditorMessages.getFormattedString(UNTERMINATED_CONSTRUCT, parent.getName()));
+ break;
+ } else if (token.getType() == ITokenConstants.EOL) {
+ atEOL = true;
+ } else {
+ if (atEOL && token.getText().equals(hereTag)) {
+ // only the end if it is also followed by EOL without any whitespace
+ Token eol = tokenizer.readToken();
+ if (eol.getType() == ITokenConstants.EOL && eol.getOffset() == token.getOffset() + token.getLength()) {
+ break;
+ }
+ }
+ if (token.getType() == ITokenConstants.WORD) {
+ checkMacro(parent, token);
+ }
+ atEOL = false;
+ }
+ }
+ }
+ }
+
+ /**
+ * Parse through a single expression up to a semicolon or newline.
+ * Add a macro call to the element or just return upon finding the desired token.
+ * Whenever a token terminates the expression, we check its validity and return the final token
+ * Throw {@link BlockEndCondition} if an unexpected token was found.
+ * @param parent the parent into which to add statements. The type of this element is used
+ * to validate the legality of block closing tokens.
+ */
+ protected Token parseExpression(AutoconfElement parent) throws BlockEndCondition {
+
+ while (true) {
+ Token token = tokenizer.readToken();
+
+ // 0. Ignore comments (tokenizer skipped them!)
+
+ switch (token.getType()) {
+ // 1. Check EOF
+ case ITokenConstants.EOF:
+ throw new BlockEndCondition(token);
+
+ // 2. Check macro expansions
+ case ITokenConstants.WORD:
+ token = checkMacro(parent, token);
+ break;
+
+ // 3. Check expression terminators
+ case ITokenConstants.SEMI:
+ case ITokenConstants.EOL:
+ return token;
+
+ // 4. Handle variables
+ case ITokenConstants.SH_DOLLAR:
+ token = tokenizer.readToken();
+ break;
+
+ case ITokenConstants.SH_IN:
+ // in 'for' or 'select, an 'in' may occur before 'do'
+ if (!(parent instanceof AutoconfForElement)
+ && !(parent instanceof AutoconfSelectElement))
+ return token;
+ // fall through
+
+ // 5. Abort on unexpected tokens
+ case ITokenConstants.SH_DO:
+ case ITokenConstants.SH_THEN:
+ handleError(parent, token, AutoconfEditorMessages.getFormattedString(INVALID_SPECIFIER, token.getText()));
+ tokenizer.unreadToken(token);
+ // close enough...
+ return token;
+
+ case ITokenConstants.SH_ESAC:
+ case ITokenConstants.SH_CASE:
+ case ITokenConstants.SH_CASE_CONDITION_END:
+ case ITokenConstants.SH_FOR:
+ case ITokenConstants.SH_IF:
+ case ITokenConstants.SH_ELIF:
+ case ITokenConstants.SH_ELSE:
+ case ITokenConstants.SH_FI:
+ case ITokenConstants.SH_DONE:
+ handleError(parent, token, AutoconfEditorMessages.getFormattedString(UNTERMINATED_CONSTRUCT, parent.getName()));
+ tokenizer.unreadToken(token);
+ throw new BlockEndCondition(token);
+ }
+ }
+ }
+
+ /**
+ * Parse through a single expression up to 'do'.
+ * Add a macro call to the element or just return upon finding the desired token.
+ * Whenever a token terminates the expression, we check its validity and then throw ExprEndCondition.
+ * Throw {@link BlockEndCondition} if an unexpected token was found.
+ * @param parent the parent into which to add statements. The type of this element is used
+ * to validate the legality of block closing tokens.
+ */
+ protected Token parseForExpression(AutoconfElement parent) throws BlockEndCondition {
+ while (true) {
+ Token token = tokenizer.readToken();
+
+ // 0. Ignore comments (tokenizer skipped them!)
+
+ // 1. Check EOF
+ if (token.getType() == ITokenConstants.EOF) {
+ throw new BlockEndCondition(token);
+ }
+
+ // 2. Check macro expansions
+ else if (token.getType() == ITokenConstants.WORD) {
+ token = checkMacro(parent, token);
+ }
+
+ // 3. Check expression terminators -- not ';' here, but 'do'
+ else if (token.getType() == ITokenConstants.SH_DO) {
+ tokenizer.unreadToken(token);
+ return tokenizer.peekToken();
+ }
+
+ // 4. Abort on unexpected tokens
+ else switch (token.getType()) {
+ case ITokenConstants.SH_THEN:
+ handleError(parent, token, AutoconfEditorMessages.getFormattedString(INVALID_SPECIFIER, token.getText()));
+ tokenizer.unreadToken(token);
+ // close enough...
+ //throw new ExprEndCondition(token);
+ return token;
+
+ case ITokenConstants.SH_ESAC:
+ case ITokenConstants.SH_CASE:
+ case ITokenConstants.SH_CASE_CONDITION_END:
+ case ITokenConstants.SH_FOR:
+ case ITokenConstants.SH_IF:
+ case ITokenConstants.SH_ELIF:
+ case ITokenConstants.SH_ELSE:
+ case ITokenConstants.SH_FI:
+ case ITokenConstants.SH_DONE:
+ handleError(parent, token, AutoconfEditorMessages.getFormattedString(UNTERMINATED_CONSTRUCT, parent.getName()));
+ tokenizer.unreadToken(token);
+ throw new BlockEndCondition(token);
+ }
+ }
+ }
+
+ /**
+ * Parse through a single expression up to 'in'.
+ * Add a macro call to the element or just return upon finding the desired token.
+ * Whenever a token terminates the expression, we check its validity and then throw ExprEndCondition.
+ * Throw {@link BlockEndCondition} if an unexpected token was found.
+ * @param parent the parent into which to add statements. The type of this element is used
+ * to validate the legality of block closing tokens.
+ */
+ protected Token parseCaseExpression(AutoconfElement parent) throws BlockEndCondition {
+ while (true) {
+ Token token = tokenizer.readToken();
+
+ // 0. Ignore comments (tokenizer skipped them!)
+
+ // 1. Check EOF
+ if (token.getType() == ITokenConstants.EOF) {
+ throw new BlockEndCondition(token);
+ }
+
+ // 2. Check macro expansions
+ else if (token.getType() == ITokenConstants.WORD) {
+ token = checkMacro(parent, token);
+ }
+
+ // 3. Check expression terminators
+ else if (parent instanceof AutoconfCaseElement && token.getType() == ITokenConstants.SH_IN) {
+ return token;
+ }
+ else if (parent instanceof AutoconfCaseConditionElement && token.getType() == ITokenConstants.RPAREN) {
+ return token;
+ }
+
+ // 4. Abort on unexpected tokens
+ else switch (token.getType()) {
+ case ITokenConstants.SEMI:
+ case ITokenConstants.SH_IN:
+ case ITokenConstants.RPAREN:
+ case ITokenConstants.SH_DO:
+ case ITokenConstants.SH_THEN:
+ if (parent instanceof AutoconfCaseElement)
+ handleError(parent, token, AutoconfEditorMessages.getString(INVALID_IN));
+ else
+ handleError(parent, token, AutoconfEditorMessages.getString(IMPROPER_CASE_CONDITION));
+ // close enough...
+ return token;
+
+ case ITokenConstants.SH_ESAC:
+ case ITokenConstants.SH_CASE:
+ case ITokenConstants.SH_CASE_CONDITION_END:
+ case ITokenConstants.SH_FOR:
+ case ITokenConstants.SH_IF:
+ case ITokenConstants.SH_ELIF:
+ case ITokenConstants.SH_ELSE:
+ case ITokenConstants.SH_FI:
+ case ITokenConstants.SH_DONE:
+ handleError(parent, token, AutoconfEditorMessages.getFormattedString(UNTERMINATED_CONSTRUCT, parent.getName()));
+ tokenizer.unreadToken(token);
+ throw new BlockEndCondition(token);
+ }
+ }
+ }
+
+ /**
+ * Check a given close block token against the current parent by checking that
+ * the parent's class is one of classes, If a match happens,
+ * optionally push back the token if it will be used to parse new statements in the parent.
+ * Report an error if the parent is not one of the expected kinds.
+ * @param parent
+ * @param token
+ * @param classes
+ */
+ private void checkBlockValidity(
+ AutoconfElement parent,
+ Token token,
+ Class<?>[] classes,
+ String errorMessage) {
+ for (int i = 0; i < classes.length; i++) {
+ if (classes[i].isInstance(parent)) {
+ return;
+ }
+ }
+
+ // not a match
+ handleError(parent, token,
+ AutoconfEditorMessages.getFormattedString(errorMessage, parent.getName(), token.getText()));
+ }
+
+ /**
+ * Check whether the given token is part of a macro, and parse it as such
+ * if necessary.
+ * @param parent
+ * @param token
+ * @return Token last read for the macro call
+ */
+ private Token checkMacro(AutoconfElement parent, Token token) {
+ String name = token.getText();
+
+ boolean hasArguments = tokenizer.peekToken().getType() == ITokenConstants.LPAREN;
+ if (macroDetector != null && macroDetector.isMacroIdentifier(name)) {
+ // ok
+ } else if (m4builtins.contains(name)) {
+ // all of these except dnl take arguments
+ if (!name.equals("dnl") && !hasArguments) //$NON-NLS-1$
+ return token;
+ } else {
+ return token;
+ }
+
+ AutoconfMacroElement macro = new AutoconfMacroElement(name);
+ token = parseMacro(macro, token);
+
+ // handle special macros here
+ if ("dnl".equals(name)) { //$NON-NLS-1$
+ // consume to EOL
+ while (true) {
+ token = tokenizer.readToken();
+ if (token.getType() == ITokenConstants.EOF || token.getType() == ITokenConstants.EOL)
+ break;
+ }
+
+ // ignore macro entirely
+ macro = null;
+ } else if ("changequote".equals(name)) { //$NON-NLS-1$
+ // change quote delimiters
+ validateMacroParameterCount(macro, token, 2);
+
+ // GNU behavior for invalid argument count
+ String parm0 = "`"; //$NON-NLS-1$
+ String parm1 = "'"; //$NON-NLS-1$
+ if (macro.getParameterCount() >= 1)
+ parm0 = macro.getParameter(0);
+ if (macro.getParameterCount() >= 2)
+ parm1 = macro.getParameter(1);
+
+ tokenizer.setM4Quote(parm0, parm1);
+ } else if ("changecom".equals(name)) { //$NON-NLS-1$
+ // change comment delimiters
+ validateMacroParameterCount(macro, token, 2);
+
+ // GNU behavior for invalid argument count
+ String parm0 = "#"; //$NON-NLS-1$
+ String parm1 = "\n"; //$NON-NLS-1$
+ if (macro.getParameterCount() >= 1)
+ parm0 = macro.getParameter(0);
+ if (macro.getParameterCount() >= 2)
+ parm1 = macro.getParameter(1);
+
+ tokenizer.setM4Comment(parm0, parm1);
+ }
+
+ if (macro != null) {
+ parent.addChild(macro);
+ }
+
+ // now validate that the macro is properly terminated
+ if (!(parent instanceof AutoconfMacroArgumentElement)
+ && !(parent instanceof AutoconfMacroElement)
+ && !(parent instanceof AutoconfForElement)) {
+ Token peek = tokenizer.peekToken();
+ if (peek.getType() == ITokenConstants.RPAREN) {
+ handleError(macro, peek, AutoconfEditorMessages.getString(UNMATCHED_RIGHT_PARENTHESIS));
+ }
+ }
+
+ return token;
+ }
+
+ private void validateMacroParameterCount(AutoconfMacroElement macro, Token token, int count) {
+ if (macro.getParameterCount() < count) {
+ handleError(macro, token, AutoconfEditorMessages.getFormattedString("M4MacroArgsTooFew", macro.getName(), new Integer(2))); //$NON-NLS-1$
+ } else if (macro.getParameterCount() > count) {
+ handleError(macro, token, AutoconfEditorMessages.getFormattedString("M4MacroArgsTooMany", macro.getName(), new Integer(2))); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Start parsing a macro call at a suspected macro expansion location.
+ * @param macro
+ * @param line the line containing the start of the
+ * @param parent
+ * @return last token parsed
+ */
+ protected Token parseMacro(AutoconfMacroElement macro, Token macroName) {
+ setSourceStart(macro, macroName);
+
+ // parse any arguments
+ tokenizer.setM4Context(true);
+
+ Token token = tokenizer.readToken();
+ if (token.getType() == ITokenConstants.LPAREN) {
+ token = parseMacroArguments(macro, token);
+ setSourceEnd(macro, token);
+ } else {
+ tokenizer.unreadToken(token);
+ setSourceEnd(macro, macroName);
+ }
+
+ tokenizer.setM4Context(false);
+
+ // validate macro arguments?
+ if (macroValidator != null) {
+ try {
+ macroValidator.validateMacroCall(macro);
+ } catch (ParseException e) {
+ errorHandler.handleError(e);
+ }
+ }
+
+ return token;
+ }
+
+ /**
+ * Parse the arguments for the given macro. These are not interpreted as shell
+ * constructs but just as text with possibly more macro expansions inside.
+ * @param macro
+ * @return final token (')')
+ */
+ protected Token parseMacroArguments(AutoconfMacroElement macro, Token lparen) {
+ Token argStart = null;
+ Token argEnd = null;
+ Token token;
+
+ // When parsing, we want to ignore the whitespace around the arguments.
+ // So, instead of taking the source range "between" a parenthesis and a comma,
+ // track the exact tokens forming the start and end of an argument, defaulting
+ // to the borders of the parentheses and commas if no text is included.
+
+ StringBuffer argBuffer = new StringBuffer();
+ AutoconfMacroArgumentElement arg = new AutoconfMacroArgumentElement();
+
+ while (true) {
+ token = tokenizer.readToken();
+
+ if (token.getType() == ITokenConstants.EOL) {
+ if (argBuffer.length() > 0)
+ argBuffer.append(token.getText());
+ continue;
+ }
+
+ if (token.getType() == ITokenConstants.COMMA
+ || token.getType() == ITokenConstants.RPAREN
+ || token.getType() == ITokenConstants.EOF) {
+
+ arg.setName(argBuffer.toString());
+ argBuffer.setLength(0);
+
+ if (argStart != null && argEnd != null) {
+ setSourceStart(arg, argStart);
+ setSourceEnd(arg, argEnd);
+ } else if (argEnd != null) {
+ setSourceStart(arg, argStart);
+ setSourceEndBefore(arg, token);
+ } else {
+ // empty argument
+ setSourceStart(arg, token);
+ setSourceEndBefore(arg, token);
+ }
+
+ macro.addChild(arg);
+
+ if (token.getType() != ITokenConstants.COMMA)
+ break;
+
+ argStart = null;
+ argEnd = null;
+
+ arg = new AutoconfMacroArgumentElement();
+
+ } else {
+ if (argStart == null) {
+ argStart = token;
+ }
+ argEnd = token;
+
+ if (argBuffer.length() > 0 && token.followsSpace())
+ argBuffer.append(' ');
+ argBuffer.append(token.getText());
+
+ // handle nested macro calls in arguments
+ if (token.getType() == ITokenConstants.WORD) {
+ argEnd = checkMacro(arg, token);
+ }
+ }
+ }
+
+ if (token.getType() != ITokenConstants.RPAREN) {
+ handleError(macro, token, AutoconfEditorMessages.getString(UNMATCHED_LEFT_PARENTHESIS));
+ }
+
+ // note: moved 15-char truncation to AutoconfLabelProvider
+ AutoconfElement[] children = macro.getChildren();
+ if (children.length > 0)
+ macro.setVar(children[0].getVar());
+
+ return token;
+ }
+
+
+
+ protected void handleError(AutoconfElement element, Token token, String message) {
+ handleMessage(element, token, message, IMarker.SEVERITY_ERROR);
+ }
+ protected void handleWarning(AutoconfElement element, Token token, String message) {
+ handleMessage(element, token, message, IMarker.SEVERITY_WARNING);
+ }
+ protected void handleMessage(AutoconfElement element, Token token, String message, int severity) {
+ if (errorHandler != null) {
+ int lineNumber = 0;
+ int startColumn = 0;
+ int endColumn = 0;
+ try {
+ lineNumber = token.getDocument().getLineOfOffset(token.getOffset());
+ int lineOffs = token.getDocument().getLineOffset(lineNumber);
+ startColumn = token.getOffset() - lineOffs;
+ endColumn = startColumn + token.getLength();
+ } catch (BadLocationException e) {
+ // Don't care if we blow up trying to issue marker
+ }
+ errorHandler.handleError(new ParseException(
+ message,
+ token.getOffset(),
+ token.getOffset() + token.getLength(),
+ lineNumber,
+ startColumn, endColumn,
+ severity));
+ }
+ }
+
+ public IAutoconfErrorHandler getErrorHandler() {
+ return errorHandler;
+ }
+}
+
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfRootElement.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfRootElement.java
new file mode 100644
index 0000000000..105d00b88d
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfRootElement.java
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors.parser;
+
+public class AutoconfRootElement extends AutoconfElement {
+
+ public AutoconfRootElement() {
+ super(""); //$NON-NLS-1$
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfSelectElement.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfSelectElement.java
new file mode 100644
index 0000000000..204a45985e
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfSelectElement.java
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors.parser;
+
+public class AutoconfSelectElement extends AutoconfElement {
+
+ public AutoconfSelectElement() {
+ super("select"); //$NON-NLS-1$
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfTokenizer.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfTokenizer.java
new file mode 100644
index 0000000000..6063be4716
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfTokenizer.java
@@ -0,0 +1,435 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2009 Nokia Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.cdt.autotools.ui.editors.parser;
+
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.AutoconfEditorMessages;
+
+
+/**
+ * This tokenizer traverses autotools-style text (m4 or configure.ac) to support the
+ * autoconf parser. It tracks the current context (m4 macro call or shell commands)
+ * to detect appropriate tokens, and tracks the m4 current quote style as well.
+ * <p>
+ * In m4 mode, its primary purpose is to find word boundaries, detect comments and quoted
+ * strings, and to find the macro punctuation tokens. It will not interpret anything
+ * (e.g. '$1' inside a macro) -- this is up to the parser.
+ * <p>
+ * In shell script mode, its primary purpose is to identify enough
+ * tokens to get a general picture of the structure of source for use by the autoconf
+ * parser. This isn't intended to be used for full shell script parsing. In fact,
+ * aside from the known tokens and identifiers, only individual characters will be returned.
+ * <p>
+ * Both modes know about "words" or identifiers and use the same syntax to detect these.
+ * It's expected that the parser will detect a word as a macro or possible macro and
+ * switch the mode of the tokenizer to fit. The parser should invoke "setM4Context(...)"
+ * (and "unreadToken" if necessary) to switch modes.
+ * @author eswartz
+ *
+ */
+public class AutoconfTokenizer {
+
+ private static final String UNTERMINATED_STRING = "UnterminatedString"; //$NON-NLS-1$
+ public static final String UNMATCHED_RIGHT_QUOTE = "UnmatchedRightQuote"; //$NON-NLS-1$
+ public static final String UNMATCHED_LEFT_QUOTE = "UnmatchedLeftQuote"; //$NON-NLS-1$
+ public static final String UNMATCHED_CLOSE_COMMENT = "UnmatchedCloseComment"; //$NON-NLS-1$
+
+ private IDocument document;
+ private int offset;
+ private String m4OpenQuote;
+ private String m4CloseQuote;
+ private String m4OpenComment;
+ private String m4CloseComment;
+ private char[] chars;
+ private int startOffset;
+ private boolean isM4Context;
+ private Token eofToken;
+ private IAutoconfErrorHandler errorHandler;
+
+ /** Create a tokenizer for a document. */
+ public AutoconfTokenizer(IDocument document, IAutoconfErrorHandler errorHandler) {
+ if (document == null /* || macroDetector == null*/)
+ throw new IllegalArgumentException();
+ this.document = document;
+ this.errorHandler = errorHandler;
+
+ this.chars = document.get().toCharArray();
+ this.offset = 0;
+
+ this.eofToken = new Token(ITokenConstants.EOF, "", document, chars.length, 0);
+
+ this.m4OpenQuote = "`"; //$NON-NLS-1$
+ this.m4CloseQuote = "'"; //$NON-NLS-1$
+ this.m4OpenComment = "#"; //$NON-NLS-1$
+ this.m4CloseComment = "\n"; //$NON-NLS-1$
+ }
+
+ /**
+ * Tell whether the tokenizer considers itself to be in an m4 context.
+ * This determines what kinds of tokens it returns.
+ * @return
+ */
+ public boolean isM4Context() {
+ return isM4Context;
+ }
+
+ /**
+ * Switch the tokenizer into or out of m4 context.
+ * @return
+ */
+ public void setM4Context(boolean flag) {
+ isM4Context = flag;
+ }
+
+ /**
+ * Set the m4 quote delimiters
+ */
+ public void setM4Quote(String open, String close) {
+ this.m4OpenQuote = open;
+ this.m4CloseQuote = close;
+ }
+
+ /**
+ * Set the m4 comment delimiters
+ */
+ public void setM4Comment(String open, String close) {
+ this.m4OpenComment = open;
+ this.m4CloseComment = close;
+ }
+
+ /** Push back the given token. This allows the tokenizer to restart from its start position,
+ * potentially in a different context. */
+ public void unreadToken(Token token) {
+ if (token.getLength() > 0 && offset == token.getOffset())
+ throw new IllegalStateException();
+ offset = token.getOffset();
+ }
+
+ /** Read the next token. Returns an EOF token at EOF. */
+ public Token readToken() {
+ if (offset >= chars.length)
+ return eofToken;
+
+ char ch = chars[offset];
+
+ // skip whitespace (but not EOL)
+ while (isWhitespace(ch)) {
+ offset++;
+ if (offset >= chars.length)
+ return eofToken;
+ ch = chars[offset];
+ }
+
+ // in shell mode, strip comments up to eol
+ if (!isM4Context && ch == '#') {
+ while (offset < chars.length) {
+ ch = chars[offset];
+ if (ch == '\n')
+ break;
+ offset++;
+ }
+
+ // keep inside doc if we didn't find that EOL
+ if (offset >= chars.length)
+ offset--;
+ }
+
+ startOffset = offset;
+ StringBuffer buffer = new StringBuffer();
+
+ // check EOL
+ if (ch == '\r' || ch == '\n') {
+ buffer.append(ch);
+ offset++;
+ if (ch == '\r' && offset < chars.length && chars[offset] == '\n') {
+ buffer.append(chars[offset++]);
+ }
+ return makeToken(ITokenConstants.EOL, buffer.toString());
+ }
+
+ // TODO: this parser always uses fixed logic for identifier reading, ignoring m4's "changeword"
+ if (isLeadIdentifierChar(ch)) {
+ return parseWord(ch);
+ }
+
+ // check comments and quotes
+ if (isM4Context) {
+ if (lookAhead(m4OpenComment)) {
+ boolean found = false;
+ // keep reading until the close comment (these are NOT nested)
+ while (offset < chars.length) {
+ if (lookAhead(m4CloseComment)) {
+ found = true;
+ break;
+ }
+ offset++;
+ }
+ if (!found) {
+ handleError(startOffset, offset, AutoconfEditorMessages.getFormattedString(UNMATCHED_CLOSE_COMMENT,
+ m4CloseComment.equals("\n") ? "newline" : m4CloseComment)); //$NON-NLS-1$
+ }
+ return makeToken(ITokenConstants.M4_COMMENT);
+ }
+
+ if (lookAhead(m4OpenQuote)) {
+ return parseQuote();
+ }
+ }
+
+ // check shell punctuation
+ if (!isM4Context) {
+ if (ch == ';' && offset + 1 < chars.length && chars[offset + 1] == ';') {
+ offset += 2;
+ return makeToken(ITokenConstants.SH_CASE_CONDITION_END);
+ }
+ if (ch == '<' && offset + 1 < chars.length && chars[offset + 1] == '<') {
+ offset += 2;
+ if (offset < chars.length && chars[offset] == '-') {
+ offset++;
+ return makeToken(ITokenConstants.SH_HERE_DASH);
+ } else {
+ return makeToken(ITokenConstants.SH_HERE);
+ }
+ }
+ switch (ch) {
+ case '$':
+ offset++;
+ return makeToken(ITokenConstants.SH_DOLLAR);
+ case '[':
+ offset++;
+ return makeToken(ITokenConstants.SH_LBRACKET);
+ case ']':
+ offset++;
+ return makeToken(ITokenConstants.SH_RBRACKET);
+ case '{':
+ offset++;
+ return makeToken(ITokenConstants.SH_LBRACE);
+ case '}':
+ offset++;
+ return makeToken(ITokenConstants.SH_RBRACE);
+ case '\'':
+ return parseString(ITokenConstants.SH_STRING_SINGLE, ch);
+ case '\"':
+ return parseString(ITokenConstants.SH_STRING_DOUBLE, ch);
+ case '`':
+ return parseString(ITokenConstants.SH_STRING_BACKTICK, ch);
+ }
+ }
+
+ // check common punctuation
+ if (ch == ';') {
+ offset++;
+ return makeToken(ITokenConstants.SEMI);
+ }
+ if (ch == ',') {
+ offset++;
+ return makeToken(ITokenConstants.COMMA);
+ }
+ if (ch == '(') {
+ offset++;
+ return makeToken(ITokenConstants.LPAREN);
+ }
+ if (ch == ')') {
+ offset++;
+ return makeToken(ITokenConstants.RPAREN);
+ }
+
+ // unknown text
+ offset++;
+ return makeToken(ITokenConstants.TEXT);
+ }
+
+ private Token parseWord(char ch) {
+ StringBuffer buffer = new StringBuffer();
+
+ buffer.append(ch);
+ offset++;
+ do {
+ if (offset >= chars.length)
+ break;
+ ch = chars[offset];
+ if (!isIdentifierChar(ch))
+ break;
+ buffer.append(ch);
+ offset++;
+ } while (true);
+
+ String text = buffer.toString();
+
+ if (!isM4Context) {
+ // detect sh tokens
+ if ("case".equals(text))
+ return makeToken(ITokenConstants.SH_CASE, text);
+ if ("in".equals(text))
+ return makeToken(ITokenConstants.SH_IN, text);
+ if ("esac".equals(text))
+ return makeToken(ITokenConstants.SH_ESAC, text);
+ if ("while".equals(text))
+ return makeToken(ITokenConstants.SH_WHILE, text);
+ if ("select".equals(text))
+ return makeToken(ITokenConstants.SH_SELECT, text);
+ if ("until".equals(text))
+ return makeToken(ITokenConstants.SH_UNTIL, text);
+ if ("for".equals(text))
+ return makeToken(ITokenConstants.SH_FOR, text);
+ if ("do".equals(text))
+ return makeToken(ITokenConstants.SH_DO, text);
+ if ("done".equals(text))
+ return makeToken(ITokenConstants.SH_DONE, text);
+ if ("if".equals(text))
+ return makeToken(ITokenConstants.SH_IF, text);
+ if ("then".equals(text))
+ return makeToken(ITokenConstants.SH_THEN, text);
+ if ("else".equals(text))
+ return makeToken(ITokenConstants.SH_ELSE, text);
+ if ("elif".equals(text))
+ return makeToken(ITokenConstants.SH_ELIF, text);
+ if ("fi".equals(text))
+ return makeToken(ITokenConstants.SH_FI, text);
+ }
+
+ // other identifier-looking word
+ return makeToken(ITokenConstants.WORD, text);
+ }
+
+ private Token parseQuote() {
+ // read text, honoring nested quotes, but don't put the outermost quotes in the token
+
+ StringBuffer buffer = new StringBuffer();
+
+ int quoteLevel = 1;
+ // keep reading until the close quote
+ while (offset < chars.length) {
+ if (lookAhead(m4CloseQuote)) {
+ quoteLevel--;
+ if (quoteLevel == 0)
+ break;
+ buffer.append(m4CloseQuote);
+ } else if (lookAhead(m4OpenQuote)) {
+ buffer.append(m4OpenQuote);
+ quoteLevel++;
+ } else {
+ buffer.append(chars[offset]);
+ offset++;
+ }
+ }
+
+ if (quoteLevel > 0) {
+ handleError(startOffset, offset, AutoconfEditorMessages.getFormattedString(UNMATCHED_LEFT_QUOTE, m4CloseQuote));
+ } else if (quoteLevel < 0) {
+ handleError(startOffset, offset, AutoconfEditorMessages.getFormattedString(UNMATCHED_RIGHT_QUOTE, m4OpenQuote));
+ }
+
+ return makeToken(ITokenConstants.M4_STRING, buffer.toString());
+ }
+
+ private Token parseString(int type, char terminal) {
+ startOffset = offset;
+ offset++;
+
+ StringBuffer buffer = new StringBuffer();
+
+ char ch = 0;
+ while (offset < chars.length) {
+ ch = chars[offset++];
+ if (ch == '\\') {
+ if (offset < chars.length)
+ buffer.append(chars[offset++]);
+ else
+ buffer.append(ch);
+ } else if (ch == terminal) {
+ break;
+ } else {
+ buffer.append(ch);
+ }
+ }
+
+ if (ch != terminal) {
+ handleError(startOffset, offset, AutoconfEditorMessages.getFormattedString(UNTERMINATED_STRING, "" + ch));
+ }
+
+ return makeToken(type, buffer.toString());
+ }
+
+ private void handleError(int start, int end,
+ String message) {
+ if (errorHandler != null) {
+ int lineNumber = 0;
+ int startColumn = 0;
+ int endColumn = 0;
+ try {
+ lineNumber = document.getLineOfOffset(start);
+ int lineOffs = document.getLineOffset(lineNumber);
+ startColumn = start - lineOffs;
+ endColumn = end - lineOffs;
+ } catch (BadLocationException e) {
+ // Don't care if we blow up trying to issue marker
+ }
+ errorHandler.handleError(new ParseException(
+ message,
+ start, end,
+ lineNumber,
+ startColumn, endColumn,
+ IMarker.SEVERITY_ERROR));
+ }
+ }
+
+ /**
+ * Look ahead for the given string. If found, return true, and have
+ * offset updated. Otherwise, return false with offset unchanged.
+ * @param keyword
+ * @param text
+ * @return
+ */
+ private boolean lookAhead(String keyword) {
+ int length = keyword.length();
+ if (offset + length > chars.length) {
+ return false;
+ }
+ for (int idx = 0; idx < length; idx++) {
+ if (chars[offset + idx] != keyword.charAt(idx))
+ return false;
+ }
+ offset += length;
+ return true;
+ }
+
+ private boolean isWhitespace(char ch) {
+ return ch == ' ' || ch == '\t' || ch == '\f';
+ }
+
+ private Token makeToken(int type) {
+ return new Token(type,
+ new String(chars, startOffset, offset - startOffset),
+ document, startOffset, offset - startOffset);
+ }
+
+ private Token makeToken(int type, String text) {
+ return new Token(type, text, document, startOffset, offset - startOffset);
+ }
+
+ private boolean isIdentifierChar(char ch) {
+ return isLeadIdentifierChar(ch) || (ch >= '0' && ch <= '9');
+ }
+
+ private boolean isLeadIdentifierChar(char ch) {
+ return (ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z') || ch == '_';
+ }
+
+ public Token peekToken() {
+ Token token = readToken();
+ unreadToken(token);
+ return token;
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfUntilElement.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfUntilElement.java
new file mode 100644
index 0000000000..979ffe4940
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfUntilElement.java
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors.parser;
+
+public class AutoconfUntilElement extends AutoconfElement {
+
+ public AutoconfUntilElement() {
+ super("until"); //$NON-NLS-1$
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfWhileElement.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfWhileElement.java
new file mode 100644
index 0000000000..169edd7ed0
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfWhileElement.java
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors.parser;
+
+public class AutoconfWhileElement extends AutoconfElement {
+
+ public AutoconfWhileElement() {
+ super("while"); //$NON-NLS-1$
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/IAutoconfErrorHandler.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/IAutoconfErrorHandler.java
new file mode 100644
index 0000000000..1363240bbc
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/IAutoconfErrorHandler.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.cdt.autotools.ui.editors.parser;
+
+
+/**
+ * Clients implement this interface to handle errors encountered while parsing.
+ * @author eswartz
+ *
+ */
+public interface IAutoconfErrorHandler {
+
+ /**
+ * Handle an exception associated with the given element
+ * @param exception the exception to handle; has a line number
+ * at the time of call
+ */
+ void handleError(ParseException exception);
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/IAutoconfMacroDetector.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/IAutoconfMacroDetector.java
new file mode 100644
index 0000000000..e4387316e5
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/IAutoconfMacroDetector.java
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.cdt.autotools.ui.editors.parser;
+
+
+/**
+ * Clients implement this interface to identify what identifiers represent
+ * macros for the autoconf tree.
+ * @author eswartz
+ *
+ */
+public interface IAutoconfMacroDetector {
+
+ /**
+ * Tell if this identifier should be treated as an m4 macro call.
+ * The identifier has already been judged to be a valid candidate
+ * (i.e. it's not quoted).
+ * @param name the string to check
+ */
+ boolean isMacroIdentifier(String name);
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/IAutoconfMacroValidator.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/IAutoconfMacroValidator.java
new file mode 100644
index 0000000000..2a54ee4773
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/IAutoconfMacroValidator.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.cdt.autotools.ui.editors.parser;
+
+
+/**
+ * Clients implement this interface to validate macro calls.
+ * @author eswartz
+ *
+ */
+public interface IAutoconfMacroValidator {
+
+ /**
+ * Validate the given macro call.
+ * @param element macro call, never <code>null</code>
+ * @throws ParseException if the call doesn't match the expected number of elements
+ */
+ void validateMacroCall(AutoconfMacroElement element) throws ParseException;
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/IMacroDetector.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/IMacroDetector.java
new file mode 100644
index 0000000000..b225942cfe
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/IMacroDetector.java
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.cdt.autotools.ui.editors.parser;
+
+/**
+ * Clients implement this interface to detect whether a given identifier
+ * represents a known or potential macro in m4 or configure.ac text.
+ * @author eswartz
+ *
+ */
+public interface IMacroDetector {
+ boolean isMacro(String identifier);
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/ITokenConstants.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/ITokenConstants.java
new file mode 100644
index 0000000000..b665115f8d
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/ITokenConstants.java
@@ -0,0 +1,87 @@
+package org.eclipse.linuxtools.cdt.autotools.ui.editors.parser;
+
+public interface ITokenConstants {
+
+ /** end of file */
+ public static final int EOF = 0;
+ /** end of line */
+ public static final int EOL = 1;
+
+ /** an open parenthesis */
+ public static final int LPAREN = 2;
+ /** a close parenthesis */
+ public static final int RPAREN = 3;
+ /** a comma */
+ public static final int COMMA = 4;
+ /** a semicolon */
+ public static final int SEMI = 5;
+
+ /** a word (either m4 word or shell identifier-looking word) */
+ public static final int WORD = 6;
+
+ /** other text (usually punctuation or number, one char at a time) */
+ public static final int TEXT = 7;
+
+ /** an m4 string (the text does not contain the outermost quotes) */
+ public static final int M4_STRING = 21;
+ /** an m4 comment (as determined by changecomment, NOT dnl) */
+ public static final int M4_COMMENT = 22;
+
+ /** the sh 'if' token */
+ public static final int SH_IF = 40;
+ /** the sh 'then' token */
+ public static final int SH_THEN = 41;
+ /** the sh 'else' token */
+ public static final int SH_ELSE = 42;
+ /** the sh 'elif' token */
+ public static final int SH_ELIF = 43;
+ /** the sh 'fi' token */
+ public static final int SH_FI = 44;
+
+ /** the sh 'while' token */
+ public static final int SH_WHILE = 45;
+ /** the sh 'for' token */
+ public static final int SH_FOR = 46;
+ /** the sh 'select' token */
+ public static final int SH_SELECT = 47;
+ /** the sh 'until' token */
+ public static final int SH_UNTIL = 48;
+ /** the sh 'do' token */
+ public static final int SH_DO = 49;
+ /** the sh 'done' token */
+ public static final int SH_DONE = 50;
+ /** the sh 'case' token */
+
+ public static final int SH_CASE = 51;
+ /** the sh 'in' token */
+ public static final int SH_IN = 52;
+ /** the sh ';;' token */
+ public static final int SH_CASE_CONDITION_END = 53;
+ /** the sh 'esac' token */
+ public static final int SH_ESAC = 54;
+
+ /** the sh '$' token */
+ public static final int SH_DOLLAR = 60;
+
+ /** the sh '{' token */
+ public static final int SH_LBRACE = 61;
+ /** the sh '}' token */
+ public static final int SH_RBRACE = 62;
+ /** the sh '[' token */
+ public static final int SH_LBRACKET = 63;
+ /** the sh ']' token */
+ public static final int SH_RBRACKET = 64;
+
+ /** the sh '<<' token */
+ public static final int SH_HERE = 65;
+ /** the sh '<<-' token */
+ public static final int SH_HERE_DASH = 66;
+ /** an sh double-quoted string */
+ public static final int SH_STRING_DOUBLE = 67;
+ /** an sh single-quoted string */
+ public static final int SH_STRING_SINGLE = 68;
+ /** an sh backtick-quoted string */
+ public static final int SH_STRING_BACKTICK = 69;
+
+
+} \ No newline at end of file
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/ParseException.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/ParseException.java
new file mode 100644
index 0000000000..f0bc442469
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/ParseException.java
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors.parser;
+
+public class ParseException extends Exception {
+
+ static final long serialVersionUID = 1;
+ String message;
+ int severity;
+ int lineNumber;
+ int startColumn;
+ int endColumn;
+ private int startOffset;
+ private int endOffset;
+ public int getEndColumn() {
+ return endColumn;
+ }
+ public void setEndColumn(int endColumn) {
+ this.endColumn = endColumn;
+ }
+ public int getLineNumber() {
+ return lineNumber;
+ }
+ public void setLineNumber(int lineNumber) {
+ this.lineNumber = lineNumber;
+ }
+ public String getMessage() {
+ return message;
+ }
+ public void setMessage(String message) {
+ this.message = message;
+ }
+ public int getStartColumn() {
+ return startColumn;
+ }
+ public void setStartColumn(int startColumn) {
+ this.startColumn = startColumn;
+ }
+ public ParseException(String message,
+ int startOffset, int endOffset,
+ int lineNumber, int startColumn, int endColumn, int severity) {
+ super();
+ this.message = message;
+ this.startOffset = startOffset;
+ this.endOffset = endOffset;
+ this.lineNumber = lineNumber;
+ this.startColumn = startColumn;
+ this.endColumn = endColumn;
+ this.severity = severity;
+ }
+ public int getSeverity() {
+ return severity;
+ }
+ public void setSeverity(int severity) {
+ this.severity = severity;
+ }
+ public int getStartOffset() {
+ return startOffset;
+ }
+ public int getEndOffset() {
+ return endOffset;
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/Token.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/Token.java
new file mode 100644
index 0000000000..9690363b4b
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/Token.java
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.cdt.autotools.ui.editors.parser;
+
+import org.eclipse.jface.text.IDocument;
+
+/**
+ * A single token parsed from an autotools-style file. This represents m4 and sh
+ * tokens. Punctuation characters shared by both are not in a namespace.
+ *
+ * @author eswartz
+ *
+ */
+public class Token implements ITokenConstants {
+ /** Type:
+ * @see ITokenConstants
+ */
+ final int type;
+ /**
+ * Text of token, possibly interpreted or reduced from original characters
+ */
+ final String text;
+ /**
+ * Offset of token before interpretation
+ */
+ final int offset;
+ /**
+ * Length of token before interpretation
+ */
+ final int length;
+ /**
+ * The document providing the text
+ */
+ final IDocument document;
+
+ public Token(int type, String text, IDocument document, int offset, int length) {
+ this.type = type;
+ this.text = text;
+ this.document = document;
+ this.offset = offset;
+ this.length = length;
+ }
+
+ public String toString() {
+ return text;
+ }
+
+ public int getType() {
+ return type;
+ }
+
+ public String getText() {
+ return text;
+ }
+
+ public IDocument getDocument() {
+ return document;
+ }
+
+ public int getOffset() {
+ return offset;
+ }
+
+ public int getLength() {
+ return length;
+ }
+
+ public boolean followsSpace() {
+ char[] text = document.get().toCharArray();
+ if (offset == 0)
+ return false;
+ return (" \t\r\n\f".indexOf(text[offset - 1]) >= 0);
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/AbstractAutotoolsCPropertyTab.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/AbstractAutotoolsCPropertyTab.java
new file mode 100644
index 0000000000..3459ea07fb
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/AbstractAutotoolsCPropertyTab.java
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui;
+
+import org.eclipse.cdt.managedbuilder.ui.properties.AbstractCBuildPropertyTab;
+
+public abstract class AbstractAutotoolsCPropertyTab extends
+ AbstractCBuildPropertyTab {
+
+ public boolean isIndexerAffected() {
+ return false;
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/AutotoolsConsole.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/AutotoolsConsole.java
new file mode 100644
index 0000000000..982764a120
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/AutotoolsConsole.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 2004, 2009 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ * Red Hat Inc - Adapted for Autotools usage
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui;
+
+import org.eclipse.cdt.ui.IBuildConsoleManager;
+import org.eclipse.core.resources.IProject;
+
+public class AutotoolsConsole extends Console {
+ IProject project;
+ IBuildConsoleManager fConsoleManager;
+
+ private static final String CONTEXT_MENU_ID = "CAutotoolsConsole"; //$NON-NLS-1$
+ private static final String CONSOLE_NAME = ConsoleMessages.getString("AutotoolsConsole.name"); //$NON-NLS-1$
+
+ public AutotoolsConsole() {
+ super(CONSOLE_NAME, CONTEXT_MENU_ID);
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/AutotoolsUIPluginImages.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/AutotoolsUIPluginImages.java
new file mode 100644
index 0000000000..7314abcbd0
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/AutotoolsUIPluginImages.java
@@ -0,0 +1,133 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2007, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * QNX Software System
+ * Red Hat Inc. - completely modified for Autotools usage
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.eclipse.cdt.ui.CUIPlugin;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.linuxtools.cdt.autotools.ui.AutotoolsUIPlugin;
+import org.eclipse.swt.graphics.Image;
+
+
+/**
+ * Bundle of all images used by the C plugin.
+ */
+public class AutotoolsUIPluginImages {
+
+ // The plugin registry
+ private static ImageRegistry imageRegistry = new ImageRegistry(CUIPlugin.getStandardDisplay());
+
+ // Subdirectory (under the package containing this class) where 16 color images are
+ private static URL fgIconBaseURL;
+
+ static {
+ try {
+ fgIconBaseURL= new URL(AutotoolsUIPlugin.getDefault().getBundle().getEntry("/"), "icons/" ); //$NON-NLS-1$ //$NON-NLS-2$
+ } catch (MalformedURLException e) {
+ CUIPlugin.log(e);
+ }
+ }
+ private static final String NAME_PREFIX= AutotoolsUIPlugin.PLUGIN_ID + '.';
+ private static final int NAME_PREFIX_LENGTH= NAME_PREFIX.length();
+
+ public static final String T_OBJ= "ac16/"; //$NON-NLS-1$
+ public static final String T_BUILD= "elcl16/"; //$NON-NLS-1$
+
+ public static final String IMG_OBJS_IF= NAME_PREFIX + "if_obj.gif"; //$NON-NLS-1$
+ public static final String IMG_OBJS_ELSE= NAME_PREFIX + "else_obj.gif"; //$NON-NLS-1$
+ public static final String IMG_OBJS_ELIF= NAME_PREFIX + "elif_obj.gif"; //$NON-NLS-1$
+ public static final String IMG_OBJS_CASE= NAME_PREFIX + "case_obj.gif"; //$NON-NLS-1$
+ public static final String IMG_OBJS_CONDITION= NAME_PREFIX + "condition_obj.gif"; //$NON-NLS-1$
+ public static final String IMG_OBJS_FOR= NAME_PREFIX + "for_obj.gif"; //$NON-NLS-1$
+ public static final String IMG_OBJS_WHILE= NAME_PREFIX + "while_obj.gif"; //$NON-NLS-1$
+ public static final String IMG_OBJS_ACMACRO= NAME_PREFIX + "acmacro_obj.gif"; //$NON-NLS-1$
+ public static final String IMG_OBJS_AMMACRO= NAME_PREFIX + "ammacro_obj.gif"; //$NON-NLS-1$
+ public static final String IMG_OBJS_ACMACRO_ARG = NAME_PREFIX + "acmacro_arg_obj.gif"; // $NON-NLS-1$
+ public static final String IMG_BUILD_CONFIG = NAME_PREFIX + "build_configs.gif"; //$NON-NLS-1$
+ public static final String IMG_CFG_CATEGORY = NAME_PREFIX + "config_category.gif"; //$NON-NLS-1$
+ public static final String IMG_CFG_TOOL = NAME_PREFIX + "config_tool.gif"; //$NON-NLS-1$
+
+ public static final ImageDescriptor DESC_OBJS_IF= createManaged(T_OBJ, IMG_OBJS_IF);
+ public static final ImageDescriptor DESC_OBJS_ELSE= createManaged(T_OBJ, IMG_OBJS_ELSE);
+ public static final ImageDescriptor DESC_OBJS_ELIF= createManaged(T_OBJ, IMG_OBJS_ELIF);
+ public static final ImageDescriptor DESC_OBJS_CASE= createManaged(T_OBJ, IMG_OBJS_CASE);
+ public static final ImageDescriptor DESC_OBJS_CONDITION = createManaged(T_OBJ, IMG_OBJS_CONDITION);
+ public static final ImageDescriptor DESC_OBJS_FOR= createManaged(T_OBJ, IMG_OBJS_FOR);
+ public static final ImageDescriptor DESC_OBJS_WHILE= createManaged(T_OBJ, IMG_OBJS_WHILE);
+ public static final ImageDescriptor DESC_OBJS_ACMACRO= createManaged(T_OBJ, IMG_OBJS_ACMACRO);
+ public static final ImageDescriptor DESC_OBJS_AMMACRO= createManaged(T_OBJ, IMG_OBJS_AMMACRO);
+ public static final ImageDescriptor DESC_OBJS_ACMACRO_ARG= createManaged(T_OBJ, IMG_OBJS_ACMACRO_ARG);
+ public static final ImageDescriptor DESC_BUILD_CONFIG = createManaged(T_BUILD, IMG_BUILD_CONFIG);
+ public static final ImageDescriptor DESC_CFG_CATEGORY = createManaged(T_BUILD, IMG_CFG_CATEGORY);
+ public static final ImageDescriptor DESC_CFG_TOOL = createManaged(T_BUILD, IMG_CFG_TOOL);
+
+ 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.log(e);
+ return null;
+ }
+ }
+
+ /**
+ * Sets all available image descriptors for the given action.
+ */
+ public static void setImageDescriptors(IAction action, String type, String relPath) {
+ if (relPath.startsWith(NAME_PREFIX))
+ 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$
+
+ // We are still not sure about this, let see TF results first.
+ // Use the managed version so that we ensure that there is no resource handle leaks
+ // Let the widget itself manage the disabled/hover attribution. This was a huge leak
+ //ImageDescriptor desc = getImageRegistry().getDescriptor(relPath);
+ //if(desc == null) {
+ // desc = createManaged(T + "c" + type, relPath);
+ //}
+ //action.setImageDescriptor(desc);
+ }
+
+ /**
+ * Helper method to access the image registry from the CUIPlugin class.
+ */
+ static ImageRegistry getImageRegistry() {
+ return imageRegistry;
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/CBuildStepsConsole.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/CBuildStepsConsole.java
new file mode 100644
index 0000000000..5ba325974f
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/CBuildStepsConsole.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 2004, 2009 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ * Red Hat Inc - Adapted for Autotools usage
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui;
+
+import org.eclipse.cdt.ui.IBuildConsoleManager;
+import org.eclipse.core.resources.IProject;
+
+public class CBuildStepsConsole extends Console {
+ IProject project;
+ IBuildConsoleManager fConsoleManager;
+
+ private static final String CONTEXT_MENU_ID = "CAutotoolsBuildStepsConsole"; //$NON-NLS-1$
+ private static final String CONSOLE_NAME = ConsoleMessages.getString("BuildStepsConsole.name"); //$NON-NLS-1$
+
+ public CBuildStepsConsole() {
+ super(CONSOLE_NAME, CONTEXT_MENU_ID);
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/CConfigureConsole.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/CConfigureConsole.java
new file mode 100644
index 0000000000..1925fcd7c2
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/CConfigureConsole.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 2004, 2009 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui;
+
+import org.eclipse.cdt.ui.IBuildConsoleManager;
+import org.eclipse.core.resources.IProject;
+
+public class CConfigureConsole extends Console {
+ IProject project;
+ IBuildConsoleManager fConsoleManager;
+
+ private static final String CONTEXT_MENU_ID = "CAutotoolsConfigureConsole"; //$NON-NLS-1$
+ private static final String CONSOLE_NAME = ConsoleMessages.getString("ConfigureConsole.name"); //$NON-NLS-1$
+
+ public CConfigureConsole() {
+ super(CONSOLE_NAME, CONTEXT_MENU_ID);
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/CWordFinder.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/CWordFinder.java
new file mode 100644
index 0000000000..cc28694b10
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/CWordFinder.java
@@ -0,0 +1,283 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.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;
+
+
+/**
+ * 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 {
+
+ private static final char CBRACE_L = '{';
+ private static final char CBRACE_R = '}';
+ private static final char BRACE_R = ')';
+
+ /**
+ * 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 + 1;
+
+ 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
+ return new Region(start, end - start);
+ }
+
+ 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;
+ }
+
+ /**
+ * This method will determine whether current offset is contained
+ * in any function's body or it's outside it.
+ *
+ * @param document
+ * The document to be examined
+ * @param offset
+ * The offset into the document
+ * @return
+ * <code>true</code> if there is no function body around offset
+ * <code>false</code> otherwise
+ */
+ public static boolean isGlobal(IDocument document, int offset) {
+ try {
+ int pos = offset;
+ int bracketcount = 0;
+ char c;
+
+ //Find left curled bracket from our position
+ while (pos > 0) {
+ c = document.getChar(pos--);
+
+ if (c == CBRACE_R) {
+ bracketcount++; // take into account nested blocks
+ } else if (c == CBRACE_L) {
+ if (bracketcount-- == 0) {
+ do {
+ c = document.getChar(pos--);
+ if (c == BRACE_R) return false;
+ } while (Character.isWhitespace(c));
+ // container block seems to be not a function or statement body
+ pos++; // step back one symbol
+ bracketcount = 0; // let's search for upper block
+ }
+ }
+ }
+
+ } catch (BadLocationException x) { /* Ignore */ }
+ // return true in case of unknown result or exception
+ return true;
+ }
+
+ /**
+ * Searches for line feed symbols in string.
+ * First met '\r' or '\n' is treated as LF symbol
+ *
+ * @param s
+ * string to search in.
+ * @return number of LFs met.
+ */
+ public static int countLFs (String s) {
+ int counter = 0;
+ char lf = 0;
+ char c;
+ for (int i=0; i<s.length(); i++) {
+ c = s.charAt(i);
+ if (lf == 0) {
+ if (c == '\n' || c == '\r') {
+ lf = c;
+ counter++;
+ }
+ } else if (lf == c) counter++;
+ }
+ return counter;
+ }
+
+ /**
+ * Checks whether the string contains any C-block delimiters ( { } )
+ *
+ * @param s
+ * text to check
+ * @return true if curled brace found.
+ */
+ public static boolean hasCBraces (String s) {
+ if (s.indexOf(CBRACE_L) > -1 || s.indexOf(CBRACE_R) > -1) return true;
+ else return false;
+ }
+}
+
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/Console.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/Console.java
new file mode 100644
index 0000000000..695e489a1b
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/Console.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 2004 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui;
+
+import org.eclipse.cdt.core.ConsoleOutputStream;
+import org.eclipse.cdt.core.resources.IConsole;
+import org.eclipse.cdt.ui.CUIPlugin;
+import org.eclipse.cdt.ui.IBuildConsoleManager;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+
+public class Console implements IConsole {
+ IProject project;
+ IBuildConsoleManager fConsoleManager;
+
+ public Console(String consoleName, String contextId) {
+ fConsoleManager = CUIPlugin.getDefault().getConsoleManager(consoleName,
+ contextId);
+ }
+
+// /**
+// * Constructor for ConfigureConsole.
+// */
+// public CConfigureConsole() {
+// fConsoleManager = AutotoolsPlugin.getDefault().getConsoleManager();
+// }
+//
+
+ public void start(IProject project ) {
+ this.project = project;
+ fConsoleManager.getConsole(project).start(project);
+ }
+
+ /**
+ * @throws CoreException
+ * @see org.eclipse.cdt.core.resources.IConsole#getOutputStream()
+ */
+ public ConsoleOutputStream getOutputStream() throws CoreException {
+ return fConsoleManager.getConsole(project).getOutputStream();
+ }
+
+ public ConsoleOutputStream getInfoStream() throws CoreException {
+ return fConsoleManager.getConsole(project).getInfoStream();
+ }
+
+ public ConsoleOutputStream getErrorStream() throws CoreException {
+ return fConsoleManager.getConsole(project).getErrorStream();
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/ConsoleMessages.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/ConsoleMessages.java
new file mode 100644
index 0000000000..a9b3d21ef0
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/ConsoleMessages.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 2004 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class ConsoleMessages {
+
+ public static final String BUNDLE_NAME = "org.eclipse.linuxtools.internal.cdt.autotools.ui.ConsoleMessages";//$NON-NLS-1$
+
+ private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
+
+ private ConsoleMessages() {
+
+ }
+ public static String getString(String key) {
+ try {
+ return RESOURCE_BUNDLE.getString(key);
+ } catch (MissingResourceException e) {
+ return '!' + key + '!';
+ }
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/ConsoleMessages.properties b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/ConsoleMessages.properties
new file mode 100644
index 0000000000..7c4510df87
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/ConsoleMessages.properties
@@ -0,0 +1,25 @@
+###############################################################################
+# Copyright (c) 2003, 2004 QNX Software Systems and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# QNX Software Systems - Initial API and implementation
+###############################################################################
+ConfigureConsole.name=Configure
+BuildStepsConsole.name=Build Steps
+AutotoolsConsole.name=Autotools
+
+find_replace_action.label=&Find/Replace...@Ctrl+F
+find_replace_action.tooltip=Find/Replace
+find_replace_action.image=
+find_replace_action.description=Find/Replace
+
+ConfigureConsolePage.&Copy@Ctrl+C_6=&Copy@Ctrl+C
+ConfigureConsolePage.Copy_7=Copy
+ConfigureConsolePage.Select_&All@Ctrl+A_12=Select &All@Ctrl+A
+ConfigureConsolePage.Select_All=Select All
+
+ScrollLockAction.Scroll_Lock_1=Scroll Lock
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/ErrorParserBlock.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/ErrorParserBlock.java
new file mode 100644
index 0000000000..fd1ad8674d
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/ErrorParserBlock.java
@@ -0,0 +1,119 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.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.cdt.ui.dialogs.ICOptionContainer;
+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.Preferences;
+import org.eclipse.swt.widgets.Composite;
+
+@SuppressWarnings("deprecation")
+public class ErrorParserBlock extends AbstractErrorParserBlock {
+
+ // make builder enabled
+ IMakeBuilderInfo fBuildInfo;
+ boolean useBuildInfo = false;
+ Preferences fPrefs;
+
+ public ErrorParserBlock(Preferences preferences) {
+ super();
+ fPrefs = preferences;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
+ */
+ public void createControl(Composite parent) {
+
+ if (useBuildInfo == true && fBuildInfo == null) {
+ Composite composite = ControlFactory.createComposite(parent, 1);
+ setControl(composite);
+ ControlFactory.createEmptySpace(composite);
+ ControlFactory.createLabel(composite, MakeUIMessages.getResourceString("ErrorParserBlock.label.missingBuilderInformation")); //$NON-NLS-1$
+ return;
+ }
+ super.createControl(parent);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.cdt.ui.dialogs.ErrorParserBlock#getErrorParserIDs(org.eclipse.core.resources.IProject)
+ */
+ protected String[] getErrorParserIDs(IProject project) {
+ if (getContainer().getProject() != null && fBuildInfo == null) {
+ try {
+ fBuildInfo = MakeCorePlugin.createBuildInfo(getContainer().getProject(), MakeBuilder.BUILDER_ID);
+ } catch (CoreException e) {
+ }
+ }
+ if (fBuildInfo != null) {
+ return fBuildInfo.getErrorParsers();
+ }
+ return new String[0];
+ }
+
+ /*
+ * (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 {
+ if (getContainer().getProject() != null) {
+ try {
+ fBuildInfo = MakeCorePlugin.createBuildInfo(getContainer().getProject(), MakeBuilder.BUILDER_ID);
+ } catch (CoreException e) {
+ }
+ }
+ if (fBuildInfo != null) {
+ fBuildInfo.setErrorParsers(parserIDs);
+ }
+ }
+
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.ui.dialogs.AbstractErrorParserBlock#saveErrorParsers(java.lang.String[])
+ */
+ protected void saveErrorParsers(String[] parserIDs) throws CoreException {
+ fBuildInfo = MakeCorePlugin.createBuildInfo(fPrefs, MakeBuilder.BUILDER_ID, false);
+ fBuildInfo.setErrorParsers(parserIDs);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.ui.dialogs.AbstractErrorParserBlock#getErrorParserIDs(boolean)
+ */
+ protected String[] getErrorParserIDs(boolean defaults) {
+ fBuildInfo = MakeCorePlugin.createBuildInfo(fPrefs, MakeBuilder.BUILDER_ID, defaults);
+ return fBuildInfo.getErrorParsers();
+ }
+
+ public void setContainer(ICOptionContainer container) {
+ super.setContainer(container);
+ if (getContainer().getProject() != null) {
+ try {
+ fBuildInfo = MakeCorePlugin.createBuildInfo(getContainer().getProject(), MakeBuilder.BUILDER_ID);
+ } catch (CoreException e) {
+ }
+ useBuildInfo = true;
+ } else {
+ }
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/FileRelevance.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/FileRelevance.java
new file mode 100644
index 0000000000..a360965f84
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/FileRelevance.java
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Broadcom and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * James Blackburn (Broadcom) - Initial API and implementation
+ * Markus Schorn (Wind River Systems)
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui;
+
+import org.eclipse.cdt.core.model.CoreModel;
+import org.eclipse.cdt.core.model.ICProject;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourceAttributes;
+
+/**
+ * This class computes a relevance for files in case we have to select
+ * from multiple files for the same file-system location.
+ */
+public class FileRelevance {
+ private static final int PREFERRED_PROJECT = 0x40;
+ private static final int CDT_PROJECT = 0x20;
+ private static final int ON_SOURCE_ROOT = 0x10;
+
+ // Penalty for undesirable attributes
+ private static final int LINK_PENALTY = 1;
+ private static final int INACCESSIBLE_SHIFT = 4;
+
+ /**
+ * Compute a relevance for the given file. The higher the score the more relevant the
+ * file. It is determined by the following criteria: <br>
+ * - file belongs to preferred project <br>
+ * - file belongs to a cdt-project <br>
+ * - file belongs to a source folder of a cdt-project <br>
+ * - file is accessible
+ * - file is not a link
+ * @param f the file to compute the relevance for
+ * @return integer representing file relevance. Larger numbers are more relevant
+ */
+ public static int getRelevance(IFile f, IProject preferredProject) {
+ int result= 0;
+ IProject p= f.getProject();
+ if (p.equals(preferredProject))
+ result+= PREFERRED_PROJECT;
+
+ if (CoreModel.hasCNature(p)) {
+ result+= CDT_PROJECT;
+ ICProject cproject= CoreModel.getDefault().create(p);
+ if (cproject.isOnSourceRoot(f))
+ result+= ON_SOURCE_ROOT;
+ }
+
+ if (!f.isAccessible())
+ result >>= INACCESSIBLE_SHIFT;
+ else {
+ ResourceAttributes ra = f.getResourceAttributes();
+ if (f.isLinked() || (ra != null && ra.isSymbolicLink()))
+ result -= LINK_PENALTY;
+ }
+
+ return result;
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/HTML2TextReader.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/HTML2TextReader.java
new file mode 100644
index 0000000000..c4adcba055
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/HTML2TextReader.java
@@ -0,0 +1,260 @@
+/*******************************************************************************
+ * Copyright (c) 2000 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * QNX Software System
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui;
+
+
+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<String, String> fgEntityLookup;
+ private static final Set<String> fgTags;
+
+ static {
+
+ fgTags= new HashSet<String>();
+ 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<String, String>(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 <code>null</code>, 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" + "-"; //$NON-NLS-1$ //$NON-NLS-2$
+
+ 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/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/HTMLPrinter.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/HTMLPrinter.java
new file mode 100644
index 0000000000..a9de7d1159
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/HTMLPrinter.java
@@ -0,0 +1,116 @@
+/*******************************************************************************
+ * Copyright (c) 2000 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * QNX Software System
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui;
+
+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, '<', "&lt;"); //$NON-NLS-1$
+ return replace(content, '>', "&gt;"); //$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, "<html><body text=\"#000000\" bgcolor=\"#FFFF88\"><font size=-1>"); //$NON-NLS-1$
+ }
+
+ public static void addPageProlog(StringBuffer buffer) {
+ insertPageProlog(buffer, buffer.length());
+ }
+
+ public static void addPageEpilog(StringBuffer buffer) {
+ buffer.append("</font></body></html>"); //$NON-NLS-1$
+ }
+
+ public static void startBulletList(StringBuffer buffer) {
+ buffer.append("<ul>"); //$NON-NLS-1$
+ }
+
+ public static void endBulletList(StringBuffer buffer) {
+ buffer.append("</ul>"); //$NON-NLS-1$
+ }
+
+ public static void addBullet(StringBuffer buffer, String bullet) {
+ if (bullet != null) {
+ buffer.append("<li>"); //$NON-NLS-1$
+ buffer.append(bullet);
+ buffer.append("</li>"); //$NON-NLS-1$
+ }
+ }
+
+ public static void addSmallHeader(StringBuffer buffer, String header) {
+ if (header != null) {
+ buffer.append("<h5>"); //$NON-NLS-1$
+ buffer.append(header);
+ buffer.append("</h5>"); //$NON-NLS-1$
+ }
+ }
+
+ public static void addParagraph(StringBuffer buffer, String paragraph) {
+ if (paragraph != null) {
+ buffer.append("<p>"); //$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/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/HTMLTextPresenter.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/HTMLTextPresenter.java
new file mode 100644
index 0000000000..233112ba1d
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/HTMLTextPresenter.java
@@ -0,0 +1,190 @@
+/*******************************************************************************
+ * Copyright (c) 2000 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * QNX Software System
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui;
+
+import java.io.IOException;
+import java.io.Reader;
+import java.io.StringReader;
+import java.util.Iterator;
+
+import org.eclipse.jface.text.DefaultInformationControl;
+import org.eclipse.jface.text.Region;
+import org.eclipse.jface.text.TextPresentation;
+import org.eclipse.linuxtools.cdt.autotools.ui.AutotoolsUIPlugin;
+import org.eclipse.swt.custom.StyleRange;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.widgets.Display;
+
+
+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);
+ }
+
+ @SuppressWarnings("unchecked")
+ 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); //$NON-NLS-1$
+ }
+
+ return trim(buffer, presentation);
+
+ } catch (IOException e) {
+
+ AutotoolsUIPlugin.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/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/LineBreakingReader.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/LineBreakingReader.java
new file mode 100644
index 0000000000..52fb3e31e5
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/LineBreakingReader.java
@@ -0,0 +1,111 @@
+/*******************************************************************************
+ * Copyright (c) 2000 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * QNX Software System
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui;
+
+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;
+ }
+ 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/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/LocationAdapter.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/LocationAdapter.java
new file mode 100644
index 0000000000..22b5584105
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/LocationAdapter.java
@@ -0,0 +1,97 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Wind River Systems, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Markus Schorn - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URI;
+
+import org.eclipse.core.filesystem.URIUtil;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+
+/**
+ * Provides common functionality for URI and IPath
+ */
+abstract class LocationAdapter<T> {
+
+ public abstract String extractName(T location);
+ public abstract IFile[] platformsFindFilesForLocation(T location);
+ public abstract String getCanonicalPath(T location);
+ public abstract T getLocation(IFile file);
+
+ public static final LocationAdapter<IPath> PATH = new LocationAdapter<IPath>() {
+ @Override
+ public String extractName(IPath location) {
+ String name = location.lastSegment();
+ if (name != null)
+ return name;
+ return location.toString();
+ }
+
+ @Override
+ public IFile[] platformsFindFilesForLocation(IPath location) {
+ final IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+ return root.findFilesForLocationURI(URIUtil.toURI(location.makeAbsolute()));
+ }
+
+ @Override
+ public String getCanonicalPath(IPath location) {
+ final File file= location.toFile();
+ try {
+ return file.getCanonicalPath();
+ } catch (IOException e) {
+ // use non-canonical version
+ return file.getAbsolutePath();
+ }
+ }
+
+ @Override
+ public IPath getLocation(IFile file) {
+ return file.getLocation();
+ }
+ };
+
+ public static final LocationAdapter<URI> URI = new LocationAdapter<URI>() {
+ @Override
+ public String extractName(URI location) {
+ String path= location.getPath();
+ int idx= path.lastIndexOf('/');
+ return path.substring(idx+1);
+ }
+
+ @Override
+ public IFile[] platformsFindFilesForLocation(URI location) {
+ return ResourcesPlugin.getWorkspace().getRoot().findFilesForLocationURI(location);
+ }
+
+ @Override
+ public String getCanonicalPath(URI location) {
+ if (!"file".equals(location.getScheme())) //$NON-NLS-1$
+ return null;
+
+ String path= location.getPath();
+ try {
+ return new File(path).getCanonicalPath();
+ } catch (IOException e) {
+ // use non-canonical version
+ return path;
+ }
+ }
+
+ @Override
+ public URI getLocation(IFile file) {
+ return file.getLocationURI();
+ }
+ };
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/MakeUIImages.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/MakeUIImages.java
new file mode 100644
index 0000000000..68bff558f0
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/MakeUIImages.java
@@ -0,0 +1,140 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005, 2009 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.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.linuxtools.cdt.autotools.ui.AutotoolsUIPlugin;
+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(AutotoolsUIPlugin.getDefault().getBundle().getEntry("/"), "icons/"); //$NON-NLS-1$ //$NON-NLS-2$
+ } catch (MalformedURLException e) {
+ AutotoolsUIPlugin.log(e);
+ }
+ }
+ private static final String NAME_PREFIX = AutotoolsUIPlugin.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$
+ public static final String T_LCL = "lcl16/"; //$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"; //$NON-NLS-1$
+ public static final ImageDescriptor DESC_OBJ_ERROR = createManaged(OBJ, IMG_OBJS_ERROR);
+ public static final String IMG_OBJS_WARNING = NAME_PREFIX + "warning_obj.gif"; //$NON-NLS-1$
+ public static final ImageDescriptor DESC_OBJ_WARNING = createManaged(OBJ, IMG_OBJS_WARNING);
+
+ 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_TOOLS_MAKE_TARGET_FILTER = NAME_PREFIX + "target_filter.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_ACMACRO = NAME_PREFIX + "acmacro_obj.gif"; //$NON-NLS-1$
+ public static final ImageDescriptor DESC_MAKEFILE_ACMACRO = createManaged(OBJ, IMG_OBJS_MAKEFILE_ACMACRO);
+
+ 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_OBJS_ENVIRONMNET = NAME_PREFIX + "environment_obj.gif"; //$NON-NLS-1$
+ public static final ImageDescriptor DESC_ENVIRONMENT = createManaged(OBJ, IMG_OBJS_ENVIRONMNET);
+
+ public static final String IMG_OBJS_ENV_VAR = NAME_PREFIX + "envvar_obj.gif"; //$NON-NLS-1$
+ public static final ImageDescriptor DESC_ENV_VAR = createManaged(OBJ, IMG_OBJS_ENV_VAR);
+
+ public static final String IMG_TOOLS_ALPHA_SORTING= NAME_PREFIX + "alphab_sort_co.gif"; //$NON-NLS-1$
+ public static final String IMG_TOOLS_MAKEFILE_SEGMENT_EDIT= NAME_PREFIX + "segment_edit.gif"; //$NON-NLS-1$
+
+ public static final String IMG_MENU_OPEN_INCLUDE= NAME_PREFIX + "open_include.gif"; //$NON-NLS-1$
+
+ 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) {
+ AutotoolsUIPlugin.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$ //$NON-NLS-2$
+// action.setHoverImageDescriptor(create("e" + type + "/", relPath)); //$NON-NLS-1$ //$NON-NLS-2$
+ action.setImageDescriptor(create("e" + type + "/", relPath)); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ /**
+ * Helper method to access the image registry from the JavaPlugin class.
+ */
+ static ImageRegistry getImageRegistry() {
+ return imageRegistry;
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/MakeUIMessages.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/MakeUIMessages.java
new file mode 100644
index 0000000000..a4ecd91784
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/MakeUIMessages.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 2004, 2009 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class MakeUIMessages {
+
+ public static final String BUNDLE_NAME = MakeUIMessages.class.getName();
+
+ private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
+
+ private MakeUIMessages() {
+
+ }
+ public static String getResourceString(String key) {
+ try {
+ return RESOURCE_BUNDLE.getString(key);
+ } catch (MissingResourceException e) {
+ return '!' + key + '!';
+ }
+ }
+
+ /**
+ * Returns the plugin's resource bundle,
+ */
+ public static ResourceBundle getResourceBundle() {
+ return RESOURCE_BUNDLE;
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/MakeUIMessages.properties b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/MakeUIMessages.properties
new file mode 100644
index 0000000000..4f49ba8d57
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/MakeUIMessages.properties
@@ -0,0 +1,283 @@
+###############################################################################
+# Copyright (c) 2003, 2005, 2009 QNX Software Systems and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# QNX Software Systems - initial API and implementation
+# Wind River Systems - fix for bugzilla 135150
+# Tianchao Li (tianchao.li@gmail.com) - arbitrary build directory (bug #136136)
+###############################################################################
+
+MakeCWizard.title=C/Make Project
+MakeCWizard.description=Create a New C Project using 'make' to build it
+MakeEnvironmentBlock.10=&Remove
+MakeEnvironmentBlock.11=New Environment Variable
+MakeEnvironmentBlock.12=Overwrite variable?
+MakeEnvironmentBlock.13=A variable named {0} already exists. Overwrite?
+MakeEnvironmentBlock.14=Select &environment variables to add:
+MakeEnvironmentBlock.15=Select Environment Variables
+MakeEnvironmentBlock.16=Edit Environment Variable
+MakeEnvironmentBlock.17=&Append environment to native environment
+MakeEnvironmentBlock.18=Re&place native environment with specified environment
+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...
+MakeEnvironmentBlock.0=Variable
+MakeEnvironmentBlock.1=Value
+MakeEnvironmentBlock.2=&Name:
+MakeEnvironmentBlock.3=&Value:
+MakeEnvironmentBlock.4=Environment
+MakeEnvironmentBlock.5=Environment used for make builder
+MakeEnvironmentBlock.6=Environment variables to set
+MakeEnvironmentBlock.7=N&ew...
+MakeEnvironmentBlock.8=Se&lect...
+MakeEnvironmentBlock.9=E&dit...
+
+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 project to a C/C++ project which uses 'make' to build it.
+WizardMakeProjectConversion.monitor.convertingToMakeProject=Converting to Make Project...
+
+MakeWizardUpdate.window_title=Make Project Migration
+MakeWizardUpdatePage.title=Make Project Migration
+MakeWizardUpdatePage.description=Migrate older make projects to new make builder.
+MakeWizardUpdatePage.projectList=Project list
+MakeWizardUpdatePage.status.noProjectsToUpdate=No projects to update
+MakeWizardUpdatePage.status.noProjectsSelected=No projects selected
+
+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.makeSetting.runAllBuilders=Run all project builders.
+SettingsBlock.makeCmd.group_label=Build command
+SettingsBlock.makeCmd.use_default=Use default
+SettingsBlock.makeCmd.label=Build command:
+SettingsBlock.makeLoc.group_label=Build Location
+SettingsBlock.makeDir.label=Build directory:
+SettingsBlock.makeDir.browseWorkspace=Workspace...
+SettingsBlock.makeDir.browseFilesystem=Filesystem...
+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.note=Note:
+SettingsBlock.makeWorkbench.autobuildMessage=See Workbench automatic build preference.
+SettingsBlock.makeWorkbench.incremental=Build (Incremental Build)
+SettingsBlock.makeWorkbench.clean=Clean
+SettingsBlock.makeWorkbench.autoBuildTarget=Auto Build Target
+SettingsBlock.makeWorkbench.incrementalBuildTarget=Incremental Build Target
+SettingsBlock.makeWorkbench.cleanTarget=Clean Target
+SettingsBlock.variables=Variables...
+TargetBlock.target.group_label=Target
+TargetBlock.target.label=Target Name:
+
+ErrorParserBlock.label.missingBuilderInformation=Builder is missing or disabled on project.
+
+BuildTarget.target.group_label=Make Target
+BuildTarget.target.label=Make Target:
+
+MakeTargetsPreferencePage.buildTargetInBackground.label=Build make targets in background.
+
+MakeDocumentProvider.exception.createElementInfo=Error creating element.
+
+AddBuildTargetAction.title=Add make Target
+AddBuildTargetAction.description=Add make Target
+AddBuildTargetAction.tooltip= Add make Target
+AddBuildTargetAction.exception.internal=Internal Error
+
+OpenIncludeAction.title=Open include directive
+OpenIncludeAction.description=Open an include directive
+OpenIncludeAction.tooltip= Include Directive
+OpenIncludeAction.exception.internal=Internal Error
+
+TargetBuild.execption.message=Target Build Error
+TargetBuild.monitor.beginTask=Building Targets...
+TargetBuild.backgroundTask.name=Building Targets.
+
+TargetListViewer.button.add=Add...
+TargetListViewer.button.remove=Remove
+TargetListViewer.button.edit=Edit...
+TargetListViewer.lable.target=Target
+TargetListViewer.lable.location=Location
+TargetListViewer.exception.error=Error
+TargetListViewer.exception.message=An error occurred performing the selected action
+
+UpdateMakeProjectAction.exception.error=Error
+UpdateMakeProjectAction.eception.message=Error updating Make Projects
+UpdateMakeProjectAction.monitor.convert=Converting Make Targets...
+UpdateMakeProjectAction.monitor.update=Updating make Projects...
+
+BuildPathInfoBlock.button.browse=Browse...
+BuildPathInfoBlock.description=Set the include paths and preprocessor symbols for this project
+BuildPathInfoBlock.monitor.settingScannerInfo=Setting Scanner Info
+
+BuildTargetDialog.title.buildTarget=Make Targets
+BuildTargetDialog.button.build=Build
+BuildTargetDialog.title.makeTargetsFor=Make Targets for:
+
+MakeTargetDialog.exception.noTargetBuilderOnProject=Not target builders on the project
+MakeTargetDialog.title.createMakeTarget=Create a new Make target
+MakeTargetDialog.title.modifyMakeTarget=Modify a Make target
+MakeTargetDialog.message.mustSpecifyName=Must specify a target name.
+MakeTargetDialog.message.targetWithNameExists=Target with that name already exits.
+MakeTargetDialog.message.mustSpecifyBuildCommand=Must specify a build command
+MakeTargetDialog.button.update=Update
+MakeTargetDialog.button.create=Create
+MakeTargetDialog.exception.makeTargetError=Make Target Error
+MakeTargetDialog.exception.errorAddingTarget=Error adding target
+
+SettingsBlock.title.selectLocationToBuildFrom=Selection Location to build from.
+SettingsBlock.label.missingBuilderInformation=Builder is missing or disabled on project.
+SettingsBlock.monitor.applyingSettings=Applying Settings...
+SettingsBlock.message.mustEnterBuildCommand=Must enter a build command
+
+DeleteTargetAction.label=Delete Make Target
+DeleteTargetAction.tooltip=Delete Make Target
+DeleteTargetAction.title.confirmDeletion=Confirm Target Deletion
+DeleteTargetAction.message.confirmDeleteion=Are you sure you want to delete ''{0}''?
+DeleteTargetAction.title.confirmMultipleDeletion=Confirm Multiple Target Deletion
+DeleteTargetAction.message.confirmMultipleDeletion=Are you sure you want to delete these {0} targets?
+DeleteTargetAction.exception.removeError=Make Target Remove Error
+DeleteTargetAction.exception.errorDeletingBuildTarget=Error deleting Make target
+
+BuildTargetAction.label=Build Make Target
+BuildTargetAction.tooltip=Build Make Target
+
+EditTargetAction.label=Edit Make Target
+EditTargetAction.tooltip=Edit Make Target
+EditTargetAction.exception.internalError=Internal Error
+EditTargetAction.exception.errorEditingTarget=Error editing target.
+
+AddTargetAction.label=Add Make Target
+AddTargetAction.tooltip=Add Make Target
+AddTargetAction.exception.internalError=Internal Error
+AddTargetAction.=Internal Error
+
+FilterEmptyFolderAction.label=Hide Empty Folders
+FilterEmptyFolderAction.tooltip=Hide Empty Folders
+
+# Startup messages
+MakeUIPlugin.update_project=Update make projects
+MakeUIPlugin.update_project_message=Older \'make\' projects have been detected in your workspace. \n These projects are no longer supported, would you like to convert these now?
+
+# Prefernece Page
+MakePreferencePage.description=Specify the settings used as defaults by the New Standard Make Project creation wizard.
+MakeTargetPreferencePage.buildTargetInBackground.label=Build Make target in the background.
+
+#Property Page
+MakeProjectPropertyPage.closedproject=Project Closed
+MakeProjectPropertyPage.internalError=An Internal error has occur please check error log.
+
+#-------------- 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=Show Source of Selected Element Only
+TogglePresentation.tooltip=Show Source of Selected Element Only
+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
+
+OpenDeclarationAction.label=&Open Declaration@F3
+OpenDeclarationAction.description=Open an editor on the referenced element
+OpenDeclarationAction.tooltip=Open an editor on the referenced element
+
+# ------- 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
+
+# --- ManageIncludePathsDialog dialog ---
+ManageIncludePathsDialog.title=Manage include paths
+ManageIncludePathsDialog.userGroup.title=User specified include paths
+ManageIncludePathsDialog.discoveredGroup.title=Discovered include paths
+
+ManageScannerConfigDialogCommon.discoveredGroup.selected.label=Selected:
+ManageScannerConfigDialogCommon.discoveredGroup.removed.label=Removed:
+ManageScannerConfigDialogCommon.discoveredGroup.buttons.up.label=Up
+ManageScannerConfigDialogCommon.discoveredGroup.buttons.down.label=Down
+ManageScannerConfigDialogCommon.discoveredGroup.buttons.disable.label=Disable
+ManageScannerConfigDialogCommon.discoveredGroup.buttons.enable.label=Enable
+ManageScannerConfigDialogCommon.discoveredGroup.buttons.delete.label=Delete
+ManageScannerConfigDialogCommon.discoveredGroup.buttons.deleteAll.label=Delete all
+ManageScannerConfigDialogCommon.discoveredGroup.annotation.disabled=disabled
+
+# --- ManageDefinedSymbolsDialog dialog ---
+ManageDefinedSymbolsDialog.title=Manage defined symbols
+ManageDefinedSymbolsDialog.userGroup.title=User specified symbol definitions
+ManageDefinedSymbolsDialog.discoveredGroup.title=Discovered symbol definitions
+
+# --- ScannerConfigOptionsDialog ---
+ScannerConfigOptionsDialog.title=Discovery Options
+ScannerConfigOptionsDialog.description=Set the scanner configuration discovery options for this project
+ScannerConfigOptionsDialog.scGroup.label=Automated discovery of paths and symbols
+ScannerConfigOptionsDialog.scGroup.enabled.button=Automate discovery of paths and symbols
+ScannerConfigOptionsDialog.scGroup.problemReporting.enabled.button=Report path detection problems
+ScannerConfigOptionsDialog.scGroup.selectedProfile.combo=Discovery profile:
+ScannerConfigOptionsDialog.profile.group.label=Discovery profile options
+ScannerConfigOptionsDialog.boProvider.parser.enabled.button=Enable build output scanner info discovery
+ScannerConfigOptionsDialog.boProvider.open.label=Load build output from file
+ScannerConfigOptionsDialog.boProvider.browse.button=Browse...
+ScannerConfigOptionsDialog.boProvider.browse.openFileDialog=Build output file:
+ScannerConfigOptionsDialog.boProvider.load.button=Load
+ScannerConfigOptionsDialog.siProvider.parser.enabled.button=Enable generate scanner info command
+ScannerConfigOptionsDialog.siProvider.command.label=Compiler invocation command
+ScannerConfigOptionsDialog.siProvider.browse.button=Browse...
+ScannerConfigOptionsDialog.siProvider.browse.runCommandDialog='gcc' command:
+ScannerConfigOptionsDialog.siProvider.command.errorMessage=Must enter compiler invocation command
+ScannerConfigOptionsDialog.apply.progressMessage=Setting scanner configuration discovery options...
+ScannerConfigOptionsDialog.common.variables.button=Variables...
+
+ScannerConfigOptionsDialog.unsavedchanges.title=Setting C/C++ Make Project Discovery Options
+ScannerConfigOptionsDialog.unsavedchanges.message=The C/C++ Make Project Discovery Options property page contains unsaved modifications. Do you want to save changes so that other discovery related settings can be updated?
+ScannerConfigOptionsDialog.unsavedchanges.button.save=Apply
+ScannerConfigOptionsDialog.unsavedchanges.button.cancel=Cancel
+
+ScannerConfigOptionsDialog.error.title=Error Setting Project Discovery options
+ScannerConfigOptionsDialog.error.message=An error occurred while setting the project discovery options
+
+# --- DiscoveredScannerConfigurationContainerPage ---
+DiscoveredScannerConfigurationContainerPage.title=Edit container
+DiscoveredScannerConfigurationContainerPage.description=Manage discovered scanner configuration
+DiscoveredScannerConfigurationContainerPage.list.title=Discovered include paths and symbol definitions
+DiscoveredScannerConfigurationContainerPage.initialization.error.message=Error initializing Discovered paths container
+
+CopyDiscoveredPathAction.title=Copy
+CopyDiscoveredPathAction.description=Copy as text
+CopyDiscoveredPathAction.tooltip=Copy as text
+MultipleInputDialog.0=&Browse...
+MultipleInputDialog.1=Select a file:
+MultipleInputDialog.2=Varia&bles...
+
+OptionalMessageDialog_dontShowAgain= Do not show this &message again
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/MessageLine.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/MessageLine.java
new file mode 100644
index 0000000000..f909063de9
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/MessageLine.java
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui;
+
+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 distinguishes between "normal" messages and errors.
+ * Setting an error message hides a currently displayed message until
+ * <code>clearErrorMessage</code> is called.
+ */
+public class MessageLine extends CLabel {
+
+ private String fMessage;
+
+ private Color fNormalMsgAreaBackground;
+
+ private boolean hasErrorMessage;
+
+ /**
+ * 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) {
+ hasErrorMessage = true;
+ setText(message);
+ setImage(MakeUIImages.getImage(MakeUIImages.IMG_OBJS_ERROR));
+ setBackground(JFaceColors.getErrorBackground(getDisplay()));
+ return;
+ }
+ hasErrorMessage = false;
+ setText(fMessage);
+ setImage(null);
+ setBackground(fNormalMsgAreaBackground);
+ }
+
+ public void setMessage(String message) {
+ fMessage = message;
+ setText(message);
+ }
+
+ public boolean hasErrorMessage() {
+ return hasErrorMessage;
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/OptionalMessageDialog.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/OptionalMessageDialog.java
new file mode 100644
index 0000000000..a8e5781bb7
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/OptionalMessageDialog.java
@@ -0,0 +1,144 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Anton Leherbauer (Wind River Systems)
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui;
+
+import org.eclipse.cdt.ui.CUIPlugin;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ * This is a <code>MessageDialog</code> which allows the user
+ * to choose that the dialog isn't shown again the next time.
+ */
+public class OptionalMessageDialog extends MessageDialog {
+ // String constants for widgets
+ private static final String CHECKBOX_TEXT= MakeUIMessages.getResourceString("OptionalMessageDialog_dontShowAgain"); // $NON-NLS-1$
+
+ // Dialog store id constants
+ private static final String STORE_ID= "OptionalMessageDialog.hide."; //$NON-NLS-1$
+ private static final String KEY_DETAIL = ".detail"; //$NON-NLS-1$
+
+ public static final int NOT_SHOWN= IDialogConstants.CLIENT_ID + 1;
+ public static final int NO_DETAIL= -1;
+
+ private Button fHideDialogCheckBox;
+ private String fId;
+
+ /**
+ * Opens the dialog but only if the user hasn't choosen to hide it.
+ * Returns <code>NOT_SHOWN</code> if the dialog was not shown.
+ */
+ public static int open(String id, Shell parent, String title, Image titleImage, String message, int dialogType, String[] buttonLabels, int defaultButtonIndex) {
+ if (!isDialogEnabled(id))
+ return OptionalMessageDialog.NOT_SHOWN;
+
+ MessageDialog dialog= new OptionalMessageDialog(id, parent, title, titleImage, message, dialogType, buttonLabels, defaultButtonIndex);
+ return dialog.open();
+ }
+
+ protected OptionalMessageDialog(String id, Shell parent, String title, Image titleImage, String message, int dialogType, String[] buttonLabels, int defaultButtonIndex) {
+ super(parent, title, titleImage, message, dialogType, buttonLabels, defaultButtonIndex);
+ fId= id;
+ }
+
+ @Override
+ protected Control createCustomArea(Composite parent) {
+ Composite composite= new Composite(parent, SWT.NONE);
+ GridLayout layout= new GridLayout();
+ layout.marginHeight= convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
+ layout.marginWidth= convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
+ layout.horizontalSpacing= convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
+ composite.setLayout(layout);
+ composite.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ fHideDialogCheckBox= new Button(composite, SWT.CHECK | SWT.LEFT);
+ fHideDialogCheckBox.setText(CHECKBOX_TEXT);
+ fHideDialogCheckBox.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ setDialogEnabled(fId, !((Button)e.widget).getSelection());
+ }
+ });
+ applyDialogFont(fHideDialogCheckBox);
+ return fHideDialogCheckBox;
+ }
+
+ //--------------- Configuration handling --------------
+
+ /**
+ * Returns this dialog
+ *
+ * @return the settings to be used
+ */
+ private static IDialogSettings getDialogSettings() {
+ IDialogSettings settings= CUIPlugin.getDefault().getDialogSettings();
+ settings= settings.getSection(STORE_ID);
+ if (settings == null)
+ settings= CUIPlugin.getDefault().getDialogSettings().addNewSection(STORE_ID);
+ return settings;
+ }
+
+ /**
+ * Answers whether the optional dialog is enabled and should be shown.
+ */
+ public static boolean isDialogEnabled(String key) {
+ IDialogSettings settings= getDialogSettings();
+ return !settings.getBoolean(key);
+ }
+
+ /**
+ * Sets a detail for the dialog.
+ */
+ public static void setDialogDetail(String key, int detail) {
+ IDialogSettings settings= getDialogSettings();
+ settings.put(key+KEY_DETAIL, detail);
+ }
+
+ /**
+ * Returns the detail for this dialog, or NO_DETAIL, if none.
+ */
+ public static int getDialogDetail(String key) {
+ IDialogSettings settings= getDialogSettings();
+ try {
+ return settings.getInt(key+KEY_DETAIL);
+ } catch (NumberFormatException e) {
+ return NO_DETAIL;
+ }
+ }
+
+ /**
+ * Sets whether the optional dialog is enabled and should be shown.
+ */
+ public static void setDialogEnabled(String key, boolean isEnabled) {
+ IDialogSettings settings= getDialogSettings();
+ settings.put(key, !isEnabled);
+ }
+
+ /**
+ * Clears all remembered information about hidden dialogs
+ */
+ public static void clearAllRememberedStates() {
+ IDialogSettings settings= CUIPlugin.getDefault().getDialogSettings();
+ settings.addNewSection(STORE_ID);
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/ResourceLookup.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/ResourceLookup.java
new file mode 100644
index 0000000000..0479466cc5
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/ResourceLookup.java
@@ -0,0 +1,159 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Wind River Systems, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Markus Schorn - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui;
+
+import java.net.URI;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Comparator;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IPath;
+
+/**
+ * Allows for looking up resources by location or name.
+ */
+public class ResourceLookup {
+ private static ResourceLookupTree lookupTree= new ResourceLookupTree();
+
+ public static void startup() {
+ lookupTree.startup();
+ }
+
+ public static void shutdown() {
+ lookupTree.shutdown();
+ }
+
+ /**
+ * Searches for files with the given location suffix.
+ *
+ * At this point the method works for sources and headers (no other content types), only.
+ * This is done to use less memory and can be changed if necessary.
+ * For linked resource files, the name of the link target is relevant.
+ *
+ * @param locationSuffix the suffix to match, always used as relative path.
+ * @param projects the projects to search
+ * @param ignoreCase whether or not to ignore case when comparing the suffix.
+ */
+ public static IFile[] findFilesByName(IPath locationSuffix, IProject[] projects, boolean ignoreCase) {
+ return lookupTree.findFilesByName(locationSuffix, projects, ignoreCase);
+ }
+
+ /**
+ * Uses a lookup-tree that finds resources for locations using the canonical representation
+ * of the path.
+ */
+ public static IFile[] findFilesForLocationURI(URI location) {
+ return lookupTree.findFilesForLocationURI(location);
+ }
+
+ /**
+ * Uses a lookup-tree that finds resources for locations using the canonical representation
+ * of the path. The method does not work for files where the name (last segment) of the
+ * resources differs from the name of the location.
+ */
+ public static IFile[] findFilesForLocation(IPath location) {
+ return lookupTree.findFilesForLocation(location);
+ }
+
+ /**
+ * Uses {@link #findFilesForLocationURI(URI)} and selects the most relevant file
+ * from the result. Files form the first project, from cdt-projects and those on source
+ * roots are preferred, see {@link FileRelevance}.
+ * @param location an URI for the location of the files to search for.
+ * @param preferredProject a project to be preferred over others, or <code>null</code>.
+ * @return a file for the location in one of the given projects, or <code>null</code>.
+ * NB the returned IFile may not exist
+ */
+ public static IFile selectFileForLocationURI(URI location, IProject preferredProject) {
+ return selectFile(findFilesForLocationURI(location), preferredProject);
+ }
+
+ /**
+ * Uses {@link #findFilesForLocation(IPath)} and selects the most relevant file
+ * from the result. Files form the preferred project, from cdt-projects and those on source
+ * roots are preferred, see {@link FileRelevance}.
+ * @param location a path for the location of the files to search for.
+ * @param preferredProject a project to be preferred over others, or <code>null</code>.
+ * @return a file for the location or <code>null</code>.
+ * NB the returned IFile may not exist
+ */
+ public static IFile selectFileForLocation(IPath location, IProject preferredProject) {
+ return selectFile(findFilesForLocation(location), preferredProject);
+ }
+
+ private static IFile selectFile(IFile[] files, IProject preferredProject) {
+ if (files.length == 0)
+ return null;
+
+ if (files.length == 1)
+ return files[0];
+
+ IFile best= null;
+ int bestRelevance= -1;
+
+ for (int i = 0; i < files.length; i++) {
+ IFile file = files[i];
+ int relevance= FileRelevance.getRelevance(file, preferredProject);
+ if (best == null || relevance > bestRelevance ||
+ (relevance == bestRelevance &&
+ best.getFullPath().toString().compareTo(file.getFullPath().toString()) > 0)) {
+ bestRelevance= relevance;
+ best= file;
+ }
+ }
+ return best;
+ }
+
+ /**
+ * Sorts files by relevance for CDT, by the criteria listed below. The most relevant files
+ * is listed first.
+ * <br> Accessible files
+ * <br> Files of preferred project
+ * <br> Files of CDT projects
+ * <br> Files on a source root of a CDT project
+ */
+ public static void sortFilesByRelevance(IFile[] filesToSort, final IProject preferredProject) {
+ Collections.sort(Arrays.asList(filesToSort), new Comparator<IFile>() {
+ public int compare(IFile f1, IFile f2) {
+ int r1= FileRelevance.getRelevance(f1, preferredProject);
+ int r2= FileRelevance.getRelevance(f2, preferredProject);
+
+ if (r1 > r2)
+ return -1;
+ if (r1 < r2)
+ return 1;
+
+ return f1.getFullPath().toString().compareTo(f2.getFullPath().toString());
+ }
+ });
+ }
+
+ /**
+ * For testing, only.
+ */
+ public static void dump() {
+ lookupTree.dump();
+ }
+ /**
+ * For testing, only.
+ */
+ public static void unrefNodeMap() {
+ lookupTree.unrefNodeMap();
+ }
+ /**
+ * For testing, only.
+ */
+ public static void simulateNodeMapCollection() {
+ lookupTree.simulateNodeMapCollection();
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/ResourceLookupTree.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/ResourceLookupTree.java
new file mode 100644
index 0000000000..5644f98e2e
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/ResourceLookupTree.java
@@ -0,0 +1,861 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Wind River Systems, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Markus Schorn - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui;
+
+import java.lang.ref.SoftReference;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.cdt.core.CCorePlugin;
+import org.eclipse.cdt.core.CProjectNature;
+import org.eclipse.cdt.core.model.CoreModel;
+import org.eclipse.cdt.core.parser.util.CharArrayUtils;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IResourceChangeListener;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.resources.IResourceDeltaVisitor;
+import org.eclipse.core.resources.IResourceProxy;
+import org.eclipse.core.resources.IResourceProxyVisitor;
+import org.eclipse.core.resources.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.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.content.IContentType;
+import org.eclipse.core.runtime.content.IContentTypeManager;
+import org.eclipse.core.runtime.jobs.Job;
+
+/**
+ * Allows for looking up resources by location or name. When using this class 100 bytes per resource
+ * are needed. Therefore the support is limited to header-files int non-cdt projects and all files
+ * except non-cdt-files in CDT projects.
+ *
+ * The information for a project is initialized when first requested and then it is kept up to date
+ * using a resource change listener. No memory is used, as long as the class is not used.
+ * When information is not used for more than 10 minutes, the data-structures will be held via a weak
+ * reference, only and are subject to garbage collection.
+ *
+ * The node map stores a map from hash-code of file-names to nodes.
+ * A node contains the name of a file plus a link to the parent resource. From that we can compute
+ * the resource path and obtain further information via the resource.
+ */
+class ResourceLookupTree implements IResourceChangeListener, IResourceDeltaVisitor, IResourceProxyVisitor {
+ private static final int UNREF_DELAY = 10 * 60000; // 10 min
+
+ private static final boolean VISIT_CHILDREN = true;
+ private static final boolean SKIP_CHILDREN = false;
+ private static final IFile[] NO_FILES = new IFile[0];
+ private static final int TRIGGER_RECALC=
+ IResourceDelta.TYPE | IResourceDelta.REPLACED |
+ IResourceDelta.LOCAL_CHANGED | IResourceDelta.OPEN;
+
+ private static class Extensions {
+ private final boolean fInvert;
+ private final Set<String> fExtensions;
+ Extensions(Set<String> extensions, boolean invert) {
+ fInvert= invert;
+ fExtensions= extensions;
+ }
+ boolean isRelevant(String filename) {
+ // accept all files without extension
+ final int idx= filename.lastIndexOf('.');
+ if (idx < 0)
+ return true;
+
+ return fExtensions.contains(filename.substring(idx+1).toUpperCase()) != fInvert;
+ }
+ }
+
+ private static class Node {
+ final Node fParent;
+ final char[] fResourceName;
+ final boolean fHasFileLocationName;
+ final boolean fIsFileLinkTarget;
+
+ boolean fDeleted;
+ boolean fHasChildren;
+ int fCanonicHash;
+
+ Node(Node parent, char[] name, boolean hasFileLocationName, boolean isFileLinkTarget) {
+ fParent= parent;
+ fResourceName= name;
+ fHasFileLocationName= hasFileLocationName;
+ fIsFileLinkTarget= isFileLinkTarget;
+ if (parent != null)
+ parent.fHasChildren= true;
+ }
+ }
+
+ private final Object fLock= new Object();
+ private final Job fUnrefJob;
+ private SoftReference<Map<Integer, Object>> fNodeMapRef;
+ private Map<Integer, Object> fNodeMap;
+ private final Map<String, Extensions> fFileExtensions;
+ private Extensions fCDTProjectExtensions;
+ private Extensions fDefaultExtensions;
+ private Extensions fCurrentExtensions;
+ private Node fRootNode;
+ private boolean fNeedCleanup;
+ private Node fLastFolderNode;
+
+ public ResourceLookupTree() {
+ fRootNode= new Node(null, CharArrayUtils.EMPTY, false, false) {};
+ fFileExtensions= new HashMap<String, Extensions>();
+ fUnrefJob= new Job("Timer") { //$NON-NLS-1$
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ unrefNodeMap();
+ return Status.OK_STATUS;
+ }
+ };
+ fUnrefJob.setSystem(true);
+ }
+
+ public void startup() {
+ final IWorkspace workspace = ResourcesPlugin.getWorkspace();
+ workspace.addResourceChangeListener(this, IResourceChangeEvent.POST_CHANGE);
+ }
+
+ public void shutdown() {
+ ResourcesPlugin.getWorkspace().removeResourceChangeListener(this);
+ synchronized (fLock) {
+ fNodeMap= null;
+ fNodeMapRef= null;
+ fFileExtensions.clear();
+ }
+ }
+
+ /**
+ * Handle resource change notifications.
+ */
+ public void resourceChanged(IResourceChangeEvent event) {
+ IResourceDelta delta= event.getDelta();
+ synchronized (fLock) {
+ if (fNodeMapRef == null)
+ return;
+ boolean unsetMap= false;
+ if (fNodeMap == null) {
+ fNodeMap= fNodeMapRef.get();
+ if (fNodeMap == null)
+ return;
+ unsetMap= true;
+ }
+ try {
+ delta.accept(this);
+ } catch (CoreException e) {
+ CCorePlugin.log(e);
+ } finally {
+ if (fNeedCleanup)
+ cleanup();
+ fCurrentExtensions= null;
+ fNeedCleanup= false;
+ if (unsetMap)
+ fNodeMap= null;
+ }
+ }
+ }
+
+ /**
+ * Handles resource change notifications by visiting the delta.
+ */
+ public boolean visit(IResourceDelta delta) throws CoreException {
+ assert Thread.holdsLock(fLock);
+
+ final IResource res= delta.getResource();
+ if (res instanceof IWorkspaceRoot)
+ return VISIT_CHILDREN;
+
+ if (res instanceof IProject) {
+ // project not yet handled
+ final String name = res.getName();
+ final Extensions exts= fFileExtensions.get(name);
+ if (exts == null)
+ return SKIP_CHILDREN;
+
+ switch (delta.getKind()) {
+ case IResourceDelta.ADDED: // new projects should not yet be part of the tree
+ case IResourceDelta.REMOVED:
+ fFileExtensions.remove(name);
+ remove(res);
+ return SKIP_CHILDREN;
+
+ case IResourceDelta.CHANGED:
+ if ((delta.getFlags() & (TRIGGER_RECALC | IResourceDelta.DESCRIPTION)) != 0) {
+ fFileExtensions.remove(name);
+ remove(res);
+ return SKIP_CHILDREN;
+ }
+ break;
+ }
+ fCurrentExtensions= exts;
+ return VISIT_CHILDREN;
+ }
+
+ // file or folder
+ switch (delta.getKind()) {
+ case IResourceDelta.ADDED:
+ add(res);
+ return SKIP_CHILDREN;
+
+ case IResourceDelta.CHANGED:
+ if ((delta.getFlags() & TRIGGER_RECALC) != 0) {
+ remove(res);
+ add(res);
+ return SKIP_CHILDREN;
+ }
+ return VISIT_CHILDREN;
+
+ case IResourceDelta.REMOVED:
+
+ remove(res);
+ return SKIP_CHILDREN;
+ }
+ return VISIT_CHILDREN;
+ }
+
+
+ /**
+ * Add a resource to the tree.
+ */
+ private void add(IResource res) {
+ assert Thread.holdsLock(fLock);
+
+ if (res instanceof IFile) {
+ final String resName = res.getName();
+ String linkedName= null;
+ if (res.isLinked()) {
+ URI uri= res.getLocationURI();
+ if (uri != null) {
+ linkedName= LocationAdapter.URI.extractName(uri);
+ if (linkedName.length() > 0 && fCurrentExtensions.isRelevant(linkedName)) {
+ if (linkedName.equals(resName)) {
+ createFileNode(res.getFullPath(), null);
+ } else {
+ createFileNode(res.getFullPath(), linkedName);
+ }
+ }
+ }
+ } else if (fCurrentExtensions.isRelevant(resName)) {
+ createFileNode(res.getFullPath(), null);
+ }
+ } else {
+ try {
+ res.accept(this, 0);
+ } catch (CoreException e) {
+ CCorePlugin.log(e);
+ }
+ }
+ }
+
+ /**
+ * Add a resource tree by using a resource proxy visitor.
+ */
+ public boolean visit(IResourceProxy proxy) throws CoreException {
+ if (proxy.getType() == IResource.FILE) {
+ if (fCurrentExtensions.isRelevant(proxy.getName())) {
+ if (proxy.isLinked()) {
+ IResource res= proxy.requestResource();
+ if (res instanceof IFile) {
+ add(res);
+ }
+ return true;
+ }
+ createFileNode(proxy.requestFullPath(), null);
+ }
+ }
+ return true;
+ }
+
+
+ public void unrefNodeMap() {
+ synchronized (fLock) {
+ fNodeMap= null;
+ }
+ }
+
+ public void simulateNodeMapCollection() {
+ synchronized (fLock) {
+ fNodeMap= null;
+ fNodeMapRef= new SoftReference<Map<Integer, Object>>(null);
+ }
+ }
+
+ /**
+ * Initializes nodes for the given projects. Also creates the node map if it was collected.
+ */
+ private void initializeProjects(IProject[] projects) {
+ assert Thread.holdsLock(fLock);
+
+ if (fNodeMap == null) {
+ if (fNodeMapRef != null) {
+ fNodeMap= fNodeMapRef.get();
+ }
+
+ if (fNodeMap == null) {
+ fFileExtensions.clear();
+ fNodeMap= new HashMap<Integer, Object>();
+ fNodeMapRef= new SoftReference<Map<Integer, Object>>(fNodeMap);
+ }
+ }
+ fUnrefJob.cancel();
+ fUnrefJob.schedule(UNREF_DELAY);
+
+ for (IProject project : projects) {
+ if (project.isOpen() && !fFileExtensions.containsKey(project.getName())) {
+ Extensions ext= fDefaultExtensions;
+ try {
+ if (project.hasNature(CProjectNature.C_NATURE_ID)) {
+ ext= fCDTProjectExtensions;
+ }
+ } catch (CoreException e) {
+ CCorePlugin.log(e);
+ // treat as non-cdt project
+ }
+ fCurrentExtensions= ext;
+ add(project);
+ fFileExtensions.put(project.getName(), ext);
+ fCurrentExtensions= null;
+ }
+ }
+ }
+
+ /**
+ * Initializes file-extensions and node map
+ */
+ private void initFileExtensions() {
+
+ if (fDefaultExtensions == null) {
+ HashSet<String> cdtContentTypes= new HashSet<String>();
+ String[] registeredContentTypes= CoreModel.getRegistedContentTypeIds();
+ cdtContentTypes.addAll(Arrays.asList(registeredContentTypes));
+
+ final IContentTypeManager ctm= Platform.getContentTypeManager();
+ final IContentType[] ctts= ctm.getAllContentTypes();
+ Set<String> result= new HashSet<String>();
+ outer: for (IContentType ctt : ctts) {
+ IContentType basedOn= ctt;
+ while (basedOn != null) {
+ if (cdtContentTypes.contains(basedOn.getId()))
+ continue outer;
+ basedOn= basedOn.getBaseType();
+ }
+ // this is a non-cdt content type
+ addFileSpecs(ctt, result);
+ }
+ fCDTProjectExtensions= new Extensions(result, true);
+
+ result= new HashSet<String>();
+ for (IContentType ctt : ctts) {
+ IContentType basedOn= ctt;
+ while (basedOn != null) {
+ if (cdtContentTypes.contains(basedOn.getId())) {
+ addFileSpecs(ctt, result);
+ break;
+ }
+ basedOn= basedOn.getBaseType();
+ }
+ }
+ fDefaultExtensions= new Extensions(result, false);
+ }
+ }
+
+ private void addFileSpecs(IContentType ctt, Set<String> result) {
+ String[] fspecs= ctt.getFileSpecs(IContentType.FILE_EXTENSION_SPEC);
+ for (String fspec : fspecs) {
+ result.add(fspec.toUpperCase());
+ }
+ }
+
+ /**
+ * Inserts a node for the given path.
+ */
+ private void createFileNode(IPath fullPath, String fileLink) {
+ final String[] segments= fullPath.segments();
+ final boolean isFileLinkTarget= fileLink != null;
+ final char[][] charArraySegments = toCharArrayArray(segments, fileLink);
+ createNode(charArraySegments, charArraySegments.length, true, isFileLinkTarget);
+ }
+
+ private char[][] toCharArrayArray(String[] segments, String fileLink) {
+ final int segmentLen = segments.length;
+ char[][] chsegs;
+ if (fileLink != null) {
+ chsegs= new char[segmentLen+1][];
+ chsegs[segmentLen]= fileLink.toCharArray();
+ } else {
+ chsegs= new char[segmentLen][];
+ }
+ for (int i = 0; i < segmentLen; i++) {
+ chsegs[i]= segments[i].toCharArray();
+ }
+ return chsegs;
+ }
+
+ /**
+ * Inserts a node for the given path.
+ */
+ private Node createNode(char[][] segments, int segmentCount, boolean hasFileLocationName, boolean isFileLinkTarget) {
+ assert Thread.holdsLock(fLock);
+
+ if (segmentCount == 0)
+ return fRootNode;
+
+ if (!hasFileLocationName && fLastFolderNode != null) {
+ if (isNodeForSegments(fLastFolderNode, segments, segmentCount, isFileLinkTarget))
+ return fLastFolderNode;
+ }
+
+ final char[] name= segments[segmentCount-1];
+ final int hash= hashCode(name);
+
+ // search for existing node
+ Object obj= fNodeMap.get(hash);
+
+ Node[] nodes= null;
+ int len= 0;
+ if (obj != null) {
+ if (obj instanceof Node) {
+ Node node= (Node) obj;
+ if (isNodeForSegments(node, segments, segmentCount, isFileLinkTarget)) {
+ if (!hasFileLocationName)
+ fLastFolderNode= node;
+ return node;
+ }
+ nodes= new Node[]{node, null};
+ fNodeMap.put(hash, nodes);
+ len= 1;
+ } else {
+ nodes= (Node[]) obj;
+ for (len=0; len < nodes.length; len++) {
+ Node node = nodes[len];
+ if (node == null)
+ break;
+ if (isNodeForSegments(node, segments, segmentCount, isFileLinkTarget)) {
+ if (!hasFileLocationName)
+ fLastFolderNode= node;
+ return node;
+ }
+ }
+ }
+ }
+ final Node parent= createNode(segments, segmentCount-1, false, false);
+ Node node= new Node(parent, name, hasFileLocationName, isFileLinkTarget);
+ if (nodes == null) {
+ fNodeMap.put(hash, node);
+ } else {
+ if (len == nodes.length) {
+ Node[] newNodes= new Node[len+2];
+ System.arraycopy(nodes, 0, newNodes, 0, len);
+ nodes= newNodes;
+ fNodeMap.put(hash, nodes);
+ }
+ nodes[len]= node;
+ }
+
+ if (!hasFileLocationName)
+ fLastFolderNode= node;
+ return node;
+ }
+
+ /**
+ * Checks whether the given node matches the given segments.
+ */
+ private boolean isNodeForSegments(Node node, char[][] segments, int segmentLength, boolean isFileLinkTarget) {
+ assert Thread.holdsLock(fLock);
+
+ if (node.fIsFileLinkTarget != isFileLinkTarget)
+ return false;
+
+ while(segmentLength > 0 && node != null) {
+ if (!CharArrayUtils.equals(segments[--segmentLength], node.fResourceName))
+ return false;
+ node= node.fParent;
+ }
+ return node == fRootNode;
+ }
+
+ /**
+ * Remove a resource from the tree
+ */
+ private void remove(IResource res) {
+ assert Thread.holdsLock(fLock);
+
+ final char[] name= res.getName().toCharArray();
+ final int hash= hashCode(name);
+
+ Object obj= fNodeMap.get(hash);
+ if (obj == null)
+ return;
+
+ final IPath fullPath= res.getFullPath();
+ final int segmentCount= fullPath.segmentCount();
+ if (segmentCount == 0)
+ return;
+
+ final char[][]segments= toCharArrayArray(fullPath.segments(), null);
+ if (obj instanceof Node) {
+ final Node node= (Node) obj;
+ if (!node.fDeleted && isNodeForSegments(node, segments, segmentCount, false)) {
+ node.fDeleted= true;
+ if (node.fHasChildren)
+ fNeedCleanup= true;
+ fNodeMap.remove(hash);
+ }
+ } else {
+ final Node[] nodes= (Node[]) obj;
+ for (int i= 0; i < nodes.length; i++) {
+ Node node = nodes[i];
+ if (node == null)
+ return;
+ if (!node.fDeleted && isNodeForSegments(node, segments, segmentCount, false)) {
+ remove(nodes, i);
+
+ if (nodes[0] == null)
+ fNodeMap.remove(hash);
+
+ node.fDeleted= true;
+ if (node.fHasChildren)
+ fNeedCleanup= true;
+
+ return;
+ }
+ }
+ }
+ }
+
+ private void remove(Node[] nodes, int i) {
+ int idx= lastValid(nodes, i);
+ if (idx > 0) {
+ nodes[i]= nodes[idx];
+ nodes[idx]= null;
+ }
+ }
+
+ private int lastValid(Node[] nodes, int left) {
+ int right= nodes.length-1;
+ while (left < right) {
+ int mid= (left+right+1)/2; // ==> mid > left
+ if (nodes[mid] == null)
+ right= mid-1;
+ else
+ left= mid;
+ }
+ return right;
+ }
+
+ private void cleanup() {
+ assert Thread.holdsLock(fLock);
+ fLastFolderNode= null;
+
+ for (Iterator<Object> iterator = fNodeMap.values().iterator(); iterator.hasNext();) {
+ Object obj= iterator.next();
+ if (obj instanceof Node) {
+ if (isDeleted((Node) obj)) {
+ iterator.remove();
+ }
+ } else {
+ Node[] nodes= (Node[]) obj;
+ int j= 0;
+ for (int i = 0; i < nodes.length; i++) {
+ final Node node = nodes[i];
+ if (node == null) {
+ if (j==0) {
+ iterator.remove();
+ }
+ break;
+ }
+ if (!isDeleted(node)) {
+ if (i != j) {
+ nodes[j]= node;
+ nodes[i]= null;
+ }
+ j++;
+ } else {
+ nodes[i]= null;
+ }
+ }
+ }
+ }
+ }
+
+ private boolean isDeleted(Node node) {
+ while(node != null) {
+ if (node.fDeleted)
+ return true;
+ node= node.fParent;
+ }
+ return false;
+ }
+
+ /**
+ * Computes a case insensitive hash-code for file names.
+ */
+ private int hashCode(char[] name) {
+ int h= 0;
+ final int len = name.length;
+ for (int i = 0; i < len; i++) {
+ h = 31*h + Character.toUpperCase(name[i]);
+ }
+ return h;
+ }
+
+ /**
+ * Searches for all files with the given location. In case the name of the location is
+ * a cdt-content type the lookup tree is consulted, otherwise as a fallback the platform's
+ * method is called.
+ */
+ public IFile[] findFilesForLocationURI(URI location) {
+ return findFilesForLocation(location, LocationAdapter.URI);
+ }
+
+ /**
+ * Searches for all files with the given location. In case the name of the location is
+ * a cdt-content type the lookup tree is consulted, otherwise as a fallback the platform's
+ * method is called.
+ */
+ public IFile[] findFilesForLocation(IPath location) {
+ return findFilesForLocation(location, LocationAdapter.PATH);
+ }
+
+ /**
+ * Searches for all files with the given location. In case the name of the location is
+ * a cdt-content type the lookup tree is consulted, otherwise as a fallback the platform's
+ * method is called.
+ */
+ public <T> IFile[] findFilesForLocation(T location, LocationAdapter<T> adapter) {
+ initFileExtensions();
+ String name= adapter.extractName(location);
+ Node[] candidates= null;
+ synchronized (fLock) {
+ initializeProjects(ResourcesPlugin.getWorkspace().getRoot().getProjects());
+ Object obj= fNodeMap.get(hashCode(name.toCharArray()));
+ if (obj != null) {
+ candidates= convert(obj);
+ IFile[] result= extractMatchesForLocation(candidates, location, adapter);
+ if (result.length > 0)
+ return result;
+ }
+ }
+
+ // fall back to platform functionality
+ return adapter.platformsFindFilesForLocation(location);
+ }
+
+ private Node[] convert(Object obj) {
+ if (obj instanceof Node)
+ return new Node[] {(Node) obj};
+
+ final Node[] nodes= (Node[]) obj;
+ final int len= lastValid(nodes, -1)+1;
+ final Node[] result= new Node[len];
+ System.arraycopy(nodes, 0, result, 0, len);
+ return result;
+ }
+
+ /**
+ * Returns an array of files for the given name. Search is limited to the supplied projects.
+ */
+ public IFile[] findFilesByName(IPath relativeLocation, IProject[] projects, boolean ignoreCase) {
+ final int segCount= relativeLocation.segmentCount();
+ if (segCount < 1)
+ return NO_FILES;
+
+ final String name= relativeLocation.lastSegment();
+ Node[] candidates;
+
+ initFileExtensions();
+ synchronized (fLock) {
+ initializeProjects(projects);
+ Object obj= fNodeMap.get(hashCode(name.toCharArray()));
+ if (obj == null) {
+ return NO_FILES;
+ }
+ candidates= convert(obj);
+ }
+ String suffix= relativeLocation.toString();
+ while(suffix.startsWith("../")) { //$NON-NLS-1$
+ suffix= suffix.substring(3);
+ }
+ Set<String> prjset= new HashSet<String>();
+ for (IProject prj : projects) {
+ prjset.add(prj.getName());
+ }
+ return extractMatchesForName(candidates, name, suffix, ignoreCase, prjset);
+ }
+
+ /**
+ * Selects the actual matches for the list of candidate nodes.
+ */
+ private IFile[] extractMatchesForName(Node[] candidates, String name, String suffix, boolean ignoreCase, Set<String> prjSet) {
+ final char[] n1= name.toCharArray();
+ final int namelen = n1.length;
+ int resultIdx= 0;
+
+ if (ignoreCase) {
+ for (int j = 0; j < namelen; j++) {
+ n1[j]= Character.toUpperCase(n1[j]);
+ }
+ }
+ final int suffixLen= suffix.length();
+ final IWorkspaceRoot root= ResourcesPlugin.getWorkspace().getRoot();
+ IFile[] result= null;
+ outer: for (int i = 0; i < candidates.length; i++) {
+ final Node node = candidates[i];
+ if (node.fHasFileLocationName && checkProject(node, prjSet)) {
+ final char[] n2= node.fResourceName;
+ if (namelen == n2.length) {
+ for (int j = 0; j < n2.length; j++) {
+ final char c= ignoreCase ? Character.toUpperCase(n2[j]) : n2[j];
+ if (c != n1[j])
+ continue outer;
+ }
+ final IFile file= root.getFile(createPath(node));
+ final URI loc= file.getLocationURI();
+ if (loc != null) {
+ String path= loc.getPath();
+ final int len= path.length();
+ if (len >= suffixLen &&
+ suffix.regionMatches(ignoreCase, 0, path, len-suffixLen, suffixLen)) {
+ if (result == null)
+ result= new IFile[candidates.length-i];
+ result[resultIdx++]= root.getFile(createPath(node));
+ }
+ }
+ }
+ }
+ }
+ if (result==null)
+ return NO_FILES;
+
+ if (resultIdx < result.length) {
+ IFile[] copy= new IFile[resultIdx];
+ System.arraycopy(result, 0, copy, 0, resultIdx);
+ return copy;
+ }
+ return result;
+ }
+
+ private boolean checkProject(Node node, Set<String> prjSet) {
+ while(true) {
+ final Node n= node.fParent;
+ if (n == fRootNode)
+ break;
+ if (n == null)
+ return false;
+ node= n;
+ }
+ return prjSet.contains(new String(node.fResourceName));
+ }
+
+ private IPath createPath(Node node) {
+ if (node == fRootNode)
+ return Path.ROOT;
+
+ if (node.fIsFileLinkTarget)
+ return createPath(node.fParent);
+
+ return createPath(node.fParent).append(new String(node.fResourceName));
+ }
+
+ /**
+ * Selects the actual matches from the list of candidates
+ */
+ private <T> IFile[] extractMatchesForLocation(Node[] candidates, T location, LocationAdapter<T> adapter) {
+ final IWorkspaceRoot root= ResourcesPlugin.getWorkspace().getRoot();
+ final String searchPath= adapter.getCanonicalPath(location);
+ IFile[] result= null;
+ int resultIdx= 0;
+ for (int i = 0; i < candidates.length; i++) {
+ final Node node = candidates[i];
+ if (node.fHasFileLocationName) {
+ final IFile file= root.getFile(createPath(node));
+ final T loc= adapter.getLocation(file);
+ if (loc != null) {
+ if (!loc.equals(location)) {
+ if (searchPath == null)
+ continue;
+
+ if (node.fCanonicHash != 0 && node.fCanonicHash != searchPath.hashCode())
+ continue;
+
+ final String candPath= adapter.getCanonicalPath(loc);
+ if (candPath == null)
+ continue;
+
+ node.fCanonicHash= candPath.hashCode();
+ if (!candPath.equals(searchPath))
+ continue;
+ }
+ if (result == null)
+ result= new IFile[candidates.length-i];
+ result[resultIdx++]= root.getFile(createPath(node));
+ }
+ }
+ }
+ if (result==null)
+ return NO_FILES;
+
+ if (resultIdx < result.length) {
+ IFile[] copy= new IFile[resultIdx];
+ System.arraycopy(result, 0, copy, 0, resultIdx);
+ return copy;
+ }
+ return result;
+ }
+
+ @SuppressWarnings("nls")
+ public void dump() {
+ List<String> lines= new ArrayList<String>();
+ synchronized (fLock) {
+ for (Iterator<Object> iterator = fNodeMap.values().iterator(); iterator.hasNext();) {
+ Node[] nodes= convert(iterator.next());
+ for (int i = 0; i < nodes.length; i++) {
+ final Node node = nodes[i];
+ if (node == null) {
+ break;
+ }
+ lines.add(toString(node));
+ }
+ }
+ }
+ Collections.sort(lines);
+ System.out.println("Dumping files:");
+ for (Iterator<String> iterator = lines.iterator(); iterator.hasNext();) {
+ String line = iterator.next();
+ System.out.println(line);
+ }
+ System.out.flush();
+ }
+
+ @SuppressWarnings("nls")
+ private String toString(Node node) {
+ if (node == fRootNode)
+ return "";
+
+ return toString(node.fParent) + "/" + new String(node.fResourceName);
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/SingleCharReader.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/SingleCharReader.java
new file mode 100644
index 0000000000..1d48fcc21b
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/SingleCharReader.java
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * Copyright (c) 2000 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * QNX Software System
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui;
+
+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;
+ }
+ 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/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/SubstitutionTextReader.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/SubstitutionTextReader.java
new file mode 100644
index 0000000000..16d8400b98
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/SubstitutionTextReader.java
@@ -0,0 +1,138 @@
+/*******************************************************************************
+ * Copyright (c) 2000 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * QNX Software System
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui;
+
+
+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 <code>nextChar</code>
+ * 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;
+ }
+ 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/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/AbstractAutotoolsHandler.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/AbstractAutotoolsHandler.java
new file mode 100644
index 0000000000..f912af4a57
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/AbstractAutotoolsHandler.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.actions;
+
+import java.util.Collection;
+
+import org.eclipse.cdt.core.model.ICContainer;
+import org.eclipse.cdt.core.model.ICElement;
+import org.eclipse.cdt.core.model.ICProject;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.expressions.IEvaluationContext;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IResource;
+
+public abstract class AbstractAutotoolsHandler extends AbstractHandler {
+
+ @SuppressWarnings("unchecked")
+ protected IContainer getContainer(IEvaluationContext e) {
+ IContainer fContainer = null;
+
+ Object obj = e.getDefaultVariable();
+ if (obj instanceof Collection) {
+ Collection<Object> c = (Collection<Object>)obj;
+ Object[] objArray = c.toArray();
+ if (objArray.length > 0)
+ obj = objArray[0];
+ }
+ if (obj instanceof ICElement) {
+ if ( obj instanceof ICContainer || obj instanceof ICProject) {
+ fContainer = (IContainer) ((ICElement) 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;
+ }
+ return fContainer;
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/AbstractTargetAction.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/AbstractTargetAction.java
new file mode 100644
index 0000000000..738faf088c
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/AbstractTargetAction.java
@@ -0,0 +1,92 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2004 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.actions;
+
+import org.eclipse.cdt.core.model.ICContainer;
+import org.eclipse.cdt.core.model.ICElement;
+import org.eclipse.cdt.core.model.ICProject;
+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.linuxtools.cdt.autotools.core.AutotoolsPlugin;
+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 AutotoolsPlugin.getActiveWorkbenchShell();
+ }
+
+ protected IContainer getSelectedContainer() {
+ return fContainer;
+ }
+
+ public void setSelectedContainer(IContainer container) {
+ fContainer = container;
+ }
+
+ 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 || obj instanceof ICProject) {
+ fContainer = (IContainer) ((ICElement) 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 && AutotoolsPlugin.hasTargetBuilder(fContainer.getProject())) {
+ enabled = true;
+ }
+ }
+ action.setEnabled(enabled);
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/AclocalHandler.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/AclocalHandler.java
new file mode 100644
index 0000000000..e09ea2609e
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/AclocalHandler.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.actions;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.expressions.IEvaluationContext;
+import org.eclipse.core.resources.IContainer;
+
+/**
+ * @author Jeff Johnston
+ *
+ */
+public class AclocalHandler extends AbstractAutotoolsHandler {
+
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ InvokeAclocalAction a = new InvokeAclocalAction();
+ Object o = event.getApplicationContext();
+ if (o instanceof IEvaluationContext) {
+ IContainer container = getContainer((IEvaluationContext)o);
+ if (container != null) {
+ a.setSelectedContainer(container);
+ a.run(null);
+ }
+ }
+ return null;
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/AutoconfHandler.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/AutoconfHandler.java
new file mode 100644
index 0000000000..7991a519e4
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/AutoconfHandler.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.actions;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.expressions.IEvaluationContext;
+import org.eclipse.core.resources.IContainer;
+
+public class AutoconfHandler extends AbstractAutotoolsHandler {
+
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ InvokeAutoconfAction a = new InvokeAutoconfAction();
+ Object o = event.getApplicationContext();
+ if (o instanceof IEvaluationContext) {
+ IContainer container = getContainer((IEvaluationContext)o);
+ if (container != null) {
+ a.setSelectedContainer(container);
+ a.run(null);
+ }
+ }
+ return null;
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/AutoheaderHandler.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/AutoheaderHandler.java
new file mode 100644
index 0000000000..473e71b4ea
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/AutoheaderHandler.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.actions;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.expressions.IEvaluationContext;
+import org.eclipse.core.resources.IContainer;
+
+/**
+ * @author Jeff Johnston
+ *
+ */
+public class AutoheaderHandler extends AbstractAutotoolsHandler {
+
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ InvokeAutoheaderAction a = new InvokeAutoheaderAction();
+ Object o = event.getApplicationContext();
+ if (o instanceof IEvaluationContext) {
+ IContainer container = getContainer((IEvaluationContext)o);
+ if (container != null) {
+ a.setSelectedContainer(container);
+ a.run(null);
+ }
+ }
+ return null;
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/AutomakeHandler.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/AutomakeHandler.java
new file mode 100644
index 0000000000..23b8050d4e
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/AutomakeHandler.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.actions;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.expressions.IEvaluationContext;
+import org.eclipse.core.resources.IContainer;
+
+public class AutomakeHandler extends AbstractAutotoolsHandler {
+
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ InvokeAutomakeAction a = new InvokeAutomakeAction();
+ Object o = event.getApplicationContext();
+ if (o instanceof IEvaluationContext) {
+ IContainer container = getContainer((IEvaluationContext)o);
+ if (container != null) {
+ a.setSelectedContainer(container);
+ a.run(null);
+ }
+ }
+ return null;
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/AutoreconfHandler.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/AutoreconfHandler.java
new file mode 100644
index 0000000000..ae1923f806
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/AutoreconfHandler.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.actions;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.expressions.IEvaluationContext;
+import org.eclipse.core.resources.IContainer;
+
+/**
+ * @author Jeff Johnston
+ *
+ */
+public class AutoreconfHandler extends AbstractAutotoolsHandler {
+
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ InvokeAutoreconfAction a = new InvokeAutoreconfAction();
+ Object o = event.getApplicationContext();
+ if (o instanceof IEvaluationContext) {
+ IContainer container = getContainer((IEvaluationContext)o);
+ if (container != null) {
+ a.setSelectedContainer(container);
+ a.run(null);
+ }
+ }
+ return null;
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeAclocalAction.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeAclocalAction.java
new file mode 100644
index 0000000000..1d03b33797
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeAclocalAction.java
@@ -0,0 +1,104 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2007 2009 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.actions;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.linuxtools.internal.cdt.autotools.core.AutotoolsPropertyConstants;
+import org.eclipse.swt.widgets.Shell;
+
+
+public class InvokeAclocalAction extends InvokeAction {
+
+ private static final String DEFAULT_OPTION = ""; //$NON-NLS-1$
+ private static final String DEFAULT_COMMAND = "aclocal"; //$NON-NLS-1$
+
+ public void run(IAction action) {
+
+ IContainer container = getSelectedContainer();
+ if (container == null)
+ return;
+
+ IPath execDir = getExecDir(container);
+ String cwd = InvokeMessages.getString("CWD") + getCWD(container); //$NON-NLS-1$
+
+ TwoInputDialog optionDialog = new TwoInputDialog(
+ new Shell(),
+ cwd,
+ InvokeMessages
+ .getString("InvokeAclocalAction.windowTitle.options"), //$NON-NLS-1$
+ InvokeMessages
+ .getString("InvokeAclocalAction.message.options.otherOptions"), //$NON-NLS-1$
+ InvokeMessages
+ .getString("InvokeAclocalAction.message.options.includeDir"), DEFAULT_OPTION, null); //$NON-NLS-1$
+
+ optionDialog.open();
+
+ // chop args into string array
+ String rawArgList = optionDialog.getValue();
+
+ String[] optionsList = separateOptions(rawArgList);
+
+ // chop args into string array
+ rawArgList = optionDialog.getSecondValue();
+
+ String[] targetList = separateTargets(rawArgList);
+
+ if (targetList == null) {
+
+ showError(InvokeMessages
+ .getString("InvokeAction.execute.windowTitle.error"), //$NON-NLS-1$
+ InvokeMessages
+ .getString("InvokeAction.windowTitle.quoteError")); //$NON-NLS-1$
+ return;
+ }
+
+ int iOption = 0;
+ if (targetList.length > 0)
+ iOption = 1;
+
+ String[] argumentList = new String[targetList.length
+ + optionsList.length + iOption];
+
+ System.arraycopy(optionsList, 0, argumentList, 0, optionsList.length);
+
+ if (iOption == 1)
+ argumentList[optionsList.length] = "-I"; //$NON-NLS-1$
+
+ System.arraycopy(targetList, 0, argumentList, optionsList.length
+ + iOption, targetList.length);
+
+ if (container != null) {
+ String aclocalCommand = null;
+ IProject project = getSelectedContainer().getProject();
+ try {
+ aclocalCommand = project.getPersistentProperty(AutotoolsPropertyConstants.ACLOCAL_TOOL);
+ } catch (CoreException e) {
+ // do nothing
+ }
+
+ // If unset, use default system path
+ if (aclocalCommand == null)
+ aclocalCommand = DEFAULT_COMMAND;
+
+ executeConsoleCommand(DEFAULT_COMMAND, aclocalCommand,
+ argumentList, execDir);
+ }
+ }
+
+ public void dispose() {
+
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeAction.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeAction.java
new file mode 100644
index 0000000000..600eef7708
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeAction.java
@@ -0,0 +1,442 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2007, 2009 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.actions;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.StringTokenizer;
+
+import org.eclipse.cdt.core.CCorePlugin;
+import org.eclipse.cdt.core.CommandLauncher;
+import org.eclipse.cdt.core.ConsoleOutputStream;
+import org.eclipse.cdt.core.envvar.IEnvironmentVariable;
+import org.eclipse.cdt.core.resources.IConsole;
+import org.eclipse.cdt.managedbuilder.core.IConfiguration;
+import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
+import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
+import org.eclipse.core.resources.IContainer;
+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;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.core.runtime.jobs.ISchedulingRule;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.dialogs.InputDialog;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.linuxtools.cdt.autotools.ui.AutotoolsUIPlugin;
+import org.eclipse.linuxtools.internal.cdt.autotools.core.AutotoolsNewMakeGenerator;
+import org.eclipse.swt.widgets.Shell;
+
+public abstract class InvokeAction extends AbstractTargetAction {
+
+ protected void showInformation(String title, String content) {
+
+ MessageDialog.openInformation(new Shell(), title, content);
+ }
+
+ protected void showError(String title, String content) {
+
+ MessageDialog.openError(new Shell(), title, content);
+ }
+
+ protected void showSuccess(String title) {
+ MessageDialog.openInformation(new Shell(), title,
+ InvokeMessages.getString("InvokeAction.success")); //$NON-NLS-1$
+ }
+
+ protected String showInput(String title, String content, String defaultTxt) {
+ InputDialog getOptionDialog = new InputDialog(new Shell(), title,
+ content, defaultTxt, null);
+
+ getOptionDialog.open();
+
+ return getOptionDialog.getValue();
+ }
+
+ /**
+ * Separate targets to array from a string.
+ *
+ * @param rawArgList
+ * @return targets in string[] array. if targets are not formatted properly,
+ * returns null
+ */
+ protected String[] separateTargets(String rawArgList) {
+
+ StringTokenizer st = new StringTokenizer(rawArgList, " "); //$NON-NLS-1$
+ ArrayList<String> targetList = new ArrayList<String>();
+
+ while (st.hasMoreTokens()) {
+ String currentWord = st.nextToken().trim();
+
+ if (currentWord.startsWith("'")) { //$NON-NLS-1$
+ String tmpTarget = ""; //$NON-NLS-1$
+ while (!currentWord.endsWith("'")) { //$NON-NLS-1$
+ tmpTarget += currentWord + " "; //$NON-NLS-1$
+ if (!st.hasMoreTokens()) {
+ // quote not closed properly, so return null
+ return null;
+ }
+ currentWord = st.nextToken().trim();
+ }
+
+ tmpTarget += currentWord;
+ targetList.add(tmpTarget);
+ continue;
+ }
+
+ if (currentWord.startsWith("\"")) { //$NON-NLS-1$
+ String tmpTarget = ""; //$NON-NLS-1$
+ while (!currentWord.endsWith("\"")) { //$NON-NLS-1$
+ tmpTarget += currentWord + " "; //$NON-NLS-1$
+ if (!st.hasMoreTokens()) {
+ // double quote not closed properly, so return null
+ return null;
+ }
+ currentWord = st.nextToken().trim();
+ }
+
+ tmpTarget += currentWord;
+ targetList.add(tmpTarget);
+ continue;
+ }
+
+ // for targets without quote/double quotes.
+ targetList.add(currentWord);
+
+ }
+
+ return (String[])targetList.toArray(new String[targetList.size()]);
+ }
+
+ protected String[] separateOptions(String rawArgList) {
+ ArrayList<String> argList = new ArrayList<String>();
+ // May be multiple user-specified options in which case we
+ // need to split them up into individual options
+ rawArgList = rawArgList.trim();
+ boolean finished = false;
+ int lastIndex = rawArgList.indexOf("--"); //$NON-NLS-1$
+ if (lastIndex != -1) {
+ while (!finished) {
+ int index = rawArgList.indexOf("--", lastIndex + 2); //$NON-NLS-1$
+ if (index != -1) {
+ String previous = rawArgList.substring(lastIndex, index)
+ .trim();
+ argList.add(previous);
+ rawArgList = rawArgList.substring(index);
+ } else {
+ argList.add(rawArgList);
+ finished = true;
+ }
+ }
+ }
+
+ return (String[])argList.toArray(new String[argList.size()]);
+
+ }
+
+ protected String[] simpleParseOptions(String rawArgList) {
+ ArrayList<String> argList = new ArrayList<String>();
+ int lastArgIndex = -1;
+ int i = 0;
+ while (i < rawArgList.length()) {
+ char ch = rawArgList.charAt(i);
+ // Skip white-space
+ while (Character.isWhitespace(ch)) {
+ ++i;
+ if (i < rawArgList.length())
+ ch = rawArgList.charAt(i);
+ else // Otherwise we are done
+ return argList.toArray(new String[argList.size()]);
+ }
+
+ // Simplistic parser. We break up into strings delimited
+ // by blanks. If quotes are used, we ignore blanks within.
+ // If a backslash is used, we ignore the next character and
+ // pass it through.
+ lastArgIndex = i;
+ boolean inString = false;
+ while (i < rawArgList.length()) {
+ ch = rawArgList.charAt(i);
+ if (ch == '\\') // escape character
+ ++i; // skip over the next character
+ else if (ch == '\"') { // double quotes
+ inString = !inString;
+ } else if (Character.isWhitespace(ch)) {
+ if (!inString) {
+ argList.add(rawArgList.substring(lastArgIndex, i));
+ break;
+ }
+ }
+ ++i;
+ }
+ // Look for the case where we ran out of chars for the last
+ // token.
+ if (i >= rawArgList.length())
+ argList.add(rawArgList.substring(lastArgIndex));
+ ++i;
+ }
+ return argList.toArray(new String[argList.size()]);
+ }
+
+ protected IPath getExecDir(IContainer container) {
+ int type = container.getType();
+ IPath execDir = null;
+ if (type == IContainer.FILE) {
+ execDir = container.getLocation().removeLastSegments(1);
+ } else {
+ execDir = container.getLocation();
+ }
+ return execDir;
+ }
+
+ protected IPath getCWD(IContainer container) {
+ int type = container.getType();
+ IPath cwd = null;
+ if (type == IContainer.FILE) {
+ cwd = container.getFullPath().removeLastSegments(1);
+ } else {
+ cwd = container.getFullPath();
+ }
+ return cwd;
+ }
+
+ private class ExecuteProgressDialog implements IRunnableWithProgress {
+ private IPath command;
+ private String[] argumentList;
+ private String[] envList;
+ private IPath execDir;
+ private int status;
+ private HashMap<String, String> outputs = null;
+
+ public ExecuteProgressDialog(IPath command, String[] argumentList,
+ String[] envList, IPath execDir) {
+ this.command = command;
+ this.argumentList = argumentList;
+ this.envList = envList;
+ this.execDir = execDir;
+ }
+
+ public void run(IProgressMonitor monitor)
+ throws InvocationTargetException, InterruptedException {
+ ByteArrayOutputStream stdout = new ByteArrayOutputStream();
+ ByteArrayOutputStream stderr = new ByteArrayOutputStream();
+ CommandLauncher cmdL = new CommandLauncher();
+ outputs = null;
+
+ // invoke command
+ try {
+ monitor.beginTask(
+ InvokeMessages.getFormattedString("InvokeAction.progress.message", // $NON-NLS-1$
+ new String[]{command.toOSString()}), IProgressMonitor.UNKNOWN);
+ monitor.worked(1);
+ Process process = cmdL.execute(command, argumentList, envList,
+ execDir, new NullProgressMonitor());
+
+ if (cmdL.waitAndRead(stdout, stderr) == CommandLauncher.OK) {
+ try {
+ status = 0;
+ monitor.done();
+ process.getOutputStream().close();
+ } catch (IOException e) {
+ // ignore
+ }
+ } else {
+ // failed to execute command
+ status = -1;
+ monitor.done();
+ return;
+ }
+ } catch (CoreException e) {
+ monitor.done();
+ throw new InvocationTargetException(e);
+ }
+
+ outputs = new HashMap<String, String>();
+
+ outputs.put("stdout", stdout.toString()); //$NON-NLS-1$
+ outputs.put("stderr", stderr.toString()); //$NON-NLS-1$
+
+ try {
+ stdout.close();
+ stderr.close();
+ } catch (IOException e) {
+ // ignore
+ }
+ }
+
+ public HashMap<String, String> getOutputs() {
+ return outputs;
+ }
+
+ public int getStatus() {
+ return status;
+ }
+ }
+
+
+ protected HashMap<String, String> executeCommand(IPath command,
+ String[] argumentList, String[] envList, IPath execDir) {
+ try {
+ ExecuteProgressDialog d = new ExecuteProgressDialog(command,
+ argumentList, envList, execDir);
+ new ProgressMonitorDialog(new Shell()).run(false, false, d);
+ if (d.getStatus() == -1)
+ showError(InvokeMessages
+ .getString("InvokeAction.execute.windowTitle.error"), InvokeMessages //$NON-NLS-1$
+ .getString("InvokeAction.execute.message") //$NON-NLS-1$
+ + command.toOSString()); //$NON-NLS-1$
+ return d.getOutputs();
+ } catch (InvocationTargetException e) {
+ showError(InvokeMessages
+ .getString("InvokeAction.execute.windowTitle.error"), InvokeMessages //$NON-NLS-1$
+ .getString("InvokeAction.execute.message") //$NON-NLS-1$
+ + command.toOSString()); //$NON-NLS-1$
+ AutotoolsUIPlugin.logException(e);
+ return null;
+ } catch (InterruptedException e) {
+ return null;
+ }
+ }
+
+ protected void executeConsoleCommand(final String actionName, final String command,
+ final String[] argumentList, final IPath execDir) {
+ // We need to use a workspace root scheduling rule because adding MakeTargets
+ // may end up saving the project description which runs under a workspace root rule.
+ final ISchedulingRule rule = ResourcesPlugin.getWorkspace().getRoot();
+
+ Job backgroundJob = new Job(actionName) {
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
+
+ public void run(IProgressMonitor monitor) throws CoreException {
+ try {
+ String errMsg = null;
+ IProject project = getSelectedContainer().getProject();
+ // Get a build console for the project
+ IConsole console = CCorePlugin.getDefault().getConsole("org.eclipse.linuxtools.cdt.autotools.ui.autotoolsConsole"); //$NON-NLS-1$
+ console.start(project);
+ ConsoleOutputStream consoleOutStream = console.getOutputStream();
+ // FIXME: we want to remove need for ManagedBuilderManager, but how do we
+ // get environment variables.
+ IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project);
+ IConfiguration cfg = info.getDefaultConfiguration();
+
+ StringBuffer buf = new StringBuffer();
+ String[] consoleHeader = new String[3];
+
+ consoleHeader[0] = actionName;
+ consoleHeader[1] = cfg.getName();
+ consoleHeader[2] = project.getName();
+ buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$ //$NON-NLS-2$
+ String invokeMsg = InvokeMessages.getFormattedString("InvokeAction.console.message", //$NON-NLS-1$
+ new String[]{actionName, execDir.toString()}); //$NON-NLS-1$
+ buf.append(invokeMsg);
+ buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$ //$NON-NLS-2$
+ buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$ //$NON-NLS-2$
+ consoleOutStream.write(buf.toString().getBytes());
+ consoleOutStream.flush();
+
+ ArrayList<String> additionalEnvs = new ArrayList<String>();
+ String strippedCommand = AutotoolsNewMakeGenerator.stripEnvVars(command, additionalEnvs);
+ // Get a launcher for the config command
+ CommandLauncher launcher = new CommandLauncher();
+ // Set the environment
+ IEnvironmentVariable variables[] = ManagedBuildManager
+ .getEnvironmentVariableProvider().getVariables(cfg, true);
+ String[] env = null;
+ ArrayList<String> envList = new ArrayList<String>();
+ if (variables != null) {
+ for (int i = 0; i < variables.length; i++) {
+ envList.add(variables[i].getName()
+ + "=" + variables[i].getValue()); //$NON-NLS-1$
+ }
+ if (additionalEnvs.size() > 0)
+ envList.addAll(additionalEnvs); // add any additional environment variables specified ahead of script
+ env = (String[]) envList.toArray(new String[envList.size()]);
+ }
+ OutputStream stdout = consoleOutStream;
+ OutputStream stderr = consoleOutStream;
+
+ launcher.showCommand(true);
+ // Run the shell script via shell command.
+ Process proc = launcher.execute(new Path(strippedCommand), argumentList, env,
+ execDir, new NullProgressMonitor());
+ 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
+ // ensure
+ // the UI is up-to-date with the build results
+ // monitor.subTask(ManagedMakeMessages
+ // .getResourceString(REFRESH));
+ monitor.subTask(AutotoolsUIPlugin.getResourceString("MakeGenerator.refresh")); //$NON-NLS-1$
+ try {
+ project.refreshLocal(IResource.DEPTH_INFINITE, null);
+ } catch (CoreException e) {
+ monitor.subTask(AutotoolsUIPlugin
+ .getResourceString("MakeGenerator.refresh.error")); //$NON-NLS-1$
+ }
+ } else {
+ errMsg = launcher.getErrorMessage();
+ }
+
+ if (errMsg != null)
+ AutotoolsUIPlugin.logErrorMessage(errMsg);
+
+ } catch (IOException e) {
+ AutotoolsUIPlugin.log(e);
+ }
+ }
+ }, rule, IWorkspace.AVOID_UPDATE, monitor);
+ } catch (CoreException e) {
+ return e.getStatus();
+ }
+ IStatus returnStatus = Status.OK_STATUS;
+ return returnStatus;
+ }
+ };
+
+ backgroundJob.setRule(rule);
+ backgroundJob.schedule();
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeAutoconfAction.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeAutoconfAction.java
new file mode 100644
index 0000000000..81e323c9ba
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeAutoconfAction.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2007 2009 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.actions;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.linuxtools.internal.cdt.autotools.core.AutotoolsPropertyConstants;
+
+
+/**
+ * Class responsible for invoking autoconf.
+ *
+ * @author klee
+ *
+ */
+public class InvokeAutoconfAction extends InvokeAction {
+
+ private final static String DEFAULT_COMMAND = "autoconf"; //$NON-NLS-1$
+ public void run(IAction action) {
+ IContainer container = getSelectedContainer();
+ if (container == null)
+ return;
+
+ IPath execDir = getExecDir(container);
+
+ if (container != null) {
+ IProject project = container.getProject();
+ String autoconfCommand = null;
+ try {
+ autoconfCommand = project.getPersistentProperty(AutotoolsPropertyConstants.AUTOCONF_TOOL);
+ } catch (CoreException e) {
+ // do nothing
+ }
+
+ // If unset for the project, default to system path
+ if (autoconfCommand == null)
+ autoconfCommand = DEFAULT_COMMAND;
+
+ executeConsoleCommand(DEFAULT_COMMAND, autoconfCommand, new String[]{}, execDir);
+ }
+ }
+
+
+ public void dispose() {
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeAutoheaderAction.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeAutoheaderAction.java
new file mode 100644
index 0000000000..8c4e5779e4
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeAutoheaderAction.java
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.actions;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.InputDialog;
+import org.eclipse.linuxtools.internal.cdt.autotools.core.AutotoolsPropertyConstants;
+import org.eclipse.swt.widgets.Shell;
+
+
+public class InvokeAutoheaderAction extends InvokeAction {
+
+ private static final String DEFAULT_OPTION = ""; //$NON-NLS-1$
+ private static final String DEFAULT_COMMAND = "autoheader"; //$NON-NLS-1$
+
+ public void run(IAction action) {
+
+ IContainer container = getSelectedContainer();
+ if (container == null)
+ return;
+
+ IPath execDir = getExecDir(container);
+ String cwd = InvokeMessages.getString("CWD") + getCWD(container); //$NON-NLS-1$
+
+ InputDialog optionDialog = new SingleInputDialog(
+ new Shell(),
+ cwd,
+ InvokeMessages
+ .getString("InvokeAutoheaderAction.windowTitle.options"), //$NON-NLS-1$
+ InvokeMessages
+ .getString("InvokeAutoheaderAction.message.options.otherOptions"), //$NON-NLS-1$
+ DEFAULT_OPTION, null);
+ optionDialog.open();
+
+ // chop args into string array
+ String rawArgList = optionDialog.getValue();
+
+ String[] optionsList = simpleParseOptions(rawArgList);
+
+ String[] argumentList = new String[optionsList.length];
+
+ System.arraycopy(optionsList, 0, argumentList, 0, optionsList.length);
+
+ if (container != null) {
+ String autoheaderCommand = null;
+ IProject project = getSelectedContainer().getProject();
+ try {
+ autoheaderCommand = project.getPersistentProperty(AutotoolsPropertyConstants.AUTOHEADER_TOOL);
+ } catch (CoreException e) {
+ // do nothing
+ }
+
+ // If unset, use default system path
+ if (autoheaderCommand == null)
+ autoheaderCommand = DEFAULT_COMMAND;
+
+ executeConsoleCommand(DEFAULT_COMMAND, autoheaderCommand,
+ argumentList, execDir);
+ }
+
+ }
+
+ public void dispose() {
+
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeAutomakeAction.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeAutomakeAction.java
new file mode 100644
index 0000000000..8210cd96ec
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeAutomakeAction.java
@@ -0,0 +1,98 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2007 2009 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.actions;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.linuxtools.internal.cdt.autotools.core.AutotoolsPropertyConstants;
+import org.eclipse.swt.widgets.Shell;
+
+
+/**
+ * Class responsible for invoking automake.
+ *
+ * @author klee
+ *
+ */
+public class InvokeAutomakeAction extends InvokeAction {
+
+ private static final String DEFAULT_OPTION = ""; //$NON-NLS-1$
+ private static final String DEFAULT_COMMAND = "automake"; //$NON-NLS-1$
+
+ public void run(IAction action) {
+
+ IContainer container = getSelectedContainer();
+ if (container == null)
+ return;
+
+ IPath execDir = getExecDir(container);
+ String cwd = InvokeMessages.getString("CWD") + getCWD(container); //$NON-NLS-1$
+;
+ TwoInputDialog optionDialog = new TwoInputDialog(new Shell(), cwd,
+ InvokeMessages
+ .getString("InvokeAutomakeAction.windowTitle.options"), //$NON-NLS-1$
+InvokeMessages
+ .getString("InvokeAutomakeAction.message.options.otherOptions"),InvokeMessages //$NON-NLS-1$
+ .getString("InvokeAutomakeAction.message.options.makeTargets"), DEFAULT_OPTION, null); //$NON-NLS-1$
+
+ optionDialog.open();
+
+ // chop args into string array
+ String rawArgList = optionDialog.getValue();
+
+ String[] optionsList = separateOptions(rawArgList);
+
+
+ // chop args into string array
+ rawArgList = optionDialog.getSecondValue();
+
+ String[] targetList = separateTargets(rawArgList);
+
+ if (targetList == null) {
+
+ showError(InvokeMessages.getString("InvokeAction.execute.windowTitle.error"), //$NON-NLS-1$
+ InvokeMessages.getString("InvokeAction.windowTitle.quoteError")); //$NON-NLS-1$
+ return;
+ }
+
+ String[] argumentList = new String[targetList.length
+ + optionsList.length];
+
+ System.arraycopy(optionsList, 0, argumentList, 0, optionsList.length);
+ System.arraycopy(targetList, 0, argumentList, optionsList.length,
+ targetList.length);
+
+ if (container != null) {
+ IProject project = container.getProject();
+ String automakeCommand = null;
+ try {
+ automakeCommand = project.getPersistentProperty(AutotoolsPropertyConstants.AUTOMAKE_TOOL);
+ } catch (CoreException e) {
+ // do nothing
+ }
+
+ // If automake path not set for the project, default to system path
+ if (automakeCommand == null)
+ automakeCommand = DEFAULT_COMMAND;
+
+ executeConsoleCommand(DEFAULT_COMMAND, automakeCommand,
+ argumentList, execDir);
+ }
+ }
+
+ public void dispose() {
+
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeAutoreconfAction.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeAutoreconfAction.java
new file mode 100644
index 0000000000..ade71d9667
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeAutoreconfAction.java
@@ -0,0 +1,78 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.actions;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.InputDialog;
+import org.eclipse.linuxtools.internal.cdt.autotools.core.AutotoolsPropertyConstants;
+import org.eclipse.swt.widgets.Shell;
+
+
+public class InvokeAutoreconfAction extends InvokeAction {
+
+ private static final String DEFAULT_OPTION = ""; //$NON-NLS-1$
+ private static final String DEFAULT_COMMAND = "autoreconf"; //$NON-NLS-1$
+
+ public void run(IAction action) {
+
+ IContainer container = getSelectedContainer();
+ if (container == null)
+ return;
+
+ IPath execDir = getExecDir(container);
+ String cwd = InvokeMessages.getString("CWD") + getCWD(container); //$NON-NLS-1$
+
+ InputDialog optionDialog = new SingleInputDialog(
+ new Shell(),
+ cwd,
+ InvokeMessages
+ .getString("InvokeAutoreconfAction.windowTitle.options"), //$NON-NLS-1$
+ InvokeMessages
+ .getString("InvokeAutoreconfAction.message.options.otherOptions"), //$NON-NLS-1$
+ DEFAULT_OPTION, null);
+ optionDialog.open();
+
+ // chop args into string array
+ String rawArgList = optionDialog.getValue();
+
+ String[] optionsList = simpleParseOptions(rawArgList);
+
+ String[] argumentList = new String[optionsList.length];
+
+ System.arraycopy(optionsList, 0, argumentList, 0, optionsList.length);
+
+ if (container != null) {
+ String autoreconfCommand = null;
+ IProject project = getSelectedContainer().getProject();
+ try {
+ autoreconfCommand = project.getPersistentProperty(AutotoolsPropertyConstants.AUTORECONF_TOOL);
+ } catch (CoreException e) {
+ // do nothing
+ }
+
+ // If unset, use default system path
+ if (autoreconfCommand == null)
+ autoreconfCommand = DEFAULT_COMMAND;
+
+ executeConsoleCommand(DEFAULT_COMMAND, autoreconfCommand,
+ argumentList, execDir);
+ }
+ }
+
+ public void dispose() {
+
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeLibtoolizeAction.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeLibtoolizeAction.java
new file mode 100644
index 0000000000..02ec65d21d
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeLibtoolizeAction.java
@@ -0,0 +1,78 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.actions;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.InputDialog;
+import org.eclipse.linuxtools.internal.cdt.autotools.core.AutotoolsPropertyConstants;
+import org.eclipse.swt.widgets.Shell;
+
+
+public class InvokeLibtoolizeAction extends InvokeAction {
+
+ private static final String DEFAULT_OPTION = ""; //$NON-NLS-1$
+ private static final String DEFAULT_COMMAND = "libtoolize"; //$NON-NLS-1$
+
+ public void run(IAction action) {
+
+ IContainer container = getSelectedContainer();
+ if (container == null)
+ return;
+
+ IPath execDir = getExecDir(container);
+ String cwd = InvokeMessages.getString("CWD") + getCWD(container); //$NON-NLS-1$
+
+ InputDialog optionDialog = new SingleInputDialog(
+ new Shell(),
+ cwd,
+ InvokeMessages
+ .getString("InvokeLibtoolizeAction.windowTitle.options"), //$NON-NLS-1$
+ InvokeMessages
+ .getString("InvokeLibtoolizeAction.message.options.otherOptions"), //$NON-NLS-1$
+ DEFAULT_OPTION, null);
+ optionDialog.open();
+
+ // chop args into string array
+ String rawArgList = optionDialog.getValue();
+
+ String[] optionsList = simpleParseOptions(rawArgList);
+
+ String[] argumentList = new String[optionsList.length];
+
+ System.arraycopy(optionsList, 0, argumentList, 0, optionsList.length);
+
+ if (container != null) {
+ String libtoolizeCommand = null;
+ IProject project = getSelectedContainer().getProject();
+ try {
+ libtoolizeCommand = project.getPersistentProperty(AutotoolsPropertyConstants.AUTOHEADER_TOOL);
+ } catch (CoreException e) {
+ // do nothing
+ }
+
+ // If unset, use default system path
+ if (libtoolizeCommand == null)
+ libtoolizeCommand = DEFAULT_COMMAND;
+
+ executeConsoleCommand(DEFAULT_COMMAND, libtoolizeCommand,
+ argumentList, execDir);
+ }
+ }
+
+ public void dispose() {
+
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeMessages.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeMessages.java
new file mode 100644
index 0000000000..5a3710c5e7
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeMessages.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2007, 2009 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.actions;
+
+import java.text.MessageFormat;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class InvokeMessages {
+ private static final String BUNDLE_NAME = InvokeMessages.class.getName();
+
+ private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
+ .getBundle(BUNDLE_NAME);
+
+ private InvokeMessages() {
+ }
+
+ /**
+ * Returns the string from the resource bundle,
+ * or 'key' if not found.
+ *
+ * @param key the message key
+ * @return the resource bundle message
+ */
+ public static String getString(String key) {
+ try {
+ return RESOURCE_BUNDLE.getString(key);
+ } catch (MissingResourceException e) {
+ return '!' + key + '!';
+ }
+ }
+
+ /**
+ * Returns the formatted string from the resource bundle,
+ * or 'key' if not found.
+ *
+ * @param key the message key
+ * @param args an array of substituition strings
+ * @return the resource bundle message
+ */
+ public static String getFormattedString(String key, String[] args) {
+ return MessageFormat.format(getString(key), (Object[])args);
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeMessages.properties b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeMessages.properties
new file mode 100644
index 0000000000..b2da117fef
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeMessages.properties
@@ -0,0 +1,56 @@
+#################################################################################
+# Copyright (c) 2006, 2007, 2009 Red Hat, Inc.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Red Hat Incorporated - initial API and implementation
+#################################################################################
+CWD=Working Directory:
+
+InvokeAction.windowTitle.quoteError=Quote/Double quote not correct
+InvokeAction.progress.message=Running {0}
+InvokeAction.execute.windowTitle.error=Invoke Action Error
+InvokeAction.execute.message=Couldn't execute command :
+InvokeAction.success=Command executed successfully
+InvokeAction.console.message=Invoking {0} in {1}
+
+
+InvokeAutoconfAction.command=Running autoconf in {0}
+InvokeAutoconfAction.windowTitle.stdout=Invoke Autoconf - Output
+InvokeAutoconfAction.windowTitle.stderr=Invoke Autoconf - Error
+
+
+InvokeAutomakeAction.command=Running automake
+InvokeAutomakeAction.windowTitle.options=Automake Options
+InvokeAutomakeAction.message.options.makeTargets=Enter targets separated by space :
+InvokeAutomakeAction.message.options.otherOptions=Enter options separated by space :
+InvokeAutomakeAction.windowTitle.stdout=Invoke Automake - Output
+InvokeAutomakeAction.windowTitle.stderr=Invoke Automake - Error
+
+InvokeAutoheaderAction.command=Running autoheader
+InvokeAutoheaderAction.windowTitle.options=Autoheader Options
+InvokeAutoheaderAction.message.options.otherOptions=Enter options separated by space :
+InvokeAutoheaderAction.windowTitle.stdout=Invoke Autoheader - Output
+InvokeAutoheaderAction.windowTitle.stderr=Invoke Autoheader - Error
+
+InvokeAutoreconfAction.command=Running autoreconf
+InvokeAutoreconfAction.windowTitle.options=Autoreconf Options
+InvokeAutoreconfAction.message.options.otherOptions=Enter options separated by space :
+InvokeAutoreconfAction.windowTitle.stdout=Invoke Autoreconf - Output
+InvokeAutoreconfAction.windowTitle.stderr=Invoke Autoreconf - Error
+
+InvokeAclocalAction.command=Running aclocal
+InvokeAclocalAction.windowTitle.options=Aclocal Options
+InvokeAclocalAction.message.options.includeDir=Add directory to search list for .m4 files :
+InvokeAclocalAction.message.options.otherOptions=Enter options separated by space :
+InvokeAclocalAction.windowTitle.stdout=Invoke Automake - Output
+InvokeAclocalAction.windowTitle.stderr=Invoke Automake - Error
+
+InvokeLibtoolizeAction.command=Running libtoolize
+InvokeLibtoolizeAction.windowTitle.options=Libtoolize Options
+InvokeLibtoolizeAction.message.options.otherOptions=Enter options separated by space :
+InvokeLibtoolizeAction.windowTitle.stdout=Invoke Libtoolize - Output
+InvokeLibtoolizeAction.windowTitle.stderr=Invoke Libtoolize - Error
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/LibtoolizeHandler.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/LibtoolizeHandler.java
new file mode 100644
index 0000000000..c2d6faf72e
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/LibtoolizeHandler.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.actions;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.expressions.IEvaluationContext;
+import org.eclipse.core.resources.IContainer;
+
+/**
+ * @author Jeff Johnston
+ *
+ */
+public class LibtoolizeHandler extends AbstractAutotoolsHandler {
+
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ InvokeLibtoolizeAction a = new InvokeLibtoolizeAction();
+ Object o = event.getApplicationContext();
+ if (o instanceof IEvaluationContext) {
+ IContainer container = getContainer((IEvaluationContext)o);
+ if (container != null) {
+ a.setSelectedContainer(container);
+ a.run(null);
+ }
+ }
+ return null;
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/ReconfigureAction.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/ReconfigureAction.java
new file mode 100644
index 0000000000..6ab2eb7088
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/ReconfigureAction.java
@@ -0,0 +1,77 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.actions;
+
+import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
+import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.IWorkspaceRunnable;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.ISchedulingRule;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.linuxtools.internal.cdt.autotools.core.AutotoolsNewMakeGenerator;
+
+
+public class ReconfigureAction extends InvokeAction {
+
+ public void run(IAction action) {
+ IContainer container = getSelectedContainer();
+ if (container == null)
+ return;
+
+ // We need to use a workspace root scheduling rule because adding MakeTargets
+ // may end up saving the project description which runs under a workspace root rule.
+ final ISchedulingRule rule = ResourcesPlugin.getWorkspace().getRoot();
+
+ Job backgroundJob = new Job("Reconfigure Action"){ //$NON-NLS-1$
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
+
+ public void run(IProgressMonitor monitor) throws CoreException {
+ IProject project = getSelectedContainer().getProject();
+ AutotoolsNewMakeGenerator m = new AutotoolsNewMakeGenerator();
+ IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project);
+ m.initialize(project, info, monitor);
+ try {
+ m.reconfigure();
+ } catch (CoreException e) {
+ // do nothing for now
+ }
+ }
+ }, rule, IWorkspace.AVOID_UPDATE, monitor);
+ } catch (CoreException e) {
+ return e.getStatus();
+ }
+ IStatus returnStatus = Status.OK_STATUS;
+ return returnStatus;
+ }
+ };
+
+ backgroundJob.setRule(rule);
+ backgroundJob.schedule();
+ }
+
+ public void dispose() {
+
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/ReconfigureHandler.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/ReconfigureHandler.java
new file mode 100644
index 0000000000..586c5fa832
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/ReconfigureHandler.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.actions;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.expressions.IEvaluationContext;
+import org.eclipse.core.resources.IContainer;
+
+/**
+ * @author Jeff Johnston
+ *
+ */
+public class ReconfigureHandler extends AbstractAutotoolsHandler {
+
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ ReconfigureAction a = new ReconfigureAction();
+ Object o = event.getApplicationContext();
+ if (o instanceof IEvaluationContext) {
+ IContainer container = getContainer((IEvaluationContext)o);
+ if (container != null) {
+ a.setSelectedContainer(container);
+ a.run(null);
+ }
+ }
+ return null;
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/SingleInputDialog.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/SingleInputDialog.java
new file mode 100644
index 0000000000..a7342f577d
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/SingleInputDialog.java
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2007 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.actions;
+
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.IInputValidator;
+import org.eclipse.jface.dialogs.InputDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CLabel;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Shell;
+
+public class SingleInputDialog extends InputDialog {
+
+ private String firstMessage;
+
+ public SingleInputDialog(Shell parentShell, String firstMessage, String dialogTitle,
+ String dialogMessage, String initialValue,
+ IInputValidator validator) {
+ super(parentShell, dialogTitle, dialogMessage, initialValue, validator);
+
+ this.firstMessage = firstMessage;
+ }
+
+ /*
+ * (non-Javadoc) Method declared on Dialog.
+ */
+ protected void buttonPressed(int buttonId) {
+ super.buttonPressed(buttonId);
+ }
+
+ protected Control createDialogArea(Composite parent) {
+
+ // create composite
+ Composite composite = (Composite) super.createDialogArea(parent);
+
+ CLabel label0 = new CLabel(composite, SWT.WRAP);
+ label0.setText(firstMessage);
+ GridData data = new GridData(GridData.GRAB_HORIZONTAL
+ | GridData.GRAB_VERTICAL | GridData.HORIZONTAL_ALIGN_FILL
+ | GridData.VERTICAL_ALIGN_CENTER);
+ data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
+ label0.setLayoutData(data);
+ label0.setFont(parent.getFont());
+
+ // remove error message dialog from focusing.
+ composite.getTabList()[2].setVisible(false);
+ composite.getTabList()[2].setEnabled(false);
+
+ return composite;
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/TwoInputDialog.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/TwoInputDialog.java
new file mode 100644
index 0000000000..5d1654c28f
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/TwoInputDialog.java
@@ -0,0 +1,111 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2007 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.actions;
+
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.IInputValidator;
+import org.eclipse.jface.dialogs.InputDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CLabel;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+
+public class TwoInputDialog extends InputDialog {
+
+ private Text secondText;
+
+ private String secondValue;
+
+ private String secondMessage;
+
+ private String firstMessage;
+
+ public TwoInputDialog(Shell parentShell, String firstMessage, String dialogTitle,
+ String dialogMessage, String secondMessage, String initialValue,
+ IInputValidator validator) {
+ super(parentShell, dialogTitle, dialogMessage, initialValue, validator);
+
+ this.firstMessage = firstMessage;
+ this.secondMessage = secondMessage;
+ }
+
+ /*
+ * (non-Javadoc) Method declared on Dialog.
+ */
+ protected void buttonPressed(int buttonId) {
+ if (buttonId == IDialogConstants.OK_ID) {
+ secondValue = secondText.getText();
+ } else {
+ secondValue = null;
+ }
+ super.buttonPressed(buttonId);
+ }
+
+ protected Control createDialogArea(Composite parent) {
+
+ // create composite
+ Composite composite = (Composite) super.createDialogArea(parent);
+
+ CLabel label0 = new CLabel(composite, SWT.WRAP);
+ label0.setText(firstMessage);
+ Label label = new Label(composite, SWT.WRAP);
+ label.setText(secondMessage);
+ GridData data = new GridData(GridData.GRAB_HORIZONTAL
+ | GridData.GRAB_VERTICAL | GridData.HORIZONTAL_ALIGN_FILL
+ | GridData.VERTICAL_ALIGN_CENTER);
+ data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
+ label0.setLayoutData(data);
+ label0.setFont(parent.getFont());
+ label.setLayoutData(data);
+ label.setFont(parent.getFont());
+
+
+ secondText = new Text(composite, SWT.SINGLE | SWT.BORDER);
+ secondText.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL
+ | GridData.HORIZONTAL_ALIGN_FILL));
+ secondText.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ validateInput();
+ }
+ });
+
+ // remove error message dialog from focusing.
+ composite.getTabList()[2].setVisible(false);
+ composite.getTabList()[2].setEnabled(false);
+
+ return composite;
+ }
+
+ /**
+ * Returns the text area.
+ *
+ * @return the text area
+ */
+ protected Text getSecondText() {
+ return secondText;
+ }
+
+ /**
+ * Returns the string typed into this input dialog.
+ *
+ * @return the input string
+ */
+ public String getSecondValue() {
+ return secondValue;
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/autoconf/ProjectionFileUpdater.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/autoconf/ProjectionFileUpdater.java
new file mode 100644
index 0000000000..0d5555299c
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/autoconf/ProjectionFileUpdater.java
@@ -0,0 +1,424 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 2006, 2007 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ * Red Hat Inc. - convert to use with Autoconf Editor
+ * Ed Swartz (NOKIA) - refactoring
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.autoconf;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.Position;
+import org.eclipse.jface.text.source.Annotation;
+import org.eclipse.jface.text.source.IAnnotationModel;
+import org.eclipse.jface.text.source.projection.IProjectionListener;
+import org.eclipse.jface.text.source.projection.ProjectionAnnotation;
+import org.eclipse.jface.text.source.projection.ProjectionAnnotationModel;
+import org.eclipse.jface.text.source.projection.ProjectionViewer;
+import org.eclipse.linuxtools.cdt.autotools.core.AutotoolsPlugin;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.AutoconfEditor;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.AutoconfCaseElement;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.AutoconfElement;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.AutoconfElifElement;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.AutoconfElseElement;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.AutoconfForElement;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.AutoconfIfElement;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.AutoconfMacroArgumentElement;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.AutoconfMacroElement;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.AutoconfRootElement;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.AutoconfSelectElement;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.AutoconfUntilElement;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.AutoconfWhileElement;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake.IReconcilingParticipant;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.preferences.AutotoolsEditorPreferenceConstants;
+import org.eclipse.ui.texteditor.IDocumentProvider;
+
+
+/**
+ * ProjectionMakefileUpdater
+ */
+public class ProjectionFileUpdater implements IProjectionListener {
+
+ private static class AutoconfProjectionAnnotation extends ProjectionAnnotation {
+
+ private AutoconfElement fElement;
+ private boolean fIsComment;
+
+ public AutoconfProjectionAnnotation(AutoconfElement element, boolean isCollapsed, boolean isComment) {
+ super(isCollapsed);
+ fElement = element;
+ fIsComment = isComment;
+ }
+
+ public AutoconfElement getElement() {
+ return fElement;
+ }
+
+ public void setElement(AutoconfElement element) {
+ fElement = element;
+ }
+
+ public boolean isComment() {
+ return fIsComment;
+ }
+
+ }
+
+
+ public void install(AutoconfEditor editor, ProjectionViewer viewer) {
+ fEditor= editor;
+ fViewer= viewer;
+ fViewer.addProjectionListener(this);
+ }
+
+ public void uninstall() {
+ if (isInstalled()) {
+ projectionDisabled();
+ fViewer.removeProjectionListener(this);
+ fViewer= null;
+ fEditor= null;
+ }
+ }
+
+ protected boolean isInstalled() {
+ return fEditor != null;
+ }
+
+ private class ReconcilerParticipant implements IReconcilingParticipant {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake.IReconcilingParticipant#reconciled()
+ */
+ public void reconciled() {
+ processReconcile();
+ }
+ }
+
+ private IDocument fCachedDocument;
+ private AutoconfEditor fEditor;
+ private ProjectionViewer fViewer;
+ private IReconcilingParticipant fParticipant;
+
+ private boolean fAllowCollapsing = false;
+ private boolean fCollapseMacroDef = false;
+ private boolean fCollapseCase = false;
+ private boolean fCollapseConditional = false;
+ private boolean fCollapseLoop = false;
+
+ /*
+ * @see org.eclipse.jface.text.source.projection.IProjectionListener#projectionEnabled()
+ */
+ public void projectionEnabled() {
+ // http://home.ott.oti.com/teams/wswb/anon/out/vms/index.html
+ // projectionEnabled messages are not always paired with projectionDisabled
+ // i.e. multiple enabled messages may be sent out.
+ // we have to make sure that we disable first when getting an enable
+ // message.
+ projectionDisabled();
+
+ initialize();
+ fParticipant= new ReconcilerParticipant();
+ fEditor.addReconcilingParticipant(fParticipant);
+ }
+
+ /*
+ * @see org.eclipse.jface.text.source.projection.IProjectionListener#projectionDisabled()
+ */
+ public void projectionDisabled() {
+ fCachedDocument= null;
+ if (fParticipant != null) {
+ fEditor.addReconcilingParticipant(fParticipant);
+ fParticipant= null;
+ }
+ }
+
+ public void initialize() {
+
+ if (!isInstalled())
+ return;
+
+ initializePreferences();
+
+ try {
+
+ IDocumentProvider provider= fEditor.getDocumentProvider();
+ fCachedDocument= provider.getDocument(fEditor.getEditorInput());
+ fAllowCollapsing= true;
+
+// IWorkingCopyManager manager= AutomakeEditorFactory.getDefault().getWorkingCopyManager();
+ AutoconfElement fInput= fEditor.getRootElement();
+
+ if (fInput != null) {
+ ProjectionAnnotationModel model= (ProjectionAnnotationModel) fEditor.getAdapter(ProjectionAnnotationModel.class);
+ if (model != null) {
+ Map<AutoconfProjectionAnnotation, Position> additions= computeAdditions(fInput);
+ model.removeAllAnnotations();
+ model.replaceAnnotations(null, additions);
+ }
+ }
+
+ } finally {
+ fCachedDocument= null;
+ fAllowCollapsing= false;
+ }
+ }
+
+ private void initializePreferences() {
+ //FIXME: what to do with Makefile editor preferences
+ IPreferenceStore store = AutotoolsPlugin.getDefault().getPreferenceStore();
+ fCollapseMacroDef = store.getBoolean(AutotoolsEditorPreferenceConstants.EDITOR_FOLDING_MACRODEF);
+ fCollapseCase = store.getBoolean(AutotoolsEditorPreferenceConstants.EDITOR_FOLDING_CASE);
+ fCollapseConditional = store.getBoolean(AutotoolsEditorPreferenceConstants.EDITOR_FOLDING_CONDITIONAL);
+ fCollapseLoop = store.getBoolean(AutotoolsEditorPreferenceConstants.EDITOR_FOLDING_LOOP);
+ }
+
+ private Map<AutoconfProjectionAnnotation, Position> computeAdditions(AutoconfElement root) {
+ Map<AutoconfProjectionAnnotation, Position> map= new HashMap<AutoconfProjectionAnnotation, Position>();
+ if (root instanceof AutoconfRootElement)
+ computeAdditions(root.getChildren(), map);
+ return map;
+ }
+
+ private void computeAdditions(Object[] elements, Map<AutoconfProjectionAnnotation, Position> map) {
+ for (int i= 0; i < elements.length; i++) {
+ AutoconfElement element= (AutoconfElement)elements[i];
+
+ computeAdditions(element, map);
+
+ if (element.hasChildren()) {
+ computeAdditions(element.getChildren(), map);
+ }
+ }
+ }
+
+ private void computeAdditions(AutoconfElement element, Map<AutoconfProjectionAnnotation, Position> map) {
+
+ boolean createProjection= false;
+
+ @SuppressWarnings("unused")
+ boolean collapse= false;
+
+ if (element instanceof AutoconfIfElement ||
+ element instanceof AutoconfElseElement ||
+ element instanceof AutoconfElifElement) {
+ collapse= fAllowCollapsing && fCollapseConditional;
+ createProjection= true;
+ } else if (element instanceof AutoconfMacroElement) {
+ collapse= fAllowCollapsing && fCollapseMacroDef;
+ createProjection= true;
+ } else if (element instanceof AutoconfMacroArgumentElement) {
+ collapse= fAllowCollapsing && fCollapseMacroDef;
+ createProjection= true;
+ } else if (element instanceof AutoconfCaseElement) {
+ collapse= fAllowCollapsing && fCollapseCase;
+ createProjection= true;
+ } else if (element instanceof AutoconfForElement ||
+ element instanceof AutoconfWhileElement ||
+ element instanceof AutoconfUntilElement ||
+ element instanceof AutoconfSelectElement) {
+ collapse = fAllowCollapsing && fCollapseLoop;
+ createProjection = true;
+ }
+
+ if (createProjection) {
+ Position position= createProjectionPosition(element);
+ if (position != null) {
+ map.put(new AutoconfProjectionAnnotation(element, fAllowCollapsing, true), position);
+ }
+ }
+ }
+
+ private Position createProjectionPosition(AutoconfElement element) {
+ if (fCachedDocument == null)
+ return null;
+ int offset = 0;
+ try {
+ int startLine = 0;
+ int endLine = 0;
+ startLine = fCachedDocument.getLineOfOffset(element.getStartOffset());
+ endLine = fCachedDocument.getLineOfOffset(element.getEndOffset());
+
+ if (startLine != endLine) {
+ offset= fCachedDocument.getLineOffset(startLine);
+ int endOffset = fCachedDocument.getLineOffset(endLine) + fCachedDocument.getLineLength(endLine);
+ return new Position(offset, endOffset - offset);
+ }
+ } catch (BadLocationException x) {
+ // We should only get here if we try and read the line past EOF
+ return new Position(offset, fCachedDocument.getLength() - 1);
+ }
+ return null;
+ }
+
+ public void processReconcile() {
+ if (!isInstalled())
+ return;
+
+ ProjectionAnnotationModel model= (ProjectionAnnotationModel) fEditor.getAdapter(ProjectionAnnotationModel.class);
+ if (model == null)
+ return;
+
+ try {
+ IDocumentProvider provider= fEditor.getDocumentProvider();
+ fCachedDocument= provider.getDocument(fEditor.getEditorInput());
+ fAllowCollapsing= false;
+
+ Map<AutoconfProjectionAnnotation, Position> additions= new HashMap<AutoconfProjectionAnnotation, Position>();
+ List<AutoconfProjectionAnnotation> deletions= new ArrayList<AutoconfProjectionAnnotation>();
+ List<AutoconfProjectionAnnotation> updates = new ArrayList<AutoconfProjectionAnnotation>();
+
+ Map<AutoconfProjectionAnnotation, Position> updated= computeAdditions(fEditor.getRootElement());
+
+ Map<AutoconfElement, List<AutoconfProjectionAnnotation>> previous= createAnnotationMap(model);
+
+
+ Iterator<AutoconfProjectionAnnotation> e= updated.keySet().iterator();
+ while (e.hasNext()) {
+ AutoconfProjectionAnnotation annotation= (AutoconfProjectionAnnotation) e.next();
+ AutoconfElement element= annotation.getElement();
+ Position position= (Position) updated.get(annotation);
+
+ List<AutoconfProjectionAnnotation> annotations= previous.get(element);
+ if (annotations == null) {
+ additions.put(annotation, position);
+ } else {
+ Iterator<AutoconfProjectionAnnotation> x= annotations.iterator();
+ while (x.hasNext()) {
+ AutoconfProjectionAnnotation a= (AutoconfProjectionAnnotation) x.next();
+ if (annotation.isComment() == a.isComment()) {
+ Position p= model.getPosition(a);
+ if (p != null && !position.equals(p)) {
+ p.setOffset(position.getOffset());
+ p.setLength(position.getLength());
+ updates.add(a);
+ }
+ x.remove();
+ break;
+ }
+ }
+
+ if (annotations.isEmpty())
+ previous.remove(element);
+ }
+ }
+
+ Iterator<List<AutoconfProjectionAnnotation>> e2 = previous.values().iterator();
+ while (e2.hasNext()) {
+ List<AutoconfProjectionAnnotation> list= e2.next();
+ int size= list.size();
+ for (int i= 0; i < size; i++)
+ deletions.add(list.get(i));
+ }
+
+ match(model, deletions, additions, updates);
+
+ Annotation[] removals= new Annotation[deletions.size()];
+ deletions.toArray(removals);
+ Annotation[] changes= new Annotation[updates.size()];
+ updates.toArray(changes);
+ model.modifyAnnotations(removals, additions, changes);
+
+ } finally {
+ fCachedDocument= null;
+ fAllowCollapsing= true;
+ }
+ }
+
+ private void match(ProjectionAnnotationModel model, List<AutoconfProjectionAnnotation> deletions, Map<AutoconfProjectionAnnotation, Position> additions, List<AutoconfProjectionAnnotation> changes) {
+ if (deletions.isEmpty() || (additions.isEmpty() && changes.isEmpty()))
+ return;
+
+ List<AutoconfProjectionAnnotation> newDeletions= new ArrayList<AutoconfProjectionAnnotation>();
+ List<AutoconfProjectionAnnotation> newChanges= new ArrayList<AutoconfProjectionAnnotation>();
+
+ Iterator<AutoconfProjectionAnnotation> deletionIterator= deletions.iterator();
+ outer: while (deletionIterator.hasNext()) {
+ AutoconfProjectionAnnotation deleted= (AutoconfProjectionAnnotation) deletionIterator.next();
+ Position deletedPosition= model.getPosition(deleted);
+ if (deletedPosition == null)
+ continue;
+
+ Iterator<AutoconfProjectionAnnotation> changesIterator= changes.iterator();
+ while (changesIterator.hasNext()) {
+ AutoconfProjectionAnnotation changed= (AutoconfProjectionAnnotation) changesIterator.next();
+ if (deleted.isComment() == changed.isComment()) {
+ Position changedPosition= model.getPosition(changed);
+ if (changedPosition == null)
+ continue;
+
+ if (deletedPosition.getOffset() == changedPosition.getOffset()) {
+
+ deletedPosition.setLength(changedPosition.getLength());
+ deleted.setElement(changed.getElement());
+
+ deletionIterator.remove();
+ newChanges.add(deleted);
+
+ changesIterator.remove();
+ newDeletions.add(changed);
+
+ continue outer;
+ }
+ }
+ }
+
+ Iterator<AutoconfProjectionAnnotation> additionsIterator= additions.keySet().iterator();
+ while (additionsIterator.hasNext()) {
+ AutoconfProjectionAnnotation added= (AutoconfProjectionAnnotation) additionsIterator.next();
+ if (deleted.isComment() == added.isComment()) {
+ Position addedPosition= (Position) additions.get(added);
+
+ if (deletedPosition.getOffset() == addedPosition.getOffset()) {
+
+ deletedPosition.setLength(addedPosition.getLength());
+ deleted.setElement(added.getElement());
+
+ deletionIterator.remove();
+ newChanges.add(deleted);
+
+ additionsIterator.remove();
+
+ break;
+ }
+ }
+ }
+ }
+
+ deletions.addAll(newDeletions);
+ changes.addAll(newChanges);
+ }
+
+ @SuppressWarnings("unchecked")
+ private Map<AutoconfElement, List<AutoconfProjectionAnnotation>> createAnnotationMap(IAnnotationModel model) {
+ Map<AutoconfElement, List<AutoconfProjectionAnnotation>> map= new HashMap<AutoconfElement, List<AutoconfProjectionAnnotation>>();
+ Iterator e= model.getAnnotationIterator();
+ while (e.hasNext()) {
+ Object annotation= e.next();
+ if (annotation instanceof AutoconfProjectionAnnotation) {
+ AutoconfProjectionAnnotation directive= (AutoconfProjectionAnnotation) annotation;
+ List<AutoconfProjectionAnnotation> list= map.get(directive.getElement());
+ if (list == null) {
+ list= new ArrayList<AutoconfProjectionAnnotation>(2);
+ map.put(directive.getElement(), list);
+ }
+ list.add(directive);
+ }
+ }
+ return map;
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AbstractElementListSelectionDialog.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AbstractElementListSelectionDialog.java
new file mode 100644
index 0000000000..f63da33227
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AbstractElementListSelectionDialog.java
@@ -0,0 +1,283 @@
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * QNX Software System
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+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<Object> getWidgetSelection() {
+ if (fSelectionList == null || fSelectionList.isDisposed())
+ return new ArrayList<Object>(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<Object> 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<Object> 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/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AbstractMakefile.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AbstractMakefile.java
new file mode 100644
index 0000000000..8edc6c9c7c
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AbstractMakefile.java
@@ -0,0 +1,294 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import java.io.IOException;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.List;
+
+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.IMakefile;
+import org.eclipse.cdt.make.core.makefile.IMakefileReaderProvider;
+import org.eclipse.cdt.make.core.makefile.IRule;
+import org.eclipse.cdt.make.core.makefile.ITargetRule;
+
+/**
+ * Makefile : ( statement ) *
+ * statement : rule | macro_definition | comments | empty
+ * rule : inference_rule | target_rule
+ * inference_rule : target ':' <nl> ( <tab> command <nl> ) +
+ * target_rule : target [ ( target ) * ] ':' [ ( prerequisite ) * ] [ ';' command ] <nl>
+ [ ( command ) * ]
+ * macro_definition : string '=' (string)*
+ * comments : ('#' (string) <nl>) *
+ * empty : <nl>
+ * command : <tab> prefix_command string <nl>
+ * target : string
+ * prefix_command : '-' | '@' | '+'
+ * internal_macro : "$<" | "$*" | "$@" | "$?" | "$%"
+ */
+
+public abstract class AbstractMakefile extends Parent implements IMakefile {
+
+ private URI filename;
+
+ public AbstractMakefile(Directive parent) {
+ super(parent);
+ }
+
+ public abstract IDirective[] getBuiltins();
+
+ public IRule[] getRules() {
+ IDirective[] stmts = getDirectives(true);
+ List<IRule> array = new ArrayList<IRule>(stmts.length);
+ for (int i = 0; i < stmts.length; i++) {
+ if (stmts[i] instanceof IRule) {
+ array.add((IRule)stmts[i]);
+ }
+ }
+ return (IRule[]) array.toArray(new IRule[0]);
+ }
+
+ public IRule[] getRules(String target) {
+ IRule[] rules = getRules();
+ List<IRule> array = new ArrayList<IRule>(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<IInferenceRule> array = new ArrayList<IInferenceRule>(rules.length);
+ for (int i = 0; i < rules.length; i++) {
+ if (rules[i] instanceof IInferenceRule) {
+ array.add((IInferenceRule)rules[i]);
+ }
+ }
+ return (IInferenceRule[]) array.toArray(new IInferenceRule[0]);
+ }
+
+ public IInferenceRule[] getInferenceRules(String target) {
+ IInferenceRule[] irules = getInferenceRules();
+ List<IInferenceRule> array = new ArrayList<IInferenceRule>(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<ITargetRule> array = new ArrayList<ITargetRule>(trules.length);
+ for (int i = 0; i < trules.length; i++) {
+ if (trules[i] instanceof ITargetRule) {
+ array.add((ITargetRule)trules[i]);
+ }
+ }
+ return (ITargetRule[]) array.toArray(new ITargetRule[0]);
+ }
+
+ public ITargetRule[] getTargetRules(String target) {
+ ITargetRule[] trules = getTargetRules();
+ List<ITargetRule> array = new ArrayList<ITargetRule>(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(true);
+ List<IMacroDefinition> array = new ArrayList<IMacroDefinition>(stmts.length);
+ for (int i = 0; i < stmts.length; i++) {
+ if (stmts[i] instanceof IMacroDefinition) {
+ array.add((IMacroDefinition)stmts[i]);
+ }
+ }
+ return (IMacroDefinition[]) array.toArray(new IMacroDefinition[0]);
+ }
+
+ public IMacroDefinition[] getMacroDefinitions(String name) {
+ IMacroDefinition[] variables = getMacroDefinitions();
+ List<IMacroDefinition> array = new ArrayList<IMacroDefinition>(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<IMacroDefinition> array = new ArrayList<IMacroDefinition>(stmts.length);
+ for (int i = 0; i < stmts.length; i++) {
+ if (stmts[i] instanceof IMacroDefinition) {
+ array.add((IMacroDefinition)stmts[i]);
+ }
+ }
+ return (IMacroDefinition[]) array.toArray(new IMacroDefinition[0]);
+ }
+
+ public IMacroDefinition[] getBuiltinMacroDefinitions(String name) {
+ IMacroDefinition[] variables = getBuiltinMacroDefinitions();
+ List<IMacroDefinition> array = new ArrayList<IMacroDefinition>(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<IInferenceRule> array = new ArrayList<IInferenceRule>(stmts.length);
+ for (int i = 0; i < stmts.length; i++) {
+ if (stmts[i] instanceof IInferenceRule) {
+ array.add((IInferenceRule)stmts[i]);
+ }
+ }
+ return (IInferenceRule[]) array.toArray(new IInferenceRule[0]);
+ }
+
+ public IInferenceRule[] getBuiltinInferenceRules(String target) {
+ IInferenceRule[] irules = getBuiltinInferenceRules();
+ List<IInferenceRule> array = new ArrayList<IInferenceRule>(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 String expandString(String line) {
+ return expandString(line, false);
+ }
+
+ public String expandString(String line, boolean recursive) {
+ int len = line.length();
+ boolean foundDollar = false;
+ boolean inMacro = false;
+ StringBuffer buffer = new StringBuffer();
+ StringBuffer macroName = new StringBuffer();
+ for (int i = 0; i < len; i++) {
+ char c = line.charAt(i);
+ switch(c) {
+ case '$':
+ // '$$' --> '$'
+ if (foundDollar) {
+ buffer.append(c);
+ foundDollar = false;
+ } else {
+ foundDollar = true;
+ }
+ break;
+ case '(':
+ case '{':
+ if (foundDollar) {
+ inMacro = true;
+ } else {
+ buffer.append(c);
+ }
+ break;
+ case ')':
+ case '}':
+ if (inMacro) {
+ String name = macroName.toString();
+ if (name.length() > 0) {
+ IMacroDefinition[] defs = getMacroDefinitions(name);
+ if (defs.length == 0) {
+ defs = getBuiltinMacroDefinitions(name);
+ }
+ if (defs.length > 0) {
+ String result = defs[0].getValue().toString();
+ if (result.indexOf('$') != -1 && recursive) {
+ result = expandString(result, recursive);
+ }
+ buffer.append(result);
+ } else { // Do not expand
+ buffer.append('$').append('(').append(name).append(')');
+ }
+ }
+ macroName.setLength(0);
+ inMacro = false;
+ } else {
+ buffer.append(c);
+ }
+ break;
+ default:
+ if (inMacro) {
+ macroName.append(c);
+ } else if (foundDollar) {
+ String name = String.valueOf(c);
+ IMacroDefinition[] defs = getMacroDefinitions(name);
+ if (defs.length == 0) {
+ defs = getBuiltinMacroDefinitions(name);
+ }
+ if (defs.length > 0) {
+ String result = defs[0].getValue().toString();
+ if (result.indexOf('$') != -1 && recursive) {
+ result = expandString(result, recursive);
+ }
+ buffer.append(result);
+ } else {
+ // nothing found
+ buffer.append('$').append(c);
+ }
+ inMacro = false;
+ } else {
+ buffer.append(c);
+ }
+ foundDollar = false;
+ break;
+ }
+ }
+ return buffer.toString();
+ }
+
+ public URI getFileURI() {
+ return filename;
+ }
+
+ public void setFileURI(URI filename) {
+ this.filename = filename;
+ }
+
+
+ public IMakefile getMakefile() {
+ return this;
+ }
+
+ public IMakefileReaderProvider getMakefileReaderProvider() {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.make.core.makefile.IMakefile#parse(java.net.URI, org.eclipse.cdt.make.core.makefile.IMakefileReaderProvider)
+ */
+ public void parse(URI fileURI,
+ IMakefileReaderProvider makefileReaderProvider) throws IOException {
+ // not used
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AbstractMakefileCodeScanner.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AbstractMakefileCodeScanner.java
new file mode 100644
index 0000000000..0bb70e2e9c
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AbstractMakefileCodeScanner.java
@@ -0,0 +1,172 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 2006, 2007 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ * Red Hat Inc. - convert to use with Automake editor
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.resource.StringConverter;
+import org.eclipse.jface.text.TextAttribute;
+import org.eclipse.jface.text.rules.IRule;
+import org.eclipse.jface.text.rules.RuleBasedScanner;
+import org.eclipse.jface.text.rules.Token;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.linuxtools.cdt.autotools.core.AutotoolsPlugin;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.preferences.ColorManager;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.RGB;
+
+
+/**
+ * AbstractMakefileEditorScanner
+ */
+public abstract class AbstractMakefileCodeScanner extends RuleBasedScanner {
+
+ private Map<String, Token> fTokenMap= new HashMap<String, Token>();
+ private String[] fPropertyNamesColor;
+ /**
+ * Preference keys for boolean preferences which are <code>true</code>,
+ * iff the corresponding token should be rendered bold.
+ */
+ private String[] fPropertyNamesBold;
+ /**
+ * Preference keys for boolean preferences which are <code>true</code>,
+ * iff the corresponding token should be rendered italic.
+ */
+ private String[] fPropertyNamesItalic;
+
+
+ /**
+ * 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<IRule> createRules();
+
+ /**
+ * Must be called after the constructor has been called.
+ */
+ public final void initialize() {
+
+ fPropertyNamesColor= getTokenProperties();
+ int length= fPropertyNamesColor.length;
+ fPropertyNamesBold= new String[length];
+ fPropertyNamesItalic= new String[length];
+
+ for (int i= 0; i < length; i++) {
+ fPropertyNamesBold[i]= fPropertyNamesColor[i] + MakefileEditorPreferenceConstants.EDITOR_BOLD_SUFFIX;
+ fPropertyNamesItalic[i]= fPropertyNamesColor[i] + MakefileEditorPreferenceConstants.EDITOR_ITALIC_SUFFIX;
+ addToken(fPropertyNamesColor[i], fPropertyNamesBold[i], fPropertyNamesItalic[i]);
+ }
+
+ initializeRules();
+ }
+
+ private void initializeRules() {
+ List<IRule> rules= createRules();
+ if (rules != null) {
+ IRule[] result= new IRule[rules.size()];
+ rules.toArray(result);
+ setRules(result);
+ }
+ }
+
+ protected Token getToken(String key) {
+ return (Token) fTokenMap.get(key);
+ }
+
+ private void addToken(String colorKey, String boldKey, String italicKey) {
+ fTokenMap.put(colorKey, new Token(createTextAttribute(colorKey, boldKey, italicKey)));
+ }
+
+ 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(fPropertyNamesBold[i]) || property.equals(fPropertyNamesItalic[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(event, token);
+ else if (fPropertyNamesBold[index].equals(p))
+ adaptToStyleChange(event, token, SWT.BOLD);
+ else if (fPropertyNamesItalic[index].equals(p))
+ adaptToStyleChange(event, token, SWT.ITALIC);
+ }
+
+ protected void adaptToColorChange(PropertyChangeEvent event, Token token) {
+ 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) {
+ TextAttribute attr= (TextAttribute) token.getData();
+ token.setData(new TextAttribute(ColorManager.getDefault().getColor(rgb), attr.getBackground(), attr.getStyle()));
+ }
+ }
+
+ protected void adaptToStyleChange(PropertyChangeEvent event, Token token, int styleAttribute) {
+ if (token == null) {
+ return;
+ }
+ boolean eventValue= false;
+ Object value= event.getNewValue();
+ if (value instanceof Boolean) {
+ eventValue= ((Boolean) value).booleanValue();
+ } else if (IPreferenceStore.TRUE.equals(value)) {
+ eventValue= true;
+ }
+
+ TextAttribute attr= (TextAttribute) token.getData();
+ boolean activeValue= (attr.getStyle() & styleAttribute) == styleAttribute;
+ if (activeValue != eventValue) {
+ token.setData(new TextAttribute(attr.getForeground(), attr.getBackground(), eventValue ? attr.getStyle() | styleAttribute : attr.getStyle() & ~styleAttribute));
+ }
+ }
+
+ protected TextAttribute createTextAttribute(String colorID, String boldKey, String italicKey) {
+ Color color= null;
+ if (colorID != null) {
+ color= AutomakeEditorFactory.getPreferenceColor(colorID);
+ }
+ IPreferenceStore store= AutotoolsPlugin.getDefault().getPreferenceStore();
+ int style= store.getBoolean(boldKey) ? SWT.BOLD : SWT.NORMAL;
+ if (store.getBoolean(italicKey)) {
+ style |= SWT.ITALIC;
+ }
+ return new TextAttribute(color, null, style);
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AddBuildTargetAction.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AddBuildTargetAction.java
new file mode 100644
index 0000000000..8e3c69954f
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AddBuildTargetAction.java
@@ -0,0 +1,155 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006, 2007 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ * Red Hat Inc. - convert to use with Automake editor
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+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.ui.dialogs.MakeTargetDialog;
+import org.eclipse.core.resources.IContainer;
+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.linuxtools.cdt.autotools.ui.AutotoolsUIPlugin;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.MakeUIMessages;
+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(MakeUIMessages.getResourceString("AddBuildTargetAction.title")); //$NON-NLS-1$
+ setDescription(MakeUIMessages.getResourceString("AddBuildTargetAction.description")); //$NON-NLS-1$
+ setToolTipText(MakeUIMessages.getResourceString("AddBuildTargetAction.tooltip")); //$NON-NLS-1$
+ 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 = generateUniqueName(file.getParent(), sbBuildName.toString());
+ String makefileTarget = sbMakefileTarget.toString();
+ IMakeTarget target = null;
+ try {
+ String[] ids = manager.getTargetBuilders(file.getProject());
+ if (ids.length > 0) {
+ target = manager.createTarget(file.getProject(), buildName, ids[0]);
+ target.setBuildAttribute(IMakeTarget.BUILD_TARGET, makefileTarget);
+ target.setContainer(file.getParent());
+ }
+ } catch (CoreException e) {
+ AutotoolsUIPlugin.errorDialog(shell, MakeUIMessages.getResourceString("AddBuildTargetAction.exception.internal"), e.toString(), e); //$NON-NLS-1$
+ target = null;
+ }
+
+ // Always popup the dialog.
+ if (target != null) {
+ MakeTargetDialog dialog;
+ try {
+ dialog = new MakeTargetDialog(shell, target);
+ dialog.open();
+ } catch (CoreException e) {
+ AutotoolsUIPlugin.errorDialog(shell, MakeUIMessages.getResourceString("AddBuildTargetAction.exception.internal"), e.toString(), e); //$NON-NLS-1$
+ }
+ }
+ }
+ }
+
+ private String generateUniqueName(IContainer container, String targetString) {
+ String newName = targetString;
+ int i = 0;
+ IMakeTargetManager manager = MakeCorePlugin.getDefault().getTargetManager();
+ try {
+ while (manager.findTarget(container, newName) != null) {
+ i++;
+ newName = targetString + " (" + Integer.toString(i) + ")"; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ } catch (CoreException e) {
+ }
+ return newName;
+ }
+
+ 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;
+ }
+
+ @SuppressWarnings("unchecked")
+ private ITargetRule[] getTargetRules(ISelection sel) {
+ if (!sel.isEmpty() && sel instanceof IStructuredSelection) {
+ List list = ((IStructuredSelection)sel).toList();
+ if (list.size() > 0) {
+ List<ITargetRule> targets = new ArrayList<ITargetRule>(list.size());
+ Object[] elements = list.toArray();
+ for (int i = 0; i < elements.length; i++) {
+ if (elements[i] instanceof ITargetRule) {
+ targets.add((ITargetRule)elements[i]);
+ }
+ }
+ return (ITargetRule[])targets.toArray(EMPTY_TARGET_RULES);
+ }
+ }
+ return EMPTY_TARGET_RULES;
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ArchiveTarget.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ArchiveTarget.java
new file mode 100644
index 0000000000..0b6cf7e9a5
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ArchiveTarget.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+/**
+ * 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/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutoconfSubstRule.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutoconfSubstRule.java
new file mode 100644
index 0000000000..c4f2e3ff38
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutoconfSubstRule.java
@@ -0,0 +1,92 @@
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import java.util.Arrays;
+import java.util.Comparator;
+
+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.Token;
+
+public class AutoconfSubstRule implements IPredicateRule {
+
+ private IToken token;
+ private char[][] fLineDelimiters;
+ private char[][] fSortedLineDelimiters;
+
+ private static class DecreasingCharArrayLengthComparator implements Comparator<Object> {
+ public int compare(Object o1, Object o2) {
+ return ((char[]) o2).length - ((char[]) o1).length;
+ }
+ }
+
+ private Comparator<Object> fLineDelimiterComparator= new DecreasingCharArrayLengthComparator();
+
+ public AutoconfSubstRule(IToken token) {
+ this.token = token;
+ }
+
+ public IToken evaluate(ICharacterScanner scanner, boolean resume) {
+ char[][] originalDelimiters= scanner.getLegalLineDelimiters();
+ int count= originalDelimiters.length;
+ if (fLineDelimiters == null || originalDelimiters.length != count) {
+ fSortedLineDelimiters= new char[count][];
+ } else {
+ while (count > 0 && fLineDelimiters[count-1] == originalDelimiters[count-1])
+ count--;
+ }
+ if (count != 0) {
+ fLineDelimiters= originalDelimiters;
+ System.arraycopy(fLineDelimiters, 0, fSortedLineDelimiters, 0, fLineDelimiters.length);
+ Arrays.sort(fSortedLineDelimiters, fLineDelimiterComparator);
+ }
+
+ int c;
+ boolean okToScan = resume;
+ int charCount = 0;
+
+ if (!resume) {
+ // Not resuming. Verify first char is '@'.
+ c = scanner.read();
+ ++charCount;
+ if (c == '@') {
+ okToScan = true;
+ }
+ }
+
+ if (okToScan) {
+ // We want to make sure we have a valid id (not @@) or (@_@). When
+ // we resume, we have no choice but to assume it is valid so far.
+ boolean isId = resume;
+ ++charCount;
+ while ((c = scanner.read()) != ICharacterScanner.EOF) {
+ if (c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z') {
+ // A valid id has some alphabetic character in it.
+ isId = true;
+ }
+ else if (c >= '0' && c <= '9' || c == '_') {
+ ; // continue
+ }
+ else if (c == '@' && isId)
+ return getSuccessToken();
+ else
+ break;
+ ++charCount;
+ }
+ }
+
+ for (int i = 0; i < charCount; ++i)
+ scanner.unread();
+
+ return Token.UNDEFINED;
+ }
+
+ public IToken getSuccessToken() {
+ return token;
+ }
+
+ public IToken evaluate(ICharacterScanner scanner) {
+ return evaluate(scanner, false);
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeCompletionProcessor.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeCompletionProcessor.java
new file mode 100644
index 0000000000..94a608efce
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeCompletionProcessor.java
@@ -0,0 +1,241 @@
+/*******************************************************************************
+ * Mostly copied from makefileCompletionProcessor which has the following
+ * copyright notice:
+ *
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Comparator;
+
+import org.eclipse.cdt.make.core.makefile.IDirective;
+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.ui.IWorkingCopyManager;
+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.linuxtools.internal.cdt.autotools.ui.MakeUIImages;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.IEditorPart;
+
+
+public class AutomakeCompletionProcessor 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<Object> {
+
+ /* (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 =""; //$NON-NLS-1$
+ }
+
+ if (o2 instanceof IMacroDefinition) {
+ name2 = ((IMacroDefinition)o1).getName();
+ } else if (o2 instanceof IRule) {
+ name2 = ((IRule)o1).getTarget().toString();
+ } else {
+ name2 =""; //$NON-NLS-1$
+ }
+
+ //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 AutomakeCompletionProcessor(IEditorPart editor) {
+ fEditor = editor;
+ fManager = AutomakeEditorFactory.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) {
+ WordPartDetector wordPart = new WordPartDetector(viewer, documentOffset);
+ boolean macro = WordPartDetector.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<ICompletionProposal> proposalList = new ArrayList<ICompletionProposal>(statements.length);
+
+ // iterate over all the different categories
+ for (int i = 0; i < statements.length; i++) {
+ String name = null;
+ Image image = null;
+ String infoString = "";//getContentInfoString(name); //$NON-NLS-1$
+ 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.toString())) {
+ IContextInformation info = new ContextInformation(name, infoString);
+ String displayString = (name.equals(infoString) ? name : name + " - " + infoString); //$NON-NLS-1$
+ ICompletionProposal result =
+ new CompletionProposal(
+ name,
+ wordPart.getOffset(),
+ wordPart.toString().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 = WordPartDetector.inMacro(viewer, documentOffset);
+ IMakefile makefile = fManager.getWorkingCopy(fEditor.getEditorInput());
+ ArrayList<String> contextList = new ArrayList<String>();
+ 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.toString())) {
+ 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.toString())) {
+ 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.toString(), 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;
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeConfigMacro.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeConfigMacro.java
new file mode 100644
index 0000000000..63c47d9201
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeConfigMacro.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2007 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+
+
+public class AutomakeConfigMacro extends Directive {
+ String name;
+
+ public AutomakeConfigMacro(Directive parent, String name) {
+ super(parent);
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String toString() {
+ return name + "\n";
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeDocumentProvider.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeDocumentProvider.java
new file mode 100644
index 0000000000..92226f6521
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeDocumentProvider.java
@@ -0,0 +1,121 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006, 2007 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ * Red Hat Inc. - Modified from MakefileDocumentProvider for Automake
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import java.io.IOException;
+import java.util.Iterator;
+
+import org.eclipse.cdt.make.core.makefile.IMakefile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.IURIEditorInput;
+import org.eclipse.ui.editors.text.TextFileDocumentProvider;
+
+
+public class AutomakeDocumentProvider extends TextFileDocumentProvider implements IMakefileDocumentProvider {
+
+ /**
+ * Remembers a IMakefile for each element.
+ */
+ protected class AutomakefileFileInfo extends FileInfo {
+ public IMakefile fCopy;
+ }
+
+ /*
+ * @see org.eclipse.ui.editors.text.TextFileDocumentProvider#createEmptyFileInfo()
+ */
+ protected FileInfo createEmptyFileInfo() {
+ return new AutomakefileFileInfo();
+ }
+
+ /*
+ * @see org.eclipse.ui.editors.text.TextFileDocumentProvider#createFileInfo(java.lang.Object)
+ */
+ protected FileInfo createFileInfo(Object element) throws CoreException {
+ IMakefile original = null;
+ if (element instanceof IFileEditorInput) {
+ IFileEditorInput input= (IFileEditorInput) element;
+ if (input.getFile().exists())
+ original= createMakefile(input.getFile().getLocation().toOSString());
+ } else if (element instanceof IURIEditorInput) {
+ IURIEditorInput input = (IURIEditorInput)element;
+ original = createMakefile(input.getURI().getPath().toString());
+ }
+ if (original == null)
+ return null;
+
+ FileInfo info= super.createFileInfo(element);
+ if (!(info instanceof AutomakefileFileInfo)) {
+ return null;
+ }
+
+ AutomakefileFileInfo makefileInfo= (AutomakefileFileInfo) info;
+ setUpSynchronization(makefileInfo);
+
+ makefileInfo.fCopy = original;
+
+ return makefileInfo;
+ }
+
+ /**
+ */
+ private IMakefile createMakefile(String fileName) {
+ IMakefile makefile = null;
+ Automakefile automakefile = new Automakefile();
+ try {
+ automakefile.parse(fileName);
+ } catch (IOException e) {
+ }
+ makefile = automakefile;
+ return makefile;
+ }
+
+ /*
+ * @see org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake.IMakefileDocumentProvider#getWorkingCopy(java.lang.Object)
+ */
+ public IMakefile getWorkingCopy(Object element) {
+ FileInfo fileInfo= getFileInfo(element);
+ if (fileInfo instanceof AutomakefileFileInfo) {
+ AutomakefileFileInfo info= (AutomakefileFileInfo) fileInfo;
+ return info.fCopy;
+ }
+ return null;
+ }
+
+ /*
+ * @see org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake.IMakefileDocumentProvider#shutdown()
+ */
+ @SuppressWarnings("unchecked")
+ public void shutdown() {
+ Iterator e= getConnectedElementsIterator();
+ while (e.hasNext())
+ disconnect(e.next());
+ }
+
+ public void connect(Object element) throws CoreException {
+ super.connect(element);
+ IMakefile makefile = getWorkingCopy(element);
+ IDocument document = getDocument(element);
+ AutomakeErrorHandler errorHandler = new AutomakeErrorHandler(document);
+ errorHandler.update(makefile);
+ }
+
+ public IDocument getDocument(Object element) {
+ FileInfo info= (FileInfo) getFileInfo(element);
+ if (info != null)
+ return info.fTextFileBuffer.getDocument();
+ return getParentProvider().getDocument(element);
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeEditor.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeEditor.java
new file mode 100644
index 0000000000..644274cea3
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeEditor.java
@@ -0,0 +1,132 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006, 2007 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ * Red Hat Inc. - Modified from MakefileEditor to support Automake files
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import org.eclipse.cdt.make.core.makefile.IMakefile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.linuxtools.cdt.autotools.core.AutotoolsPlugin;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.preferences.AutomakeEditorPreferencePage;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.preferences.AutotoolsEditorPreferenceConstants;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.editors.text.EditorsUI;
+import org.eclipse.ui.texteditor.ChainedPreferenceStore;
+import org.eclipse.ui.texteditor.DefaultRangeIndicator;
+import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
+
+
+public class AutomakeEditor extends MakefileEditor {
+
+ protected AutomakefileContentOutlinePage page;
+ private AutomakefileSourceConfiguration sourceViewerConfiguration;
+ private AutomakeErrorHandler errorHandler;
+ private static AutomakeEditor fgInstance;
+ private IEditorInput input;
+
+ public AutomakeEditor() {
+ super();
+ fgInstance = this;
+ }
+
+ /**
+ * Returns the default editor instance.
+ *
+ * @return the default editor instance
+ */
+ public static AutomakeEditor getDefault() {
+ return fgInstance;
+ }
+
+ protected void doSetInput(IEditorInput newInput) throws CoreException
+ {
+ super.doSetInput(newInput);
+ this.input = newInput;
+
+ getOutlinePage().setInput(input);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.texteditor.AbstractDecoratedTextEditor#initializeEditor()
+ */
+ protected void initializeEditor() {
+ setRangeIndicator(new DefaultRangeIndicator());
+ setEditorContextMenuId("#MakefileEditorContext"); //$NON-NLS-1$
+ setRulerContextMenuId("#MakefileRulerContext"); //$NON-NLS-1$
+ setDocumentProvider(AutomakeEditorFactory.getDefault().getAutomakefileDocumentProvider());
+ IPreferenceStore[] stores = new IPreferenceStore[2];
+ stores[0] = AutotoolsPlugin.getDefault().getPreferenceStore();
+ stores[1] = EditorsUI.getPreferenceStore();
+ ChainedPreferenceStore chainedStore = new ChainedPreferenceStore(stores);
+ setPreferenceStore(chainedStore);
+ sourceViewerConfiguration = new AutomakefileSourceConfiguration(chainedStore, this);
+ setSourceViewerConfiguration(sourceViewerConfiguration);
+ AutotoolsEditorPreferenceConstants.initializeDefaultValues(stores[0]);
+ AutomakeEditorPreferencePage.initDefaults(stores[0]);
+ configureInsertMode(SMART_INSERT, false);
+ setInsertMode(INSERT);
+ }
+
+ public AutomakeDocumentProvider getAutomakefileDocumentProvider() {
+ return (AutomakeDocumentProvider) AutomakeEditorFactory.getDefault().getAutomakefileDocumentProvider();
+ }
+
+ public AutomakefileContentOutlinePage getAutomakeOutlinePage() {
+ if (page == null) {
+ page = new AutomakefileContentOutlinePage(this);
+ page.addSelectionChangedListener(this);
+ page.setInput(getEditorInput());
+ }
+ return page;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IWorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
+ */
+ public void createPartControl(Composite parent) {
+ super.createPartControl(parent);
+ }
+
+ /* (non-Javadoc)
+ * Method declared on IAdaptable
+ */
+ @SuppressWarnings("unchecked")
+ public Object getAdapter(Class key) {
+ if (key.equals(IContentOutlinePage.class)) {
+ return getAutomakeOutlinePage();
+ }
+ return super.getAdapter(key);
+ }
+
+ public AutomakefileSourceConfiguration getAutomakeSourceViewerConfiguration() {
+ return sourceViewerConfiguration;
+ }
+
+ protected void handlePreferenceStoreChanged(PropertyChangeEvent event) {
+ super.handlePreferenceStoreChanged(event);
+ }
+
+ public IMakefile getMakefile() {
+ return getAutomakefileDocumentProvider().getWorkingCopy(this.getEditorInput());
+ }
+
+ public ISourceViewer getAutomakeSourceViewer() {
+ return getSourceViewer();
+ }
+
+ public AutomakeErrorHandler getAutomakeErrorHandler() {
+ return errorHandler;
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeEditorFactory.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeEditorFactory.java
new file mode 100644
index 0000000000..8e4737805e
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeEditorFactory.java
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import org.eclipse.cdt.make.ui.IWorkingCopyManager;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.linuxtools.cdt.autotools.core.AutotoolsPlugin;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.preferences.ColorManager;
+import org.eclipse.swt.graphics.Color;
+
+
+public class AutomakeEditorFactory {
+ private IWorkingCopyManager workingCopyManager;
+ private IMakefileDocumentProvider automakeFileDocumentProvider;
+ private static AutomakeEditorFactory factory;
+
+ /**
+ * The constructor.
+ */
+ private AutomakeEditorFactory() {
+ factory = this;
+ }
+
+ public synchronized IMakefileDocumentProvider getAutomakefileDocumentProvider() {
+ if (automakeFileDocumentProvider == null) {
+ automakeFileDocumentProvider= new AutomakeDocumentProvider();
+ }
+ return automakeFileDocumentProvider;
+ }
+
+ public synchronized IWorkingCopyManager getWorkingCopyManager() {
+ if (workingCopyManager == null) {
+ IMakefileDocumentProvider provider= getAutomakefileDocumentProvider();
+ workingCopyManager= new WorkingCopyManager(provider);
+ }
+ return workingCopyManager;
+ }
+
+ /**
+ * Returns the preference color, identified by the given preference.
+ */
+ public static Color getPreferenceColor(String key) {
+ //FIXME: what do we do with Makefile editor preferences?
+ return ColorManager.getDefault().getColor(PreferenceConverter.getColor(AutotoolsPlugin.getDefault().getPreferenceStore(), key));
+ }
+
+ public static AutomakeEditorFactory getDefault() {
+ if (factory == null)
+ factory = new AutomakeEditorFactory();
+ return factory;
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeErrorHandler.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeErrorHandler.java
new file mode 100644
index 0000000000..7862b20d22
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeErrorHandler.java
@@ -0,0 +1,229 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.cdt.make.core.makefile.IDirective;
+import org.eclipse.cdt.make.core.makefile.IMakefile;
+import org.eclipse.cdt.make.core.makefile.IParent;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.Position;
+import org.eclipse.jface.text.source.AnnotationModel;
+import org.eclipse.linuxtools.cdt.autotools.ui.AutotoolsUIPlugin;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.texteditor.MarkerAnnotation;
+import org.eclipse.ui.texteditor.MarkerUtilities;
+
+
+public class AutomakeErrorHandler {
+ public static final String AUTOMAKE_ERROR_MARKER_ID = AutotoolsUIPlugin.PLUGIN_ID
+ + ".parsefileerror";
+
+ private IDocument document;
+ private AnnotationModel fAnnotationModel;
+
+ public AutomakeErrorHandler(IDocument document)
+ {
+ this.document = document;
+ IEditorInput input = AutomakeEditor.getDefault().getEditorInput();
+ this.fAnnotationModel = (AnnotationModel)AutomakeEditorFactory.getDefault().getAutomakefileDocumentProvider().getAnnotationModel(input);
+ }
+
+ private class AutomakeMarker implements IMarker {
+ private Map<String, Object> attributes;
+ private String type;
+ private long id;
+
+ public void delete() throws CoreException {
+ // TODO Auto-generated method stub
+
+ }
+ public boolean equals(Object obj) {
+ // TODO Auto-generated method stub
+ return super.equals(obj);
+ }
+ public boolean exists() {
+ // TODO Auto-generated method stub
+ return true;
+ }
+ @SuppressWarnings("unchecked")
+ public Object getAdapter(Class adapter) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+ public Object getAttribute(String attributeName) throws CoreException {
+ return attributes.get(attributeName);
+ }
+ public boolean getAttribute(String attributeName, boolean defaultValue) {
+ Object o = attributes.get(attributeName);
+ if (o != null && o instanceof Boolean)
+ return ((Boolean)o).booleanValue();
+ return defaultValue;
+ }
+ public int getAttribute(String attributeName, int defaultValue) {
+ Object o = attributes.get(attributeName);
+ if (o != null && o instanceof Integer)
+ return ((Integer)o).intValue();
+ return defaultValue;
+ }
+ public String getAttribute(String attributeName, String defaultValue) {
+ Object o = attributes.get(attributeName);
+ if (o != null && o instanceof String)
+ return (String)o;
+ return defaultValue;
+ }
+ @SuppressWarnings("unchecked")
+ public Map getAttributes() throws CoreException {
+ return attributes;
+ }
+ public Object[] getAttributes(String[] attributeNames)
+ throws CoreException {
+ Collection<Object> c = attributes.values();
+ return c.toArray();
+ }
+ public long getCreationTime() throws CoreException {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+ public long getId() {
+ return id;
+ }
+ public IResource getResource() {
+ return null;
+ }
+ public String getType() throws CoreException {
+ return type;
+ }
+ public boolean isSubtypeOf(String superType) throws CoreException {
+ if (superType.equals(type))
+ return true;
+ return false;
+ }
+ public void setAttribute(String attributeName, boolean value)
+ throws CoreException {
+ Boolean b = new Boolean(value);
+ attributes.put(attributeName, b);
+ }
+ public void setAttribute(String attributeName, int value)
+ throws CoreException {
+ Integer i = new Integer(value);
+ attributes.put(attributeName, i);
+ }
+ public void setAttribute(String attributeName, Object value)
+ throws CoreException {
+ attributes.put(attributeName, value);
+ }
+ @SuppressWarnings("unchecked")
+ public void setAttributes(Map map) throws CoreException {
+ attributes.putAll(map);
+ }
+ public void setAttributes(String[] attributeNames, Object[] values)
+ throws CoreException {
+ for (int i = 0; i < attributeNames.length; ++i) {
+ attributes.put(attributeNames[i], values[i]);
+ }
+ }
+ protected Object clone() throws CloneNotSupportedException {
+ // TODO Auto-generated method stub
+ return super.clone();
+ }
+ public AutomakeMarker(String type, long id) {
+ this.type = type;
+ this.id = id;
+ this.attributes = new HashMap<String, Object>();
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ private IMarker createMarker(Map attributes, String markerType) throws CoreException {
+ IMarker marker= new AutomakeMarker(markerType, -1);
+ marker.setAttributes(attributes);
+ return marker;
+ }
+
+ public void update(IMakefile makefile) {
+ removeExistingMarkers();
+
+ // Recursively process all the directives in the Makefile
+ checkChildren(makefile);
+ }
+
+ private void checkChildren(IParent parent) {
+ IDirective[] directives = parent.getDirectives();
+ for (int i = 0; i < directives.length; i++) {
+ IDirective directive = directives[i];
+ if (directive instanceof IParent) {
+ checkChildren((IParent)directive);
+ } else if (directive instanceof BadDirective) {
+
+ int lineNumber = directive.getStartLine();
+
+ Map<String, Object> map = new HashMap<String, Object>();
+ MarkerUtilities.setLineNumber(map, lineNumber);
+ // FIXME: message
+ MarkerUtilities.setMessage(map, "Bad Directive");
+ map.put(IMarker.MESSAGE, "Bad Directive");
+ map.put(IMarker.LOCATION, Integer.valueOf(lineNumber));
+
+ Integer charStart = getCharOffset(lineNumber - 1, 0);
+ if (charStart != null) {
+ map.put(IMarker.CHAR_START, charStart);
+ }
+ // FIXME: probably a better way to do this
+ // This is the end character
+ Integer charEnd = new Integer(getCharOffset(directive.getEndLine(), 0).intValue() - 1);
+ if (charEnd != null) {
+ map.put(IMarker.CHAR_END, charEnd);
+ }
+
+ // FIXME: add severity level
+ map.put(IMarker.SEVERITY, new Integer(IMarker.SEVERITY_ERROR));
+
+ try {
+ IMarker marker = createMarker(map, AUTOMAKE_ERROR_MARKER_ID); // ICModelMarker.C_MODEL_PROBLEM_MARKER);
+
+ MarkerAnnotation annotation = new MarkerAnnotation(marker);
+ Position p = new Position(charStart.intValue(),charEnd.intValue() - charStart.intValue());
+ fAnnotationModel.addAnnotation(annotation, p);
+ } catch (CoreException ce) {
+ // do nothing
+ }
+ }
+ }
+ return;
+ }
+
+ public void removeExistingMarkers()
+ {
+ fAnnotationModel.removeAllAnnotations();
+ }
+
+
+ private Integer getCharOffset(int lineNumber, int columnNumber)
+ {
+ try
+ {
+ return new Integer(document.getLineOffset(lineNumber) + columnNumber);
+ }
+ catch (BadLocationException e)
+ {
+ e.printStackTrace();
+ return null;
+ }
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeIfElse.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeIfElse.java
new file mode 100644
index 0000000000..a0b7abee1d
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeIfElse.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2007 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+
+
+public class AutomakeIfElse extends Parent {
+ String condition;
+ int startLine;
+ int endLine;
+ String type;
+ public AutomakeIfElse(Directive parent, String type, String condition) {
+ super(parent);
+ this.type = type;
+ this.condition = condition;
+ }
+ public String getCondition() {
+ return condition;
+ }
+ public void setCondition(String condition) {
+ this.condition = condition;
+ }
+ public void setLines(int startLine, int endLine) {
+ this.startLine = startLine;
+ this.endLine = endLine;
+ }
+ public String getType() {
+ return type;
+ }
+ public void setType(String type) {
+ this.type = type;
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeMacroDefinitionRule.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeMacroDefinitionRule.java
new file mode 100644
index 0000000000..e4ef44ddc5
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeMacroDefinitionRule.java
@@ -0,0 +1,206 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006, 2007 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ * Red Hat Inc. - Modified from MacroDefinitionRule to support Automake files
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+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.Token;
+
+class AutomakeMacroDefinitionRule 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 AutomakeMacroDefinitionRule(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 c;
+ int state = INIT_STATE;
+
+ if (resume)
+ scanToBeginOfLine(scanner);
+
+ for (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 (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);
+ }
+
+ if (state == FINISH_STATE) {
+ scanToEndOfLine(scanner);
+ return token;
+ }
+
+ boolean debug = true;
+ if (debug) {
+// System.out.println("This should be a 'c': " + peek(scanner));
+// System.out.println("This is what's in the **REST OF** the buffer:");
+// int count = 0;
+// for (int c = scanner.read(); c != ICharacterScanner.EOF; c = scanner.read()) {
+// System.out.println((char) c);
+// count++;
+// }
+// // Unread what we just displayed
+// for (int i = 0; i < count; i++) {
+// scanner.unread();
+// }
+ }
+
+ if (defaultToken.isUndefined()) {
+ // If c is EOF, we've read it and broken out of the for loop above,
+ // but we need to unread it since it got read but not put into the
+ // buffer
+ if (state == ERROR_STATE || c == ICharacterScanner.EOF)
+ scanner.unread();
+ unreadBuffer(scanner);
+ debug = true;
+ if (debug) {
+// System.out.println("This should be an 'i': " + peek(scanner));
+// System.out.println("We've supposedly just unread the entire buffer. Here it is:");
+// int count = 0;
+// for (int c = scanner.read(); c != ICharacterScanner.EOF; c = scanner.read()) {
+// System.out.println((char) c);
+// count++;
+// }
+// // Unread what we just displayed
+// for (int i = 0; i < count + 1; i++) {
+// scanner.unread();
+// }
+// System.out.println("... just to be safe, here's the first character: " + peek(scanner));
+ }
+
+ }
+
+ return Token.UNDEFINED;
+ }
+
+ public char peek(ICharacterScanner scanner) {
+ char c = (char) scanner.read();
+ scanner.unread();
+ return c;
+ }
+
+ 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) {
+ while(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 == '_') || (c0 == '-') ||
+ (c0 == '@') || (c0 == '+') || (c0 == '$') || (c0 == '(') || (c0 == ')');
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeMacroReferenceRule.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeMacroReferenceRule.java
new file mode 100644
index 0000000000..678f506224
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeMacroReferenceRule.java
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2006, Red Hat, Inc.
+ * Based on MacroReferenceRule which has the following copyright notice
+ *
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import org.eclipse.jface.text.rules.ICharacterScanner;
+import org.eclipse.jface.text.rules.IToken;
+import org.eclipse.jface.text.rules.PatternRule;
+
+public class AutomakeMacroReferenceRule extends PatternRule {
+
+ int nOfBrackets;
+ int fBracket;
+
+// public MacroReferenceRule(IToken token) {
+// super("$(", ")", token, (char) 0, true); //$NON-NLS-1$ //$NON-NLS-2$
+// }
+
+ public AutomakeMacroReferenceRule(IToken token, String startSeq, String endSeq) {
+ super(startSeq, endSeq, token, (char)0, true);
+ if (endSeq.length() > 0 && endSeq.charAt(0) == '}') {
+ fBracket = '{';
+ } else {
+ fBracket = '(';
+ }
+ }
+
+ 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 (fBracket == 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 false;
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeTextHover.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeTextHover.java
new file mode 100644
index 0000000000..483f6307f4
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeTextHover.java
@@ -0,0 +1,187 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2007 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import org.eclipse.cdt.make.core.makefile.IDirective;
+import org.eclipse.cdt.make.core.makefile.IMacroDefinition;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IInformationControlCreator;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITextHover;
+import org.eclipse.jface.text.ITextHoverExtension;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.Region;
+import org.eclipse.swt.graphics.Point;
+
+
+public class AutomakeTextHover implements ITextHover, ITextHoverExtension {
+
+ AutomakeEditor editor;
+
+ public AutomakeTextHover(AutomakeEditor editor) {
+ this.editor = editor;
+ }
+
+ public String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion) {
+ TargetRule target = null;
+ String[] preReqs = null;
+
+ if (hoverRegion == null || hoverRegion.getLength() == 0)
+ return null;
+ Automakefile makefile = (Automakefile) editor.getMakefile();
+ if (makefile == null)
+ return null;
+
+ String hoverText;
+ int hoverLine;
+ try {
+ hoverText = textViewer.getDocument().get(hoverRegion.getOffset(), hoverRegion.getLength());
+ hoverLine = textViewer.getDocument().getLineOfOffset(hoverRegion.getOffset());
+ } catch (BadLocationException e) {
+ return null;
+ }
+
+ // Automatic variables
+ if (hoverText.startsWith("$")) {
+ IDirective containingDirective = makefile.getDirectiveContainingLine(hoverLine);
+ if (containingDirective instanceof TargetRule) {
+ target = (TargetRule) containingDirective;
+ }
+ if (target == null)
+ return "";
+ switch (hoverText.charAt(1)) {
+ case '@':
+ return target.getTarget().toString();
+ case '<':
+ preReqs = target.getPrerequisites();
+ if (preReqs != null && preReqs.length > 0)
+ return preReqs[0];
+ break;
+ // FIXME: implement $* ?
+// case '*':
+// break;
+ case '?':
+ preReqs = target.getPrerequisites();
+ if (preReqs != null && preReqs.length > 0) {
+ String toReturn = "";
+ toReturn = preReqs[0];
+ for (int i = 1; i < preReqs.length; i++) {
+ toReturn += " " + preReqs[i];
+ }
+ return toReturn;
+ }
+ break;
+ case '%':
+// if (target instanceOf ArchiveTarget) {
+// return target.getMember();
+// } else {
+// error;
+// }
+// break;
+ default:
+ break;
+ }
+ } else {
+ // Macros
+ IMacroDefinition[] macroDefinitions = makefile.getMacroDefinitions(hoverText);
+ for (int i = 0; i < macroDefinitions.length; i++) {
+ IMacroDefinition definition = macroDefinitions[i];
+ if (definition.getName().equals(hoverText))
+ return definition.getValue().toString();
+ }
+ }
+
+// IRule[] rules = makefile.getRules();
+// for (int i = 0; i < rules.length; i++) {
+// rule = rules[i];
+// System.out.println("rule: " + rule);
+// System.out.println("target: " + rule.getTarget());
+// ICommand[] commands = rule.getCommands();
+// for (int j = 0; j < commands.length; j++) {
+// ICommand command = commands[j];
+// System.out.println("command: " + command);
+// }
+// }
+ return "";
+ }
+
+ public IRegion getHoverRegion(ITextViewer textViewer, int offset) {
+
+ if (textViewer != null) {
+ /*
+ * If the hover offset falls within the selection range return the
+ * region for the whole selection.
+ */
+ Point selectedRange = textViewer.getSelectedRange();
+ if (selectedRange.x >= 0 && selectedRange.y > 0
+ && offset >= selectedRange.x
+ && offset <= selectedRange.x + selectedRange.y)
+ return new Region(selectedRange.x, selectedRange.y);
+ else {
+ return findWord(textViewer.getDocument(), offset);
+ }
+ }
+ return null;
+ }
+
+ private 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) &&
+ (c != '@') && (c != '<') && (c != '*') && (c != '?') && (c != '%'))
+ break;
+ --pos;
+ }
+
+ start = pos;
+
+ pos = offset;
+ int length = document.getLength();
+
+ while (pos < length) {
+ c = document.getChar(pos);
+ if (!Character.isJavaIdentifierPart(c) &&
+ (c != '@') && (c != '<') && (c != '*') && (c != '?') && (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;
+ }
+
+ public IInformationControlCreator getHoverControlCreator() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeWordDetector.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeWordDetector.java
new file mode 100644
index 0000000000..941e7d4b1c
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeWordDetector.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2007 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import org.eclipse.jface.text.rules.IWordDetector;
+
+public class AutomakeWordDetector implements IWordDetector {
+
+ private static final String correctStartSpecChars = "$%*().><"; //$NON-NLS-1$
+ private static final String correctSpecChars = "?@$/\\<*%"; //$NON-NLS-1$
+
+ public boolean isWordStart(char character) {
+ return Character.isLetterOrDigit(character) || (correctStartSpecChars.indexOf(character) >= 0);
+ }
+
+ public boolean isWordPart(char character) {
+ return Character.isLetterOrDigit(character) || (correctSpecChars.indexOf(character) >= 0);
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Automakefile.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Automakefile.java
new file mode 100644
index 0000000000..2879c5bd89
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Automakefile.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006, 2007 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ * Red Hat Inc. - Modified from PosixMakeFile to support Automake files
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import java.io.IOException;
+import org.eclipse.cdt.make.core.makefile.IDirective;
+
+
+public class Automakefile extends GNUAutomakefile {
+
+ public Automakefile() {
+ super();
+ }
+
+ protected IDirective getDirectiveContainingLine(int line) {
+ int startLine, endLine;
+ IDirective[] directives = this.getDirectives();
+ for (int i = 0; i < directives.length; i++) {
+ IDirective directive = directives[i];
+ startLine = directive.getStartLine();
+ endLine = directive.getEndLine();
+ if (startLine <= line && endLine >= line)
+ return directive;
+ }
+ return null;
+ }
+
+ public static void main(String[] args) {
+ try {
+ String filename = "Makefile.am"; //$NON-NLS-1$
+ if (args.length == 1) {
+ filename = args[0];
+ }
+ Automakefile makefile = new Automakefile();
+ 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/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakefileCodeScanner.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakefileCodeScanner.java
new file mode 100644
index 0000000000..7bd336b3be
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakefileCodeScanner.java
@@ -0,0 +1,150 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006, 2007 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ * Red Hat Inc. - Modified from MakefileCodeScanner to support Automake files
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.text.rules.EndOfLineRule;
+import org.eclipse.jface.text.rules.IPredicateRule;
+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.MultiLineRule;
+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.WordRule;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.AutoconfIdentifierRule;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.AutoconfWhitespaceDetector;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.preferences.ColorManager;
+
+
+public class AutomakefileCodeScanner extends AbstractMakefileCodeScanner {
+
+
+ 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$
+ "if", "@if", "@endif" }; //$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$
+ };
+
+ private final static String[] automaticVariables = { "$<" , "$*" , "$@" , "$?" , "$%"
+ };
+
+ public static final String[] fTokenProperties = new String[] {
+ ColorManager.MAKE_COMMENT_COLOR,
+ ColorManager.MAKE_KEYWORD_COLOR,
+ ColorManager.MAKE_FUNCTION_COLOR,
+ ColorManager.MAKE_MACRO_REF_COLOR,
+ ColorManager.MAKE_MACRO_DEF_COLOR,
+ ColorManager.MAKE_DEFAULT_COLOR
+ };
+
+ /**
+ * Constructor for AutomakefileCodeScanner
+ */
+ public AutomakefileCodeScanner() {
+ super();
+ initialize();
+ }
+
+ protected List<IRule> createRules() {
+ IToken keyword = getToken(ColorManager.MAKE_KEYWORD_COLOR);
+ IToken function = getToken(ColorManager.MAKE_FUNCTION_COLOR);
+ IToken comment = getToken(ColorManager.MAKE_COMMENT_COLOR);
+ IToken macroRef = getToken(ColorManager.MAKE_MACRO_REF_COLOR);
+ IToken macroDef = getToken(ColorManager.MAKE_MACRO_DEF_COLOR);
+ IToken other = getToken(ColorManager.MAKE_DEFAULT_COLOR);
+
+ List<IRule> rules = new ArrayList<IRule>();
+
+ // Add rule for single line comments.
+ rules.add(new EndOfLineRule("#", comment, '\\', true)); //$NON-NLS-1$
+
+ // Add generic whitespace rule.
+ rules.add(new WhitespaceRule(new IWhitespaceDetector() {
+ public boolean isWhitespace(char character) {
+ return Character.isWhitespace(character);
+ }
+ }));
+
+ // Put before the the word rules
+ MultiLineRule defineRule = new MultiLineRule("define", "endef", macroDef); //$NON-NLS-1$ //$NON-NLS-2$
+ defineRule.setColumnConstraint(0);
+ rules.add(defineRule);
+
+ rules.add(new AutomakeMacroDefinitionRule(macroDef, Token.UNDEFINED));
+
+ // @AC_SUBST_VAR@
+ IPredicateRule substVarRule = new AutoconfSubstRule(macroRef);
+ rules.add(substVarRule);
+
+ // Add word rule for keywords, types, and constants.
+ // We restring the detection of the keywords to be the first column to be valid.
+ WordRule keyWordRule = new WordRule(new MakefileWordDetector(), Token.UNDEFINED);
+ for (int i = 0; i < keywords.length; i++) {
+ keyWordRule.addWord(keywords[i], keyword);
+ }
+ keyWordRule.setColumnConstraint(0);
+ rules.add(keyWordRule);
+
+
+ WordRule functionRule = new WordRule(new MakefileWordDetector(), Token.UNDEFINED);
+ for (int i = 0; i < functions.length; i++)
+ functionRule.addWord(functions[i], function);
+ rules.add(functionRule);
+
+ WordRule automaticVarRule = new WordRule(new AutomakeWordDetector(), Token.UNDEFINED);
+ for (int i = 0; i < automaticVariables.length; i++)
+ automaticVarRule.addWord(automaticVariables[i], keyword);
+ rules.add(automaticVarRule);
+
+// rules.add(new SingleLineRule("$(", ")", macroRef)); //$NON-NLS-1$ //$NON-NLS-2$
+// rules.add(new SingleLineRule("${", "}", macroRef)); //$NON-NLS-1$ //$NON-NLS-2$
+ rules.add(new AutomakeMacroReferenceRule(macroRef, "$(", ")")); //$NON-NLS-1$ //$NON-NLS-2$
+ rules.add(new AutomakeMacroReferenceRule(macroRef, "${", "}")); //$NON-NLS-1$ //$NON-NLS-2$
+ // Add word rule for identifier.
+
+ rules.add(new AutoconfIdentifierRule(other));
+
+ // Make sure we don't treat "\#" as comment start.
+ rules.add(new SingleLineRule("\\#", null, Token.UNDEFINED));
+
+ rules.add(new WhitespaceRule(new AutoconfWhitespaceDetector()));
+
+ setDefaultReturnToken(other);
+
+ return rules;
+ }
+
+ public IToken nextToken() {
+ return super.nextToken();
+ }
+
+ /*
+ * @see AbstractMakefileCodeScanner#getTokenProperties()
+ */
+ protected String[] getTokenProperties() {
+ return fTokenProperties;
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakefileContentOutlinePage.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakefileContentOutlinePage.java
new file mode 100644
index 0000000000..4c1fcacc5b
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakefileContentOutlinePage.java
@@ -0,0 +1,322 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006, 2007 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ * Red Hat Inc. - Modified from MakefileContentOutlinePage for Automake files
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+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.ui.IWorkingCopyManager;
+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.linuxtools.internal.cdt.autotools.ui.MakeUIImages;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.views.contentoutline.ContentOutlinePage;
+import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
+
+
+public class AutomakefileContentOutlinePage extends ContentOutlinePage implements IContentOutlinePage {
+
+ protected IMakefile makefile;
+ protected IMakefile nullMakefile = new NullMakefile();
+
+ private class AutomakefileContentProvider 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<IDirective> list = new ArrayList<IDirective>(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 if (showTargetRule && directives[i] instanceof AutomakeIfElse) {
+ 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= AutomakeEditorFactory.getDefault().getWorkingCopyManager();
+ makefile = manager.getWorkingCopy((IEditorInput) newInput);
+ if (makefile == null) {
+ makefile = nullMakefile;
+ }
+ }
+ }
+ }
+
+ private class AutomakefileLabelProvider 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 IAutomakeConditional) {
+ // Must process this before ICommand because if/else are also ICommands
+ return super.getImage(element);
+ } 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 AutomakeConfigMacro) {
+ return MakeUIImages.getImage(MakeUIImages.IMG_OBJS_MAKEFILE_ACMACRO);
+ }
+
+ 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 if (element instanceof AutomakeIfElse) {
+ AutomakeIfElse ifelse = (AutomakeIfElse) element;
+ // FIXME: make this not a string comparison
+ if (ifelse.getType().equals("if")) {
+ name = "if " + ifelse.getCondition();
+ } else
+ name = "else";
+ } else if (element instanceof AutomakeConfigMacro) {
+ AutomakeConfigMacro macro = (AutomakeConfigMacro)element;
+ name = macro.getName();
+ } 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 AutomakeEditor fEditor;
+ protected Object fInput;
+
+ public AutomakefileContentOutlinePage(AutomakeEditor editor) {
+ super();
+ fEditor = editor;
+ }
+
+ /**
+ * Sets the input of the outline page
+ */
+ public void setInput(Object input) {
+ fInput = input;
+ update();
+ }
+
+ /**
+ * 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#createControl(org.eclipse.swt.widgets.Composite)
+ */
+ public void createControl(Composite parent) {
+ super.createControl(parent);
+ TreeViewer viewer = getTreeViewer();
+ viewer.setContentProvider(new AutomakefileContentProvider());
+ viewer.setLabelProvider(new AutomakefileLabelProvider());
+ if (fInput != null) {
+ viewer.setInput(fInput);
+ }
+
+// MenuManager manager= new MenuManager("#MakefileOutlinerContext"); //$NON-NLS-1$
+// 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);
+//
+// viewer.addDoubleClickListener(new IDoubleClickListener() {
+// /* (non-Javadoc)
+// * @see org.eclipse.jface.viewers.IDoubleClickListener#doubleClick(org.eclipse.jface.viewers.DoubleClickEvent)
+// */
+// public void doubleClick(DoubleClickEvent event) {
+// if (fOpenIncludeAction != null) {
+// fOpenIncludeAction.run();
+// }
+// }
+// });
+//
+// IPageSite site= getSite();
+// site.registerContextMenu(MakeUIPlugin.getPluginId() + ".outline", manager, viewer); //$NON-NLS-1$
+// site.setSelectionProvider(viewer);
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
+ */
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ if (oldInput != null) {
+ makefile = nullMakefile;
+ }
+
+ if (newInput != null) {
+ IWorkingCopyManager manager= AutomakeEditorFactory.getDefault().getWorkingCopyManager();
+ makefile = manager.getWorkingCopy((IEditorInput)newInput);
+ if (makefile == null) {
+ makefile = nullMakefile;
+ }
+ }
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakefileReconcilingStrategy.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakefileReconcilingStrategy.java
new file mode 100644
index 0000000000..7cae0e2c5c
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakefileReconcilingStrategy.java
@@ -0,0 +1,108 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006, 2007 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ * Red Hat Inc. - Modified from MakefileReconcilingStrategy for Automake files
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import java.io.IOException;
+import java.io.StringReader;
+
+import org.eclipse.cdt.make.core.makefile.IMakefile;
+import org.eclipse.cdt.make.ui.IWorkingCopyManager;
+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.IEditorInput;
+import org.eclipse.ui.texteditor.IDocumentProvider;
+import org.eclipse.ui.texteditor.ITextEditor;
+
+
+public class AutomakefileReconcilingStrategy implements IReconcilingStrategy {
+
+ private int fLastRegionOffset;
+ private ITextEditor fEditor;
+ private IWorkingCopyManager fManager;
+ private IDocumentProvider fDocumentProvider;
+ private AutomakefileContentOutlinePage fOutliner;
+ private IReconcilingParticipant fMakefileReconcilingParticipant;
+ private AutomakeErrorHandler fErrorHandler;
+ private IEditorInput input;
+
+ public AutomakefileReconcilingStrategy(AutomakeEditor editor) {
+ fOutliner= editor.getAutomakeOutlinePage();
+ fLastRegionOffset = Integer.MAX_VALUE;
+ fEditor= editor;
+ input = (IEditorInput) fEditor.getEditorInput();
+ fManager= AutomakeEditorFactory.getDefault().getWorkingCopyManager();
+ fDocumentProvider= AutomakeEditorFactory.getDefault().getAutomakefileDocumentProvider();
+ fErrorHandler= new AutomakeErrorHandler(fDocumentProvider.getDocument(input));
+ if (fEditor instanceof IReconcilingParticipant) {
+ fMakefileReconcilingParticipant= (IReconcilingParticipant)fEditor;
+ }
+ }
+
+ /**
+ * @see IReconcilingStrategy#reconcile(document)
+ */
+ public void setDocument(IDocument document) {
+ }
+
+
+ /**
+ * @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 too much flashing in
+ // the contentoutline viewer.
+ //reconcile();
+ }
+
+ private void reconcile() {
+ try {
+ IMakefile makefile = fManager.getWorkingCopy(fEditor.getEditorInput());
+ if (makefile != null) {
+ String content = fDocumentProvider.getDocument(input).get();
+ StringReader reader = new StringReader(content);
+ try {
+ makefile.parse(makefile.getFileURI(), reader);
+ } catch (IOException e) {
+ }
+
+ fOutliner.update();
+ fErrorHandler.update(makefile);
+ }
+ } finally {
+ try {
+ if (fMakefileReconcilingParticipant != null) {
+ fMakefileReconcilingParticipant.reconciled();
+ }
+ } finally {
+ //
+ }
+ }
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakefileSourceConfiguration.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakefileSourceConfiguration.java
new file mode 100644
index 0000000000..acffc5eb05
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakefileSourceConfiguration.java
@@ -0,0 +1,148 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006, 2007 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ * Red Hat Inc. - Modified from MakefileSourceConfiguration to support Automake
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ITextHover;
+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.DefaultDamagerRepairer;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.jface.text.source.SourceViewerConfiguration;
+import org.eclipse.jface.util.PropertyChangeEvent;
+
+
+public class AutomakefileSourceConfiguration extends
+ MakefileSourceConfiguration {
+
+ AutomakeEditor editor;
+ AutomakefileCodeScanner codeScanner;
+ AutomakeTextHover amHover;
+
+ /**
+ * Constructor for MakeConfiguration
+ */
+ public AutomakefileSourceConfiguration(IPreferenceStore preferenceStore) {
+ super(preferenceStore, null);
+ }
+
+ public AutomakefileSourceConfiguration(IPreferenceStore preferenceStore, AutomakeEditor editor) {
+ super(preferenceStore, editor);
+ this.editor = editor;
+ }
+
+ public AutomakefileCodeScanner getAutomakeCodeScanner() {
+ if (null == codeScanner)
+ codeScanner = new AutomakefileCodeScanner();
+ return codeScanner;
+
+ }
+
+ public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) {
+ if (amHover == null)
+ amHover = new AutomakeTextHover(editor);
+ return amHover;
+ }
+
+ /**
+ * @param event
+ */
+ public void adaptToPreferenceChange(PropertyChangeEvent event) {
+ AutomakefileCodeScanner scanner = getAutomakeCodeScanner();
+ scanner.adaptToPreferenceChange(event);
+ }
+
+ /**
+ * @param event
+ * @return
+ */
+ public boolean affectsBehavior(PropertyChangeEvent event) {
+ AutomakefileCodeScanner scanner = getAutomakeCodeScanner();
+ return scanner.affectsBehavior(event);
+ }
+
+ public IPresentationReconciler getPresentationReconciler(ISourceViewer v) {
+
+ PresentationReconciler reconciler = new PresentationReconciler();
+
+ DefaultDamagerRepairer dr = new DefaultDamagerRepairer(getAutomakeCodeScanner());
+ reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE);
+ reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE);
+
+ dr = new DefaultDamagerRepairer(getAutomakeCodeScanner());
+ reconciler.setDamager(dr, MakefilePartitionScanner.MAKEFILE_COMMENT_PARTITION);
+ reconciler.setRepairer(dr, MakefilePartitionScanner.MAKEFILE_COMMENT_PARTITION);
+
+ dr = new DefaultDamagerRepairer(getAutomakeCodeScanner());
+ reconciler.setDamager(dr, MakefilePartitionScanner.MAKEFILE_MACRO_ASSIGNEMENT_PARTITION);
+ reconciler.setRepairer(dr, MakefilePartitionScanner.MAKEFILE_MACRO_ASSIGNEMENT_PARTITION);
+
+ dr = new DefaultDamagerRepairer(getAutomakeCodeScanner());
+ reconciler.setDamager(dr, MakefilePartitionScanner.MAKEFILE_INCLUDE_BLOCK_PARTITION);
+ reconciler.setRepairer(dr, MakefilePartitionScanner.MAKEFILE_INCLUDE_BLOCK_PARTITION);
+
+ dr = new DefaultDamagerRepairer(getAutomakeCodeScanner());
+ reconciler.setDamager(dr, MakefilePartitionScanner.MAKEFILE_IF_BLOCK_PARTITION);
+ reconciler.setRepairer(dr, MakefilePartitionScanner.MAKEFILE_IF_BLOCK_PARTITION);
+
+ dr = new DefaultDamagerRepairer(getAutomakeCodeScanner());
+ reconciler.setDamager(dr, MakefilePartitionScanner.MAKEFILE_DEF_BLOCK_PARTITION);
+ reconciler.setRepairer(dr, MakefilePartitionScanner.MAKEFILE_DEF_BLOCK_PARTITION);
+
+ dr = new DefaultDamagerRepairer(getAutomakeCodeScanner());
+ reconciler.setDamager(dr, MakefilePartitionScanner.MAKEFILE_OTHER_PARTITION);
+ reconciler.setRepairer(dr, MakefilePartitionScanner.MAKEFILE_OTHER_PARTITION);
+ return reconciler;
+ }
+
+
+ /**
+ * @see SourceViewerConfiguration#getReconciler(ISourceViewer)
+ */
+ public IReconciler getReconciler(ISourceViewer sourceViewer) {
+ if (editor != null && editor.isEditable()) {
+ MonoReconciler reconciler= new MonoReconciler(new AutomakefileReconcilingStrategy(editor), false);
+ reconciler.setDelay(1000);
+ reconciler.setProgressMonitor(new NullProgressMonitor());
+ return reconciler;
+ }
+ return null;
+ }
+
+ /**
+ * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getContentAssistant(ISourceViewer)
+ */
+ public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
+ ContentAssistant assistant = new ContentAssistant();
+ assistant.setContentAssistProcessor(new AutomakeCompletionProcessor(editor), IDocument.DEFAULT_CONTENT_TYPE);
+ assistant.setContentAssistProcessor(new AutomakeCompletionProcessor(editor), MakefilePartitionScanner.MAKEFILE_COMMENT_PARTITION);
+ assistant.setContentAssistProcessor(new AutomakeCompletionProcessor(editor), MakefilePartitionScanner.MAKEFILE_DEF_BLOCK_PARTITION);
+ assistant.setContentAssistProcessor(new AutomakeCompletionProcessor(editor), MakefilePartitionScanner.MAKEFILE_IF_BLOCK_PARTITION);
+ assistant.setContentAssistProcessor(new AutomakeCompletionProcessor(editor), MakefilePartitionScanner.MAKEFILE_INCLUDE_BLOCK_PARTITION);
+ assistant.setContentAssistProcessor(new AutomakeCompletionProcessor(editor), MakefilePartitionScanner.MAKEFILE_MACRO_ASSIGNEMENT_PARTITION);
+
+ assistant.enableAutoActivation(true);
+ assistant.setAutoActivationDelay(500);
+
+ assistant.setProposalPopupOrientation(IContentAssistant.CONTEXT_INFO_BELOW);
+ assistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_BELOW);
+
+ return assistant;
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakefileUtil.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakefileUtil.java
new file mode 100644
index 0000000000..1cc1f62aab
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakefileUtil.java
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2007, 2009 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+
+public class AutomakefileUtil {
+
+ // Look for Automake conditionals which optionally
+ // activate or disable a Makefile rule command.
+ public static boolean isAutomakeCommand(String line) {
+ return line.matches("^@[a-z_A-Z0-9]+@\\t.*$"); //$NON-NLS-1$
+ }
+
+ public static boolean isIfBlock(String line) {
+ return line.startsWith("if"); //$NON-NLS-1$
+ }
+
+ public static boolean isElseBlock(String line) {
+ return line.startsWith("else"); //$NON-NLS-1$
+ }
+
+ public static boolean isElseIfBlock(String line) {
+ return line.startsWith("else if"); //$NON-NLS-1$
+ }
+
+ public static boolean isEndifBlock(String line) {
+ return line.startsWith("endif"); //$NON-NLS-1$
+ }
+
+ public static boolean isConfigMacro(String line) {
+ return line.matches("\\s*@[a-z_A-Z0-9]+@"); //$NON-NLS-1$
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/BadDirective.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/BadDirective.java
new file mode 100644
index 0000000000..2186b49c06
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/BadDirective.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+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/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Command.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Command.java
new file mode 100644
index 0000000000..3d761803c7
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Command.java
@@ -0,0 +1,115 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.eclipse.cdt.make.core.makefile.ICommand;
+
+/**
+ * Makefile : ( statement ) *
+ * statement : command | ..
+ * command : <tab> prefix_command string <nl>
+ * prefix_command : '-' | '@' | '+'
+ */
+public class Command extends Directive implements ICommand {
+
+ final public static char NL = '\n';
+
+ String command = ""; //$NON-NLS-1$
+ 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 : <tab> prefix_command string <nl>
+ */
+ 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}; //$NON-NLS-1$
+ return Runtime.getRuntime().exec(cmdArray, envp, dir);
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Comment.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Comment.java
new file mode 100644
index 0000000000..772105fb95
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Comment.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+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/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/CompletionProposalComparator.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/CompletionProposalComparator.java
new file mode 100644
index 0000000000..a92415dfc4
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/CompletionProposalComparator.java
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+
+import java.util.Comparator;
+
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+
+public class CompletionProposalComparator implements Comparator<ICompletionProposal> {
+
+ /**
+ * Constructor for CompletionProposalComparator.
+ */
+ public CompletionProposalComparator() {
+ }
+
+ /* (non-Javadoc)
+ * @see Comparator#compare(Object, Object)
+ */
+ public int compare(ICompletionProposal o1, ICompletionProposal o2) {
+ ICompletionProposal c1= (ICompletionProposal) o1;
+ ICompletionProposal c2= (ICompletionProposal) o2;
+ return c1.getDisplayString().compareToIgnoreCase(c2.getDisplayString());
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Conditional.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Conditional.java
new file mode 100644
index 0000000000..90e582861f
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Conditional.java
@@ -0,0 +1,170 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006, 2007 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ * Red Hat Inc. - modified for Automake editor usage
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import org.eclipse.cdt.make.core.makefile.gnu.IConditional;
+
+
+public abstract class Conditional extends Parent implements IConditional {
+
+ private static final String EMPTY = ""; //$NON-NLS-1$
+ String cond;
+ String arg1;
+ String arg2;
+
+ public Conditional(Directive parent, String conditional) {
+ super(parent);
+ cond = conditional;
+ parse();
+ }
+
+ public Conditional(Directive parent) {
+ this(parent, EMPTY, EMPTY, EMPTY);
+ }
+
+ 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 isIf() {
+ return false;
+ }
+
+ 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 = EMPTY;
+ 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;
+ }
+ }
+ }
+
+ if (count >= line.length()) {
+ arg1 = arg2 = EMPTY;
+ return;
+ }
+
+ 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 = EMPTY;
+ 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;
+ }
+ }
+ }
+ if (count > line.length()) {
+ arg2 = EMPTY;
+ } else {
+ arg2 = line.substring(0, count);
+ }
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/DefaultRule.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/DefaultRule.java
new file mode 100644
index 0000000000..2967311570
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/DefaultRule.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+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(MakeFileConstants.RULE_DEFAULT), new String[0], cmds);
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/DefineVariable.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/DefineVariable.java
new file mode 100644
index 0000000000..b4bde3e768
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/DefineVariable.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+
+public class DefineVariable extends GNUVariableDef {
+
+ public DefineVariable(Directive parent, String name, StringBuffer value) {
+ super(parent, name, value);
+ }
+
+ public boolean isMultiLine() {
+ return true;
+ }
+
+ public String toString() {
+ StringBuffer sb = new StringBuffer(GNUMakefileConstants.VARIABLE_DEFINE);
+ sb.append(getName()).append('\n');
+ sb.append(getValue());
+ sb.append(GNUMakefileConstants.TERMINAL_ENDEF);
+ return sb.toString();
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/DeleteOnErrorRule.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/DeleteOnErrorRule.java
new file mode 100644
index 0000000000..fc25fbb8f3
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/DeleteOnErrorRule.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import org.eclipse.cdt.make.core.makefile.gnu.IDeleteOnErrorRule;
+
+/**
+ * .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(GNUMakefileConstants.RULE_DELETE_ON_ERROR), reqs, new Command[0]);
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Directive.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Directive.java
new file mode 100644
index 0000000000..06f0826b53
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Directive.java
@@ -0,0 +1,100 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import org.eclipse.cdt.make.core.makefile.IDirective;
+import org.eclipse.cdt.make.core.makefile.IMakefile;
+
+public abstract class Directive implements IDirective {
+
+ int endLine;
+ int startLine;
+ String filename;
+ IMakefile makefile;
+ 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;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.make.core.makefile.IDirective#getFileName()
+ */
+ public String getFileName() {
+ if (filename == null) {
+ if (parent != null) {
+ filename = parent.getFileName();
+ }
+ }
+ return filename;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.make.core.makefile.IDirective#getMakefile()
+ */
+ public IMakefile getMakefile() {
+ if (makefile == null) {
+ if (parent != null) {
+ makefile = parent.getMakefile();
+ }
+ }
+ return makefile;
+ }
+
+ 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);
+ }
+
+ public void setFilename(String name) {
+ filename = name;
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/EditorUtility.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/EditorUtility.java
new file mode 100644
index 0000000000..ffb99a2322
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/EditorUtility.java
@@ -0,0 +1,561 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ * Markus Schorn (Wind River Systems)
+ * Norbert Ploett (Siemens AG)
+ * Anton Leherbauer (Wind River Systems)
+ * Ed Swartz (Nokia)
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.IOException;
+import java.text.MessageFormat;
+
+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.IBinary;
+import org.eclipse.cdt.core.model.IBuffer;
+import org.eclipse.cdt.core.model.ICElement;
+import org.eclipse.cdt.core.model.ICProject;
+import org.eclipse.cdt.core.model.IIncludeReference;
+import org.eclipse.cdt.core.model.ISourceReference;
+import org.eclipse.cdt.core.model.ITranslationUnit;
+import org.eclipse.cdt.core.model.IWorkingCopy;
+import org.eclipse.cdt.core.resources.FileStorage;
+import org.eclipse.cdt.ui.CUIPlugin;
+import org.eclipse.core.filebuffers.FileBuffers;
+import org.eclipse.core.filesystem.URIUtil;
+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.IStorage;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.content.IContentType;
+import org.eclipse.jface.action.Action;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.MessageBox;
+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.editors.text.EditorsUI;
+import org.eclipse.ui.part.FileEditorInput;
+
+public class EditorUtility {
+
+ /**
+ * The ID of the default text editor
+ */
+ public static final String DEFAULT_TEXT_EDITOR_ID = EditorsUI.DEFAULT_TEXT_EDITOR_ID;
+
+ 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 an editor for an element such as <code>ICElement</code>,
+ * <code>IFile</code>, or <code>IStorage</code>.
+ * 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 an editor for an element (ICElement, 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 != null) {
+ return openInEditor(input, getEditorID(input, inputElement), activate);
+ }
+
+ return null;
+ }
+
+ // Following is not needed and drags in internal reference to CEditor.
+
+// /**
+// * 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.getProject().isAccessible()){
+ closedProject(file.getProject());
+ return null;
+ }
+
+ if (file != null) {
+ try {
+ if (!isLinked(file)) {
+ File tempFile = file.getRawLocation().toFile();
+
+ if (tempFile != null){
+ String canonicalPath = null;
+ try {
+ canonicalPath = tempFile.getCanonicalPath();
+ } catch (IOException e1) {}
+
+ if (canonicalPath != null){
+ IPath path = new Path(canonicalPath);
+ file = CUIPlugin.getWorkspace().getRoot().getFileForLocation(path);
+ }
+ }
+ }
+
+ IEditorInput input = getEditorInput(file);
+ if (input != null) {
+ return openInEditor(input, getEditorID(input, file), activate);
+ }
+ } catch (CModelException e) {}
+ }
+ return null;
+ }
+
+ @SuppressWarnings("deprecation")
+ public static boolean isLinked(IFile file) {
+ if (file.isLinked())
+ return true;
+
+ IPath path = file.getLocation();
+ while (path.segmentCount() > 0) {
+ path = path.removeLastSegments(1);
+ IContainer[] containers = ResourcesPlugin.getWorkspace().getRoot().findContainersForLocation(path);
+
+ for(int i=0; i<containers.length; i++) {
+ if (containers[i] instanceof IFolder && ((IFolder)containers[i]).isLinked()) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Open error dialog about closed project.
+ * @param project
+ */
+ private static void closedProject(IProject project) {
+ MessageBox errorMsg = new MessageBox(CUIPlugin.getActiveWorkbenchShell(), SWT.ICON_ERROR | SWT.OK);
+ errorMsg.setText(CUIPlugin.getResourceString("EditorUtility.closedproject")); //$NON-NLS-1$
+ String desc= CUIPlugin.getResourceString("Editorutility.closedproject.description"); //$NON-NLS-1$
+ errorMsg.setMessage (MessageFormat.format(desc, new Object[]{project.getName()}));
+ errorMsg.open();
+
+ }
+
+ 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);
+ return editorPart;
+ }
+ }
+ return null;
+ }
+
+ private static IEditorInput getEditorInput(ICElement element) throws CModelException {
+ while (element != null) {
+ if (element instanceof ISourceReference) {
+ ITranslationUnit tu = ((ISourceReference)element).getTranslationUnit();
+ if (tu != null) {
+ element = tu;
+ }
+ }
+ if (element instanceof IWorkingCopy && ((IWorkingCopy) element).isWorkingCopy())
+ element= ((IWorkingCopy) element).getOriginalElement();
+
+ if (element instanceof ITranslationUnit) {
+ ITranslationUnit unit= (ITranslationUnit) element;
+ IResource resource= unit.getResource();
+ if (resource instanceof IFile) {
+ return new FileEditorInput((IFile) resource);
+ }
+ return new ExternalEditorInput(unit, new FileStorage(unit.getPath()));
+ }
+
+ if (element instanceof IBinary) {
+ return new ExternalEditorInput(getStorage((IBinary)element), (IPath)null);
+ }
+
+ 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 ExternalEditorInput((IStorage)input);
+ }
+ return null;
+ }
+
+ /**
+ * Utility method to open an editor for the given file system location
+ * using {@link #getEditorInputForLocation(IPath, ICElement)} to create
+ * the editor input.
+ *
+ * @param location a file system location
+ * @param element an element related to the target file, may be <code>null</code>
+ * @throws PartInitException
+ */
+ public static IEditorPart openInEditor(IPath location, ICElement element) throws PartInitException {
+ IEditorInput input= getEditorInputForLocation(location, element);
+ return EditorUtility.openInEditor(input, getEditorID(input, element), true);
+ }
+
+ /**
+ * Utility method to get an editor input for the given file system location.
+ * If the location denotes a workspace file, a <code>FileEditorInput</code>
+ * is returned, otherwise, the input is an <code>IStorageEditorInput</code>
+ * assuming the location points to an existing file in the file system.
+ * The <code>ICElement</code> is used to determine the associated project
+ * in case the location can not be resolved to a workspace <code>IFile</code>.
+ *
+ * @param location a valid file system location
+ * @param context an element related to the target file, may be <code>null</code>
+ * @return an editor input
+ */
+ public static IEditorInput getEditorInputForLocation(IPath location, ICElement context) {
+ IFile resource= getWorkspaceFileAtLocation(location, context);
+ if (resource != null) {
+ return new FileEditorInput(resource);
+ }
+
+ if (context == null) {
+ // try to synthesize a context for a location appearing on a project's
+ // include paths
+ try {
+ ICProject[] projects = CCorePlugin.getDefault().getCoreModel().getCModel().getCProjects();
+ outerFor: for (int i = 0; i < projects.length; i++) {
+ IIncludeReference[] includeReferences = projects[i].getIncludeReferences();
+ for (int j = 0; j < includeReferences.length; j++) {
+ if (includeReferences[j].isOnIncludeEntry(location)) {
+ context = projects[i];
+ break outerFor;
+ }
+ }
+ }
+ if (context == null && projects.length > 0) {
+ // last resort: just take any of them
+ context= projects[0];
+ }
+ } catch (CModelException e) {
+ }
+ }
+
+ if (context != null) {
+ // try to get a translation unit from the location and associated element
+ ICProject cproject= context.getCProject();
+ if (cproject != null) {
+ ITranslationUnit unit = CoreModel.getDefault().createTranslationUnitFrom(cproject, location);
+ if (unit != null) {
+ return new ExternalEditorInput(unit, new FileStorage(location));
+ }
+ // no translation unit - still try to get a sensible marker resource
+ // from the associated element
+ IResource markerResource= cproject.getProject();
+ return new ExternalEditorInput(new FileStorage(location), markerResource);
+ }
+ }
+ return new ExternalEditorInput(new FileStorage(location));
+ }
+
+
+ /**
+ * Utility method to resolve a file system location to a workspace resource.
+ * If a context element is given and there are multiple matches in the workspace,
+ * a resource with the same project of the context element are preferred.
+ *
+ * @param location a valid file system location
+ * @param context an element related to the target file, may be <code>null</code>
+ * @return an <code>IFile</code> or <code>null</code>
+ */
+ private static IFile getWorkspaceFileAtLocation(IPath location, ICElement context) {
+ IFile file= FileBuffers.getWorkspaceFileAtLocation(location);
+ if (file == null) {
+ // try to find a linked resource
+ IProject project= null;
+ if (context != null) {
+ ICProject cProject= context.getCProject();
+ if (cProject != null) {
+ project= cProject.getProject();
+ }
+ }
+ IFile bestMatch= null;
+ IWorkspaceRoot root= ResourcesPlugin.getWorkspace().getRoot();
+ IFile[] files= root.findFilesForLocationURI(URIUtil.toURI(location));
+ for (int i= 0; i < files.length; i++) {
+ file= files[i];
+ if (file.isAccessible()) {
+ if (project != null && file.getProject() == project) {
+ bestMatch= file;
+ break;
+ }
+ if (bestMatch == null) {
+ bestMatch= file;
+ if (project == null) {
+ break;
+ }
+ }
+ }
+ }
+ return bestMatch;
+ }
+ return file;
+ }
+
+ /**
+ * 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 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 cu.findSharedWorkingCopy();
+ }
+
+ /**
+ * Determine the editor id from the given file name using
+ * the workspace-wide content-type definitions.
+ *
+ * @param name the file name
+ * @return a valid editor id, never <code>null</code>
+ */
+ 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();
+ }
+ }
+ return DEFAULT_TEXT_EDITOR_ID;
+ }
+
+ /**
+ * Determine the editor id from the given editor input and optional input object.
+ * When a translation unit can be obtained, the project-specific content-type
+ * mechanism is used to determine the correct editor id.
+ * If that fails, the editor id is determined by file name and extension using
+ * the workspace-wide content-type definitions.
+ *
+ * @param input the editor input
+ * @param inputObject the input object (used to create the editor input) or <code>null</code>
+ * @return a valid editor id, never <code>null</code>
+ */
+ public static String getEditorID(IEditorInput input, Object inputObject) {
+
+ ITranslationUnit tunit = null;
+ if (inputObject instanceof ITranslationUnit) {
+ tunit= (ITranslationUnit)inputObject;
+ } else if (input instanceof IFileEditorInput) {
+ IFileEditorInput editorInput = (IFileEditorInput)input;
+ IFile file = editorInput.getFile();
+ ICElement celement = CoreModel.getDefault().create(file);
+ if (celement instanceof ITranslationUnit) {
+ tunit = (ITranslationUnit)celement;
+ }
+ } else if (input instanceof ITranslationUnitEditorInput) {
+ ITranslationUnitEditorInput editorInput = (ITranslationUnitEditorInput)input;
+ tunit = editorInput.getTranslationUnit();
+ }
+
+ if (tunit != null) {
+ // Choose an editor based on the content type
+ String contentTypeId= tunit.getContentTypeId();
+ if (contentTypeId != null) {
+ IContentType contentType= Platform.getContentTypeManager().getContentType(contentTypeId);
+ IEditorRegistry registry = PlatformUI.getWorkbench().getEditorRegistry();
+ IEditorDescriptor desc= registry.getDefaultEditor(input.getName(), contentType);
+ if (desc != null) {
+ return desc.getId();
+ }
+ }
+ // Choose an editor based on the language (obsolete?)
+ if (tunit.isCLanguage()) {
+ return CUIPlugin.EDITOR_ID;
+ } else if (tunit.isCXXLanguage()) {
+ return CUIPlugin.EDITOR_ID;
+ } else if (tunit.isASMLanguage()) {
+ return "org.eclipse.cdt.ui.editor.asm.AsmEditor"; //$NON-NLS-1$
+ }
+ }
+
+ // Choose an editor based on filename/extension
+ String editorId = getEditorID(input.getName());
+
+ return editorId;
+ }
+
+ /**
+ * Maps the localized modifier name to a code in the same
+ * manner as #findModifier.
+ *
+ * @return the SWT modifier bit, or <code>0</code> if no match was found
+ */
+ public static int findLocalizedModifier(String token) {
+ if (token == null)
+ return 0;
+
+ if (token.equalsIgnoreCase(Action.findModifierString(SWT.CTRL)))
+ return SWT.CTRL;
+ if (token.equalsIgnoreCase(Action.findModifierString(SWT.SHIFT)))
+ return SWT.SHIFT;
+ if (token.equalsIgnoreCase(Action.findModifierString(SWT.ALT)))
+ return SWT.ALT;
+ if (token.equalsIgnoreCase(Action.findModifierString(SWT.COMMAND)))
+ return SWT.COMMAND;
+
+ return 0;
+ }
+
+ /**
+ * Returns the modifier string for the given SWT modifier
+ * modifier bits.
+ *
+ * @param stateMask the SWT modifier bits
+ * @return the modifier string
+ * @since 2.1.1
+ */
+ public static String getModifierString(int stateMask) {
+ String modifierString= ""; //$NON-NLS-1$
+ if ((stateMask & SWT.CTRL) == SWT.CTRL)
+ modifierString= appendModifierString(modifierString, SWT.CTRL);
+ if ((stateMask & SWT.ALT) == SWT.ALT)
+ modifierString= appendModifierString(modifierString, SWT.ALT);
+ if ((stateMask & SWT.SHIFT) == SWT.SHIFT)
+ modifierString= appendModifierString(modifierString, SWT.SHIFT);
+ if ((stateMask & SWT.COMMAND) == SWT.COMMAND)
+ modifierString= appendModifierString(modifierString, SWT.COMMAND);
+
+ return modifierString;
+ }
+
+ /**
+ * Appends to modifier string of the given SWT modifier bit
+ * to the given modifierString.
+ *
+ * @param modifierString the modifier string
+ * @param modifier an int with SWT modifier bit
+ * @return the concatenated modifier string
+ * @since 2.1.1
+ */
+ private static String appendModifierString(String modifierString, int modifier) {
+ if (modifierString == null)
+ modifierString= ""; //$NON-NLS-1$
+ String newModifierString= Action.findModifierString(modifier);
+ if (modifierString.length() == 0)
+ return newModifierString;
+ return MakefileMessages.getFormattedString("EditorUtility.concatModifierStrings", new String[] {modifierString, newModifierString}); //$NON-NLS-1$
+ }
+
+ public static IStorage getStorage(IBinary bin) {
+ IStorage store = null;
+ try {
+ IBuffer buffer = bin.getBuffer();
+ if (buffer != null) {
+ store = new FileStorage (new ByteArrayInputStream(buffer.getContents().getBytes()), bin.getPath());
+ }
+ } catch (CModelException e) {
+ // nothing;
+ }
+ return store;
+ }
+
+ public static IStorage getStorage(ITranslationUnit tu) {
+ IStorage store = null;
+ try {
+ store = new FileStorage (new ByteArrayInputStream(tu.getBuffer().getContents().getBytes()), tu.getPath());
+ } catch (CModelException e) {
+ // nothing;
+ }
+ return store;
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ElementListSelectionDialog.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ElementListSelectionDialog.java
new file mode 100644
index 0000000000..82a7f71b0e
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ElementListSelectionDialog.java
@@ -0,0 +1,120 @@
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * QNX Software System
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+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<Object> 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<Object> 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<Object> elements, String initialSelection) {
+ setElements(elements);
+ setInitialSelection(initialSelection);
+ return open();
+ }
+ /**
+ * Sets the elements presented by this dialog.
+ */
+ public void setElements(List<Object> elements) {
+ fElements= elements;
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Else.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Else.java
new file mode 100644
index 0000000000..618ce90919
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Else.java
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006, 2007 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ * Red Hat Inc. - modified for Automake editor usage
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.eclipse.cdt.make.core.makefile.ICommand;
+
+public class Else extends Conditional implements IAutomakeConditional, ICommand {
+
+ private boolean isAutomake;
+ private Rule[] rules;
+
+ public Else(Directive parent) {
+ super(parent);
+ }
+
+ public boolean isAutomake() {
+ return isAutomake;
+ }
+
+ public Rule[] getRules() {
+ return rules;
+ }
+
+ public void setRules(Rule[] rules) {
+ this.rules = rules;
+ }
+
+ public void setAutomake(boolean value) {
+ isAutomake = value;
+ }
+
+ public boolean isElse() {
+ return true;
+ }
+
+ public String toString() {
+ return GNUMakefileConstants.CONDITIONAL_ELSE;
+ }
+
+ // ICommand methods so Automake else can be a child of an IRule
+ public Process execute(String shell, String[] envp, File dir)
+ throws IOException {
+ return null;
+ }
+
+ public boolean shouldBeSilent() {
+ return false;
+ }
+
+ public boolean shouldIgnoreError() {
+ return false;
+ }
+
+ public boolean shouldExecute() {
+ return false;
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/EmptyLine.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/EmptyLine.java
new file mode 100644
index 0000000000..fa7aaee24d
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/EmptyLine.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+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"; //$NON-NLS-1$
+
+ public EmptyLine(Directive parent) {
+ super(parent);
+ }
+
+ public String toString() {
+ return NL_STRING;
+ }
+
+ public boolean equals(IEmptyLine stmt) {
+ return true;
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Endef.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Endef.java
new file mode 100644
index 0000000000..9bcc68bb23
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Endef.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+public class Endef extends Terminal {
+
+
+ public Endef(Directive parent) {
+ super(parent);
+ }
+
+ public boolean isEndef() {
+ return true;
+ }
+
+ public String toString() {
+ return GNUMakefileConstants.TERMINAL_ENDEF;
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Endif.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Endif.java
new file mode 100644
index 0000000000..af77d40c5e
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Endif.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+
+public class Endif extends Terminal {
+
+ public Endif(Directive parent) {
+ super(parent);
+ }
+
+ public boolean isEndif() {
+ return true;
+ }
+
+ public String toString() {
+ return GNUMakefileConstants.TERMINAL_ENDIF;
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ExportAllVariablesRule.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ExportAllVariablesRule.java
new file mode 100644
index 0000000000..0aa0a31695
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ExportAllVariablesRule.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import org.eclipse.cdt.make.core.makefile.gnu.IExportAllVariablesRule;
+
+/**
+ * .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(GNUMakefileConstants.RULE_EXPORT_ALL_VARIABLES), reqs, new Command[0]);
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ExportVariable.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ExportVariable.java
new file mode 100644
index 0000000000..b98512dd16
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ExportVariable.java
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006, 2007 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ * Red Hat Inc. - Modified for Automake usage
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+public class ExportVariable extends GNUVariableDef {
+
+ public ExportVariable(Directive parent, String name, StringBuffer value, int type) {
+ super(parent, name, value, type);
+ }
+
+ public boolean isExport() {
+ return true;
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ExternalEditorInput.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ExternalEditorInput.java
new file mode 100644
index 0000000000..a7087de46c
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ExternalEditorInput.java
@@ -0,0 +1,169 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ * Anton Leherbauer (Wind River Systems)
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+
+import org.eclipse.cdt.core.model.ITranslationUnit;
+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.Platform;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.IEditorRegistry;
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.IPersistableElement;
+import org.eclipse.ui.IStorageEditorInput;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.editors.text.ILocationProvider;
+
+
+/**
+ * An EditorInput for an external (non-workspace) file.
+ */
+public class ExternalEditorInput implements ITranslationUnitEditorInput, IPersistableElement {
+
+ private IStorage externalFile;
+ private IResource markerResource;
+ private ITranslationUnit unit;
+ private IPath location;
+
+ /*
+ */
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (!(obj instanceof IStorageEditorInput))
+ return false;
+ IStorageEditorInput other = (IStorageEditorInput)obj;
+ try {
+ return externalFile.equals(other.getStorage());
+ } catch (CoreException exc) {
+ return false;
+ }
+ }
+
+ /*
+ * @see IEditorInput#exists()
+ */
+ public boolean exists() {
+ // External file can not be deleted
+ return true;
+ }
+
+ /*
+ * @see IAdaptable#getAdapter(Class)
+ */
+ @SuppressWarnings("unchecked")
+ public Object getAdapter(Class adapter) {
+ if (ILocationProvider.class.equals(adapter)) {
+ return this;
+ }
+ return Platform.getAdapterManager().getAdapter(this, adapter);
+ }
+
+ /*
+ * @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 this;
+ }
+
+ /*
+ * see IStorageEditorInput#getStorage()
+ */
+ public IStorage getStorage() {
+ return externalFile;
+ }
+
+ /*
+ * @see IEditorInput#getToolTipText()
+ */
+ public String getToolTipText() {
+ return externalFile.getFullPath().toString();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake.ITranslationUnitEditorInput#getTranslationUnit()
+ */
+ public ITranslationUnit getTranslationUnit() {
+ return unit;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.editors.text.ILocationProvider#getPath(java.lang.Object)
+ */
+ public IPath getPath(Object element) {
+ return location;
+ }
+
+ public ExternalEditorInput(ITranslationUnit unit, IStorage exFile) {
+ this(exFile, exFile.getFullPath());
+ this.unit = unit;
+ markerResource= unit.getCProject().getProject();
+ }
+
+ public ExternalEditorInput(IStorage exFile) {
+ this(exFile, exFile.getFullPath());
+ }
+
+ public ExternalEditorInput(IStorage exFile, IPath location) {
+ externalFile = exFile;
+ this.location = location;
+ }
+
+ /**
+ * This constructor accepts the storage for the editor
+ * and a reference to a resource which holds the markers for the external file.
+ */
+ public ExternalEditorInput(IStorage exFile, IResource markerResource) {
+ this(exFile, exFile.getFullPath());
+ this.markerResource = markerResource ;
+ }
+
+ /**
+ * Return the resource where markers for this external editor input are stored
+ */
+ public IResource getMarkerResource() {
+ return markerResource;
+ }
+
+ /*
+ * @see org.eclipse.ui.IPersistableElement#getFactoryId()
+ */
+ public String getFactoryId() {
+ return ExternalEditorInputFactory.ID;
+ }
+
+ /*
+ * @see org.eclipse.ui.IPersistable#saveState(org.eclipse.ui.IMemento)
+ */
+ public void saveState(IMemento memento) {
+ ExternalEditorInputFactory.saveState(memento, this);
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ExternalEditorInputFactory.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ExternalEditorInputFactory.java
new file mode 100644
index 0000000000..2e8ebf6d4d
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ExternalEditorInputFactory.java
@@ -0,0 +1,92 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Wind River Systems, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Anton Leherbauer (Wind River Systems) - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.ui.IElementFactory;
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.IPersistableElement;
+
+import org.eclipse.cdt.core.model.CoreModel;
+import org.eclipse.cdt.core.model.ICProject;
+import org.eclipse.cdt.core.model.ITranslationUnit;
+
+/**
+ * The ExternalEditorInputFactory is used to save and recreate an ExternalEditorInput object.
+ * As such, it implements the IPersistableElement interface for storage
+ * and the IElementFactory interface for recreation.
+ *
+ * @see IMemento
+ * @see IPersistableElement
+ * @see IElementFactory
+ *
+ * @since 4.0
+ */
+public class ExternalEditorInputFactory implements IElementFactory {
+
+ public static final String ID = "org.eclipse.cdt.ui.ExternalEditorInputFactory"; //$NON-NLS-1$
+
+ private static final String TAG_PATH = "path";//$NON-NLS-1$
+ private static final String TAG_PROJECT = "project";//$NON-NLS-1$
+
+ /*
+ * @see org.eclipse.ui.IElementFactory#createElement(org.eclipse.ui.IMemento)
+ */
+ public IAdaptable createElement(IMemento memento) {
+ // Get the file name.
+ String fileName = memento.getString(TAG_PATH);
+ if (fileName == null) {
+ return null;
+ }
+
+ IPath location= new Path(fileName);
+ ICProject cProject= null;
+
+ String projectName= memento.getString(TAG_PROJECT);
+ if (projectName != null) {
+ IProject project= ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
+ if (project.isAccessible() && CoreModel.hasCNature(project)) {
+ cProject= CoreModel.getDefault().create(project);
+ }
+ }
+ return EditorUtility.getEditorInputForLocation(location, cProject);
+ }
+
+ /**
+ * Save the element state.
+ *
+ * @param memento the storage
+ * @param input the element
+ */
+ static void saveState(IMemento memento, ExternalEditorInput input) {
+ IPath location= input.getPath(input);
+ if (location != null) {
+ memento.putString(TAG_PATH, location.toOSString());
+ }
+ IProject project= null;
+ ITranslationUnit unit= input.getTranslationUnit();
+ if (unit != null) {
+ project= unit.getCProject().getProject();
+ }
+ if (project == null && input.getMarkerResource() instanceof IProject) {
+ project= (IProject)input.getMarkerResource();
+ }
+ if (project != null) {
+ memento.putString(TAG_PROJECT, project.getName());
+ }
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/GNUAutomakefile.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/GNUAutomakefile.java
new file mode 100644
index 0000000000..f71edd6244
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/GNUAutomakefile.java
@@ -0,0 +1,948 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006, 2007 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ * Red Hat Inc. - Modified for Automake editor usage
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+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.net.URI;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Arrays;
+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.IMakefile;
+import org.eclipse.cdt.make.core.makefile.gnu.IGNUMakefile;
+import org.eclipse.core.filesystem.URIUtil;
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Path;
+
+
+/**
+ * Makefile : ( statement ) *
+ * statement : rule | macro_definition | comments | empty
+ * rule : inference_rule | target_rule
+ * inference_rule : target ':' <nl> ( <tab> command <nl> ) +
+ * target_rule : target [ ( target ) * ] ':' [ ( prerequisite ) * ] [ ';' command ] <nl>
+ [ ( command ) * ]
+ * macro_definition : string '=' (string)*
+ * comments : ('#' (string) <nl>) *
+ * empty : <nl>
+ * command : <tab> prefix_command string <nl>
+ * target : string
+ * prefix_command : '-' | '@' | '+'
+ * internal_macro : "$<" | "$*" | "$@" | "$?" | "$%"
+ */
+
+public class GNUAutomakefile extends AbstractMakefile implements IGNUMakefile {
+
+ public static String PATH_SEPARATOR = System.getProperty("path.separator", ":"); //$NON-NLS-1$ //$NON-NLS-2$
+ public static String FILE_SEPARATOR = System.getProperty("file.separator", "/"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ String[] includeDirectories = new String[0];
+ IDirective[] builtins = null;
+
+ public GNUAutomakefile() {
+ super(null);
+ }
+
+ public void parse(String name) throws IOException {
+ FileReader stream = new FileReader(name);
+ parse(name, stream);
+ if (stream != null) {
+ try {
+ stream.close();
+ } catch (IOException e) {
+ }
+ }
+ }
+
+ public void parse(String filePath, Reader reader) throws IOException {
+ parse(URIUtil.toURI(filePath), new MakefileReader(reader));
+ }
+
+ public void parse(URI fileURI, Reader reader) throws IOException {
+ parse(fileURI, new MakefileReader(reader));
+ }
+
+
+ protected void parse(URI fileURI, MakefileReader reader) throws IOException {
+ String line;
+ Rule[] rules = null;
+ Stack<IDirective> conditions = new Stack<IDirective>();
+ Stack<GNUVariableDef> defines = new Stack<GNUVariableDef>();
+ int startLine = 0;
+ int endLine = 0;
+
+ // Clear any old directives.
+ clearDirectives();
+
+ setFileURI(fileURI);
+
+ 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()) {
+ GNUVariableDef def = (GNUVariableDef) defines.pop();
+ def.setEndLine(endLine);
+ }
+ Endef endef = new Endef((Directive)this);
+ endef.setLines(startLine, endLine);
+ addDirective(conditions, endef);
+ continue;
+ } else if (GNUMakefileUtil.isDefine(line)) {
+ GNUVariableDef def = parseGNUVariableDef(line);
+ def.setLines(startLine, endLine);
+ addDirective(conditions, def);
+ defines.push(def);
+ continue;
+ } else if (GNUMakefileUtil.isOverrideDefine(line)) {
+ GNUVariableDef oDef = parseGNUVariableDef(line);
+ oDef.setLines(startLine, endLine);
+ addDirective(conditions, oDef);
+ defines.push(oDef);
+ continue;
+ }
+
+ // We still in a define.
+ if (!defines.empty()) {
+ GNUVariableDef def = (GNUVariableDef) 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 (PosixMakefileUtil.isCommand(line) ||
+ AutomakefileUtil.isAutomakeCommand(line)) {
+ Command cmd = new Command(this, line);
+ cmd.setLines(startLine, endLine);
+ 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 (!conditions.isEmpty()) {
+ addDirective(conditions, cmd);
+ 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;
+ }
+
+ // 3b - look for if statement which is an Automake directive.
+ // These will be processed at configure time and all statements
+ // in-between are modified with a prefix. We will treat these as
+ // standard conditionals even though they can affect the behavior
+ // of lines that follow the construct. For
+ // example, an automake-if could start in the middle of a rule
+ // and the else might be outside a target.
+ if (GNUMakefileUtil.isIf(line)) {
+ // We cache the rules that were in effect at entry to the
+ // if/else block. We treat the endif as restoring the
+ // state of the rules at this point. It is possible for
+ // commands to follow the if/else that belong to different
+ // rules that start inside the if/else, but we are not
+ // prepared to handle that in an outline view and it is
+ // pretty bad Automake coding.
+ If ifDirective = parseIf(line, rules);
+ ifDirective.setLines(startLine, endLine);
+ if (rules != null) {
+ // The if statement is added to the rules.
+ for (int i = 0; i < rules.length; i++) {
+ rules[i].addDirective(ifDirective);
+ rules[i].setEndLine(endLine);
+ }
+ } else {
+ addDirective(conditions, ifDirective);
+ }
+ conditions.push(ifDirective);
+ rules = null;
+ continue;
+ }
+
+ // 3c - Check for else or endif
+
+ if (GNUMakefileUtil.isElse(line)) {
+ Else elseDirective = (Else)parseConditional(line);
+ elseDirective.setLines(startLine, endLine);
+ Conditional cond = null;
+ // FIXME: Are we missing a if condition ?
+ if (!conditions.empty()) {
+ cond = (Conditional) conditions.pop();
+ cond.setEndLine(endLine - 1);
+ }
+ if (cond != null && cond.isIf()) {
+ // See 3b above for description on automake if/else handling.
+ elseDirective.setAutomake(true);
+ rules = ((If)cond).getRules();
+ // We cache the rules at the time of entry into the if/else block.
+ elseDirective.setRules(rules);
+ if (rules != null) {
+ // The else is added to the rules.
+ for (int i = 0; i < rules.length; i++) {
+ rules[i].addDirective(elseDirective);
+ rules[i].setEndLine(endLine);
+ }
+ } else {
+ addDirective(conditions, elseDirective);
+ }
+ rules = null;
+ } else {
+ addDirective(conditions, elseDirective);
+ }
+ conditions.push(elseDirective);
+ continue;
+ } else if (GNUMakefileUtil.isEndif(line)) {
+ Endif endif = new Endif(this);
+ endif.setLines(startLine, endLine);
+ Conditional cond = null;
+ // FIXME: Are we missing a if/else condition ?
+ if (!conditions.empty()) {
+ cond = (Conditional) conditions.pop();
+ cond.setEndLine(endLine);
+ }
+ if (cond != null && cond instanceof IAutomakeConditional) {
+ rules = ((IAutomakeConditional)cond).getRules();
+ }
+ if (rules != null) {
+ // The endif is added to the rules.
+ for (int i = 0; i < rules.length; i++) {
+ rules[i].addDirective(endif);
+ rules[i].setEndLine(endLine);
+ }
+ } else {
+ addDirective(conditions, endif);
+ }
+ continue;
+ }
+
+ // 4 - reset rules to null
+ // The first non empty line that does not begin with a <TAB> or '#'
+ // shall begin a new entry.
+ rules = null;
+
+ // 5- Check for the conditionals.
+ 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 (PosixMakefileUtil.isInferenceRule(line)) {
+ InferenceRule irule = parseInferenceRule(line);
+ irule.setLines(startLine, endLine);
+ addDirective(conditions, irule);
+ rules = new Rule[] { irule };
+ continue;
+ }
+
+ // - Variable Definiton ?
+ if (GNUMakefileUtil.isVariableDefinition(line)) {
+ GNUVariableDef vd = parseGNUVariableDef(line);
+ vd.setLines(startLine, endLine);
+ addDirective(conditions, vd);
+ if (!vd.isTargetSpecific()) {
+ 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)) {
+ GNUTargetRule[] trules = parseGNUTargetRules(line);
+ for (int i = 0; i < trules.length; i++) {
+ trules[i].setLines(startLine, endLine);
+ addDirective(conditions, trules[i]);
+ }
+ rules = trules;
+ continue;
+ }
+
+ // - Configure macro (@xxxx@)
+ if (AutomakefileUtil.isConfigMacro(line)) {
+ AutomakeConfigMacro macro = parseConfigMacro(line);
+ if (macro != null) {
+ macro.setLines(startLine, endLine);
+ addDirective(macro);
+ 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<IDirective> 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 (PosixMakefileUtil.isIgnoreRule(line)) {
+ stmt = parseSpecialRule(line);
+ } else if (PosixMakefileUtil.isPosixRule(line)) {
+ stmt = parseSpecialRule(line);
+ } else if (PosixMakefileUtil.isPreciousRule(line)) {
+ stmt = parseSpecialRule(line);
+ } else if (PosixMakefileUtil.isSilentRule(line)) {
+ stmt = parseSpecialRule(line);
+ } else if (PosixMakefileUtil.isSuffixesRule(line)) {
+ stmt = parseSpecialRule(line);
+ } else if (PosixMakefileUtil.isDefaultRule(line)) {
+ stmt = parseSpecialRule(line);
+ } else if (PosixMakefileUtil.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 = PosixMakefileUtil.findPrerequisites(req);
+ } else {
+ keyword = line;
+ reqs = new String[0];
+ }
+ if (keyword.equals(MakeFileConstants.RULE_IGNORE)) {
+ special = new IgnoreRule(this, reqs);
+ } else if (keyword.equals(MakeFileConstants.RULE_POSIX)) {
+ special = new PosixRule(this);
+ } else if (keyword.equals(MakeFileConstants.RULE_PRECIOUS)) {
+ special = new PreciousRule(this, reqs);
+ } else if (keyword.equals(MakeFileConstants.RULE_SILENT)) {
+ special = new SilentRule(this, reqs);
+ } else if (keyword.equals(MakeFileConstants.RULE_SUFFIXES)) {
+ special = new SuffixesRule(this, reqs);
+ } else if (keyword.equals(MakeFileConstants.RULE_DEFAULT)) {
+ special = new DefaultRule(this, new Command[0]);
+ } else if (keyword.equals(MakeFileConstants.RULE_SCCS_GET)) {
+ special = new SccsGetRule(this, new Command[0]);
+ } else if (keyword.equals(GNUMakefileConstants.RULE_PHONY)) {
+ special = new PhonyRule(this, reqs);
+ } else if (keyword.equals(GNUMakefileConstants.RULE_INTERMEDIATE)) {
+ special = new IntermediateRule(this, reqs);
+ } else if (keyword.equals(GNUMakefileConstants.RULE_SECONDARY)) {
+ special = new SecondaryRule(this, reqs);
+ } else if (keyword.equals(GNUMakefileConstants.RULE_DELETE_ON_ERROR)) {
+ special = new DeleteOnErrorRule(this, reqs);
+ } else if (keyword.equals(GNUMakefileConstants.RULE_LOW_RESOLUTION_TIME)) {
+ special = new LowResolutionTimeRule(this, reqs);
+ } else if (keyword.equals(GNUMakefileConstants.RULE_EXPORT_ALL_VARIABLES)) {
+ special = new ExportAllVariablesRule(this, reqs);
+ } else if (keyword.equals(GNUMakefileConstants.RULE_NOT_PARALLEL)) {
+ special = new NotParallelRule(this, reqs);
+ }
+ return special;
+ }
+
+ /**
+ * if CONDITIONAL
+ *
+ * @param line
+ * @return
+ */
+ protected If parseIf(String line, Rule[] rules) {
+ 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(GNUMakefileConstants.CONDITIONAL_IF) ||
+ keyword.equals(GNUMakefileConstants.AT_CONDITIONAL_IF)) {
+ return new If(this, rules, line);
+ }
+ return null;
+ }
+
+ /**
+ *
+ * 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(GNUMakefileConstants.CONDITIONAL_IFDEF)) {
+ condition = new Ifdef(this, line);
+ } else if (keyword.equals(GNUMakefileConstants.CONDITIONAL_IFNDEF)) {
+ condition = new Ifndef(this, line);
+ } else if (keyword.equals(GNUMakefileConstants.CONDITIONAL_IFEQ)) {
+ condition = new Ifeq(this, line);
+ } else if (keyword.equals(GNUMakefileConstants.CONDITIONAL_IFNEQ)) {
+ condition = new Ifneq(this, line);
+ } else if (keyword.equals(GNUMakefileConstants.CONDITIONAL_ELSE)) {
+ condition = new Else(this);
+ }
+ return condition;
+ }
+
+ /**
+ * An Autoconf directive of the form @xxx@
+ */
+ protected AutomakeConfigMacro parseConfigMacro(String line) {
+ String extraChars = "_-";
+ char[] ch = line.toCharArray();
+ int i = 1;
+ while (Character.isLetterOrDigit(ch[i]) ||
+ extraChars.indexOf(ch[i]) >= 0) {
+ ++i;
+ }
+ if (i > 1 && ch[i] == '@')
+ return new AutomakeConfigMacro(this, line.substring(0, i+1));
+ return null;
+ }
+ /**
+ * 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<String> dirs = new ArrayList<String>(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" + GNUAutomakefile.PATH_SEPARATOR; //$NON-NLS-1$
+ 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 = PosixMakefileUtil.findTargets(target.trim());
+
+ // Some TargetRule have "::" for separator
+ String req = line.substring(index + 1);
+ doubleColon = req.startsWith(":"); //$NON-NLS-1$
+ 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 = ""; //$NON-NLS-1$
+ }
+
+ normalReqs = PosixMakefileUtil.findPrerequisites(normalReq.trim());
+ orderReqs = PosixMakefileUtil.findPrerequisites(orderReq.trim());
+ } else {
+ targetNames = PosixMakefileUtil.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 GNUVariableDef parseGNUVariableDef(String line) {
+ line = line.trim();
+ GNUVariableDef vd;
+
+ // the default type.
+ int type = GNUVariableDef.TYPE_RECURSIVE_EXPAND;
+ boolean isDefine = false;
+ boolean isOverride = false;
+ boolean isTargetVariable = false;
+ boolean isExport = false;
+ String targetName = ""; //$NON-NLS-1$
+
+ String name;
+ StringBuffer value = new StringBuffer();
+
+ // Check for Target: Variable-assignment
+ isTargetVariable = GNUMakefileUtil.isTargetVariable(line);
+ if (isTargetVariable) {
+ // 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 = ""; //$NON-NLS-1$
+ }
+ }
+
+ // 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 == GNUVariableDef.TYPE_SIMPLE_EXPAND
+ || type == GNUVariableDef.TYPE_APPEND
+ || type == GNUVariableDef.TYPE_CONDITIONAL) {
+ separator = index - 1;
+ } else {
+ type = GNUVariableDef.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);
+ } else 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 GNUVariableDef(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 = PosixMakefileUtil.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 = ""; //$NON-NLS-1$
+ prereqPatterns = new String[0];
+ }
+ } else {
+ targets = new String[0];
+ targetPattern = ""; //$NON-NLS-1$
+ 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));
+ }
+
+ public IDirective[] getDirectives(boolean expand) {
+ if (!expand) {
+ return getDirectives();
+ }
+ IDirective[] dirs = getDirectives();
+ ArrayList<IDirective> list = new ArrayList<IDirective>(Arrays.asList(dirs));
+ for (int i = 0; i < dirs.length; ++i) {
+ if (dirs[i] instanceof Include) {
+ Include include = (Include)dirs[i];
+ IDirective[] includedMakefiles = include.getDirectives();
+ for (int j = 0; j < includedMakefiles.length; ++j) {
+ IMakefile includedMakefile = (IMakefile)includedMakefiles[j];
+ list.addAll(Arrays.asList(includedMakefile.getDirectives()));
+ }
+ }
+ }
+ return (IDirective[]) list.toArray(new IDirective[list.size()]);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake.AbstractMakefile#getBuiltins()
+ */
+ public IDirective[] getBuiltins() {
+ if (builtins == null) {
+ String location = "builtin" + File.separator + "gnu.mk"; //$NON-NLS-1$ //$NON-NLS-2$
+ try {
+ InputStream stream = FileLocator.openStream(MakeCorePlugin.getDefault().getBundle(), new Path(location), false);
+ GNUAutomakefile gnu = new GNUAutomakefile();
+ URL url = FileLocator.find(MakeCorePlugin.getDefault().getBundle(), new Path(location), null);
+ url = FileLocator.resolve(url);
+ location = url.getFile();
+ gnu.parse(location, 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"; //$NON-NLS-1$
+ if (args.length == 1) {
+ filename = args[0];
+ }
+ GNUAutomakefile makefile = new GNUAutomakefile();
+ 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/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/GNUMakefileConstants.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/GNUMakefileConstants.java
new file mode 100644
index 0000000000..a9ccdfb231
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/GNUMakefileConstants.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006, 2007 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ * Red Hat Inc. - modified for Automake editor usage
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+
+public class GNUMakefileConstants extends MakeFileConstants {
+ static final String CONDITIONAL_ELSE = "else"; //$NON-NLS-1$
+ static final String CONDITIONAL_IF = "if"; //$NON-NLS-1$
+ static final String AT_CONDITIONAL_IF = "@if"; //$NON-NLS-1$
+ static final String CONDITIONAL_IFNEQ = "ifneq"; //$NON-NLS-1$
+ static final String CONDITIONAL_IFNDEF = "ifndef"; //$NON-NLS-1$
+ static final String CONDITIONAL_IFEQ = "ifeq"; //$NON-NLS-1$
+ static final String CONDITIONAL_IFDEF = "ifdef"; //$NON-NLS-1$
+
+ static final String TERMINAL_ENDEF = "endef"; //$NON-NLS-1$
+ static final String TERMINAL_ENDIF = "endif"; //$NON-NLS-1$
+ static final String AT_TERMINAL_ENDIF = "@endif"; //$NON-NLS-1$
+
+ static final String DIRECTIVE_VPATH = "vpath"; //$NON-NLS-1$
+ static final String DIRECTIVE_UNEXPORT = "unexport"; //$NON-NLS-1$
+
+ static final String VARIABLE_DEFINE = "define"; //$NON-NLS-1$
+ static final String VARIABLE_EXPORT = "export"; //$NON-NLS-1$
+ static final String VARIABLE_OVERRIDE = "override"; //$NON-NLS-1$
+
+ static final String DIRECTIVE_INCLUDE = "include"; //$NON-NLS-1$
+
+ static final String RULE_DELETE_ON_ERROR = ".DELETE_ON_ERROR"; //$NON-NLS-1$
+ static final String RULE_PHONY = ".PHONY"; //$NON-NLS-1$
+ static final String RULE_SECONDARY = ".SECONDARY"; //$NON-NLS-1$
+ static final String RULE_LOW_RESOLUTION_TIME = ".LOW_RESOLUTION_TIME"; //$NON-NLS-1$
+ static final String RULE_NOT_PARALLEL = ".NOTPARALLEL"; //$NON-NLS-1$
+ static final String RULE_EXPORT_ALL_VARIABLES = ".EXPORT_ALL_VARIABLES"; //$NON-NLS-1$
+ static final String RULE_INTERMEDIATE = ".INTERMEDIATE"; //$NON-NLS-1$
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/GNUMakefileUtil.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/GNUMakefileUtil.java
new file mode 100644
index 0000000000..80a3c452a7
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/GNUMakefileUtil.java
@@ -0,0 +1,233 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006, 2007 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ * Red Hat Inc. - modified for Automake editor usage
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+
+/**
+ * GNUMakefile
+ */
+public class GNUMakefileUtil extends PosixMakefileUtil {
+
+ public static boolean isInclude(String line) {
+ line = line.trim();
+ boolean isInclude = line.startsWith(GNUMakefileConstants.DIRECTIVE_INCLUDE) && line.length() > 7 && Character.isWhitespace(line.charAt(7));
+ boolean isDashInclude = line.startsWith("-" + GNUMakefileConstants.DIRECTIVE_INCLUDE) && line.length() > 8 && Character.isWhitespace(line.charAt(8)); //$NON-NLS-1$
+ boolean isSInclude = line.startsWith("s" + GNUMakefileConstants.DIRECTIVE_INCLUDE) && line.length() > 8 && Character.isWhitespace(line.charAt(8)); //$NON-NLS-1$
+ return isInclude || isDashInclude || isSInclude;
+ }
+
+ public static boolean isVPath(String line) {
+ line = line.trim();
+ return line.equals(GNUMakefileConstants.DIRECTIVE_VPATH) || line.startsWith(GNUMakefileConstants.DIRECTIVE_VPATH) && line.length() > 5 && Character.isWhitespace(line.charAt(5));
+ }
+
+ public static boolean isExport(String line) {
+ line = line.trim();
+ return line.equals(GNUMakefileConstants.VARIABLE_EXPORT) || line.startsWith(GNUMakefileConstants.VARIABLE_EXPORT) && line.length() > 6 && Character.isWhitespace(line.charAt(6));
+ }
+
+ public static boolean isUnExport(String line) {
+ line = line.trim();
+ return line.startsWith(GNUMakefileConstants.DIRECTIVE_UNEXPORT) && line.length() > 8 && Character.isWhitespace(line.charAt(8));
+ }
+
+ public static boolean isDefine(String line) {
+ line = line.trim();
+ return line.startsWith(GNUMakefileConstants.VARIABLE_DEFINE) && line.length() > 6 && Character.isWhitespace(line.charAt(6));
+ }
+
+ public static boolean isEndef(String line) {
+ return line.trim().equals(GNUMakefileConstants.TERMINAL_ENDEF);
+ }
+
+ public static boolean isOverride(String line) {
+ line = line.trim();
+ return line.startsWith(GNUMakefileConstants.VARIABLE_OVERRIDE) && line.length() > 8 && Character.isWhitespace(line.charAt(8));
+ }
+
+ public static boolean isIf(String line) {
+ line = line.trim();
+ return (line.startsWith(GNUMakefileConstants.CONDITIONAL_IF) && line.length() > 2 && Character.isWhitespace(line.charAt(2))) ||
+ (line.startsWith(GNUMakefileConstants.AT_CONDITIONAL_IF) && line.length() > 3 && Character.isWhitespace(line.charAt(3)));
+ }
+
+ public static boolean isIfeq(String line) {
+ line = line.trim();
+ return line.startsWith(GNUMakefileConstants.CONDITIONAL_IFEQ) && line.length() > 4 && Character.isWhitespace(line.charAt(4));
+ }
+
+ public static boolean isIfneq(String line) {
+ line = line.trim();
+ return line.startsWith(GNUMakefileConstants.CONDITIONAL_IFNEQ) && line.length() > 5 && Character.isWhitespace(line.charAt(5));
+ }
+
+ public static boolean isIfdef(String line) {
+ line = line.trim();
+ return line.startsWith(GNUMakefileConstants.CONDITIONAL_IFDEF) && line.length() > 5 && Character.isWhitespace(line.charAt(5));
+ }
+
+ public static boolean isIfndef(String line) {
+ line = line.trim();
+ return line.startsWith(GNUMakefileConstants.CONDITIONAL_IFNDEF) && line.length() > 6 && Character.isWhitespace(line.charAt(6));
+ }
+
+ public static boolean isElse(String line) {
+ return line.trim().equals(GNUMakefileConstants.CONDITIONAL_ELSE);
+ }
+
+ public static boolean isEndif(String line) {
+ return line.trim().equals(GNUMakefileConstants.TERMINAL_ENDIF) ||
+ line.trim().startsWith(GNUMakefileConstants.AT_TERMINAL_ENDIF);
+ }
+
+ public static boolean isOverrideDefine(String line) {
+ line = line.trim();
+ if (line.startsWith(GNUMakefileConstants.VARIABLE_OVERRIDE)) {
+ int i = 8;
+ while(i < line.length() && Character.isWhitespace(line.charAt(i))) {
+ i++;
+ }
+ if (line.startsWith(GNUMakefileConstants.VARIABLE_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(GNUMakefileConstants.RULE_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(GNUMakefileConstants.RULE_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(GNUMakefileConstants.RULE_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(GNUMakefileConstants.RULE_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(GNUMakefileConstants.RULE_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(GNUMakefileConstants.RULE_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(GNUMakefileConstants.RULE_NOT_PARALLEL);
+ }
+ return false;
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/GNUTargetRule.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/GNUTargetRule.java
new file mode 100644
index 0000000000..a770e0c9b7
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/GNUTargetRule.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import org.eclipse.cdt.make.core.makefile.ICommand;
+
+/**
+ */
+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(" |"); //$NON-NLS-1$
+ 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/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/GNUVariableDef.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/GNUVariableDef.java
new file mode 100644
index 0000000000..9c0509e7b3
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/GNUVariableDef.java
@@ -0,0 +1,132 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006, 2007 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ * Red Hat Inc. - Refactor name
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import org.eclipse.cdt.make.core.makefile.gnu.IVariableDefinition;
+
+/**
+ */
+public class GNUVariableDef extends MacroDefinition implements IVariableDefinition {
+
+ /**
+ * ? is Conditional
+ * : is Simply-expanded
+ * + is append
+ * 0 is recursively-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 GNUVariableDef(Directive parent, String name, StringBuffer value) {
+ this(parent, name, value, TYPE_RECURSIVE_EXPAND);
+ }
+
+ public GNUVariableDef(Directive parent, String name, StringBuffer value, int type) {
+ this(parent, "", name, value, type); //$NON-NLS-1$
+ }
+
+ public GNUVariableDef(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(": "); //$NON-NLS-1$
+ }
+ if (isOverride()) {
+ sb.append(GNUMakefileConstants.VARIABLE_OVERRIDE);
+ }
+ if (isMultiLine()) {
+ sb.append(GNUMakefileConstants.VARIABLE_DEFINE);
+ sb.append(' ');
+ sb.append(getName()).append('\n');
+ sb.append(getValue()).append('\n');
+ sb.append(GNUMakefileConstants.TERMINAL_ENDEF);
+ sb.append('\n');
+ } else {
+ if (isExport()) {
+ sb.append(GNUMakefileConstants.VARIABLE_EXPORT);
+ sb.append(' ');
+ }
+ sb.append(getName());
+ if (isRecursivelyExpanded()) {
+ sb.append(" = "); //$NON-NLS-1$
+ } else if (isSimplyExpanded()) {
+ sb.append(" := "); //$NON-NLS-1$
+ } else if (isConditional()) {
+ sb.append(" ?= "); //$NON-NLS-1$
+ } else if (isAppend()) {
+ sb.append(" += "); //$NON-NLS-1$
+ }
+ 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/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/IAutomakeConditional.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/IAutomakeConditional.java
new file mode 100644
index 0000000000..623d72b570
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/IAutomakeConditional.java
@@ -0,0 +1,19 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+public interface IAutomakeConditional {
+
+ public boolean isAutomake();
+ public void setAutomake(boolean value);
+ public Rule[] getRules();
+ public void setRules(Rule[] rules);
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/IMakefileDocumentProvider.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/IMakefileDocumentProvider.java
new file mode 100644
index 0000000000..22f1218628
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/IMakefileDocumentProvider.java
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+/*
+ */
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+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/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/IMakefileEditorActionDefinitionIds.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/IMakefileEditorActionDefinitionIds.java
new file mode 100644
index 0000000000..dc0642cce4
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/IMakefileEditorActionDefinitionIds.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds;
+
+/**
+ */
+public interface IMakefileEditorActionDefinitionIds extends ITextEditorActionDefinitionIds {
+
+ final String UNCOMMENT = "org.eclipse.cdt.make.ui.edit.text.makefile.uncomment"; //$NON-NLS-1$
+
+ final String COMMENT = "org.eclipse.cdt.make.ui.edit.text.makefile.comment"; //$NON-NLS-1$
+
+ final String OPEN_DECLARATION = "org.eclipse.cdt.make.ui.edit.text.makefile.opendcl"; //$NON-NLS-1$
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/IReconcilingParticipant.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/IReconcilingParticipant.java
new file mode 100644
index 0000000000..783dff819d
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/IReconcilingParticipant.java
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+/**
+ * IReconcilingParticipant
+ * Interface of an object participating in reconciling.
+ */
+public interface IReconcilingParticipant {
+
+ /**
+ * Called after reconciling has been finished.
+ */
+ void reconciled();
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ISelectionValidator.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ISelectionValidator.java
new file mode 100644
index 0000000000..38984ea6cf
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ISelectionValidator.java
@@ -0,0 +1,16 @@
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * QNX Software System
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+public interface ISelectionValidator {
+ void isValid(Object[] selection, StatusInfo res);
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ITranslationUnitEditorInput.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ITranslationUnitEditorInput.java
new file mode 100644
index 0000000000..33db78b5d0
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ITranslationUnitEditorInput.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import org.eclipse.cdt.core.model.ITranslationUnit;
+import org.eclipse.ui.IStorageEditorInput;
+import org.eclipse.ui.editors.text.ILocationProvider;
+
+/**
+ * ITranslationUnitEditorInput
+ */
+public interface ITranslationUnitEditorInput extends IStorageEditorInput, ILocationProvider {
+
+ ITranslationUnit getTranslationUnit();
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/If.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/If.java
new file mode 100644
index 0000000000..83dd8d6657
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/If.java
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006, 2007 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ * Red Hat Inc. - modified to be If class
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.eclipse.cdt.make.core.makefile.ICommand;
+
+
+public class If extends Conditional implements IAutomakeConditional, ICommand {
+ private static final String EMPTY = ""; //$NON-NLS-1$
+ private Rule rules[] = null;
+
+ public If(Directive parent, Rule[] rules, String var) {
+ super(parent, var, EMPTY, EMPTY);
+ if (rules != null) {
+ this.rules = new Rule[rules.length];
+ System.arraycopy(rules, 0, this.rules, 0, rules.length);
+ }
+ }
+
+ public Rule[] getRules() {
+ return rules;
+ }
+
+ public void setRules(Rule[] rules) {
+ this.rules = rules;
+ }
+
+ public boolean isIf() {
+ return true;
+ }
+
+ public boolean isAutomake() {
+ return true;
+ }
+
+ public void setAutomake(boolean value) {
+ // ignore value
+ }
+
+ public String toString() {
+ StringBuffer sb = new StringBuffer(GNUMakefileConstants.CONDITIONAL_IF);
+ sb.append(' ').append(getVariable());
+ return sb.toString();
+ }
+
+ public String getVariable() {
+ return getConditional();
+ }
+
+ // ICommand methods so Automake if can be a child of an IRule
+ public Process execute(String shell, String[] envp, File dir)
+ throws IOException {
+ return null;
+ }
+
+ public boolean shouldBeSilent() {
+ return false;
+ }
+
+ public boolean shouldIgnoreError() {
+ return false;
+ }
+
+ public boolean shouldExecute() {
+ return false;
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Ifdef.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Ifdef.java
new file mode 100644
index 0000000000..f1e9dfb987
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Ifdef.java
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+
+public class Ifdef extends Conditional {
+ private static final String EMPTY = ""; //$NON-NLS-1$
+
+ public Ifdef(Directive parent, String var) {
+ super(parent, var, EMPTY, EMPTY);
+ }
+
+ public boolean isIfdef() {
+ return true;
+ }
+
+ public String toString() {
+ StringBuffer sb = new StringBuffer(GNUMakefileConstants.CONDITIONAL_IFDEF);
+ sb.append(' ').append(getVariable());
+ return sb.toString();
+ }
+
+ public String getVariable() {
+ return getConditional();
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Ifeq.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Ifeq.java
new file mode 100644
index 0000000000..ea02665997
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Ifeq.java
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+
+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(GNUMakefileConstants.CONDITIONAL_IFEQ);
+ sb.append(' ').append(getConditional());
+ return sb.toString();
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Ifndef.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Ifndef.java
new file mode 100644
index 0000000000..336765b4a9
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Ifndef.java
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+
+public class Ifndef extends Conditional {
+
+ private static final String EMPTY = ""; //$NON-NLS-1$
+ public Ifndef(Directive parent, String var) {
+ super(parent, var, EMPTY, EMPTY);
+ }
+
+ public boolean isIfndef() {
+ return true;
+ }
+
+ public String toString() {
+ StringBuffer sb = new StringBuffer(GNUMakefileConstants.CONDITIONAL_IFNDEF);
+ sb.append(' ').append(getVariable());
+ return sb.toString();
+ }
+
+ public String getVariable() {
+ return getConditional();
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Ifneq.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Ifneq.java
new file mode 100644
index 0000000000..fa02a125ad
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Ifneq.java
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+
+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(GNUMakefileConstants.CONDITIONAL_IFNEQ);
+ sb.append(' ').append(getConditional());
+ return sb.toString();
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/IgnoreRule.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/IgnoreRule.java
new file mode 100644
index 0000000000..a962aea064
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/IgnoreRule.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import org.eclipse.cdt.make.core.makefile.IIgnoreRule;
+
+/**
+ * .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 class IgnoreRule extends SpecialRule implements IIgnoreRule {
+
+ public IgnoreRule(Directive parent, String[] reqs) {
+ super(parent, new Target(MakeFileConstants.RULE_IGNORE), reqs, new Command[0]);
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Include.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Include.java
new file mode 100644
index 0000000000..1110c13408
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Include.java
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import java.io.IOException;
+
+import org.eclipse.cdt.make.core.makefile.IDirective;
+import org.eclipse.cdt.make.core.makefile.gnu.IInclude;
+
+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(GNUMakefileConstants.DIRECTIVE_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() {
+ clearDirectives();
+ for (int i = 0; i < filenames.length; i++) {
+ // Try the current directory.
+ GNUAutomakefile gnu = new GNUAutomakefile();
+ try {
+ gnu.parse(filenames[i]);
+ addDirective(gnu);
+ continue;
+ } catch (IOException e) {
+ }
+ if (!filenames[i].startsWith(GNUAutomakefile.FILE_SEPARATOR) && dirs != null) {
+ for (int j = 0; j < dirs.length; j++) {
+ try {
+ String filename = dirs[j] + GNUAutomakefile.FILE_SEPARATOR + filenames[i];
+ gnu = new GNUAutomakefile();
+ gnu.parse(filename);
+ addDirective(gnu);
+ break;
+ } catch (IOException e) {
+ }
+ }
+ }
+ }
+ return super.getDirectives();
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/InferenceRule.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/InferenceRule.java
new file mode 100644
index 0000000000..308fdcac03
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/InferenceRule.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+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"); //$NON-NLS-1$
+ ICommand[] cmds = getCommands();
+ for (int i = 0; i < cmds.length; i++) {
+ buffer.append(cmds[i].toString());
+ }
+ return buffer.toString();
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/IntermediateRule.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/IntermediateRule.java
new file mode 100644
index 0000000000..20dee49b70
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/IntermediateRule.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import org.eclipse.cdt.make.core.makefile.gnu.IIntermediateRule;
+
+
+/**
+ * .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(GNUMakefileConstants.RULE_INTERMEDIATE), reqs, new Command[0]);
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/LexicalSortingAction.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/LexicalSortingAction.java
new file mode 100644
index 0000000000..fc15565ae9
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/LexicalSortingAction.java
@@ -0,0 +1,89 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * QNX Software System
+ * Red Hat Inc. - convert to use with Automake editor
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import org.eclipse.cdt.core.model.ICElement;
+import org.eclipse.cdt.ui.CUIPlugin;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.MakeUIImages;
+
+
+
+public class LexicalSortingAction extends Action {
+
+ private static final String ACTION_NAME= "LexicalSortingAction"; //$NON-NLS-1$
+ private static final String DIALOG_STORE_KEY= ACTION_NAME + ".sort"; //$NON-NLS-1$
+
+ private LexicalCSorter fSorter;
+ private TreeViewer fTreeViewer;
+
+ public LexicalSortingAction(TreeViewer treeViewer) {
+ super(CUIPlugin.getResourceString(ACTION_NAME + ".label")); //$NON-NLS-1$
+
+ setDescription(CUIPlugin.getResourceString(ACTION_NAME + ".description")); //$NON-NLS-1$
+ setToolTipText(CUIPlugin.getResourceString(ACTION_NAME + ".tooltip")); //$NON-NLS-1$
+
+ MakeUIImages.setImageDescriptors(this, MakeUIImages.T_TOOL, MakeUIImages.IMG_TOOLS_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"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ setToolTipText(CUIPlugin.getResourceString(key));
+
+ if (store) {
+ CUIPlugin.getDefault().getDialogSettings().put(DIALOG_STORE_KEY, on);
+ }
+ }
+
+ private class LexicalCSorter extends ViewerSorter {
+ @SuppressWarnings("unused")
+ 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/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/LowResolutionTimeRule.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/LowResolutionTimeRule.java
new file mode 100644
index 0000000000..e22225e33a
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/LowResolutionTimeRule.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import org.eclipse.cdt.make.core.makefile.gnu.ILowResolutionTimeRule;
+
+
+/**
+ * .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(GNUMakefileConstants.RULE_LOW_RESOLUTION_TIME), reqs, new Command[0]);
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MacroDefinition.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MacroDefinition.java
new file mode 100644
index 0000000000..74859d2a1d
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MacroDefinition.java
@@ -0,0 +1,112 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+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() ; //$NON-NLS-1$
+ }
+
+ 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'); //$NON-NLS-1$
+ 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/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MacroDefinitionRule.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MacroDefinitionRule.java
new file mode 100644
index 0000000000..c1f86af6d9
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MacroDefinitionRule.java
@@ -0,0 +1,164 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+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.Token;
+
+class MacroDefinitionRule 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 MacroDefinitionRule(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) {
+ while(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/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MacroReferenceRule.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MacroReferenceRule.java
new file mode 100644
index 0000000000..a2ca12e211
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MacroReferenceRule.java
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import org.eclipse.jface.text.rules.ICharacterScanner;
+import org.eclipse.jface.text.rules.IToken;
+import org.eclipse.jface.text.rules.PatternRule;
+
+public class MacroReferenceRule extends PatternRule {
+
+ int nOfBrackets;
+ int fBracket;
+
+// public MacroReferenceRule(IToken token) {
+// super("$(", ")", token, (char) 0, true); //$NON-NLS-1$ //$NON-NLS-2$
+// }
+
+ public MacroReferenceRule(IToken token, String startSeq, String endSeq) {
+ super(startSeq, endSeq, token, (char)0, true);
+ if (endSeq.length() > 0 && endSeq.charAt(0) == '}') {
+ fBracket = '{';
+ } else {
+ fBracket = '(';
+ }
+ }
+
+ 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 (fBracket == 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/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakeFileConstants.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakeFileConstants.java
new file mode 100644
index 0000000000..0ed46c2732
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakeFileConstants.java
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+
+public class MakeFileConstants {
+
+ public static final String RULE_DEFAULT = ".DEFAULT"; //$NON-NLS-1$
+ public static final String RULE_IGNORE =".IGNORE"; //$NON-NLS-1$
+ public static final String RULE_POSIX = ".POSIX"; //$NON-NLS-1$
+ public static final String RULE_PRECIOUS = ".PRECIOUS"; //$NON-NLS-1$
+ public static final String RULE_SCCS_GET = ".SCCS_GET"; //$NON-NLS-1$
+ public static final String RULE_SILENT = ".SILENT"; //$NON-NLS-1$
+ public static final String RULE_SUFFIXES = ".SUFFIXES"; //$NON-NLS-1$
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakeFileMessages.properties b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakeFileMessages.properties
new file mode 100644
index 0000000000..ae76283204
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakeFileMessages.properties
@@ -0,0 +1,27 @@
+###############################################################################
+# Copyright (c) 2003, 2006, 2007 QNX Software Systems and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# QNX Software Systems - initial API and implementation
+# Red Hat Inc. - convert to use with Automake editor
+###############################################################################
+
+MakefileValidator.errorBuild=Error Build
+MakefileValidator.errorResource=Error resource
+MakefileValidator.warningInfo=Warning info
+MakefileValidator.warning=Warning
+MakefileValidator.unknown=unknown
+MakefileValidator.checkingFile=Checking file :
+MakefileValidator.fileChecked=File checked
+MakefileValidator.error.elseMissingIfCondition=else missing if condition
+MakefileValidator.error.endifMissingIfElseCondition=Endif missing if/else condition
+MakefileValidator.error.endefMissingOverrideDefine=endef missing [override] define
+MakefileValidator.error.unknownDirective=unknow directive
+MakefileValidator.error.noMatchingEndifForCondition=No matching endif for condition
+MakefileValidator.error.noMatchingEndefForOverrideDefine=No matching endef for [override] define
+
+EditorUtility.concatModifierStrings= {0} + {1} \ No newline at end of file
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileAnnotationHover.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileAnnotationHover.java
new file mode 100644
index 0000000000..198c60316a
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileAnnotationHover.java
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006, 2007 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ * Red Hat Inc. - convert to use with Automake editor
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import org.eclipse.cdt.make.core.makefile.IMakefile;
+import org.eclipse.cdt.make.ui.IWorkingCopyManager;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.source.IAnnotationHover;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.ui.IEditorPart;
+
+
+/**
+ * MakefileAnnotationHover
+ *
+ */
+public class MakefileAnnotationHover implements IAnnotationHover {
+
+ private IEditorPart fEditor;
+
+ /**
+ *
+ */
+ public MakefileAnnotationHover(IEditorPart editor) {
+ fEditor = editor;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.text.source.IAnnotationHover#getHoverInfo(org.eclipse.jface.text.source.ISourceViewer,
+ * int)
+ */
+ public String getHoverInfo(ISourceViewer sourceViewer, int lineNumber) {
+ IDocument document = sourceViewer.getDocument();
+ try {
+ IRegion info = document.getLineInformation(lineNumber);
+ String line = document.get(info.getOffset(), info.getLength());
+ int numberOfLines = document.getNumberOfLines();
+ while (line != null && line.endsWith("\\")) { //$NON-NLS-1$
+ line = line.substring(0, line.length() - 1);
+ lineNumber++;
+ if (lineNumber < numberOfLines) {
+ info = document.getLineInformation(lineNumber);
+ String l = document.get(info.getOffset(), info.getLength());
+ line += "\n" + l; //$NON-NLS-1$
+ }
+ }
+ if (line != null && line.indexOf('$') != -1 && line.length() > 1) {
+ IWorkingCopyManager fManager = AutomakeEditorFactory.getDefault().getWorkingCopyManager();
+ IMakefile makefile = fManager.getWorkingCopy(fEditor.getEditorInput());
+ line = makefile.expandString(line);
+ return line;
+ }
+ return line;
+ } catch (BadLocationException x) {
+ }
+ return null;
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileCodeScanner.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileCodeScanner.java
new file mode 100644
index 0000000000..c7f5526d05
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileCodeScanner.java
@@ -0,0 +1,114 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.text.rules.EndOfLineRule;
+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.MultiLineRule;
+import org.eclipse.jface.text.rules.WhitespaceRule;
+import org.eclipse.jface.text.rules.WordRule;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.preferences.ColorManager;
+
+
+public class MakefileCodeScanner extends AbstractMakefileCodeScanner {
+
+ 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$
+ };
+
+ public static final String[] fTokenProperties = new String[] {
+ ColorManager.MAKE_COMMENT_COLOR,
+ ColorManager.MAKE_KEYWORD_COLOR,
+ ColorManager.MAKE_FUNCTION_COLOR,
+ ColorManager.MAKE_MACRO_REF_COLOR,
+ ColorManager.MAKE_MACRO_DEF_COLOR,
+ ColorManager.MAKE_DEFAULT_COLOR
+ };
+
+ /**
+ * Constructor for MakefileCodeScanner
+ */
+ public MakefileCodeScanner() {
+ super();
+ initialize();
+ }
+
+ protected List<IRule> createRules() {
+ IToken keyword = getToken(ColorManager.MAKE_KEYWORD_COLOR);
+ IToken function = getToken(ColorManager.MAKE_FUNCTION_COLOR);
+ IToken comment = getToken(ColorManager.MAKE_COMMENT_COLOR);
+ IToken macroRef = getToken(ColorManager.MAKE_MACRO_REF_COLOR);
+ IToken macroDef = getToken(ColorManager.MAKE_MACRO_DEF_COLOR);
+ IToken other = getToken(ColorManager.MAKE_DEFAULT_COLOR);
+
+ List<IRule> rules = new ArrayList<IRule>();
+
+ // Add rule for single line comments.
+ rules.add(new EndOfLineRule("#", comment, '\\', true)); //$NON-NLS-1$
+
+ // Add generic whitespace rule.
+ rules.add(new WhitespaceRule(new IWhitespaceDetector() {
+ public boolean isWhitespace(char character) {
+ return Character.isWhitespace(character);
+ }
+ }));
+
+ // Put before the the word rules
+ MultiLineRule defineRule = new MultiLineRule("define", "endef", macroDef); //$NON-NLS-1$ //$NON-NLS-2$
+ defineRule.setColumnConstraint(0);
+ rules.add(defineRule);
+ rules.add(new MacroDefinitionRule(macroDef, other));
+
+ // Add word rule for keywords, types, and constants.
+ // We restring the detection of the keywords to be the first column to be valid.
+ WordRule keyWordRule = new WordRule(new MakefileWordDetector(), other);
+ for (int i = 0; i < keywords.length; i++) {
+ keyWordRule.addWord(keywords[i], keyword);
+ }
+ keyWordRule.setColumnConstraint(0);
+ rules.add(keyWordRule);
+
+ WordRule functionRule = new WordRule(new MakefileWordDetector(), other);
+ for (int i = 0; i < functions.length; i++)
+ functionRule.addWord(functions[i], function);
+ rules.add(functionRule);
+
+ rules.add(new MacroReferenceRule(macroRef, "$(", ")")); //$NON-NLS-1$ //$NON-NLS-2$
+ rules.add(new MacroReferenceRule(macroRef, "${", "}")); //$NON-NLS-1$ //$NON-NLS-2$
+
+ setDefaultReturnToken(other);
+
+ return rules;
+ }
+
+ /*
+ * @see AbstractMakefileCodeScanner#getTokenProperties()
+ */
+ protected String[] getTokenProperties() {
+ return fTokenProperties;
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileCompletionProcessor.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileCompletionProcessor.java
new file mode 100644
index 0000000000..5237f17f47
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileCompletionProcessor.java
@@ -0,0 +1,242 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006, 2007 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ * Red Hat Inc. - convert to use with Automake editor
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Comparator;
+
+import org.eclipse.cdt.make.core.makefile.IDirective;
+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.ui.IWorkingCopyManager;
+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.linuxtools.internal.cdt.autotools.ui.MakeUIImages;
+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<Object>{
+
+ /* (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 =""; //$NON-NLS-1$
+ }
+
+ if (o2 instanceof IMacroDefinition) {
+ name2 = ((IMacroDefinition)o1).getName();
+ } else if (o2 instanceof IRule) {
+ name2 = ((IRule)o1).getTarget().toString();
+ } else {
+ name2 =""; //$NON-NLS-1$
+ }
+
+ //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 = AutomakeEditorFactory.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) {
+ WordPartDetector wordPart = new WordPartDetector(viewer, documentOffset);
+ boolean macro = WordPartDetector.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<ICompletionProposal> proposalList = new ArrayList<ICompletionProposal>(statements.length);
+
+ // iterate over all the different categories
+ for (int i = 0; i < statements.length; i++) {
+ String name = null;
+ Image image = null;
+ String infoString = "";//getContentInfoString(name); //$NON-NLS-1$
+ 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.toString())) {
+ IContextInformation info = new ContextInformation(name, infoString);
+ String displayString = (name.equals(infoString) ? name : name + " - " + infoString); //$NON-NLS-1$
+ ICompletionProposal result =
+ new CompletionProposal(
+ name,
+ wordPart.getOffset(),
+ wordPart.toString().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 = WordPartDetector.inMacro(viewer, documentOffset);
+ IMakefile makefile = fManager.getWorkingCopy(fEditor.getEditorInput());
+ ArrayList<String> contextList = new ArrayList<String>();
+ 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.toString())) {
+ 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.toString())) {
+ 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.toString(), 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;
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileContentOutlinePage.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileContentOutlinePage.java
new file mode 100644
index 0000000000..098195c5e0
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileContentOutlinePage.java
@@ -0,0 +1,335 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006, 2007 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ * Red Hat Inc. - convert to use with Automake editor
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+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.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.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+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.linuxtools.cdt.autotools.ui.AutotoolsUIPlugin;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.MakeUIImages;
+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<Object> list = new ArrayList<Object>(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= AutomakeEditorFactory.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;
+ protected OpenIncludeAction fOpenIncludeAction;
+
+ public MakefileContentOutlinePage(MakefileEditor editor) {
+ super();
+ fEditor = editor;
+ fAddBuildTargetAction = new AddBuildTargetAction(this);
+ fOpenIncludeAction = new OpenIncludeAction(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"); //$NON-NLS-1$
+ 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);
+
+ viewer.addDoubleClickListener(new IDoubleClickListener() {
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IDoubleClickListener#doubleClick(org.eclipse.jface.viewers.DoubleClickEvent)
+ */
+ public void doubleClick(DoubleClickEvent event) {
+ if (fOpenIncludeAction != null) {
+ fOpenIncludeAction.run();
+ }
+ }
+ });
+
+ IPageSite site= getSite();
+ //FIXME: should pluginid below be MakeUIPlugin id?
+ site.registerContextMenu(AutotoolsUIPlugin.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 (OpenIncludeAction.canActionBeAdded(getSelection())) {
+ menu.add(fOpenIncludeAction);
+ }
+ 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/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileDocumentProvider.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileDocumentProvider.java
new file mode 100644
index 0000000000..fc733b30f6
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileDocumentProvider.java
@@ -0,0 +1,148 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ * Anton Leherbauer (Wind River Systems) - Fixed bug 141295
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import java.util.Iterator;
+
+import org.eclipse.cdt.make.core.MakeCorePlugin;
+import org.eclipse.cdt.make.core.makefile.IMakefile;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.text.source.IAnnotationModel;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.editors.text.ForwardingDocumentProvider;
+import org.eclipse.ui.editors.text.TextFileDocumentProvider;
+import org.eclipse.ui.texteditor.IDocumentProvider;
+import org.eclipse.ui.texteditor.ResourceMarkerAnnotationModel;
+
+public class MakefileDocumentProvider extends TextFileDocumentProvider implements IMakefileDocumentProvider {
+
+ IMakefile fMakefile;
+
+ protected class MakefileAnnotationModel extends ResourceMarkerAnnotationModel /*implements IProblemRequestor */{
+ /**
+ * @param resource
+ */
+ public MakefileAnnotationModel(IResource resource) {
+ super(resource);
+ }
+
+ /**
+ * @param makefile
+ */
+ public void setMakefile(IMakefile makefile) {
+ fMakefile = makefile;
+ }
+ }
+
+ /**
+ * Remembers a IMakefile for each element.
+ */
+ protected class MakefileFileInfo extends FileInfo {
+ public IMakefile fCopy;
+ }
+
+ public MakefileDocumentProvider() {
+ IDocumentProvider provider= new TextFileDocumentProvider(new MakefileStorageDocumentProvider());
+ provider= new ForwardingDocumentProvider(MakefileDocumentSetupParticipant.MAKEFILE_PARTITIONING, new MakefileDocumentSetupParticipant(), provider);
+ setParentDocumentProvider(provider);
+ }
+
+ /**
+ */
+ private IMakefile createMakefile(IFile file) throws CoreException {
+ if (file.exists()) {
+ return MakeCorePlugin.getDefault().createMakefile(file);
+ }
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.editors.text.TextFileDocumentProvider#createAnnotationModel(org.eclipse.core.resources.IFile)
+ */
+ protected IAnnotationModel createAnnotationModel(IFile file) {
+ return new MakefileAnnotationModel(file);
+ }
+
+ /*
+ * @see org.eclipse.ui.editors.text.TextFileDocumentProvider#createFileInfo(java.lang.Object)
+ */
+ protected FileInfo createFileInfo(Object element) throws CoreException {
+ if (!(element instanceof IFileEditorInput))
+ return null;
+
+ IFileEditorInput input= (IFileEditorInput) element;
+ IMakefile original= createMakefile(input.getFile());
+ if (original == null)
+ return null;
+
+ FileInfo info= super.createFileInfo(element);
+ if (!(info instanceof MakefileFileInfo)) {
+ return null;
+ }
+
+ MakefileFileInfo makefileInfo= (MakefileFileInfo) info;
+ setUpSynchronization(makefileInfo);
+
+ makefileInfo.fCopy = original;
+
+ if (makefileInfo.fModel instanceof MakefileAnnotationModel) {
+ MakefileAnnotationModel model= (MakefileAnnotationModel) makefileInfo.fModel;
+ model.setMakefile(makefileInfo.fCopy);
+ }
+ return makefileInfo;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.editors.text.TextFileDocumentProvider#disposeFileInfo(java.lang.Object, org.eclipse.ui.editors.text.TextFileDocumentProvider.FileInfo)
+ */
+ protected void disposeFileInfo(Object element, FileInfo info) {
+ if (info instanceof MakefileFileInfo) {
+ MakefileFileInfo makefileInfo= (MakefileFileInfo) info;
+ if (makefileInfo.fCopy != null) {
+ makefileInfo.fCopy = null;
+ }
+ }
+ super.disposeFileInfo(element, info);
+ }
+
+ /*
+ * @see org.eclipse.ui.editors.text.TextFileDocumentProvider#createEmptyFileInfo()
+ */
+ protected FileInfo createEmptyFileInfo() {
+ return new MakefileFileInfo();
+ }
+
+ /*
+ * @see org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake.IMakefileDocumentProvider#getWorkingCopy(java.lang.Object)
+ */
+ public IMakefile getWorkingCopy(Object element) {
+ FileInfo fileInfo= getFileInfo(element);
+ if (fileInfo instanceof MakefileFileInfo) {
+ MakefileFileInfo info= (MakefileFileInfo) fileInfo;
+ return info.fCopy;
+ }
+ return null;
+ }
+
+ /*
+ * @see org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake.MakefileDocumentProvider#shutdown()
+ */
+ @SuppressWarnings("unchecked")
+ public void shutdown() {
+ Iterator e= getConnectedElementsIterator();
+ while (e.hasNext())
+ disconnect(e.next());
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileDocumentSetupParticipant.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileDocumentSetupParticipant.java
new file mode 100644
index 0000000000..30bf900ae4
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileDocumentSetupParticipant.java
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 2005 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import org.eclipse.core.filebuffers.IDocumentSetupParticipant;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IDocumentExtension3;
+import org.eclipse.jface.text.IDocumentPartitioner;
+import org.eclipse.jface.text.rules.FastPartitioner;
+
+/**
+ * MakefileDocumentSetupParticipant
+ * The document setup participant for Ant.
+ */
+public class MakefileDocumentSetupParticipant implements IDocumentSetupParticipant {
+
+ /**
+ * The name of the Makefile partitioning.
+ */
+ public final static String MAKEFILE_PARTITIONING= "___makefile_partitioning"; //$NON-NLS-1$
+
+ public MakefileDocumentSetupParticipant() {
+ }
+
+ /*
+ * @see org.eclipse.core.filebuffers.IDocumentSetupParticipant#setup(org.eclipse.jface.text.IDocument)
+ */
+ public void setup(IDocument document) {
+ if (document instanceof IDocumentExtension3) {
+ IDocumentExtension3 extension3= (IDocumentExtension3) document;
+ IDocumentPartitioner partitioner = createDocumentPartitioner();
+ extension3.setDocumentPartitioner(MAKEFILE_PARTITIONING, partitioner);
+ partitioner.connect(document);
+ }
+ }
+
+ private IDocumentPartitioner createDocumentPartitioner() {
+ return new FastPartitioner(
+ new MakefilePartitionScanner(), MakefilePartitionScanner.MAKE_PARTITIONS);
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileEditor.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileEditor.java
new file mode 100644
index 0000000000..9fb54e8ffd
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileEditor.java
@@ -0,0 +1,462 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ * Anton Leherbauer, Wind River Systems, Inc.
+ * Red Hat Inc. - convert to use with Automake editor
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import java.util.ResourceBundle;
+
+import org.eclipse.cdt.make.core.makefile.IDirective;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.ListenerList;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.FindReplaceDocumentAdapter;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITextOperationTarget;
+import org.eclipse.jface.text.ITextViewerExtension;
+import org.eclipse.jface.text.rules.IWordDetector;
+import org.eclipse.jface.text.source.IOverviewRuler;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.jface.text.source.IVerticalRuler;
+import org.eclipse.jface.text.source.SourceViewerConfiguration;
+import org.eclipse.jface.text.source.projection.ProjectionAnnotationModel;
+import org.eclipse.jface.text.source.projection.ProjectionSupport;
+import org.eclipse.jface.text.source.projection.ProjectionViewer;
+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.linuxtools.cdt.autotools.core.AutotoolsPlugin;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.MakeUIMessages;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IPartService;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.editors.text.EditorsUI;
+import org.eclipse.ui.editors.text.TextEditor;
+import org.eclipse.ui.texteditor.ChainedPreferenceStore;
+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, IReconcilingParticipant {
+
+ /**
+ * The page that shows the outline.
+ */
+ protected MakefileContentOutlinePage page;
+ ProjectionSupport projectionSupport;
+ ProjectionMakefileUpdater fProjectionMakefileUpdater;
+ private FindReplaceDocumentAdapter fFindReplaceDocumentAdapter;
+
+ /**
+ * Reconciling listeners.
+ * @since 3.0
+ */
+ private ListenerList fReconcilingListeners= new ListenerList(ListenerList.IDENTITY);
+
+ /**
+ * Adapted source viewer for CEditor
+ */
+
+ public class AdaptedSourceViewer extends ProjectionViewer implements ITextViewerExtension {
+
+
+ public AdaptedSourceViewer(Composite parent, IVerticalRuler ruler,
+ IOverviewRuler overviewRuler, boolean showsAnnotation, int styles) {
+ super(parent, ruler, overviewRuler, showsAnnotation, styles);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.source.ISourceViewer#setRangeIndication(int, int, boolean)
+ */
+ public void setRangeIndication(int offset, int length, boolean moveCursor) {
+ // Fixin a bug in the ProjectViewer implemenation
+ // PR: https://bugs.eclipse.org/bugs/show_bug.cgi?id=72914
+ if (isProjectionMode()) {
+ super.setRangeIndication(offset, length, moveCursor);
+ } else {
+ super.setRangeIndication(offset, length, false);
+ }
+ }
+ }
+
+
+ MakefileSourceConfiguration getMakefileSourceConfiguration() {
+ SourceViewerConfiguration configuration = getSourceViewerConfiguration();
+ if (configuration instanceof MakefileSourceConfiguration) {
+ return (MakefileSourceConfiguration)configuration;
+ }
+ return null;
+ }
+
+ public MakefileContentOutlinePage getOutlinePage() {
+ if (page == null) {
+ page = new MakefileContentOutlinePage(this);
+ page.addSelectionChangedListener(this);
+ page.setInput(getEditorInput());
+ }
+ return page;
+ }
+
+ public MakefileEditor() {
+ super();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.texteditor.AbstractDecoratedTextEditor#initializeEditor()
+ */
+ protected void initializeEditor() {
+ setRangeIndicator(new DefaultRangeIndicator());
+ setEditorContextMenuId("#MakefileEditorContext"); //$NON-NLS-1$
+ setRulerContextMenuId("#MakefileRulerContext"); //$NON-NLS-1$
+ setDocumentProvider(AutomakeEditorFactory.getDefault().getAutomakefileDocumentProvider());
+ IPreferenceStore[] stores = new IPreferenceStore[2];
+ stores[0] = AutotoolsPlugin.getDefault().getPreferenceStore();
+ stores[1] = EditorsUI.getPreferenceStore();
+ ChainedPreferenceStore chainedStore = new ChainedPreferenceStore(stores);
+ setPreferenceStore(chainedStore);
+ setSourceViewerConfiguration(new MakefileSourceConfiguration(chainedStore, this));
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IWorkbenchPart#dispose()
+ */
+ public void dispose() {
+ if (fProjectionMakefileUpdater != null) {
+ fProjectionMakefileUpdater.uninstall();
+ fProjectionMakefileUpdater= null;
+ }
+ super.dispose();
+ }
+
+ boolean isFoldingEnabled() {
+ return AutotoolsPlugin.getDefault().getPreferenceStore().getBoolean(MakefileEditorPreferenceConstants.EDITOR_FOLDING_ENABLED);
+ }
+
+ /*
+ * @see org.eclipse.ui.texteditor.AbstractDecoratedTextEditor#isTabsToSpacesConversionEnabled()
+ */
+ protected boolean isTabsToSpacesConversionEnabled() {
+ // always false for Makefiles
+ // see http://bugs.eclipse.org/186106
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IWorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
+ */
+ public void createPartControl(Composite parent) {
+ super.createPartControl(parent);
+ ProjectionViewer projectionViewer = (ProjectionViewer) getSourceViewer();
+ projectionSupport = new ProjectionSupport(projectionViewer, getAnnotationAccess(), getSharedColors());
+ projectionSupport.addSummarizableAnnotationType("org.eclipse.ui.workbench.texteditor.error"); //$NON-NLS-1$
+ projectionSupport.addSummarizableAnnotationType("org.eclipse.ui.workbench.texteditor.warning"); //$NON-NLS-1$
+ projectionSupport.install();
+
+ if (isFoldingEnabled()) {
+ projectionViewer.doOperation(ProjectionViewer.TOGGLE);
+ }
+
+// ProjectionAnnotationModel model= (ProjectionAnnotationModel) getAdapter(ProjectionAnnotationModel.class);
+
+ fProjectionMakefileUpdater= new ProjectionMakefileUpdater();
+ if (fProjectionMakefileUpdater != null) {
+ fProjectionMakefileUpdater.install(this, projectionViewer);
+ fProjectionMakefileUpdater.initialize();
+ }
+ }
+
+ protected ISourceViewer createSourceViewer(Composite parent, IVerticalRuler ruler, int styles) {
+ ISourceViewer viewer = new AdaptedSourceViewer(parent, ruler, getOverviewRuler(), isOverviewRulerVisible(), styles);
+
+ // ensure decoration support has been created and configured.
+ getSourceViewerDecorationSupport(viewer);
+
+ return viewer;
+ }
+
+ /* (non-Javadoc)
+ * Method declared on IAdaptable
+ */
+ @SuppressWarnings("unchecked")
+ public Object getAdapter(Class key) {
+ if (ProjectionAnnotationModel.class.equals(key)) {
+ if (projectionSupport != null) {
+ Object result = projectionSupport.getAdapter(getSourceViewer(), key);
+ if (result != null) {
+ return result;
+ }
+ }
+ } else 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);
+ if (page != null) {
+ page.update();
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.texteditor.AbstractTextEditor#createActions()
+ */
+ protected void createActions() {
+ super.createActions();
+
+ ResourceBundle bundle = MakeUIMessages.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$
+
+ a = new OpenDeclarationAction(this);
+ a.setActionDefinitionId(IMakefileEditorActionDefinitionIds.OPEN_DECLARATION);
+ setAction("OpenDeclarationAction", a); //$NON-NLS-1$
+ markAsStateDependentAction("OpenDeclarationAction", 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() && AutotoolsPlugin.getActivePage() != null) {
+ AutotoolsPlugin.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);
+ }
+
+ /**
+ * Returns the find/replace document adapter.
+ *
+ * @return the find/replace document adapter.
+ */
+ private FindReplaceDocumentAdapter getFindRepalceDocumentAdapter() {
+ if (fFindReplaceDocumentAdapter == null) {
+ IDocument doc = getDocumentProvider().getDocument(getEditorInput());
+ fFindReplaceDocumentAdapter= new FindReplaceDocumentAdapter(doc);
+ }
+ return fFindReplaceDocumentAdapter;
+ }
+
+ public 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);
+ }
+ IRegion region = getFindRepalceDocumentAdapter().find(start, var, true, true, true, false);
+
+ if (region != null) {
+ len = region.getOffset();
+ length = region.getLength();
+ 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$
+ //addAction(menu, ITextEditorActionConstants.GROUP_EDIT, "OpenDeclarationAction"); //$NON-NLS-1$
+ }
+
+ /**
+ * Adds the given listener.
+ * Has no effect if an identical listener was not already registered.
+ *
+ * @param listener The reconcile listener to be added
+ * @since 3.0
+ */
+ final void addReconcilingParticipant(IReconcilingParticipant listener) {
+ synchronized (fReconcilingListeners) {
+ fReconcilingListeners.add(listener);
+ }
+ }
+
+ /**
+ * Removes the given listener.
+ * Has no effect if an identical listener was not already registered.
+ *
+ * @param listener the reconcile listener to be removed
+ * @since 3.0
+ */
+ final void removeReconcilingParticipant(IReconcilingParticipant listener) {
+ synchronized (fReconcilingListeners) {
+ fReconcilingListeners.remove(listener);
+ }
+ }
+
+ /*
+ */
+ public void reconciled() {
+ // Notify listeners
+ Object[] listeners = fReconcilingListeners.getListeners();
+ for (int i = 0, length= listeners.length; i < length; ++i) {
+ ((IReconcilingParticipant)listeners[i]).reconciled();
+ }
+ }
+
+ /*
+ * @see org.eclipse.ui.texteditor.AbstractTextEditor#performRevert()
+ */
+ protected void performRevert() {
+ ProjectionViewer projectionViewer= (ProjectionViewer) getSourceViewer();
+ projectionViewer.setRedraw(false);
+ try {
+
+ boolean projectionMode= projectionViewer.isProjectionMode();
+ if (projectionMode) {
+ projectionViewer.disableProjection();
+ if (fProjectionMakefileUpdater != null)
+ fProjectionMakefileUpdater.uninstall();
+ }
+
+ super.performRevert();
+
+ if (projectionMode) {
+ if (fProjectionMakefileUpdater != null)
+ fProjectionMakefileUpdater.install(this, projectionViewer);
+ projectionViewer.enableProjection();
+ }
+
+ } finally {
+ projectionViewer.setRedraw(true);
+ }
+ }
+
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.texteditor.AbstractTextEditor#handlePreferenceStoreChanged(org.eclipse.jface.util.PropertyChangeEvent)
+ */
+ protected void handlePreferenceStoreChanged(PropertyChangeEvent event) {
+ ISourceViewer sourceViewer= getSourceViewer();
+ if (sourceViewer == null)
+ return;
+
+ String property = event.getProperty();
+
+ MakefileSourceConfiguration makeConf = getMakefileSourceConfiguration();
+ if (makeConf != null) {
+ if (makeConf.affectsBehavior(event)) {
+ makeConf.adaptToPreferenceChange(event);
+ sourceViewer.invalidateTextPresentation();
+ }
+ }
+
+ if (MakefileEditorPreferenceConstants.EDITOR_FOLDING_ENABLED.equals(property)) {
+ if (sourceViewer instanceof ProjectionViewer) {
+ ProjectionViewer projectionViewer= (ProjectionViewer) sourceViewer;
+ if (fProjectionMakefileUpdater != null)
+ fProjectionMakefileUpdater.uninstall();
+ // either freshly enabled or provider changed
+ fProjectionMakefileUpdater= new ProjectionMakefileUpdater();
+ if (fProjectionMakefileUpdater != null) {
+ fProjectionMakefileUpdater.install(this, projectionViewer);
+ }
+ }
+ return;
+ }
+
+ super.handlePreferenceStoreChanged(event);
+ }
+
+ /*
+ * @see org.eclipse.ui.texteditor.AbstractDecoratedTextEditor#collectContextMenuPreferencePages()
+ */
+ protected String[] collectContextMenuPreferencePages() {
+ // Add Makefile Editor relevant pages
+ String[] parentPrefPageIds = super.collectContextMenuPreferencePages();
+ String[] prefPageIds = new String[parentPrefPageIds.length + 2];
+ int nIds = 0;
+ prefPageIds[nIds++] = "org.eclipse.cdt.make.ui.preferences.MakeFileEditorPreferencePage"; //$NON-NLS-1$
+ prefPageIds[nIds++] = "org.eclipse.cdt.make.ui.preferences.MakefileSettingPreferencePage"; //$NON-NLS-1$
+ System.arraycopy(parentPrefPageIds, 0, prefPageIds, nIds, parentPrefPageIds.length);
+ return prefPageIds;
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileEditorActionContributor.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileEditorActionContributor.java
new file mode 100644
index 0000000000..d86e087073
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileEditorActionContributor.java
@@ -0,0 +1,111 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006, 2007 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ * Wind River Systems - fix for bugzilla 135150
+ * Red Hat Inc. - modify for usage with Automake editor
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import java.util.ResourceBundle;
+
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.MakeUIMessages;
+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;
+ private OpenDeclarationAction fOpenDeclarationAction;
+ protected RetargetTextEditorAction fContentAssistProposal;
+ protected RetargetTextEditorAction fContentAssistTip;
+
+ /**
+ * Constructor for MakefileEditorActionContributor.
+ */
+ public MakefileEditorActionContributor() {
+ super();
+ ResourceBundle bundle = MakeUIMessages.getResourceBundle();
+ fContentAssistProposal = new RetargetTextEditorAction(bundle, "ContentAssistProposal."); //$NON-NLS-1$
+ fContentAssistProposal.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
+ fContentAssistTip = new RetargetTextEditorAction(bundle, "ContentAssistTip."); //$NON-NLS-1$
+ fContentAssistTip.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_CONTEXT_INFORMATION);
+ fTogglePresentation = new MakefileEditorTogglePresentationAction();
+ fOpenDeclarationAction = new OpenDeclarationAction();
+
+ }
+
+ /**
+ * @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();
+
+ fOpenDeclarationAction.setEditor(editor);
+ fOpenDeclarationAction.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);
+ editMenu.add(fOpenDeclarationAction);
+ }
+
+ bars.setGlobalActionHandler(ITextEditorActionDefinitionIds.TOGGLE_SHOW_SELECTED_ELEMENT_ONLY, fTogglePresentation);
+ // there is a global action in the toolbar, that is retargeted,
+ // there is no need to add another one.
+// IToolBarManager toolBarManager = bars.getToolBarManager();
+// if (toolBarManager != null) {
+// toolBarManager.add(new Separator());
+// toolBarManager.add(fTogglePresentation);
+// }
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileEditorPreferenceConstants.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileEditorPreferenceConstants.java
new file mode 100644
index 0000000000..169d791ac9
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileEditorPreferenceConstants.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 2005 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+
+/**
+ * MakefileEditorPreferenceConstants
+ */
+public class MakefileEditorPreferenceConstants {
+
+ /**
+ *
+ */
+ private MakefileEditorPreferenceConstants() {
+ }
+
+ /**
+ * The symbolic names for colors for displaying code assist proposals
+ * @see org.eclipse.jface.resource.ColorRegistry
+ */
+ public static final String CURRENT_LINE_COLOR = "org.eclipse.cdt.make.ui.currentLineHightlightColor"; //$NON-NLS-1$
+ public static final String LINE_NUMBER_RULER_COLOR = "org.eclipse.cdt.make.ui.lineNumberForegroundColor"; //$NON-NLS-1$
+ public static final String PRINT_MARGIN_COLOR = "org.eclipse.cdt.make.ui.printMarginColor"; //$NON-NLS-1$
+
+ /**
+ * Preference key suffix for bold text style preference keys.
+ *
+ */
+ public static final String EDITOR_BOLD_SUFFIX= "_bold"; //$NON-NLS-1$
+
+ /**
+ * Preference key suffix for italic text style preference keys.
+ */
+ public static final String EDITOR_ITALIC_SUFFIX= "_italic"; //$NON-NLS-1$
+
+
+ public static final String EDITOR_FOLDING_MACRODEF = "editor_folding_default_macrodef"; //$NON-NLS-1$
+
+
+ public static final String EDITOR_FOLDING_RULE = "editor_folding_default_rule"; //$NON-NLS-1$
+
+
+ public static final String EDITOR_FOLDING_CONDITIONAL = "editor_folding_default_conditional"; //$NON-NLS-1$
+
+ public static final String EDITOR_FOLDING_ENABLED = "editor_folding_enabled"; //$NON-NLS-1$
+
+ public static void initializeDefaultValues(IPreferenceStore store) {
+
+ store.setDefault(MakefileEditorPreferenceConstants.EDITOR_FOLDING_ENABLED, false);
+ store.setDefault(MakefileEditorPreferenceConstants.EDITOR_FOLDING_MACRODEF, false);
+ store.setDefault(MakefileEditorPreferenceConstants.EDITOR_FOLDING_RULE, true);
+ store.setDefault(MakefileEditorPreferenceConstants.EDITOR_FOLDING_CONDITIONAL, true);
+
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileEditorTogglePresentationAction.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileEditorTogglePresentationAction.java
new file mode 100644
index 0000000000..cd9f159767
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileEditorTogglePresentationAction.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006, 2007 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ * Red Hat Inc. - modified for Automake editor usage
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.MakeUIImages;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.MakeUIMessages;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.ui.texteditor.TextEditorAction;
+
+
+/**
+ */
+public class MakefileEditorTogglePresentationAction extends TextEditorAction {
+
+ /**
+ * Constructor for MakefileEditorTogglePresentationAction.
+ */
+ public MakefileEditorTogglePresentationAction() {
+ super(MakeUIMessages.getResourceBundle(), "TogglePresentation.", 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/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileMessages.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileMessages.java
new file mode 100644
index 0000000000..c8decc48e4
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileMessages.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 Red Hat Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Inc. - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import java.text.MessageFormat;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class MakefileMessages {
+
+ private static final String BUNDLE_NAME = MakefileMessages.class.getName();
+
+ private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
+ .getBundle(BUNDLE_NAME);
+
+ private MakefileMessages() {
+ }
+
+ /**
+ * Returns the string from the plugin's resource bundle,
+ * or 'key' if not found.
+ *
+ * @param key the message key
+ * @return the resource bundle message
+ */
+ public static String getString(String key) {
+ try {
+ return RESOURCE_BUNDLE.getString(key);
+ } catch (MissingResourceException e) {
+ return '!' + key + '!';
+ }
+ }
+
+ /**
+ * Returns the string from the plugin's resource bundle,
+ * or 'key' if not found.
+ *
+ * @param key the message key
+ * @param args an array of substitution strings
+ * @return the resource bundle message
+ */
+ public static String getFormattedString(String key, String[] args) {
+ return MessageFormat.format(getString(key), (Object[])args);
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefilePartitionScanner.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefilePartitionScanner.java
new file mode 100644
index 0000000000..fc9975807f
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefilePartitionScanner.java
@@ -0,0 +1,96 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.text.rules.EndOfLineRule;
+import org.eclipse.jface.text.rules.IPredicateRule;
+import org.eclipse.jface.text.rules.IRule;
+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_PARTITION = "makefile_comment"; //$NON-NLS-1$
+ public final static String MAKEFILE_MACRO_ASSIGNEMENT_PARTITION = "makefile_macro_assignement"; //$NON-NLS-1$
+ public final static String MAKEFILE_INCLUDE_BLOCK_PARTITION = "makefile_include_block"; //$NON-NLS-1$
+ public final static String MAKEFILE_IF_BLOCK_PARTITION = "makefile_if_block"; //$NON-NLS-1$
+ public final static String MAKEFILE_DEF_BLOCK_PARTITION = "makefile_def_block"; //$NON-NLS-1$
+ public final static String MAKEFILE_OTHER_PARTITION = "makefile_other"; //$NON-NLS-1$
+
+ public final static String[] MAKE_PARTITIONS =
+ new String[] {
+ MAKEFILE_COMMENT_PARTITION,
+ MAKEFILE_MACRO_ASSIGNEMENT_PARTITION,
+ MAKEFILE_INCLUDE_BLOCK_PARTITION,
+ MAKEFILE_IF_BLOCK_PARTITION,
+ MAKEFILE_DEF_BLOCK_PARTITION,
+ MAKEFILE_OTHER_PARTITION,
+ };
+
+ /** 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_PARTITION);
+ IToken tMacro = new Token(MAKEFILE_MACRO_ASSIGNEMENT_PARTITION);
+ IToken tInclude = new Token(MAKEFILE_INCLUDE_BLOCK_PARTITION);
+ IToken tIf = new Token(MAKEFILE_IF_BLOCK_PARTITION);
+ IToken tDef = new Token(MAKEFILE_DEF_BLOCK_PARTITION);
+ IToken tOther = new Token(MAKEFILE_OTHER_PARTITION);
+
+ List<IRule> rules = new ArrayList<IRule>();
+
+ // Add rule for single line comments.
+
+ rules.add(new EndOfLineRule("#", tComment, '\\', true)); //$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$ //$NON-NLS-2$
+ rules.add(new MultiLineRule("override define", "endef", tDef)); //$NON-NLS-1$ //$NON-NLS-2$
+
+ // Add rules for multi-line comments and javadoc.
+ rules.add(new MultiLineRule("ifdef", "endif", tIf)); //$NON-NLS-1$ //$NON-NLS-2$
+ rules.add(new MultiLineRule("ifndef", "endif", tIf)); //$NON-NLS-1$ //$NON-NLS-2$
+ rules.add(new MultiLineRule("ifeq", "endif", tIf)); //$NON-NLS-1$ //$NON-NLS-2$
+ rules.add(new MultiLineRule("ifnneq", "endif", tIf)); //$NON-NLS-1$ //$NON-NLS-2$
+
+ // Last rule must be supplied with default token!
+ rules.add(new MacroDefinitionRule(tMacro, tOther)); //$NON-NLS-1$
+
+ IPredicateRule[] result = new IPredicateRule[rules.size()];
+ rules.toArray(result);
+ setPredicateRules(result);
+
+ }
+
+ /*
+ * @see ICharacterScanner#getLegalLineDelimiters
+ */
+ public char[][] getLegalLineDelimiters() {
+ return fModDelimiters;
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileReader.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileReader.java
new file mode 100644
index 0000000000..d06c0143f9
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileReader.java
@@ -0,0 +1,86 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+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 <newline>(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 <space>
+ //
+ // When an escaped <newline> is found in a command line in a makefile,
+ // the command line shall contain the backslash, the <newline>, and the next line,
+ // except that the first character of the next line shall not be included if it is a <tab>
+ 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/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileReconcilingStrategy.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileReconcilingStrategy.java
new file mode 100644
index 0000000000..8c654d8530
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileReconcilingStrategy.java
@@ -0,0 +1,104 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006, 2007 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ * Red Hat Inc. - convert to use with Automake editor
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import java.io.IOException;
+import java.io.StringReader;
+
+import org.eclipse.cdt.make.core.makefile.IMakefile;
+import org.eclipse.cdt.make.ui.IWorkingCopyManager;
+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 MakefileContentOutlinePage fOutliner;
+ private IReconcilingParticipant fMakefileReconcilingParticipant;
+
+ public MakefileReconcilingStrategy(MakefileEditor editor) {
+ fOutliner= editor.getOutlinePage();
+ fLastRegionOffset = Integer.MAX_VALUE;
+ fEditor= editor;
+ fManager= AutomakeEditorFactory.getDefault().getWorkingCopyManager();
+ fDocumentProvider= AutomakeEditorFactory.getDefault().getAutomakefileDocumentProvider();
+ if (fEditor instanceof IReconcilingParticipant) {
+ fMakefileReconcilingParticipant= (IReconcilingParticipant)fEditor;
+ }
+
+ }
+
+ /**
+ * @see IReconcilingStrategy#reconcile(document)
+ */
+ public void setDocument(IDocument document) {
+ }
+
+
+ /**
+ * @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() {
+ try {
+ IMakefile makefile = fManager.getWorkingCopy(fEditor.getEditorInput());
+ if (makefile != null) {
+ String content = fDocumentProvider.getDocument(fEditor.getEditorInput()).get();
+ StringReader reader = new StringReader(content);
+ try {
+ makefile.parse(makefile.getFileURI(), reader);
+ } catch (IOException e) {
+ }
+
+ fOutliner.update();
+ }
+ } finally {
+ try {
+ if (fMakefileReconcilingParticipant != null) {
+ fMakefileReconcilingParticipant.reconciled();
+ }
+ } finally {
+ //
+ }
+ }
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileSourceConfiguration.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileSourceConfiguration.java
new file mode 100644
index 0000000000..76b7f03029
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileSourceConfiguration.java
@@ -0,0 +1,191 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ * Anton Leherbauer (Wind River Systems)
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ITextHover;
+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.IAnnotationHover;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.jface.text.source.SourceViewerConfiguration;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.preferences.ColorManager;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.ui.editors.text.TextSourceViewerConfiguration;
+
+
+public class MakefileSourceConfiguration extends TextSourceViewerConfiguration {
+
+ private ColorManager colorManager;
+ 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(IPreferenceStore preferenceStore, MakefileEditor editor) {
+ super(preferenceStore);
+ fEditor = editor;
+ colorManager = ColorManager.getDefault();
+ }
+
+ /**
+ * @see SourceViewerConfiguration#getConfiguredContentTypes(ISourceViewer)
+ */
+ public String[] getConfiguredContentTypes(ISourceViewer v) {
+ return new String[] {
+ IDocument.DEFAULT_CONTENT_TYPE,
+ MakefilePartitionScanner.MAKEFILE_COMMENT_PARTITION,
+ MakefilePartitionScanner.MAKEFILE_IF_BLOCK_PARTITION,
+ MakefilePartitionScanner.MAKEFILE_DEF_BLOCK_PARTITION,
+ MakefilePartitionScanner.MAKEFILE_INCLUDE_BLOCK_PARTITION,
+ MakefilePartitionScanner.MAKEFILE_MACRO_ASSIGNEMENT_PARTITION,
+ };
+
+ }
+
+ /**
+ * @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_PARTITION);
+ assistant.setContentAssistProcessor(new MakefileCompletionProcessor(fEditor), MakefilePartitionScanner.MAKEFILE_DEF_BLOCK_PARTITION);
+ assistant.setContentAssistProcessor(new MakefileCompletionProcessor(fEditor), MakefilePartitionScanner.MAKEFILE_IF_BLOCK_PARTITION);
+ assistant.setContentAssistProcessor(new MakefileCompletionProcessor(fEditor), MakefilePartitionScanner.MAKEFILE_INCLUDE_BLOCK_PARTITION);
+ assistant.setContentAssistProcessor(new MakefileCompletionProcessor(fEditor), MakefilePartitionScanner.MAKEFILE_MACRO_ASSIGNEMENT_PARTITION);
+
+ assistant.enableAutoActivation(true);
+ assistant.setAutoActivationDelay(500);
+
+ assistant.setProposalPopupOrientation(IContentAssistant.CONTEXT_INFO_BELOW);
+ assistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_BELOW);
+ //Set to Carolina blue
+ assistant.setContextInformationPopupBackground(colorManager.getColor(new RGB(0, 191, 255)));
+
+ return assistant;
+ }
+
+ protected MakefileCodeScanner getCodeScanner() {
+ if (null == codeScanner)
+ codeScanner = new MakefileCodeScanner();
+ 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_PARTITION);
+ reconciler.setRepairer(dr, MakefilePartitionScanner.MAKEFILE_COMMENT_PARTITION);
+
+ dr = new DefaultDamagerRepairer(getCodeScanner());
+ reconciler.setDamager(dr, MakefilePartitionScanner.MAKEFILE_MACRO_ASSIGNEMENT_PARTITION);
+ reconciler.setRepairer(dr, MakefilePartitionScanner.MAKEFILE_MACRO_ASSIGNEMENT_PARTITION);
+
+ dr = new DefaultDamagerRepairer(getCodeScanner());
+ reconciler.setDamager(dr, MakefilePartitionScanner.MAKEFILE_INCLUDE_BLOCK_PARTITION);
+ reconciler.setRepairer(dr, MakefilePartitionScanner.MAKEFILE_INCLUDE_BLOCK_PARTITION);
+
+ dr = new DefaultDamagerRepairer(getCodeScanner());
+ reconciler.setDamager(dr, MakefilePartitionScanner.MAKEFILE_IF_BLOCK_PARTITION);
+ reconciler.setRepairer(dr, MakefilePartitionScanner.MAKEFILE_IF_BLOCK_PARTITION);
+
+ dr = new DefaultDamagerRepairer(getCodeScanner());
+ reconciler.setDamager(dr, MakefilePartitionScanner.MAKEFILE_DEF_BLOCK_PARTITION);
+ reconciler.setRepairer(dr, MakefilePartitionScanner.MAKEFILE_DEF_BLOCK_PARTITION);
+
+ dr = new DefaultDamagerRepairer(getCodeScanner());
+ reconciler.setDamager(dr, MakefilePartitionScanner.MAKEFILE_OTHER_PARTITION);
+ reconciler.setRepairer(dr, MakefilePartitionScanner.MAKEFILE_OTHER_PARTITION);
+ 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[]{"#"}; //$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getTextHover(org.eclipse.jface.text.source.ISourceViewer, java.lang.String)
+ */
+ public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) {
+ return new MakefileTextHover(fEditor);
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getAnnotationHover(org.eclipse.jface.text.source.ISourceViewer)
+ */
+ public IAnnotationHover getAnnotationHover(ISourceViewer sourceViewer) {
+ return new MakefileAnnotationHover(fEditor);
+ }
+
+ /**
+ * @param event
+ * @return
+ */
+ public boolean affectsBehavior(PropertyChangeEvent event) {
+ MakefileCodeScanner scanner = getCodeScanner();
+ return scanner.affectsBehavior(event);
+ }
+
+ /**
+ * @param event
+ */
+ public void adaptToPreferenceChange(PropertyChangeEvent event) {
+ MakefileCodeScanner scanner = getCodeScanner();
+ scanner.adaptToPreferenceChange(event);
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileStorageDocumentProvider.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileStorageDocumentProvider.java
new file mode 100644
index 0000000000..cbcd643869
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileStorageDocumentProvider.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 2005 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IDocumentExtension3;
+import org.eclipse.jface.text.IDocumentPartitioner;
+import org.eclipse.jface.text.rules.FastPartitioner;
+import org.eclipse.ui.editors.text.StorageDocumentProvider;
+
+/**
+ * MakefileStorageDocumentProvider
+ */
+public class MakefileStorageDocumentProvider extends StorageDocumentProvider {
+
+ /*
+ * @see org.eclipse.ui.editors.text.StorageDocumentProvider#setupDocument(java.lang.Object,
+ * org.eclipse.jface.text.IDocument)
+ */
+ protected void setupDocument(Object element, IDocument document) {
+ if (document != null) {
+ IDocumentPartitioner partitioner= createDocumentPartitioner();
+ if (document instanceof IDocumentExtension3) {
+ IDocumentExtension3 extension3= (IDocumentExtension3) document;
+ extension3.setDocumentPartitioner(MakefileDocumentSetupParticipant.MAKEFILE_PARTITIONING, partitioner);
+ } else {
+ document.setDocumentPartitioner(partitioner);
+ }
+ partitioner.connect(document);
+ }
+ }
+
+ private IDocumentPartitioner createDocumentPartitioner() {
+ return new FastPartitioner(
+ new MakefilePartitionScanner(), MakefilePartitionScanner.MAKE_PARTITIONS);
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileTextHover.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileTextHover.java
new file mode 100644
index 0000000000..c2b9a6fb78
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileTextHover.java
@@ -0,0 +1,105 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006, 2007 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ * Red Hat Inc. - convert to use with Automake editor
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import org.eclipse.cdt.make.core.makefile.IMacroDefinition;
+import org.eclipse.cdt.make.core.makefile.IMakefile;
+import org.eclipse.cdt.make.ui.IWorkingCopyManager;
+import org.eclipse.jface.text.BadLocationException;
+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;
+
+
+/**
+ * MakefileTextHover
+ *
+ */
+public class MakefileTextHover implements ITextHover {
+
+ private IEditorPart fEditor;
+
+ /**
+ *
+ */
+ public MakefileTextHover(IEditorPart editor) {
+ fEditor = editor;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.text.ITextHover#getHoverInfo(org.eclipse.jface.text.ITextViewer,
+ * org.eclipse.jface.text.IRegion)
+ */
+ public String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion) {
+ if (hoverRegion != null) {
+ try {
+ int len = hoverRegion.getLength();
+ int offset = hoverRegion.getOffset();
+ textViewer.getDocument().get(offset, len); // check off/len validity
+ if (fEditor != null && len > -1) {
+ IWorkingCopyManager fManager = AutomakeEditorFactory.getDefault().getWorkingCopyManager();
+ IMakefile makefile = fManager.getWorkingCopy(fEditor.getEditorInput());
+ if (makefile != null) {
+ WordPartDetector wordPart = new WordPartDetector(textViewer, offset);
+ String name = wordPart.toString();
+ IMacroDefinition[] statements = null;
+ if (WordPartDetector.inMacro(textViewer, offset)) {
+ statements = makefile.getMacroDefinitions(name);
+ if (statements == null || statements.length == 0) {
+ statements = makefile.getBuiltinMacroDefinitions(name);
+ }
+ }
+
+ if (statements == null) {
+ statements = new IMacroDefinition[0];
+ }
+ // iterate over all the different categories
+ StringBuffer buffer = new StringBuffer();
+ for (int i = 0; i < statements.length; i++) {
+ if (i > 0) {
+ buffer.append("\n"); //$NON-NLS-1$
+ }
+ String infoString = statements[i].getValue().toString();
+ buffer.append(name);
+ buffer.append(" - "); //$NON-NLS-1$
+ buffer.append(infoString);
+ }
+ return buffer.toString();
+ }
+ }
+ } catch (BadLocationException e) {
+ }
+ }
+ return ""; //$NON-NLS-1$
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.text.ITextHover#getHoverRegion(org.eclipse.jface.text.ITextViewer,
+ * int)
+ */
+ public IRegion getHoverRegion(ITextViewer textViewer, int offset) {
+ Point selection = textViewer.getSelectedRange();
+ if (selection.x <= offset && offset < selection.x + selection.y) {
+ return new Region(selection.x, selection.y);
+ }
+ return new Region(offset, 0);
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileWordDetector.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileWordDetector.java
new file mode 100644
index 0000000000..3008721743
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileWordDetector.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+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/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MessageLine.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MessageLine.java
new file mode 100644
index 0000000000..367c9ed9f5
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MessageLine.java
@@ -0,0 +1,132 @@
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * QNX Software System
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+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
+ * <code>clearErrorMessage</code> 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 <code>null</code> is returned.
+ */
+ public String getErrorMessage() {
+ return fErrorText;
+ }
+ /**
+ * Get the currently displayed message.
+ * @return The message. If no message is displayed <code>null<code> 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/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/NotParallelRule.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/NotParallelRule.java
new file mode 100644
index 0000000000..5650725da9
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/NotParallelRule.java
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import org.eclipse.cdt.make.core.makefile.gnu.INotParallelRule;
+
+
+/**
+ * .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(GNUMakefileConstants.RULE_NOT_PARALLEL), reqs, new Command[0]);
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/NullMakefile.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/NullMakefile.java
new file mode 100644
index 0000000000..6a5acbaee9
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/NullMakefile.java
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import java.io.IOException;
+import java.io.Reader;
+import java.net.URI;
+
+import org.eclipse.cdt.make.core.makefile.IDirective;
+
+/**
+ * Makefile : ( statement ) *
+ * statement : rule | macro_definition | comments | empty
+ * rule : inference_rule | target_rule
+ * inference_rule : target ':' <nl> ( <tab> command <nl> ) +
+ * target_rule : target [ ( target ) * ] ':' [ ( prerequisite ) * ] [ ';' command ] <nl>
+ [ ( command ) * ]
+ * macro_definition : string '=' (string)*
+ * comments : ('#' (string) <nl>) *
+ * empty : <nl>
+ * command : <tab> prefix_command string <nl>
+ * target : string
+ * prefix_command : '-' | '@' | '+'
+ * internal_macro : "$<" | "$*" | "$@" | "$?" | "$%"
+ */
+
+public class NullMakefile extends AbstractMakefile {
+
+ public final static IDirective[] EMPTY_DIRECTIVES = new IDirective[0];
+
+ public NullMakefile() {
+ super(null);
+ }
+
+ public IDirective[] getDirectives() {
+ return EMPTY_DIRECTIVES;
+ }
+
+ public IDirective[] getBuiltins() {
+ return EMPTY_DIRECTIVES;
+ }
+
+ 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(String name, Reader makefile) throws IOException {
+ }
+
+ public void parse(URI fileURI, Reader reader) throws IOException {
+ }
+
+ protected void parse(URI fileURI, MakefileReader reader) throws IOException {
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/OpenDeclarationAction.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/OpenDeclarationAction.java
new file mode 100644
index 0000000000..aaeab02880
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/OpenDeclarationAction.java
@@ -0,0 +1,130 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Red Hat Inc. - convert to use with Automake editor
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import java.net.URI;
+
+import org.eclipse.cdt.core.resources.FileStorage;
+import org.eclipse.cdt.make.core.makefile.IDirective;
+import org.eclipse.cdt.make.core.makefile.IMakefile;
+import org.eclipse.cdt.make.ui.IWorkingCopyManager;
+import org.eclipse.core.filesystem.URIUtil;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IStorage;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ITextSelection;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.linuxtools.cdt.autotools.ui.AutotoolsUIPlugin;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.MakeUIMessages;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IStorageEditorInput;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.ide.IDE;
+import org.eclipse.ui.texteditor.IDocumentProvider;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.ui.texteditor.TextEditorAction;
+
+
+public class OpenDeclarationAction extends TextEditorAction {
+
+ public OpenDeclarationAction() {
+ this(null);
+ }
+
+ public OpenDeclarationAction(ITextEditor editor) {
+ super(MakeUIMessages.getResourceBundle(), "OpenDeclarationAction.", editor); //$NON-NLS-1$
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.action.IAction#run()
+ */
+ public void run() {
+ ITextEditor editor = getTextEditor();
+ if (editor == null) {
+ return;
+ }
+ ISelectionProvider provider = editor.getSelectionProvider();
+ if (provider == null) {
+ return;
+ }
+ IDirective[] directives = null;
+ IWorkingCopyManager fManager = AutomakeEditorFactory.getDefault().getWorkingCopyManager();
+ IMakefile makefile = fManager.getWorkingCopy(editor.getEditorInput());
+ if (makefile != null) {
+ IDocumentProvider prov = editor.getDocumentProvider();
+ IDocument doc = prov.getDocument(editor.getEditorInput());
+ try {
+ ITextSelection textSelection = (ITextSelection) provider.getSelection();
+ int offset = textSelection.getOffset();
+ WordPartDetector wordPart = new WordPartDetector(doc, textSelection.getOffset());
+ String name = wordPart.toString();
+ if (WordPartDetector.inMacro(doc, offset)) {
+ directives = makefile.getMacroDefinitions(name);
+ if (directives.length == 0) {
+ directives = makefile.getBuiltinMacroDefinitions(name);
+ }
+ } else {
+ directives = makefile.getTargetRules(name);
+ }
+ if (directives != null && directives.length > 0) {
+ openInEditor(directives[0]);
+ }
+ } catch (Exception x) {
+ //
+ }
+ }
+ }
+
+ private static IEditorPart openInEditor(IDirective directive) throws PartInitException {
+ URI fileURI = directive.getMakefile().getFileURI();
+ IPath path = URIUtil.toPath(fileURI);
+ IFile file = AutotoolsUIPlugin.getWorkspace().getRoot().getFileForLocation(path);
+ if (file != null) {
+ IWorkbenchPage p = AutotoolsUIPlugin.getActivePage();
+ if (p != null) {
+ IEditorPart editorPart = IDE.openEditor(p, file, true);
+ if (editorPart instanceof MakefileEditor) {
+ ((MakefileEditor)editorPart).setSelection(directive, true);
+ }
+ return editorPart;
+ }
+ } else {
+ // External file
+ IStorage storage = new FileStorage(path);
+ IStorageEditorInput input = new ExternalEditorInput(storage);
+ IWorkbenchPage p = AutotoolsUIPlugin.getActivePage();
+ if (p != null) {
+ String editorID = "org.eclipse.cdt.make.editor"; //$NON-NLS-1$
+ IEditorPart editorPart = IDE.openEditor(p, input, editorID, true);
+ if (editorPart instanceof MakefileEditor) {
+ ((MakefileEditor)editorPart).setSelection(directive, true);
+ }
+ return editorPart;
+ }
+
+ }
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.ui.actions.SelectionDispatchAction#selectionChanged(org.eclipse.jface.text.ITextSelection)
+ */
+ //public void selectionChanged(ITextSelection selection) {
+ //setEnabled(fEditor != null);
+ //}
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/OpenIncludeAction.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/OpenIncludeAction.java
new file mode 100644
index 0000000000..eabaa06b9d
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/OpenIncludeAction.java
@@ -0,0 +1,303 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * QNX Software System
+ * Sergey Prigogin, Google - https://bugs.eclipse.org/bugs/show_bug.cgi?id=13221
+ * Ed Swartz (Nokia)
+ * Anton Leherbauer (Wind River Systems)
+ * Red Hat Inc. - convert to use with Automake editor
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.HashSet;
+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.model.IInclude;
+import org.eclipse.cdt.core.parser.ExtendedScannerInfo;
+import org.eclipse.cdt.core.parser.IExtendedScannerInfo;
+import org.eclipse.cdt.core.parser.IScannerInfo;
+import org.eclipse.cdt.core.parser.IScannerInfoProvider;
+import org.eclipse.cdt.ui.CUIPlugin;
+import org.eclipse.cdt.utils.PathUtil;
+import org.eclipse.core.filesystem.URIUtil;
+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.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+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.linuxtools.internal.cdt.autotools.ui.MakeUIImages;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.MessageBox;
+
+
+
+public class OpenIncludeAction extends Action {
+
+
+ private static final String PREFIX= "OpenIncludeAction."; //$NON-NLS-1$
+
+ private static final String DIALOG_TITLE= PREFIX + "dialog.title"; //$NON-NLS-1$
+ private static final String DIALOG_MESSAGE= PREFIX + "dialog.message"; //$NON-NLS-1$
+
+ private ISelectionProvider fSelectionProvider;
+
+
+ public OpenIncludeAction(ISelectionProvider provider) {
+ super(CUIPlugin.getResourceString(PREFIX + "label")); //$NON-NLS-1$
+ setDescription(CUIPlugin.getResourceString(PREFIX + "description")); //$NON-NLS-1$
+ setToolTipText(CUIPlugin.getResourceString(PREFIX + "tooltip")); //$NON-NLS-1$
+
+ MakeUIImages.setImageDescriptors(this, MakeUIImages.T_LCL, MakeUIImages.IMG_MENU_OPEN_INCLUDE);
+
+ fSelectionProvider= provider;
+ }
+
+ public void run() {
+ IInclude include= getIncludeStatement(fSelectionProvider.getSelection());
+ if (include == null) {
+ return;
+ }
+
+ try {
+ IResource res = include.getUnderlyingResource();
+ ArrayList<Object> filesFound = new ArrayList<Object>(4);
+ String fullFileName= include.getFullFileName();
+ if (fullFileName != null) {
+ IPath fullPath= new Path(fullFileName);
+ if (fullPath.isAbsolute() && fullPath.toFile().exists()) {
+ filesFound.add(fullPath);
+ }
+ }
+ if (filesFound.isEmpty() && 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) {
+ IExtendedScannerInfo scanInfo = new ExtendedScannerInfo(info);
+
+ boolean isSystemInclude = include.isStandard();
+
+ if (!isSystemInclude) {
+ // search in current directory
+ IPath location= include.getTranslationUnit().getLocation();
+ if (location != null) {
+ String currentDir= location.removeLastSegments(1).toOSString();
+ findFile(new String[] { currentDir }, includeName, filesFound);
+ }
+ if (filesFound.isEmpty()) {
+ // search in "..." include directories
+ String[] localIncludePaths = scanInfo.getLocalIncludePath();
+ findFile(localIncludePaths, includeName, filesFound);
+ }
+ }
+
+ if (filesFound.isEmpty()) {
+ // search in <...> include directories
+ String[] includePaths = scanInfo.getIncludePaths();
+ findFile(includePaths, includeName, filesFound);
+ }
+ }
+
+ if (filesFound.isEmpty()) {
+ // Fall back and search the project
+ findFile(proj, new Path(includeName), filesFound);
+ }
+ }
+ }
+ IPath fileToOpen;
+ int nElementsFound= filesFound.size();
+ if (nElementsFound == 0) {
+ noElementsFound();
+ fileToOpen= null;
+ } else if (nElementsFound == 1) {
+ fileToOpen= (IPath) filesFound.get(0);
+ } else {
+ fileToOpen= chooseFile(filesFound);
+ }
+
+ if (fileToOpen != null) {
+ EditorUtility.openInEditor(fileToOpen, include);
+ }
+ } catch (CModelException e) {
+ CUIPlugin.log(e.getStatus());
+ } catch (CoreException e) {
+ CUIPlugin.log(e.getStatus());
+ }
+ }
+
+ /**
+ *
+ */
+ private void noElementsFound() {
+ MessageBox errorMsg = new MessageBox(CUIPlugin.getActiveWorkbenchShell(), SWT.ICON_ERROR | SWT.OK);
+ errorMsg.setText(CUIPlugin.getResourceString("OpenIncludeAction.error")); //$NON-NLS-1$
+ errorMsg.setMessage (CUIPlugin.getResourceString("OpenIncludeAction.error.description")); //$NON-NLS-1$
+ errorMsg.open();
+ }
+
+ private boolean isInProject(IPath path) {
+ return getWorkspaceRoot().getFileForLocation(path) != null;
+ }
+
+ /**
+ * Returns the path as is, if it points to a workspace resource. If the path
+ * does not point to a workspace resource, but there are linked workspace
+ * resources pointing to it, returns the paths of these resources.
+ * Othervise, returns the path as is.
+ */
+ private IPath[] resolveIncludeLink(IPath path) {
+ if (!isInProject(path)) {
+ IFile[] files = getWorkspaceRoot().findFilesForLocationURI(URIUtil.toURI(path));
+ if (files.length > 0) {
+ IPath[] paths = new IPath[files.length];
+ for (int i = 0; i < files.length; i++) {
+ paths[i] = files[i].getFullPath();
+ }
+ return paths;
+ }
+ }
+
+ return new IPath[] { path };
+ }
+
+ private IWorkspaceRoot getWorkspaceRoot() {
+ return ResourcesPlugin.getWorkspace().getRoot();
+ }
+
+ private void findFile(String[] includePaths, String name, ArrayList<Object> list)
+ throws CoreException {
+ // in case it is an absolute path
+ IPath includeFile= new Path(name);
+ if (includeFile.isAbsolute()) {
+ includeFile = PathUtil.getCanonicalPath(includeFile);
+ if (includeFile.toFile().exists()) {
+ list.add(includeFile);
+ return;
+ }
+ }
+ HashSet<IPath> foundSet = new HashSet<IPath>();
+ for (int i = 0; i < includePaths.length; i++) {
+ IPath path = PathUtil.getCanonicalPath(new Path(includePaths[i]).append(includeFile));
+ File file = path.toFile();
+ if (file.exists()) {
+ IPath[] paths = resolveIncludeLink(path);
+ for (int j = 0; j < paths.length; j++) {
+ IPath p = paths[j];
+ if (foundSet.add(p)) {
+ list.add(p);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Recuse in the project.
+ * @param parent
+ * @param name
+ * @param list
+ * @throws CoreException
+ */
+ private void findFile(IContainer parent, final IPath name, final ArrayList<Object> list) throws CoreException {
+ parent.accept(new IResourceProxyVisitor() {
+
+ public boolean visit(IResourceProxy proxy) throws CoreException {
+ if (proxy.getType() == IResource.FILE && proxy.getName().equalsIgnoreCase(name.lastSegment())) {
+ IPath rPath = proxy.requestResource().getLocation();
+ int numSegToRemove = rPath.segmentCount() - name.segmentCount();
+ IPath sPath = rPath.removeFirstSegments(numSegToRemove);
+ sPath = sPath.setDevice(name.getDevice());
+ if (Platform.getOS().equals(Platform.OS_WIN32) ?
+ sPath.toOSString().equalsIgnoreCase(name.toOSString()) :
+ sPath.equals(name)) {
+ list.add(rPath);
+ }
+ return false;
+ }
+ return true;
+ }
+ }, 0);
+ }
+
+
+ private IPath chooseFile(ArrayList<Object> filesFound) {
+ ILabelProvider renderer= new LabelProvider() {
+ public String getText(Object element) {
+ if (element instanceof IPath) {
+ IPath file= (IPath)element;
+ return file.lastSegment() + " - " + file.toString(); //$NON-NLS-1$
+ }
+ return super.getText(element);
+ }
+ };
+
+ ElementListSelectionDialog dialog= new ElementListSelectionDialog(CUIPlugin.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;
+ }
+
+
+ @SuppressWarnings("unchecked")
+ private static IInclude 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 IInclude) {
+ return (IInclude)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;
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/OverrideDefine.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/OverrideDefine.java
new file mode 100644
index 0000000000..ff0ed3cfd1
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/OverrideDefine.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+
+public class OverrideDefine extends DefineVariable {
+
+ public OverrideDefine(Directive parent, String name, StringBuffer value) {
+ super(parent, name, value);
+ }
+
+ public String toString() {
+ StringBuffer sb = new StringBuffer(GNUMakefileConstants.VARIABLE_OVERRIDE + " " + GNUMakefileConstants.VARIABLE_DEFINE); //$NON-NLS-1$
+ sb.append(getName()).append('\n');
+ sb.append(getValue());
+ sb.append(GNUMakefileConstants.TERMINAL_ENDEF);
+ return sb.toString();
+ }
+
+ public boolean isOverride() {
+ return true;
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/OverrideVariable.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/OverrideVariable.java
new file mode 100644
index 0000000000..5fcfe6f4de
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/OverrideVariable.java
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006, 2007 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ * Red Hat Inc. - Modified for Automake usage
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+public class OverrideVariable extends GNUVariableDef {
+
+ public OverrideVariable(Directive parent, String name, StringBuffer value, int type) {
+ super(parent, name, value, type);
+ }
+
+ public boolean isOverride() {
+ return true;
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Parent.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Parent.java
new file mode 100644
index 0000000000..e9f4d38968
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Parent.java
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+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<IDirective> children = new ArrayList<IDirective>();
+
+ public Parent(Directive parent) {
+ super(parent);
+ }
+
+ public IDirective[] getDirectives(boolean expand) {
+ return getDirectives();
+ }
+
+ 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/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/PhonyRule.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/PhonyRule.java
new file mode 100644
index 0000000000..999c9e070f
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/PhonyRule.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import org.eclipse.cdt.make.core.makefile.gnu.IPhonyRule;
+
+
+/**
+ * .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(GNUMakefileConstants.RULE_PHONY), reqs, new Command[0]);
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/PosixMakefileUtil.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/PosixMakefileUtil.java
new file mode 100644
index 0000000000..9932c0196b
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/PosixMakefileUtil.java
@@ -0,0 +1,159 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ */
+public class PosixMakefileUtil {
+
+ public static String[] findPrerequisites(String line) {
+ return findTargets(line);
+ }
+
+ public static String[] findTargets(String line) {
+ List<String> aList = new ArrayList<String>();
+ int space;
+ // Trim away trailing and prepending spaces.
+ line = line.trim();
+ while ((space = Util.indexOf(line, " \t")) != -1) { //$NON-NLS-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(".")) { //$NON-NLS-1$
+ int index = Util.indexOf(line, ':');
+ if (index > 1) {
+ line = line.substring(index + 1).trim();
+ if (line.length() == 0 || line.equals(";")) { //$NON-NLS-1$
+ 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(MakeFileConstants.RULE_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(MakeFileConstants.RULE_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(MakeFileConstants.RULE_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(MakeFileConstants.RULE_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(MakeFileConstants.RULE_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(MakeFileConstants.RULE_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(MakeFileConstants.RULE_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/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/PosixRule.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/PosixRule.java
new file mode 100644
index 0000000000..0114479920
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/PosixRule.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+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(MakeFileConstants.RULE_POSIX), new String[0], new Command[0]);
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/PreciousRule.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/PreciousRule.java
new file mode 100644
index 0000000000..ef72f6dc2e
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/PreciousRule.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+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(MakeFileConstants.RULE_PRECIOUS), reqs, new Command[0]);
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ProjectionMakefileUpdater.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ProjectionMakefileUpdater.java
new file mode 100644
index 0000000000..61418d3f88
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ProjectionMakefileUpdater.java
@@ -0,0 +1,397 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 2006, 2007 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ * Red Hat Inc. - convert to use with Automake editor
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.cdt.make.core.makefile.IDirective;
+import org.eclipse.cdt.make.core.makefile.IMacroDefinition;
+import org.eclipse.cdt.make.core.makefile.IParent;
+import org.eclipse.cdt.make.core.makefile.IRule;
+import org.eclipse.cdt.make.core.makefile.gnu.IConditional;
+import org.eclipse.cdt.make.ui.IWorkingCopyManager;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.Position;
+import org.eclipse.jface.text.source.Annotation;
+import org.eclipse.jface.text.source.IAnnotationModel;
+import org.eclipse.jface.text.source.projection.IProjectionListener;
+import org.eclipse.jface.text.source.projection.ProjectionAnnotation;
+import org.eclipse.jface.text.source.projection.ProjectionAnnotationModel;
+import org.eclipse.jface.text.source.projection.ProjectionViewer;
+import org.eclipse.linuxtools.cdt.autotools.core.AutotoolsPlugin;
+import org.eclipse.ui.texteditor.IDocumentProvider;
+
+
+/**
+ * ProjectionMakefileUpdater
+ */
+public class ProjectionMakefileUpdater implements IProjectionListener {
+
+ private static class MakefileProjectionAnnotation extends ProjectionAnnotation {
+
+ private IDirective fDirective;
+ private boolean fIsComment;
+
+ public MakefileProjectionAnnotation(IDirective element, boolean isCollapsed, boolean isComment) {
+ super(isCollapsed);
+ fDirective = element;
+ fIsComment = isComment;
+ }
+
+ public IDirective getElement() {
+ return fDirective;
+ }
+
+ public void setElement(IDirective element) {
+ fDirective = element;
+ }
+
+ public boolean isComment() {
+ return fIsComment;
+ }
+ }
+
+
+ public void install(MakefileEditor editor, ProjectionViewer viewer) {
+ fEditor= editor;
+ fViewer= viewer;
+ fViewer.addProjectionListener(this);
+ }
+
+ public void uninstall() {
+ if (isInstalled()) {
+ projectionDisabled();
+ fViewer.removeProjectionListener(this);
+ fViewer= null;
+ fEditor= null;
+ }
+ }
+
+ protected boolean isInstalled() {
+ return fEditor != null;
+ }
+
+ private class ReconcilerParticipant implements IReconcilingParticipant {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake.IReconcilingParticipant#reconciled()
+ */
+ public void reconciled() {
+ processReconcile();
+ }
+ }
+
+ private IDocument fCachedDocument;
+ private MakefileEditor fEditor;
+ private IDirective fInput;
+ private ProjectionViewer fViewer;
+ private IReconcilingParticipant fParticipant;
+
+ private boolean fAllowCollapsing = false;
+ @SuppressWarnings("unused")
+ private boolean fCollapseMacroDef = false;
+ @SuppressWarnings("unused")
+ private boolean fCollapseRule = false;
+ @SuppressWarnings("unused")
+ private boolean fCollapseConditional = false;
+
+ /*
+ * @see org.eclipse.jface.text.source.projection.IProjectionListener#projectionEnabled()
+ */
+ public void projectionEnabled() {
+ // http://home.ott.oti.com/teams/wswb/anon/out/vms/index.html
+ // projectionEnabled messages are not always paired with projectionDisabled
+ // i.e. multiple enabled messages may be sent out.
+ // we have to make sure that we disable first when getting an enable
+ // message.
+ projectionDisabled();
+
+ initialize();
+ fParticipant= new ReconcilerParticipant();
+ fEditor.addReconcilingParticipant(fParticipant);
+ }
+
+ /*
+ * @see org.eclipse.jface.text.source.projection.IProjectionListener#projectionDisabled()
+ */
+ public void projectionDisabled() {
+ fCachedDocument= null;
+ if (fParticipant != null) {
+ fEditor.addReconcilingParticipant(fParticipant);
+ fParticipant= null;
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ public void initialize() {
+
+ if (!isInstalled())
+ return;
+
+ initializePreferences();
+
+ try {
+
+ IDocumentProvider provider= fEditor.getDocumentProvider();
+ fCachedDocument= provider.getDocument(fEditor.getEditorInput());
+ fAllowCollapsing= true;
+
+ IWorkingCopyManager manager= AutomakeEditorFactory.getDefault().getWorkingCopyManager();
+ fInput= manager.getWorkingCopy(fEditor.getEditorInput());
+
+ if (fInput != null) {
+ ProjectionAnnotationModel model= (ProjectionAnnotationModel) fEditor.getAdapter(ProjectionAnnotationModel.class);
+ if (model != null) {
+ Map additions= computeAdditions((IParent) fInput);
+ model.removeAllAnnotations();
+ model.replaceAnnotations(null, additions);
+ }
+ }
+
+ } finally {
+ fCachedDocument= null;
+ fAllowCollapsing= false;
+ }
+ }
+
+ private void initializePreferences() {
+ //FIXME: what to do with Makefile editor preferences
+ IPreferenceStore store = AutotoolsPlugin.getDefault().getPreferenceStore();
+ fCollapseMacroDef = store.getBoolean(MakefileEditorPreferenceConstants.EDITOR_FOLDING_MACRODEF);
+ fCollapseRule = store.getBoolean(MakefileEditorPreferenceConstants.EDITOR_FOLDING_RULE);
+ fCollapseConditional = store.getBoolean(MakefileEditorPreferenceConstants.EDITOR_FOLDING_CONDITIONAL);
+ }
+
+ private Map<MakefileProjectionAnnotation, Position> computeAdditions(IParent parent) {
+ Map<MakefileProjectionAnnotation, Position> map= new HashMap<MakefileProjectionAnnotation, Position>();
+ computeAdditions(parent.getDirectives(), map);
+ return map;
+ }
+
+ private void computeAdditions(IDirective[] elements, Map<MakefileProjectionAnnotation, Position> map) {
+ for (int i= 0; i < elements.length; i++) {
+ IDirective element= elements[i];
+
+ computeAdditions(element, map);
+
+ if (element instanceof IParent) {
+ IParent parent= (IParent) element;
+ computeAdditions(parent.getDirectives(), map);
+ }
+ }
+ }
+
+ private void computeAdditions(IDirective element, Map<MakefileProjectionAnnotation, Position> map) {
+
+ boolean createProjection= false;
+
+ if (element instanceof IConditional) {
+ createProjection= true;
+ } else if (element instanceof IMacroDefinition) {
+ createProjection= true;
+ } else if (element instanceof IRule) {
+ createProjection= true;
+ }
+
+ if (createProjection) {
+ Position position= createProjectionPosition(element);
+ if (position != null) {
+ map.put(new MakefileProjectionAnnotation(element, fAllowCollapsing, true), position);
+ }
+ }
+ }
+
+ private Position createProjectionPosition(IDirective element) {
+
+ if (fCachedDocument == null)
+ return null;
+
+ try {
+ int startLine= element.getStartLine() - 1;
+ int endLine= element.getEndLine() - 1;
+ if (startLine != endLine) {
+ int offset= fCachedDocument.getLineOffset(startLine);
+ int endOffset= fCachedDocument.getLineOffset(endLine + 1);
+ return new Position(offset, endOffset - offset);
+ }
+
+ } catch (BadLocationException x) {
+ }
+
+ return null;
+ }
+
+ public void processReconcile() {
+ if (!isInstalled())
+ return;
+
+ ProjectionAnnotationModel model= (ProjectionAnnotationModel) fEditor.getAdapter(ProjectionAnnotationModel.class);
+ if (model == null)
+ return;
+
+ try {
+ IDocumentProvider provider= fEditor.getDocumentProvider();
+ fCachedDocument= provider.getDocument(fEditor.getEditorInput());
+ fAllowCollapsing= false;
+
+ Map<MakefileProjectionAnnotation, Position> additions= new HashMap<MakefileProjectionAnnotation, Position>();
+ List<MakefileProjectionAnnotation> deletions= new ArrayList<MakefileProjectionAnnotation>();
+ List<MakefileProjectionAnnotation> updates= new ArrayList<MakefileProjectionAnnotation>();
+
+ Map<MakefileProjectionAnnotation, Position> updated= computeAdditions((IParent) fInput);
+ Map<IDirective, List<MakefileProjectionAnnotation>> previous= createAnnotationMap(model);
+
+
+ Iterator<MakefileProjectionAnnotation> e= updated.keySet().iterator();
+ while (e.hasNext()) {
+ MakefileProjectionAnnotation annotation= (MakefileProjectionAnnotation) e.next();
+ IDirective element= annotation.getElement();
+ Position position= (Position) updated.get(annotation);
+
+ List<MakefileProjectionAnnotation> annotations= previous.get(element);
+ if (annotations == null) {
+ additions.put(annotation, position);
+ } else {
+ Iterator<MakefileProjectionAnnotation> x= annotations.iterator();
+ while (x.hasNext()) {
+ MakefileProjectionAnnotation a= (MakefileProjectionAnnotation) x.next();
+ if (annotation.isComment() == a.isComment()) {
+ Position p= model.getPosition(a);
+ if (p != null && !position.equals(p)) {
+ p.setOffset(position.getOffset());
+ p.setLength(position.getLength());
+ updates.add(a);
+ }
+ x.remove();
+ break;
+ }
+ }
+
+ if (annotations.isEmpty())
+ previous.remove(element);
+ }
+ }
+
+ Iterator<List<MakefileProjectionAnnotation>> e2 = previous.values().iterator();
+ while (e.hasNext()) {
+ List<MakefileProjectionAnnotation> list= e2.next();
+ int size= list.size();
+ for (int i= 0; i < size; i++)
+ deletions.add(list.get(i));
+ }
+
+ match(model, deletions, additions, updates);
+
+ Annotation[] removals= new Annotation[deletions.size()];
+ deletions.toArray(removals);
+ Annotation[] changes= new Annotation[updates.size()];
+ updates.toArray(changes);
+ model.modifyAnnotations(removals, additions, changes);
+
+ } finally {
+ fCachedDocument= null;
+ fAllowCollapsing= true;
+ }
+ }
+
+ private void match(ProjectionAnnotationModel model, List<MakefileProjectionAnnotation> deletions,
+ Map<MakefileProjectionAnnotation, Position> additions, List<MakefileProjectionAnnotation> changes) {
+ if (deletions.isEmpty() || (additions.isEmpty() && changes.isEmpty()))
+ return;
+
+ List<MakefileProjectionAnnotation> newDeletions= new ArrayList<MakefileProjectionAnnotation>();
+ List<MakefileProjectionAnnotation> newChanges= new ArrayList<MakefileProjectionAnnotation>();
+
+ Iterator<MakefileProjectionAnnotation> deletionIterator= deletions.iterator();
+ outer: while (deletionIterator.hasNext()) {
+ MakefileProjectionAnnotation deleted= (MakefileProjectionAnnotation) deletionIterator.next();
+ Position deletedPosition= model.getPosition(deleted);
+ if (deletedPosition == null)
+ continue;
+
+ Iterator<MakefileProjectionAnnotation> changesIterator= changes.iterator();
+ while (changesIterator.hasNext()) {
+ MakefileProjectionAnnotation changed= (MakefileProjectionAnnotation) changesIterator.next();
+ if (deleted.isComment() == changed.isComment()) {
+ Position changedPosition= model.getPosition(changed);
+ if (changedPosition == null)
+ continue;
+
+ if (deletedPosition.getOffset() == changedPosition.getOffset()) {
+
+ deletedPosition.setLength(changedPosition.getLength());
+ deleted.setElement(changed.getElement());
+
+ deletionIterator.remove();
+ newChanges.add(deleted);
+
+ changesIterator.remove();
+ newDeletions.add(changed);
+
+ continue outer;
+ }
+ }
+ }
+
+ Iterator<MakefileProjectionAnnotation> additionsIterator= additions.keySet().iterator();
+ while (additionsIterator.hasNext()) {
+ MakefileProjectionAnnotation added= (MakefileProjectionAnnotation) additionsIterator.next();
+ if (deleted.isComment() == added.isComment()) {
+ Position addedPosition= (Position) additions.get(added);
+
+ if (deletedPosition.getOffset() == addedPosition.getOffset()) {
+
+ deletedPosition.setLength(addedPosition.getLength());
+ deleted.setElement(added.getElement());
+
+ deletionIterator.remove();
+ newChanges.add(deleted);
+
+ additionsIterator.remove();
+
+ break;
+ }
+ }
+ }
+ }
+
+ deletions.addAll(newDeletions);
+ changes.addAll(newChanges);
+ }
+
+ @SuppressWarnings("unchecked")
+ private Map<IDirective, List<MakefileProjectionAnnotation>> createAnnotationMap(IAnnotationModel model) {
+ Map<IDirective, List<MakefileProjectionAnnotation>> map= new HashMap<IDirective, List<MakefileProjectionAnnotation>>();
+ Iterator e= model.getAnnotationIterator();
+ while (e.hasNext()) {
+ Object annotation= e.next();
+ if (annotation instanceof MakefileProjectionAnnotation) {
+ MakefileProjectionAnnotation directive= (MakefileProjectionAnnotation) annotation;
+ List<MakefileProjectionAnnotation> list= map.get(directive.getElement());
+ if (list == null) {
+ list= new ArrayList<MakefileProjectionAnnotation>(2);
+ map.put(directive.getElement(), list);
+ }
+ list.add(directive);
+ }
+ }
+ return map;
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Rule.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Rule.java
new file mode 100644
index 0000000000..44b281a84f
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Rule.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+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<IDirective> cmds = new ArrayList<IDirective>(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/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/SccsGetRule.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/SccsGetRule.java
new file mode 100644
index 0000000000..c98f8c253c
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/SccsGetRule.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+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(MakeFileConstants.RULE_SCCS_GET), new String[0], cmds);
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/SecondaryRule.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/SecondaryRule.java
new file mode 100644
index 0000000000..c99a7701d9
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/SecondaryRule.java
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import org.eclipse.cdt.make.core.makefile.gnu.ISecondaryRule;
+
+
+/**
+ * .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(GNUMakefileConstants.RULE_SECONDARY), reqs, new Command[0]);
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/SelectionList.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/SelectionList.java
new file mode 100644
index 0000000000..c28288336b
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/SelectionList.java
@@ -0,0 +1,252 @@
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * QNX Software System
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.viewers.ILabelProvider;
+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;
+
+/**
+ * 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 <code>setElements</code>. The list doesn't contain the rendered strings.
+ */
+ public List<Object> getSelection() {
+ if (fList == null || fList.isDisposed() || fList.getSelectionCount() == 0)
+ return new ArrayList<Object>(0);
+ int[] listSelection= fList.getSelectionIndices();
+ List<Object> selected= new ArrayList<Object>(listSelection.length);
+ for (int i= 0; i < listSelection.length; i++) {
+ selected.add(fElements[fFilteredElements[listSelection[i]]]);
+ }
+ return selected;
+ }
+ /**
+ * Returns <code>true</code> 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<Object> 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/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/SelectionStatusDialog.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/SelectionStatusDialog.java
new file mode 100644
index 0000000000..f480531efa
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/SelectionStatusDialog.java
@@ -0,0 +1,195 @@
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * QNX Software System
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+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 <code>null<code>
+ * if there isn't any initial selection.
+ * @return the first element of the initial selection.
+ */
+ @SuppressWarnings("unchecked")
+ 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 <code>null</code>
+ * if no element has been selected.
+ *
+ * @return the first result element if one exists. Otherwise <code>null</code> 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;
+ }
+ @SuppressWarnings("unchecked")
+ 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 <code>true</code> status line is placed above buttons; if
+ * <code>false</code> 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/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/SilentRule.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/SilentRule.java
new file mode 100644
index 0000000000..91c7d0141f
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/SilentRule.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+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(MakeFileConstants.RULE_SILENT), reqs, new Command[0]);
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/SpecialRule.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/SpecialRule.java
new file mode 100644
index 0000000000..079605ce2d
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/SpecialRule.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+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/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/StaticTargetRule.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/StaticTargetRule.java
new file mode 100644
index 0000000000..21877de766
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/StaticTargetRule.java
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import org.eclipse.cdt.make.core.makefile.ICommand;
+import org.eclipse.cdt.make.core.makefile.IInferenceRule;
+
+
+/**
+ * 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/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/StatusInfo.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/StatusInfo.java
new file mode 100644
index 0000000000..b73de9450c
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/StatusInfo.java
@@ -0,0 +1,148 @@
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * QNX Software System
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import org.eclipse.core.runtime.IStatus;
+
+import org.eclipse.cdt.ui.CUIPlugin;
+
+/**
+ * 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 {
+
+ public static final IStatus OK_STATUS= new StatusInfo();
+
+ private String fStatusMessage;
+ private int fSeverity;
+
+ /**
+ * Creates a status set to OK (no message)
+ */
+ public StatusInfo() {
+ this(OK, null);
+ }
+
+ /**
+ * Creates a status .
+ * @param severity The status severity: ERROR, WARNING, INFO and OK.
+ * @param message The message of the status. Applies only for ERROR,
+ * WARNING and INFO.
+ */
+ public StatusInfo(int severity, String message) {
+ fStatusMessage= message;
+ fSeverity= severity;
+ }
+
+ /**
+ * @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 CUIPlugin.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;
+ }
+
+ /**
+ * Returns a string representation of the status, suitable
+ * for debugging purposes only.
+ */
+ public String toString() {
+ StringBuffer buf = new StringBuffer();
+ buf.append("StatusInfo "); //$NON-NLS-1$
+ if (fSeverity == OK) {
+ buf.append("OK"); //$NON-NLS-1$
+ } else if (fSeverity == ERROR) {
+ buf.append("ERROR"); //$NON-NLS-1$
+ } else if (fSeverity == WARNING) {
+ buf.append("WARNING"); //$NON-NLS-1$
+ } else if (fSeverity == INFO) {
+ buf.append("INFO"); //$NON-NLS-1$
+ } else {
+ buf.append("severity="); //$NON-NLS-1$
+ buf.append(fSeverity);
+ }
+ buf.append(": "); //$NON-NLS-1$
+ buf.append(fStatusMessage);
+ return buf.toString();
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/StatusTool.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/StatusTool.java
new file mode 100644
index 0000000000..0d849c90d7
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/StatusTool.java
@@ -0,0 +1,77 @@
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+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;
+ }
+ 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/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/StringMatcher.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/StringMatcher.java
new file mode 100644
index 0000000000..880f3a4737
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/StringMatcher.java
@@ -0,0 +1,389 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * QNX Software System
+ * Markus Schorn (Wind River Systems)
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+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 <code>start</code)(inclusive)
+ * and <code>end</code>(exclusive).
+ * @param text the String object to search in
+ * @param start the starting index of the search range, inclusive
+ * @param end the ending index of the search range, exclusive
+ * @return an <code>StringMatcher.Position</code> object that keeps the starting
+ * (inclusive) and ending positions (exclusive) of the first occurrence of the
+ * pattern in the specified range of the text; return null if not found or subtext
+ * is empty (start==end). A pair of zeros is returned if pattern is empty string
+ * Note that for pattern like "*abc*" with leading and trailing stars, position of "abc"
+ * is returned. For a pattern like"*??*" in text "abcdf", (1,3) is returned
+ */
+
+ public StringMatcher.Position find(String text, int start, int end) {
+ if (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) {
+ char[] chars= aPattern.toCharArray();
+ for (int i = 0; i < chars.length; i++) {
+ chars[i]= Character.toUpperCase(chars[i]);
+ }
+ fPattern= new String(chars);
+ } else {
+ fPattern= aPattern;
+ }
+
+ if (fIgnoreWildCards) {
+ parseNoWildCards();
+ } else {
+ parseWildCards();
+ }
+ }
+ /**
+ * Given the starting (inclusive) and the ending (exclusive) poisitions in the
+ * <code>text</code>, determine if the given substring matches with aPattern
+ * @return true if the specified portion of the text matches the pattern
+ * @param text a String object that contains the substring to match
+ * @param start marks the starting position (inclusive) of the substring
+ * @param end marks the ending index (exclusive) of the substring
+ */
+ public boolean match(String text, int start, int end) {
+ if (null == 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;
+ }
+ ++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 <code>text</code> 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.
+ */
+ 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<String> temp= new Vector<String>();
+
+ int pos= 0;
+ StringBuffer buf= new StringBuffer();
+ while (pos < fLength) {
+ char c= fPattern.charAt(pos++);
+ switch (c) {
+ case '\\' :
+ if (pos >= fLength) {
+ buf.append(c);
+ } else {
+ char next= fPattern.charAt(pos++);
+ /* if it's an escape sequence */
+ if (next == '*' || next == '?' || next == '\\') {
+ buf.append(next);
+ } else {
+ /* not an escape sequence, just insert literally */
+ buf.append(c);
+ buf.append(next);
+ }
+ }
+ break;
+ case '*' :
+ if (buf.length() > 0) {
+ /* new segment */
+ temp.addElement(buf.toString());
+ fBound += buf.length();
+ buf.setLength(0);
+ }
+ break;
+ case '?' :
+ /* append special character representing single match wildcard */
+ buf.append(fSingleWildCard);
+ break;
+ default :
+ buf.append(c);
+ }
+ }
+
+ /* add last buffer to segment list */
+ if (buf.length() > 0) {
+ temp.addElement(buf.toString());
+ fBound += buf.length();
+ }
+
+ fSegments= new String[temp.size()];
+ temp.copyInto(fSegments);
+ }
+ /**
+ * @param text a string which contains no wildcard
+ * @param start the starting index in the text for search, inclusive
+ * @param end the stopping point of search, exclusive
+ * @return the starting index in the text of the pattern , or -1 if not found
+ */
+ protected int posIn(String text, int start, int end) { //no wild card in pattern
+ int max= end - fLength;
+
+ if (!fIgnoreCase) {
+ int i= text.indexOf(fPattern, start);
+ if (i == -1 || i > max)
+ return -1;
+ return i;
+ }
+
+ for (int i= start; i <= max; ++i) {
+ if (text.regionMatches(true, i, fPattern, 0, fLength))
+ return i;
+ }
+
+ return -1;
+ }
+ /**
+ * @param text a simple regular expression that may only contain '?'(s)
+ * @param start the starting index in the text for search, inclusive
+ * @param end the stopping point of search, exclusive
+ * @param p a simple regular expression that may contains '?'
+ * @return the starting index in the text of the pattern , or -1 if not found
+ */
+ protected int regExpPosIn(String text, int start, int end, String p) {
+ int plen= p.length();
+
+ int max= end - plen;
+ for (int i= start; i <= max; ++i) {
+ if (regExpRegionMatches(text, i, p, 0, plen))
+ return i;
+ }
+ return -1;
+ }
+
+ 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 p a string that has no wildcard
+ * @return the starting index in the text of the pattern , or -1 if not found
+ */
+ protected int textPosIn(String text, int start, int end, String p) {
+
+ int plen= p.length();
+ int max= end - plen;
+
+ if (!fIgnoreCase) {
+ int i= text.indexOf(p, start);
+ if (i == -1 || i > max)
+ return -1;
+ return i;
+ }
+
+ for (int i= 0; i <= max; ++i) {
+ if (text.regionMatches(true, i, p, 0, plen))
+ return i;
+ }
+
+ return -1;
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/SuffixesRule.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/SuffixesRule.java
new file mode 100644
index 0000000000..c9428421f5
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/SuffixesRule.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import org.eclipse.cdt.make.core.makefile.ISuffixesRule;
+
+/**
+ * .SUFFIXES
+ * Prerequisites of .SUFFIXES shall be appended to the list of known suffixes and are
+ * used in conjunction with the inference rules.
+ *
+ */
+public class SuffixesRule extends SpecialRule implements ISuffixesRule {
+
+ public SuffixesRule(Directive parent, String[] suffixes) {
+ super(parent, new Target(MakeFileConstants.RULE_SUFFIXES), suffixes, new Command[0]);
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Target.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Target.java
new file mode 100644
index 0000000000..1c56ccabf1
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Target.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+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/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/TargetRule.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/TargetRule.java
new file mode 100644
index 0000000000..76452a6db5
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/TargetRule.java
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+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 ':' <nl> ( <tab> command <nl> ) +
+ * target_rule : target [ ( target ) * ] ':' [ ( prerequisite ) * ] [ ';' command ] <nl>
+ [ ( <tab> prefix_command command ) * ]
+ * macro_definition : string '=' (string)*
+ * comments : '#' (string) *
+ * empty : <nl>
+ * command : string <nl>
+ * 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/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/TargetVariable.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/TargetVariable.java
new file mode 100644
index 0000000000..0e393e9c76
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/TargetVariable.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006, 2007 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ * Red Hat Inc. - modified for Automake usage
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+/**
+ * Here is the syntax of a static pattern rule:
+ *
+ * TARGETS ...: VARIABLE-ASSIGNMENT
+ * TARGETS ...: override VARIABLE-ASSIGNMENT
+ */
+public class TargetVariable extends GNUVariableDef {
+
+ 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/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Terminal.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Terminal.java
new file mode 100644
index 0000000000..17eca376c2
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Terminal.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import org.eclipse.cdt.make.core.makefile.gnu.ITerminal;
+
+public abstract 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() {
+ return "\n"; //$NON-NLS-1$
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/TwoArrayQuickSort.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/TwoArrayQuickSort.java
new file mode 100644
index 0000000000..96049ba986
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/TwoArrayQuickSort.java
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * Copyright (c) 2000 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * QNX Software System
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import org.eclipse.core.runtime.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;
+ 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/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/UnExport.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/UnExport.java
new file mode 100644
index 0000000000..d51301ecfc
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/UnExport.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import org.eclipse.cdt.make.core.makefile.gnu.IUnExport;
+
+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(GNUMakefileConstants.DIRECTIVE_UNEXPORT);
+ sb.append(' ').append(variable);
+ return sb.toString();
+ }
+
+ public String getVariable() {
+ return variable;
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Util.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Util.java
new file mode 100644
index 0000000000..be70536da8
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/Util.java
@@ -0,0 +1,86 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+/**
+ * Utility methods.
+ */
+public class Util {
+
+ private Util() {
+ }
+
+ public static boolean isCommand(String line) {
+ return line.length() > 1 && line.startsWith("\t"); //$NON-NLS-1$
+ }
+
+ public static boolean isEscapedLine(String line) {
+ return (line.endsWith("\\") && !line.endsWith("\\\\")); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ 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/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/VPath.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/VPath.java
new file mode 100644
index 0000000000..7a7f8f3990
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/VPath.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import org.eclipse.cdt.make.core.makefile.gnu.IVPath;
+
+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(GNUMakefileConstants.DIRECTIVE_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/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/VariableDefinition.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/VariableDefinition.java
new file mode 100644
index 0000000000..d23236c8fe
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/VariableDefinition.java
@@ -0,0 +1,131 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import org.eclipse.cdt.make.core.makefile.gnu.IVariableDefinition;
+
+/**
+ */
+public class VariableDefinition extends MacroDefinition implements IVariableDefinition {
+
+ /**
+ * ? is Conditional
+ * : is Simply-expanded
+ * + is append
+ * 0 is recursively-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); //$NON-NLS-1$
+ }
+
+ 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(": "); //$NON-NLS-1$
+ }
+ if (isOverride()) {
+ sb.append(GNUMakefileConstants.VARIABLE_OVERRIDE);
+ }
+ if (isMultiLine()) {
+ sb.append(GNUMakefileConstants.VARIABLE_DEFINE);
+ sb.append(' ');
+ sb.append(getName()).append('\n');
+ sb.append(getValue()).append('\n');
+ sb.append(GNUMakefileConstants.TERMINAL_ENDEF);
+ sb.append('\n');
+ } else {
+ if (isExport()) {
+ sb.append(GNUMakefileConstants.VARIABLE_EXPORT);
+ sb.append(' ');
+ }
+ sb.append(getName());
+ if (isRecursivelyExpanded()) {
+ sb.append(" = "); //$NON-NLS-1$
+ } else if (isSimplyExpanded()) {
+ sb.append(" := "); //$NON-NLS-1$
+ } else if (isConditional()) {
+ sb.append(" ?= "); //$NON-NLS-1$
+ } else if (isAppend()) {
+ sb.append(" += "); //$NON-NLS-1$
+ }
+ 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/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/WordPartDetector.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/WordPartDetector.java
new file mode 100644
index 0000000000..4075dc1ac0
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/WordPartDetector.java
@@ -0,0 +1,99 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITextViewer;
+
+/**
+ * Used to scan and detect for SQL keywords
+ */
+public class WordPartDetector {
+ String wordPart = ""; //$NON-NLS-1$
+ int offset;
+
+ /**
+ * WordPartDetector.
+ * @param viewer is a text viewer
+ * @param documentOffset into the SQL document
+ */
+ public WordPartDetector(ITextViewer viewer, int documentOffset) {
+ this(viewer.getDocument(), documentOffset);
+ }
+
+ /**
+ *
+ * @param doc
+ * @param documentOffset
+ */
+ public WordPartDetector(IDocument doc, int documentOffset) {
+ offset = documentOffset - 1;
+ int endOffset = documentOffset;
+ try {
+ IRegion region = doc.getLineInformationOfOffset(documentOffset);
+ int top = region.getOffset();
+ int bottom = region.getLength() + top;
+ 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 = doc.get(offset, endOffset - offset);
+ } catch (BadLocationException e) {
+ // do nothing
+ }
+ }
+
+ public static boolean inMacro(ITextViewer viewer, int offset) {
+ return inMacro(viewer.getDocument(), offset);
+ }
+
+ public static boolean inMacro(IDocument document, int offset) {
+ boolean isMacro = false;
+ // 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;
+ }
+
+
+ /**
+ * @return String
+ */
+ public String toString() {
+ return wordPart;
+ }
+
+ public int getOffset() {
+ return offset;
+ }
+
+ boolean isMakefileLetter(char c) {
+ return Character.isLetterOrDigit(c) || c == '_' || c == '.';
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/WorkingCopyManager.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/WorkingCopyManager.java
new file mode 100644
index 0000000000..7136c4d18a
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/WorkingCopyManager.java
@@ -0,0 +1,106 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+
+
+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.Assert;
+import org.eclipse.core.runtime.CoreException;
+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<IEditorInput, IMakefile> 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<IEditorInput, IMakefile>();
+ fMap.put(input, workingCopy);
+ }
+ }
+
+ /*
+ * @see org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake.IWorkingCopyManagerExtension#removeWorkingCopy(org.eclipse.ui.IEditorInput)
+ */
+ public void removeWorkingCopy(IEditorInput input) {
+ fMap.remove(input);
+ if (fMap.isEmpty())
+ fMap= null;
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/AbstractEditorPreferencePage.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/AbstractEditorPreferencePage.java
new file mode 100644
index 0000000000..62c659cd80
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/AbstractEditorPreferencePage.java
@@ -0,0 +1,328 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.preferences;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.text.MessageFormat;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.preferences.InstanceScope;
+import org.eclipse.jface.dialogs.DialogPage;
+import org.eclipse.jface.dialogs.IMessageProvider;
+import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.linuxtools.cdt.autotools.core.AutotoolsPlugin;
+import org.eclipse.linuxtools.cdt.autotools.ui.AutotoolsUIPlugin;
+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.graphics.Font;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.osgi.service.prefs.BackingStoreException;
+
+
+/**
+ * AbstraceMakeEditorPreferencePage
+ */
+public abstract class AbstractEditorPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
+ OverlayPreferenceStore fOverlayStore;
+
+ Map<Button, String> fCheckBoxes= new HashMap<Button, String>();
+ 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());
+ }
+ };
+
+ Map<Text, String> fTextFields= new HashMap<Text, String>();
+ private ModifyListener fTextFieldListener= new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ Text text= (Text) e.widget;
+ fOverlayStore.setValue((String) fTextFields.get(text), text.getText());
+ }
+ };
+
+ private Map<Text, Object> fNumberFields= new HashMap<Text, Object>();
+ private ModifyListener fNumberFieldListener= new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ numberFieldChanged((Text) e.widget);
+ }
+ };
+
+ public AbstractEditorPreferencePage() {
+ super();
+ setPreferenceStore(AutotoolsPlugin.getDefault().getPreferenceStore());
+ fOverlayStore= createOverlayStore();
+ }
+
+ protected abstract OverlayPreferenceStore createOverlayStore();
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
+ */
+ public void init(IWorkbench workbench) {
+ }
+
+ protected void initializeFields() {
+ Map<Button, String> checkBoxes= getCheckBoxes();
+ Map<Text, String> textFields= getTextFields();
+ Iterator<Button> e= checkBoxes.keySet().iterator();
+ while (e.hasNext()) {
+ Button b= (Button) e.next();
+ String key= (String) checkBoxes.get(b);
+ b.setSelection(getOverlayStore().getBoolean(key));
+ }
+
+ Iterator<Text> e2 = textFields.keySet().iterator();
+ while (e.hasNext()) {
+ Text t= (Text) e2.next();
+ String key= (String) textFields.get(t);
+ t.setText(getOverlayStore().getString(key));
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.IPreferencePage#performOk()
+ */
+ public boolean performOk() {
+ getOverlayStore().propagate();
+ InstanceScope scope = new InstanceScope();
+ try {
+ scope.getNode(AutotoolsPlugin.PLUGIN_ID).flush();
+ } catch (BackingStoreException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return true;
+ }
+
+ protected OverlayPreferenceStore getOverlayStore() {
+ return fOverlayStore;
+ }
+
+ protected OverlayPreferenceStore setOverlayStore() {
+ return fOverlayStore;
+ }
+
+ protected Map<Button, String> getCheckBoxes() {
+ return fCheckBoxes;
+ }
+
+ protected Map<Text, String> getTextFields() {
+ return fTextFields;
+ }
+
+ protected Map<Text, Object> getNumberFields() {
+ return fNumberFields;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.PreferencePage#performDefaults()
+ */
+ protected void performDefaults() {
+ getOverlayStore().loadDefaults();
+ initializeFields();
+ handleDefaults();
+ super.performDefaults();
+ }
+
+ protected abstract void handleDefaults();
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.IDialogPage#dispose()
+ */
+ public void dispose() {
+ if (getOverlayStore() != null) {
+ getOverlayStore().stop();
+ fOverlayStore= null;
+ }
+ super.dispose();
+ }
+
+ protected Button addCheckBox(Composite parent, String labelText, String key, int indentation) {
+ Button checkBox= new Button(parent, SWT.CHECK);
+ checkBox.setText(labelText);
+ checkBox.setFont(parent.getFont());
+
+ GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
+ gd.horizontalIndent= indentation;
+ gd.horizontalSpan= 2;
+ checkBox.setLayoutData(gd);
+ checkBox.addSelectionListener(fCheckBoxListener);
+
+ getCheckBoxes().put(checkBox, key);
+
+ return checkBox;
+ }
+
+ protected Control addTextField(Composite composite, String labelText, String key, int textLimit, int indentation, String[] errorMessages) {
+ Font font= composite.getFont();
+
+ Label label= new Label(composite, SWT.NONE);
+ label.setText(labelText);
+ label.setFont(font);
+ GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
+ gd.horizontalIndent= indentation;
+ label.setLayoutData(gd);
+
+ Text textControl= new Text(composite, SWT.BORDER | SWT.SINGLE);
+ textControl.setFont(font);
+ gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
+ gd.widthHint= convertWidthInCharsToPixels(textLimit + 1);
+ textControl.setLayoutData(gd);
+ textControl.setTextLimit(textLimit);
+ getTextFields().put(textControl, key);
+ if (errorMessages != null) {
+ getNumberFields().put(textControl, errorMessages);
+ textControl.addModifyListener(fNumberFieldListener);
+ } else {
+ textControl.addModifyListener(fTextFieldListener);
+ }
+
+ return textControl;
+ }
+
+ void numberFieldChanged(Text textControl) {
+ String number= textControl.getText();
+ IStatus status= validatePositiveNumber(number, (String[])getNumberFields().get(textControl));
+ if (!status.matches(IStatus.ERROR)) {
+ getOverlayStore().setValue((String) getTextFields().get(textControl), number);
+ }
+ updateStatus(status);
+ }
+
+ private IStatus validatePositiveNumber(String number, String[] errorMessages) {
+ StatusInfo status= new StatusInfo();
+ if (number.length() == 0) {
+ status.setError(errorMessages[0]);
+ } else {
+ try {
+ int value= Integer.parseInt(number);
+ if (value < 0)
+ status.setError(MessageFormat.format(errorMessages[1], new Object[]{number})); //$NON-NLS-1$
+ } catch (NumberFormatException e) {
+ status.setError(MessageFormat.format(errorMessages[1], new Object[]{number})); //$NON-NLS-1$
+ }
+ }
+ return status;
+ }
+
+ private void updateStatus(IStatus status) {
+ if (!status.matches(IStatus.ERROR)) {
+ Set<Text> keys= getNumberFields().keySet();
+ for (Iterator<Text> iter = keys.iterator(); iter.hasNext();) {
+ Text text = (Text) iter.next();
+ IStatus s= validatePositiveNumber(text.getText(), (String[])getNumberFields().get(text));
+ status= s.getSeverity() > status.getSeverity() ? s : status;
+ }
+ }
+ setValid(!status.matches(IStatus.ERROR));
+ applyToStatusLine(this, status);
+ }
+
+ /*
+ * Applies the status to the status line of a dialog page.
+ */
+ private void applyToStatusLine(DialogPage page, IStatus status) {
+ String message= status.getMessage();
+ switch (status.getSeverity()) {
+ case IStatus.OK:
+ page.setMessage(message, IMessageProvider.NONE);
+ page.setErrorMessage(null);
+ break;
+ case IStatus.WARNING:
+ page.setMessage(message, IMessageProvider.WARNING);
+ page.setErrorMessage(null);
+ break;
+ case IStatus.INFO:
+ page.setMessage(message, IMessageProvider.INFORMATION);
+ page.setErrorMessage(null);
+ break;
+ default:
+ if (message.length() == 0) {
+ message= null;
+ }
+ page.setMessage(null);
+ page.setErrorMessage(message);
+ break;
+ }
+ }
+
+ /**
+ * Returns an array of size 2:
+ * - first element is of type <code>Label</code>
+ * - second element is of type <code>Text</code>
+ * Use <code>getLabelControl</code> and <code>getTextControl</code> to get the 2 controls.
+ */
+ protected Control[] addLabelledTextField(Composite composite, String label, String key, int textLimit, int indentation, String[] errorMessages) {
+ Label labelControl= new Label(composite, SWT.NONE);
+ labelControl.setText(label);
+ labelControl.setFont(composite.getFont());
+ 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);
+ textControl.setFont(composite.getFont());
+ fTextFields.put(textControl, key);
+ if (errorMessages != null) {
+ fNumberFields.put(textControl, errorMessages);
+ textControl.addModifyListener(fNumberFieldListener);
+ } else {
+ textControl.addModifyListener(fTextFieldListener);
+ }
+
+ return new Control[]{labelControl, textControl};
+ }
+
+ protected String loadPreviewContentFromFile(String filename) {
+ String line;
+ String separator= System.getProperty("line.separator", "\n"); //$NON-NLS-1$ //$NON-NLS-2$
+ 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) {
+ AutotoolsUIPlugin.log(io);
+ } finally {
+ if (reader != null) {
+ try { reader.close(); } catch (IOException e) {}
+ }
+ }
+ return buffer.toString();
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/AutoconfEditorPreferencePage.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/AutoconfEditorPreferencePage.java
new file mode 100644
index 0000000000..487537b23c
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/AutoconfEditorPreferencePage.java
@@ -0,0 +1,591 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 2006, 2007 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ * Red Hat Inc. - modification to use with Autoconf editor
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.preferences;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.cdt.make.ui.IMakeHelpContextIds;
+import org.eclipse.cdt.ui.PreferenceConstants;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.jface.viewers.IColorProvider;
+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.linuxtools.cdt.autotools.ui.AutotoolsUIPlugin;
+import org.eclipse.swt.SWT;
+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.Combo;
+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;
+import org.eclipse.ui.model.WorkbenchViewerComparator;
+
+
+
+/**
+ * MakeEditorPreferencePage
+ * The page for setting the editor options.
+ */
+public class AutoconfEditorPreferencePage extends AbstractEditorPreferencePage {
+
+ private static String[] fACVersions = {"2.13", "2.59", "2.61"};
+ public static final String LATEST_AC_VERSION = fACVersions[fACVersions.length - 1];
+
+ private static String[] fAMVersions = {"1.4-p6", "1.9.5", "1.9.6"};
+ public static final String LATEST_AM_VERSION = fAMVersions[fAMVersions.length - 1];
+
+ /** The keys of the overlay store. */
+ private String[][] fSyntaxColorListModel;
+
+ private TableViewer fHighlightingColorListViewer;
+ private final List<HighlightingColorListItem> fHighlightingColorList= new ArrayList<HighlightingColorListItem>(5);
+
+ ColorEditor fAppearanceColorEditor;
+ Button fAppearanceColorDefault;
+ ColorEditor fSyntaxForegroundColorEditor;
+ ColorEditor fBackgroundColorEditor;
+ Button fBoldCheckBox;
+ Button fItalicCheckBox;
+
+ // folding
+ protected Button fFoldingCheckbox;
+
+ // version
+ protected Combo fACVersionCombo;
+ protected Combo fAMVersionCombo;
+
+ /**
+ * Item in the highlighting color list.
+ *
+ * @since 3.0
+ */
+ private class HighlightingColorListItem {
+ /** Display name */
+ private String fDisplayName;
+ /** Color preference key */
+ private String fColorKey;
+ /** Bold preference key */
+ private String fBoldKey;
+ /** Italic preference key */
+ private String fItalicKey;
+ /** Item color */
+ private Color fItemColor;
+
+ /**
+ * Initialize the item with the given values.
+ *
+ * @param displayName the display name
+ * @param colorKey the color preference key
+ * @param boldKey the bold preference key
+ * @param italicKey the italic preference key
+ * @param itemColor the item color
+ */
+ public HighlightingColorListItem(String displayName, String colorKey, String boldKey, String italicKey, Color itemColor) {
+ fDisplayName= displayName;
+ fColorKey= colorKey;
+ fBoldKey= boldKey;
+ fItalicKey= italicKey;
+ fItemColor= itemColor;
+ }
+
+ /**
+ * @return the bold preference key
+ */
+ public String getBoldKey() {
+ return fBoldKey;
+ }
+
+ /**
+ * @return the bold preference key
+ */
+ public String getItalicKey() {
+ return fItalicKey;
+ }
+
+ /**
+ * @return the color preference key
+ */
+ public String getColorKey() {
+ return fColorKey;
+ }
+
+ /**
+ * @return the display name
+ */
+ public String getDisplayName() {
+ return fDisplayName;
+ }
+
+ /**
+ * @return the item color
+ */
+ public Color getItemColor() {
+ return fItemColor;
+ }
+ }
+
+ /**
+ * Color list label provider.
+ *
+ * @since 3.0
+ */
+ private class ColorListLabelProvider extends LabelProvider implements IColorProvider {
+
+ /*
+ * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
+ */
+ public String getText(Object element) {
+ return ((HighlightingColorListItem)element).getDisplayName();
+ }
+
+ /*
+ * @see org.eclipse.jface.viewers.IColorProvider#getForeground(java.lang.Object)
+ */
+ public Color getForeground(Object element) {
+ return ((HighlightingColorListItem)element).getItemColor();
+ }
+
+ /*
+ * @see org.eclipse.jface.viewers.IColorProvider#getBackground(java.lang.Object)
+ */
+ public Color getBackground(Object element) {
+ return null;
+ }
+ }
+
+ /**
+ * Color list content provider.
+ *
+ * @since 3.0
+ */
+ private class ColorListContentProvider implements IStructuredContentProvider {
+
+ /*
+ * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
+ */
+ @SuppressWarnings("unchecked")
+ public Object[] getElements(Object inputElement) {
+ return ((List<Object>)inputElement).toArray();
+ }
+
+ /*
+ * @see org.eclipse.jface.viewers.IContentProvider#dispose()
+ */
+ public void dispose() {
+ }
+
+ /*
+ * @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) {
+ }
+ }
+
+
+
+ /**
+ *
+ */
+ public AutoconfEditorPreferencePage() {
+ super();
+ }
+
+ protected OverlayPreferenceStore createOverlayStore() {
+ fSyntaxColorListModel= new String[][] {
+ {AutotoolsPreferencesMessages.getString("AutoconfEditorPreferencePage.autoconf_editor_comment"), ColorManager.AUTOCONF_COMMENT_COLOR, null}, //$NON-NLS-1$
+ {AutotoolsPreferencesMessages.getString("AutoconfEditorPreferencePage.autoconf_editor_acmacro"), ColorManager.AUTOCONF_ACMACRO_COLOR, null}, //$NON-NLS-1$
+ {AutotoolsPreferencesMessages.getString("AutoconfEditorPreferencePage.autoconf_editor_ammacro"), ColorManager.AUTOCONF_AMMACRO_COLOR, null}, //$NON-NLS-1$
+ {AutotoolsPreferencesMessages.getString("AutoconfEditorPreferencePage.autoconf_editor_code_seq"), ColorManager.AUTOCONF_CODESEQ_COLOR, null}, //$NON-NLS-1$
+ {AutotoolsPreferencesMessages.getString("AutoconfEditorPreferencePage.autoconf_editor_keyword"), ColorManager.AUTOCONF_KEYWORD_COLOR, null}, //$NON-NLS-1$
+ {AutotoolsPreferencesMessages.getString("AutoconfEditorPreferencePage.autoconf_editor_var_ref"), ColorManager.AUTOCONF_VAR_REF_COLOR, null}, //$NON-NLS-1$
+ {AutotoolsPreferencesMessages.getString("AutoconfEditorPreferencePage.autoconf_editor_var_set"), ColorManager.AUTOCONF_VAR_SET_COLOR, null}, //$NON-NLS-1$
+ {AutotoolsPreferencesMessages.getString("AutoconfEditorPreferencePage.autoconf_editor_default"), ColorManager.AUTOCONF_DEFAULT_COLOR, null}, //$NON-NLS-1$
+ };
+ ArrayList<OverlayPreferenceStore.OverlayKey> overlayKeys= new ArrayList<OverlayPreferenceStore.OverlayKey>();
+
+ overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AutotoolsEditorPreferenceConstants.EDITOR_FOLDING_ENABLED));
+ overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AutotoolsEditorPreferenceConstants.EDITOR_FOLDING_CONDITIONAL));
+ overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AutotoolsEditorPreferenceConstants.EDITOR_FOLDING_MACRODEF));
+ overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AutotoolsEditorPreferenceConstants.EDITOR_FOLDING_RULE));
+ overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, AutotoolsEditorPreferenceConstants.AUTOCONF_VERSION));
+ overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, AutotoolsEditorPreferenceConstants.AUTOMAKE_VERSION));
+
+ for (int i= 0; i < fSyntaxColorListModel.length; i++) {
+ String colorKey= fSyntaxColorListModel[i][1];
+ addTextKeyToCover(overlayKeys, colorKey);
+ }
+
+ OverlayPreferenceStore.OverlayKey[] keys= new OverlayPreferenceStore.OverlayKey[overlayKeys.size()];
+ overlayKeys.toArray(keys);
+ return new OverlayPreferenceStore(getPreferenceStore(), keys);
+ }
+
+ private void addTextKeyToCover(ArrayList<OverlayPreferenceStore.OverlayKey> overlayKeys, String mainKey) {
+ overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, mainKey));
+ overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, mainKey + AutotoolsEditorPreferenceConstants.EDITOR_BOLD_SUFFIX));
+ overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, mainKey + AutotoolsEditorPreferenceConstants.EDITOR_ITALIC_SUFFIX));
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
+ */
+ protected Control createContents(Composite parent) {
+ AutotoolsUIPlugin.getDefault().getWorkbench().getHelpSystem().setHelp(getControl(), IMakeHelpContextIds.MAKE_EDITOR_PREFERENCE_PAGE);
+ getOverlayStore().load();
+ getOverlayStore().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(AutotoolsPreferencesMessages.getString("AutomakeEditorPreferencePage.syntax")); //$NON-NLS-1$
+ item.setControl(createSyntaxPage(folder));
+
+ item= new TabItem(folder, SWT.NONE);
+ item.setText(AutotoolsPreferencesMessages.getString("AutoconfEditorPreferencePage.folding")); //$NON-NLS-1$
+ item.setControl(createFoldingTabContent(folder));
+
+ // Allow end-user to select which version of autoconf to use for hover help
+ // and syntax checking of macros.
+ item= new TabItem(folder, SWT.NONE);
+ item.setText(AutotoolsPreferencesMessages.getString("AutoconfEditorPreferencePage.version")); //$NON-NLS-1$
+ item.setControl(createVersionTabContent(folder));
+
+ initialize();
+
+ applyDialogFont(folder);
+ return folder;
+ }
+
+ private void initialize() {
+
+ initializeFields();
+
+ for (int i= 0, n= fSyntaxColorListModel.length; i < n; i++) {
+ fHighlightingColorList.add(
+ new HighlightingColorListItem (fSyntaxColorListModel[i][0], fSyntaxColorListModel[i][1],
+ fSyntaxColorListModel[i][1] + AutotoolsEditorPreferenceConstants.EDITOR_BOLD_SUFFIX,
+ fSyntaxColorListModel[i][1] + AutotoolsEditorPreferenceConstants.EDITOR_ITALIC_SUFFIX, null));
+ }
+ fHighlightingColorListViewer.setInput(fHighlightingColorList);
+ fHighlightingColorListViewer.setSelection(new StructuredSelection(fHighlightingColorListViewer.getElementAt(0)));
+
+ for (int i=0, n= fACVersions.length; i < n; i++) {
+ fACVersionCombo.setItem(i, fACVersions[i]);
+ }
+
+ initializeFolding();
+ initializeACVersion();
+ initializeAMVersion();
+ }
+
+ void initializeFolding() {
+ boolean enabled= getOverlayStore().getBoolean(PreferenceConstants.EDITOR_FOLDING_ENABLED);
+ fFoldingCheckbox.setSelection(enabled);
+ }
+
+ void initializeACVersion() {
+ // FIXME: What do we do here? There is no PreferenceConstants value for this.
+ // Perhaps we should be using our own overlay store.
+ String version = getOverlayStore().getString(AutotoolsEditorPreferenceConstants.AUTOCONF_VERSION);
+ String[] items = fACVersionCombo.getItems();
+ // Try and find which list item matches the current preference stored and
+ // select it in the list.
+ int i;
+ for (i = 0; i < items.length; ++i) {
+ if (items[i].equals(version))
+ break;
+ }
+ if (i >= items.length)
+ i = items.length - 1;
+ fACVersionCombo.select(i);
+ }
+
+ void initializeAMVersion() {
+ // FIXME: What do we do here? There is no PreferenceConstants value for this.
+ // Perhaps we should be using our own overlay store.
+ String version = getOverlayStore().getString(AutotoolsEditorPreferenceConstants.AUTOMAKE_VERSION);
+ String[] items = fAMVersionCombo.getItems();
+ // Try and find which list item matches the current preference stored and
+ // select it in the list.
+ int i;
+ for (i = 0; i < items.length; ++i) {
+ if (items[i].equals(version))
+ break;
+ }
+ if (i >= items.length)
+ i = items.length - 1;
+ fAMVersionCombo.select(i);
+ }
+
+ void initializeDefaultFolding() {
+ boolean enabled= getOverlayStore().getDefaultBoolean(PreferenceConstants.EDITOR_FOLDING_ENABLED);
+ fFoldingCheckbox.setSelection(enabled);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.linuxtools.internal.cdt.autotools.ui.preferences.AbstractAutomakeEditorPreferencePage#handleDefaults()
+ */
+ protected void handleDefaults() {
+ handleSyntaxColorListSelection();
+ initializeDefaultFolding();
+ }
+
+ private Control createSyntaxPage(Composite parent) {
+
+ Composite colorComposite= new Composite(parent, SWT.NONE);
+ colorComposite.setLayout(new GridLayout());
+
+ Label label= new Label(colorComposite, SWT.LEFT);
+ label.setText(AutotoolsPreferencesMessages.getString("AutomakeEditorPreferencePage.Foreground")); //$NON-NLS-1$
+ label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ Composite editorComposite= new Composite(colorComposite, SWT.NONE);
+ GridLayout layout= new GridLayout();
+ layout.numColumns= 2;
+ layout.marginHeight= 0;
+ layout.marginWidth= 0;
+ editorComposite.setLayout(layout);
+ GridData gd= new GridData(GridData.FILL_BOTH);
+ editorComposite.setLayoutData(gd);
+
+ fHighlightingColorListViewer= new TableViewer(editorComposite, SWT.SINGLE | SWT.V_SCROLL | SWT.BORDER | SWT.FULL_SELECTION);
+ fHighlightingColorListViewer.setLabelProvider(new ColorListLabelProvider());
+ fHighlightingColorListViewer.setContentProvider(new ColorListContentProvider());
+ fHighlightingColorListViewer.setComparator(new WorkbenchViewerComparator());
+ gd= new GridData(GridData.FILL_BOTH);
+ gd.heightHint= convertHeightInCharsToPixels(5);
+ fHighlightingColorListViewer.getControl().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));
+
+ label= new Label(stylesComposite, SWT.LEFT);
+ label.setText(AutotoolsPreferencesMessages.getString("AutomakeEditorPreferencePage.color")); //$NON-NLS-1$
+ gd= new GridData();
+ gd.horizontalAlignment= GridData.BEGINNING;
+ label.setLayoutData(gd);
+
+ fSyntaxForegroundColorEditor= new ColorEditor(stylesComposite);
+ Button foregroundColorButton= fSyntaxForegroundColorEditor.getButton();
+ gd= new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalAlignment= GridData.BEGINNING;
+ foregroundColorButton.setLayoutData(gd);
+
+ fBoldCheckBox= new Button(stylesComposite, SWT.CHECK);
+ fBoldCheckBox.setText(AutotoolsPreferencesMessages.getString("AutomakeEditorPreferencePage.bold")); //$NON-NLS-1$
+ gd= new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalAlignment= GridData.BEGINNING;
+ gd.horizontalSpan= 2;
+ fBoldCheckBox.setLayoutData(gd);
+
+ fItalicCheckBox= new Button(stylesComposite, SWT.CHECK);
+ fItalicCheckBox.setText(AutotoolsPreferencesMessages.getString("AutomakeEditorPreferencePage.italic")); //$NON-NLS-1$
+ gd= new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalAlignment= GridData.BEGINNING;
+ gd.horizontalSpan= 2;
+ fItalicCheckBox.setLayoutData(gd);
+
+ fHighlightingColorListViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ handleSyntaxColorListSelection();
+ }
+ });
+
+ foregroundColorButton.addSelectionListener(new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) {
+ // do nothing
+ }
+ public void widgetSelected(SelectionEvent e) {
+ HighlightingColorListItem item= getHighlightingColorListItem();
+ PreferenceConverter.setValue(getOverlayStore(), item.getColorKey(), fSyntaxForegroundColorEditor.getColorValue());
+ }
+ });
+
+ fBoldCheckBox.addSelectionListener(new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) {
+ // do nothing
+ }
+ public void widgetSelected(SelectionEvent e) {
+ HighlightingColorListItem item= getHighlightingColorListItem();
+ getOverlayStore().setValue(item.getBoldKey(), fBoldCheckBox.getSelection());
+ }
+ });
+
+ fItalicCheckBox.addSelectionListener(new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) {
+ // do nothing
+ }
+ public void widgetSelected(SelectionEvent e) {
+ HighlightingColorListItem item= getHighlightingColorListItem();
+ getOverlayStore().setValue(item.getItalicKey(), fItalicCheckBox.getSelection());
+ }
+ });
+
+ return colorComposite;
+ }
+
+
+ private Composite createFoldingTabContent(TabFolder folder) {
+ Composite composite= new Composite(folder, SWT.NULL);
+ // assume parent page uses griddata
+ GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_CENTER | GridData.VERTICAL_ALIGN_FILL);
+ composite.setLayoutData(gd);
+ GridLayout layout= new GridLayout();
+ layout.numColumns= 2;
+ //PixelConverter pc= new PixelConverter(composite);
+ //layout.verticalSpacing= pc.convertHeightInCharsToPixels(1) / 2;
+ composite.setLayout(layout);
+
+
+ /* check box for new editors */
+ fFoldingCheckbox= new Button(composite, SWT.CHECK);
+ fFoldingCheckbox.setText(AutotoolsPreferencesMessages.getString("AutomakeEditorPreferencePage.foldingenable")); //$NON-NLS-1$
+ gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_BEGINNING);
+ fFoldingCheckbox.setLayoutData(gd);
+ fFoldingCheckbox.addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ boolean enabled= fFoldingCheckbox.getSelection();
+ getOverlayStore().setValue(AutotoolsEditorPreferenceConstants.EDITOR_FOLDING_ENABLED, enabled);
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+ });
+
+ return composite;
+ }
+
+ private Composite createVersionTabContent(TabFolder folder) {
+ Composite composite= new Composite(folder, SWT.NULL);
+ // assume parent page uses griddata
+ GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_CENTER | GridData.VERTICAL_ALIGN_FILL);
+ composite.setLayoutData(gd);
+ GridLayout layout= new GridLayout();
+ layout.numColumns= 2;
+ //PixelConverter pc= new PixelConverter(composite);
+ //layout.verticalSpacing= pc.convertHeightInCharsToPixels(1) / 2;
+ composite.setLayout(layout);
+
+
+ /* check box for new editors */
+ fACVersionCombo= new Combo(composite, SWT.CHECK | SWT.DROP_DOWN | SWT.READ_ONLY);
+ fACVersionCombo.setItems(fACVersions);
+ fACVersionCombo.select(fACVersions.length - 1);
+ gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_BEGINNING);
+ fACVersionCombo.setLayoutData(gd);
+ fACVersionCombo.addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ int index = fACVersionCombo.getSelectionIndex();
+ getOverlayStore().setValue(AutotoolsEditorPreferenceConstants.AUTOCONF_VERSION, fACVersionCombo.getItem(index));
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+ });
+
+ Label label= new Label(composite, SWT.LEFT);
+ label.setText(AutotoolsPreferencesMessages.getString("AutoconfEditorPreferencePage.autoconfVersion")); //$NON-NLS-1$
+ gd= new GridData();
+ gd.horizontalAlignment= GridData.BEGINNING;
+ label.setLayoutData(gd);
+
+ /* check box for new editors */
+ fAMVersionCombo= new Combo(composite, SWT.CHECK | SWT.DROP_DOWN | SWT.READ_ONLY);
+ fAMVersionCombo.setItems(fAMVersions);
+ fAMVersionCombo.select(fAMVersions.length - 1);
+ gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_BEGINNING);
+ fAMVersionCombo.setLayoutData(gd);
+ fAMVersionCombo.addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ int index = fAMVersionCombo.getSelectionIndex();
+ getOverlayStore().setValue(AutotoolsEditorPreferenceConstants.AUTOMAKE_VERSION, fAMVersionCombo.getItem(index));
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+ });
+
+ Label label2= new Label(composite, SWT.LEFT);
+ label2.setText(AutotoolsPreferencesMessages.getString("AutoconfEditorPreferencePage.automakeVersion")); //$NON-NLS-1$
+ gd= new GridData();
+ gd.horizontalAlignment= GridData.BEGINNING;
+ label2.setLayoutData(gd);
+
+ return composite;
+ }
+
+ void handleSyntaxColorListSelection() {
+ HighlightingColorListItem item= getHighlightingColorListItem();
+ RGB rgb= PreferenceConverter.getColor(getOverlayStore(), item.getColorKey());
+ fSyntaxForegroundColorEditor.setColorValue(rgb);
+ fBoldCheckBox.setSelection(getOverlayStore().getBoolean(item.getBoldKey()));
+ fItalicCheckBox.setSelection(getOverlayStore().getBoolean(item.getItalicKey()));
+ }
+
+ /**
+ * Returns the current highlighting color list item.
+ *
+ * @return the current highlighting color list item
+ * @since 3.0
+ */
+ HighlightingColorListItem getHighlightingColorListItem() {
+ IStructuredSelection selection= (IStructuredSelection) fHighlightingColorListViewer.getSelection();
+ return (HighlightingColorListItem) selection.getFirstElement();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.IPreferencePage#performOk()
+ */
+ public boolean performOk() {
+ return super.performOk();
+ }
+
+ /**
+ * @param preferenceStore
+ */
+ public static void initDefaults(IPreferenceStore prefs) {
+ // Makefile Editor color preferences
+ PreferenceConverter.setDefault(prefs, ColorManager.AUTOCONF_COMMENT_COLOR, ColorManager.AUTOCONF_COMMENT_RGB);
+ PreferenceConverter.setDefault(prefs, ColorManager.AUTOCONF_DEFAULT_COLOR, ColorManager.AUTOCONF_DEFAULT_RGB);
+ PreferenceConverter.setDefault(prefs, ColorManager.AUTOCONF_KEYWORD_COLOR, ColorManager.AUTOCONF_KEYWORD_RGB);
+ PreferenceConverter.setDefault(prefs, ColorManager.AUTOCONF_VAR_REF_COLOR, ColorManager.AUTOCONF_VAR_REF_RGB);
+ PreferenceConverter.setDefault(prefs, ColorManager.AUTOCONF_VAR_SET_COLOR, ColorManager.AUTOCONF_VAR_SET_RGB);
+ PreferenceConverter.setDefault(prefs, ColorManager.AUTOCONF_ACMACRO_COLOR, ColorManager.AUTOCONF_ACMACRO_RGB);
+ PreferenceConverter.setDefault(prefs, ColorManager.AUTOCONF_AMMACRO_COLOR, ColorManager.AUTOCONF_AMMACRO_RGB);
+ PreferenceConverter.setDefault(prefs, ColorManager.AUTOCONF_CODESEQ_COLOR, ColorManager.AUTOCONF_CODESEQ_RGB);
+ prefs.setDefault(ColorManager.AUTOCONF_CODESEQ_COLOR + AutotoolsEditorPreferenceConstants.EDITOR_ITALIC_SUFFIX, true);
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/AutomakeEditorPreferencePage.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/AutomakeEditorPreferencePage.java
new file mode 100644
index 0000000000..3ef71c6758
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/AutomakeEditorPreferencePage.java
@@ -0,0 +1,468 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 2006, 2007 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ * Red Hat Inc. - modification to use with Automake editor
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.preferences;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.cdt.make.ui.IMakeHelpContextIds;
+import org.eclipse.cdt.ui.PreferenceConstants;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.jface.viewers.IColorProvider;
+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.linuxtools.cdt.autotools.ui.AutotoolsUIPlugin;
+import org.eclipse.swt.SWT;
+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.Label;
+import org.eclipse.swt.widgets.TabFolder;
+import org.eclipse.swt.widgets.TabItem;
+import org.eclipse.ui.model.WorkbenchViewerComparator;
+
+
+
+/**
+ * MakeEditorPreferencePage
+ * The page for setting the editor options.
+ */
+public class AutomakeEditorPreferencePage extends AbstractEditorPreferencePage {
+
+ /** The keys of the overlay store. */
+ private String[][] fSyntaxColorListModel;
+
+ private TableViewer fHighlightingColorListViewer;
+ private final List<HighlightingColorListItem> fHighlightingColorList= new ArrayList<HighlightingColorListItem>(5);
+
+ ColorEditor fAppearanceColorEditor;
+ Button fAppearanceColorDefault;
+ ColorEditor fSyntaxForegroundColorEditor;
+ ColorEditor fBackgroundColorEditor;
+ Button fBoldCheckBox;
+ Button fItalicCheckBox;
+
+ // folding
+ protected Button fFoldingCheckbox;
+
+ /**
+ * Item in the highlighting color list.
+ *
+ * @since 3.0
+ */
+ private class HighlightingColorListItem {
+ /** Display name */
+ private String fDisplayName;
+ /** Color preference key */
+ private String fColorKey;
+ /** Bold preference key */
+ private String fBoldKey;
+ /** Italic preference key */
+ private String fItalicKey;
+ /** Item color */
+ private Color fItemColor;
+
+ /**
+ * Initialize the item with the given values.
+ *
+ * @param displayName the display name
+ * @param colorKey the color preference key
+ * @param boldKey the bold preference key
+ * @param italicKey the italic preference key
+ * @param itemColor the item color
+ */
+ public HighlightingColorListItem(String displayName, String colorKey, String boldKey, String italicKey, Color itemColor) {
+ fDisplayName= displayName;
+ fColorKey= colorKey;
+ fBoldKey= boldKey;
+ fItalicKey= italicKey;
+ fItemColor= itemColor;
+ }
+
+ /**
+ * @return the bold preference key
+ */
+ public String getBoldKey() {
+ return fBoldKey;
+ }
+
+ /**
+ * @return the bold preference key
+ */
+ public String getItalicKey() {
+ return fItalicKey;
+ }
+
+ /**
+ * @return the color preference key
+ */
+ public String getColorKey() {
+ return fColorKey;
+ }
+
+ /**
+ * @return the display name
+ */
+ public String getDisplayName() {
+ return fDisplayName;
+ }
+
+ /**
+ * @return the item color
+ */
+ public Color getItemColor() {
+ return fItemColor;
+ }
+ }
+
+ /**
+ * Color list label provider.
+ *
+ * @since 3.0
+ */
+ private class ColorListLabelProvider extends LabelProvider implements IColorProvider {
+
+ /*
+ * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
+ */
+ public String getText(Object element) {
+ return ((HighlightingColorListItem)element).getDisplayName();
+ }
+
+ /*
+ * @see org.eclipse.jface.viewers.IColorProvider#getForeground(java.lang.Object)
+ */
+ public Color getForeground(Object element) {
+ return ((HighlightingColorListItem)element).getItemColor();
+ }
+
+ /*
+ * @see org.eclipse.jface.viewers.IColorProvider#getBackground(java.lang.Object)
+ */
+ public Color getBackground(Object element) {
+ return null;
+ }
+ }
+
+ /**
+ * Color list content provider.
+ *
+ * @since 3.0
+ */
+ private class ColorListContentProvider implements IStructuredContentProvider {
+
+ /*
+ * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
+ */
+ @SuppressWarnings("unchecked")
+ public Object[] getElements(Object inputElement) {
+ return ((List<Object>)inputElement).toArray();
+ }
+
+ /*
+ * @see org.eclipse.jface.viewers.IContentProvider#dispose()
+ */
+ public void dispose() {
+ }
+
+ /*
+ * @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) {
+ }
+ }
+
+
+
+ /**
+ *
+ */
+ public AutomakeEditorPreferencePage() {
+ super();
+ }
+
+ protected OverlayPreferenceStore createOverlayStore() {
+ fSyntaxColorListModel= new String[][] {
+ {AutotoolsPreferencesMessages.getString("AutomakeEditorPreferencePage.makefile_editor_comment"), ColorManager.MAKE_COMMENT_COLOR, null}, //$NON-NLS-1$
+ {AutotoolsPreferencesMessages.getString("AutomakeEditorPreferencePage.makefile_editor_macro_ref"), ColorManager.MAKE_MACRO_REF_COLOR, null}, //$NON-NLS-1$
+ {AutotoolsPreferencesMessages.getString("AutomakeEditorPreferencePage.makefile_editor_macro_def"), ColorManager.MAKE_MACRO_DEF_COLOR, null}, //$NON-NLS-1$
+ {AutotoolsPreferencesMessages.getString("AutomakeEditorPreferencePage.makefile_editor_function"), ColorManager.MAKE_FUNCTION_COLOR, null}, //$NON-NLS-1$
+ {AutotoolsPreferencesMessages.getString("AutomakeEditorPreferencePage.makefile_editor_keyword"), ColorManager.MAKE_KEYWORD_COLOR, null}, //$NON-NLS-1$
+ {AutotoolsPreferencesMessages.getString("AutomakeEditorPreferencePage.makefile_editor_default"), ColorManager.MAKE_DEFAULT_COLOR, null}, //$NON-NLS-1$
+ };
+ ArrayList<OverlayPreferenceStore.OverlayKey> overlayKeys= new ArrayList<OverlayPreferenceStore.OverlayKey>();
+
+ overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AutotoolsEditorPreferenceConstants.EDITOR_FOLDING_ENABLED));
+ overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AutotoolsEditorPreferenceConstants.EDITOR_FOLDING_CONDITIONAL));
+ overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AutotoolsEditorPreferenceConstants.EDITOR_FOLDING_MACRODEF));
+ overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, AutotoolsEditorPreferenceConstants.EDITOR_FOLDING_RULE));
+
+ for (int i= 0; i < fSyntaxColorListModel.length; i++) {
+ String colorKey= fSyntaxColorListModel[i][1];
+ addTextKeyToCover(overlayKeys, colorKey);
+ }
+
+ OverlayPreferenceStore.OverlayKey[] keys= new OverlayPreferenceStore.OverlayKey[overlayKeys.size()];
+ overlayKeys.toArray(keys);
+ return new OverlayPreferenceStore(getPreferenceStore(), keys);
+ }
+
+ private void addTextKeyToCover(ArrayList<OverlayPreferenceStore.OverlayKey> overlayKeys, String mainKey) {
+ overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, mainKey));
+ overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, mainKey + AutotoolsEditorPreferenceConstants.EDITOR_BOLD_SUFFIX));
+ overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, mainKey + AutotoolsEditorPreferenceConstants.EDITOR_ITALIC_SUFFIX));
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
+ */
+ protected Control createContents(Composite parent) {
+ AutotoolsUIPlugin.getDefault().getWorkbench().getHelpSystem().setHelp(getControl(), IMakeHelpContextIds.MAKE_EDITOR_PREFERENCE_PAGE);
+ getOverlayStore().load();
+ getOverlayStore().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(AutotoolsPreferencesMessages.getString("AutomakeEditorPreferencePage.syntax")); //$NON-NLS-1$
+ item.setControl(createSyntaxPage(folder));
+
+ item= new TabItem(folder, SWT.NONE);
+ item.setText(AutotoolsPreferencesMessages.getString("AutomakeEditorPreferencePage.folding")); //$NON-NLS-1$
+ item.setControl(createFoldingTabContent(folder));
+
+ initialize();
+
+ applyDialogFont(folder);
+ return folder;
+ }
+
+ private void initialize() {
+
+ initializeFields();
+
+ for (int i= 0, n= fSyntaxColorListModel.length; i < n; i++) {
+ fHighlightingColorList.add(
+ new HighlightingColorListItem (fSyntaxColorListModel[i][0], fSyntaxColorListModel[i][1],
+ fSyntaxColorListModel[i][1] + AutotoolsEditorPreferenceConstants.EDITOR_BOLD_SUFFIX,
+ fSyntaxColorListModel[i][1] + AutotoolsEditorPreferenceConstants.EDITOR_ITALIC_SUFFIX, null));
+ }
+ fHighlightingColorListViewer.setInput(fHighlightingColorList);
+ fHighlightingColorListViewer.setSelection(new StructuredSelection(fHighlightingColorListViewer.getElementAt(0)));
+
+ initializeFolding();
+ }
+
+ void initializeFolding() {
+ boolean enabled= getOverlayStore().getBoolean(PreferenceConstants.EDITOR_FOLDING_ENABLED);
+ fFoldingCheckbox.setSelection(enabled);
+ }
+
+ void initializeDefaultFolding() {
+ boolean enabled= getOverlayStore().getDefaultBoolean(PreferenceConstants.EDITOR_FOLDING_ENABLED);
+ fFoldingCheckbox.setSelection(enabled);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.linuxtools.internal.cdt.autotools.ui.preferences.AbstractAutomakeEditorPreferencePage#handleDefaults()
+ */
+ protected void handleDefaults() {
+ handleSyntaxColorListSelection();
+ initializeDefaultFolding();
+ }
+
+ private Control createSyntaxPage(Composite parent) {
+
+ Composite colorComposite= new Composite(parent, SWT.NONE);
+ colorComposite.setLayout(new GridLayout());
+
+ Label label= new Label(colorComposite, SWT.LEFT);
+ label.setText(AutotoolsPreferencesMessages.getString("AutomakeEditorPreferencePage.Foreground")); //$NON-NLS-1$
+ label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ Composite editorComposite= new Composite(colorComposite, SWT.NONE);
+ GridLayout layout= new GridLayout();
+ layout.numColumns= 2;
+ layout.marginHeight= 0;
+ layout.marginWidth= 0;
+ editorComposite.setLayout(layout);
+ GridData gd= new GridData(GridData.FILL_BOTH);
+ editorComposite.setLayoutData(gd);
+
+ fHighlightingColorListViewer= new TableViewer(editorComposite, SWT.SINGLE | SWT.V_SCROLL | SWT.BORDER | SWT.FULL_SELECTION);
+ fHighlightingColorListViewer.setLabelProvider(new ColorListLabelProvider());
+ fHighlightingColorListViewer.setContentProvider(new ColorListContentProvider());
+ fHighlightingColorListViewer.setComparator(new WorkbenchViewerComparator());
+ gd= new GridData(GridData.FILL_BOTH);
+ gd.heightHint= convertHeightInCharsToPixels(5);
+ fHighlightingColorListViewer.getControl().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));
+
+ label= new Label(stylesComposite, SWT.LEFT);
+ label.setText(AutotoolsPreferencesMessages.getString("AutomakeEditorPreferencePage.color")); //$NON-NLS-1$
+ gd= new GridData();
+ gd.horizontalAlignment= GridData.BEGINNING;
+ label.setLayoutData(gd);
+
+ fSyntaxForegroundColorEditor= new ColorEditor(stylesComposite);
+ Button foregroundColorButton= fSyntaxForegroundColorEditor.getButton();
+ gd= new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalAlignment= GridData.BEGINNING;
+ foregroundColorButton.setLayoutData(gd);
+
+ fBoldCheckBox= new Button(stylesComposite, SWT.CHECK);
+ fBoldCheckBox.setText(AutotoolsPreferencesMessages.getString("AutomakeEditorPreferencePage.bold")); //$NON-NLS-1$
+ gd= new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalAlignment= GridData.BEGINNING;
+ gd.horizontalSpan= 2;
+ fBoldCheckBox.setLayoutData(gd);
+
+ fItalicCheckBox= new Button(stylesComposite, SWT.CHECK);
+ fItalicCheckBox.setText(AutotoolsPreferencesMessages.getString("AutomakeEditorPreferencePage.italic")); //$NON-NLS-1$
+ gd= new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalAlignment= GridData.BEGINNING;
+ gd.horizontalSpan= 2;
+ fItalicCheckBox.setLayoutData(gd);
+
+ fHighlightingColorListViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ handleSyntaxColorListSelection();
+ }
+ });
+
+ foregroundColorButton.addSelectionListener(new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) {
+ // do nothing
+ }
+ public void widgetSelected(SelectionEvent e) {
+ HighlightingColorListItem item= getHighlightingColorListItem();
+ PreferenceConverter.setValue(getOverlayStore(), item.getColorKey(), fSyntaxForegroundColorEditor.getColorValue());
+ }
+ });
+
+ fBoldCheckBox.addSelectionListener(new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) {
+ // do nothing
+ }
+ public void widgetSelected(SelectionEvent e) {
+ HighlightingColorListItem item= getHighlightingColorListItem();
+ getOverlayStore().setValue(item.getBoldKey(), fBoldCheckBox.getSelection());
+ }
+ });
+
+ fItalicCheckBox.addSelectionListener(new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) {
+ // do nothing
+ }
+ public void widgetSelected(SelectionEvent e) {
+ HighlightingColorListItem item= getHighlightingColorListItem();
+ getOverlayStore().setValue(item.getItalicKey(), fItalicCheckBox.getSelection());
+ }
+ });
+
+ return colorComposite;
+ }
+
+
+ private Composite createFoldingTabContent(TabFolder folder) {
+ Composite composite= new Composite(folder, SWT.NULL);
+ // assume parent page uses griddata
+ GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_CENTER | GridData.VERTICAL_ALIGN_FILL);
+ composite.setLayoutData(gd);
+ GridLayout layout= new GridLayout();
+ layout.numColumns= 2;
+ //PixelConverter pc= new PixelConverter(composite);
+ //layout.verticalSpacing= pc.convertHeightInCharsToPixels(1) / 2;
+ composite.setLayout(layout);
+
+
+ /* check box for new editors */
+ fFoldingCheckbox= new Button(composite, SWT.CHECK);
+ fFoldingCheckbox.setText(AutotoolsPreferencesMessages.getString("AutomakeEditorPreferencePage.foldingenable")); //$NON-NLS-1$
+ gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_BEGINNING);
+ fFoldingCheckbox.setLayoutData(gd);
+ fFoldingCheckbox.addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ boolean enabled= fFoldingCheckbox.getSelection();
+ getOverlayStore().setValue(AutotoolsEditorPreferenceConstants.EDITOR_FOLDING_ENABLED, enabled);
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+ });
+
+ return composite;
+ }
+
+ void handleSyntaxColorListSelection() {
+ HighlightingColorListItem item= getHighlightingColorListItem();
+ RGB rgb= PreferenceConverter.getColor(getOverlayStore(), item.getColorKey());
+ fSyntaxForegroundColorEditor.setColorValue(rgb);
+ fBoldCheckBox.setSelection(getOverlayStore().getBoolean(item.getBoldKey()));
+ fItalicCheckBox.setSelection(getOverlayStore().getBoolean(item.getItalicKey()));
+ }
+
+ /**
+ * Returns the current highlighting color list item.
+ *
+ * @return the current highlighting color list item
+ * @since 3.0
+ */
+ HighlightingColorListItem getHighlightingColorListItem() {
+ IStructuredSelection selection= (IStructuredSelection) fHighlightingColorListViewer.getSelection();
+ return (HighlightingColorListItem) selection.getFirstElement();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.IPreferencePage#performOk()
+ */
+ public boolean performOk() {
+ return super.performOk();
+ }
+
+ /**
+ * @param preferenceStore
+ */
+ public static void initDefaults(IPreferenceStore prefs) {
+ // Makefile Editor color preferences
+ PreferenceConverter.setDefault(prefs, ColorManager.MAKE_COMMENT_COLOR, ColorManager.MAKE_COMMENT_RGB);
+ PreferenceConverter.setDefault(prefs, ColorManager.MAKE_DEFAULT_COLOR, ColorManager.MAKE_DEFAULT_RGB);
+ PreferenceConverter.setDefault(prefs, ColorManager.MAKE_FUNCTION_COLOR, ColorManager.MAKE_FUNCTION_RGB);
+ PreferenceConverter.setDefault(prefs, ColorManager.MAKE_KEYWORD_COLOR, ColorManager.MAKE_KEYWORD_RGB);
+ PreferenceConverter.setDefault(prefs, ColorManager.MAKE_MACRO_DEF_COLOR, ColorManager.MAKE_MACRO_DEF_RGB);
+ PreferenceConverter.setDefault(prefs, ColorManager.MAKE_MACRO_REF_COLOR, ColorManager.MAKE_MACRO_REF_RGB);
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/AutotoolsEditorPreferenceConstants.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/AutotoolsEditorPreferenceConstants.java
new file mode 100644
index 0000000000..ec329afce7
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/AutotoolsEditorPreferenceConstants.java
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 2005, 2007, 2009 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ * Red Hat Inc. - rename to use with Autotools editors
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.preferences;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+
+/**
+ * MakefileEditorPreferenceConstants
+ */
+public class AutotoolsEditorPreferenceConstants {
+
+ /**
+ *
+ */
+ private AutotoolsEditorPreferenceConstants() {
+ }
+
+ /**
+ * The symbolic names for colors for displaying code assist proposals
+ * @see org.eclipse.jface.resource.ColorRegistry
+ */
+ public static final String CURRENT_LINE_COLOR = "org.eclipse.linuxtools.cdt.autotools.ui.automake.currentLineHightlightColor"; //$NON-NLS-1$
+ public static final String LINE_NUMBER_RULER_COLOR = "org.eclipse.linuxtools.cdt.autotools.ui.automake.lineNumberForegroundColor"; //$NON-NLS-1$
+ public static final String PRINT_MARGIN_COLOR = "org.eclipse.linuxtools.cdt.autotools.ui.automake.printMarginColor"; //$NON-NLS-1$
+
+ /**
+ * Preference key suffix for bold text style preference keys.
+ *
+ */
+ public static final String EDITOR_BOLD_SUFFIX= "_bold"; //$NON-NLS-1$
+
+ /**
+ * Preference key suffix for italic text style preference keys.
+ */
+ public static final String EDITOR_ITALIC_SUFFIX= "_italic"; //$NON-NLS-1$
+
+
+ public static final String EDITOR_FOLDING_MACRODEF = "editor_folding_default_macrodef"; //$NON-NLS-1$
+
+ public static final String EDITOR_FOLDING_RULE = "editor_folding_default_rule"; //$NON-NLS-1$
+
+ public static final String EDITOR_FOLDING_CASE = "editor_folding_default_case"; //$NON-NLS-1$
+
+ public static final String EDITOR_FOLDING_CONDITIONAL = "editor_folding_default_conditional"; //$NON-NLS-1$
+
+ public static final String EDITOR_FOLDING_LOOP = "editor_folding_default_loop"; //$NON-NLS-1$
+
+ public static final String EDITOR_FOLDING_ENABLED = "editor_folding_enabled"; //$NON-NLS-1$
+
+ public static final String AUTOCONF_VERSION = "autoconf_version";
+
+ public static final String AUTOMAKE_VERSION = "automake_version";
+
+ public static void initializeDefaultValues(IPreferenceStore store) {
+
+ store.setDefault(AutotoolsEditorPreferenceConstants.EDITOR_FOLDING_ENABLED, false);
+ store.setDefault(AutotoolsEditorPreferenceConstants.EDITOR_FOLDING_MACRODEF, false);
+ store.setDefault(AutotoolsEditorPreferenceConstants.EDITOR_FOLDING_RULE, true);
+ store.setDefault(AutotoolsEditorPreferenceConstants.EDITOR_FOLDING_CASE, true);
+ store.setDefault(AutotoolsEditorPreferenceConstants.EDITOR_FOLDING_CONDITIONAL, true);
+ store.setDefault(AutotoolsEditorPreferenceConstants.EDITOR_FOLDING_LOOP, true);
+ store.setDefault(AutotoolsEditorPreferenceConstants.AUTOCONF_VERSION, AutoconfEditorPreferencePage.LATEST_AC_VERSION);
+ store.setDefault(AutotoolsEditorPreferenceConstants.AUTOMAKE_VERSION, AutoconfEditorPreferencePage.LATEST_AM_VERSION);
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/AutotoolsPreferencePage.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/AutotoolsPreferencePage.java
new file mode 100644
index 0000000000..525657f292
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/AutotoolsPreferencePage.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2006, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.preferences;
+
+import org.eclipse.jface.preference.BooleanFieldEditor;
+import org.eclipse.jface.preference.FieldEditorPreferencePage;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.linuxtools.cdt.autotools.core.AutotoolsPlugin;
+import org.eclipse.linuxtools.cdt.autotools.ui.AutotoolsUIPlugin;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+
+public class AutotoolsPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
+
+ private static final String PREF_BUILD_TARGET_IN_BACKGROUND = "MakeTargetPrefs.buildTargetInBackground"; //$NON-NLS-1$
+ private static final String TARGET_BUILDS_IN_BACKGROUND = "MakeTargetPreferencePage.buildTargetInBackground.label"; //$NON-NLS-1$
+
+ public AutotoolsPreferencePage() {
+ super(GRID);
+ setPreferenceStore(AutotoolsPlugin.getDefault().getPreferenceStore());
+ }
+
+ /**
+ * @see FieldEditorPreferencePage#createControl(Composite)
+ */
+ protected void createFieldEditors() {
+ Composite parent = getFieldEditorParent();
+
+ BooleanFieldEditor targetBackgroundEditor = new BooleanFieldEditor(PREF_BUILD_TARGET_IN_BACKGROUND,
+ AutotoolsUIPlugin.getResourceString(TARGET_BUILDS_IN_BACKGROUND), parent);
+ addField(targetBackgroundEditor);
+ }
+
+ public static boolean isBuildTargetInBackground() {
+ return AutotoolsPlugin.getDefault().getPreferenceStore().getBoolean(PREF_BUILD_TARGET_IN_BACKGROUND);
+ }
+
+ public static void setBuildTargetInBackground(boolean enable) {
+ AutotoolsPlugin.getDefault().getPreferenceStore().setValue(PREF_BUILD_TARGET_IN_BACKGROUND, enable);
+ }
+
+ /**
+ * Initializes the default values of this page in the preference bundle.
+ */
+ public static void initDefaults(IPreferenceStore prefs) {
+ prefs.setDefault(PREF_BUILD_TARGET_IN_BACKGROUND, true);
+ }
+
+ public void init(IWorkbench workbench) {
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/AutotoolsPreferencesMessages.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/AutotoolsPreferencesMessages.java
new file mode 100644
index 0000000000..3f24110de2
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/AutotoolsPreferencesMessages.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 2006, 2009 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.preferences;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+/**
+ * MakefilePreferencesMessages
+ */
+public class AutotoolsPreferencesMessages {
+
+ /**
+ *
+ */
+ private AutotoolsPreferencesMessages() {
+ }
+
+ private static final String BUNDLE_NAME = AutotoolsPreferencesMessages.class.getName();
+
+ public static String getString(String key) {
+ try {
+ return ResourceBundle.getBundle(BUNDLE_NAME).getString(key);
+ } catch (MissingResourceException e) {
+ return '!' + key + '!';
+ } catch (NullPointerException e) {
+ return '#' + key + '#';
+ }
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/AutotoolsPreferencesMessages.properties b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/AutotoolsPreferencesMessages.properties
new file mode 100644
index 0000000000..40b5380683
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/AutotoolsPreferencesMessages.properties
@@ -0,0 +1,108 @@
+###############################################################################
+# Copyright (c) 2000, 2006, 2007 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+# Red Hat Inc. - convert for usage with Automake and Autoconf editors
+###############################################################################
+
+AutomakeEditorPreferencePage.description=Automake Editor settings:
+AutomakeEditorPreferencePage.invalid_input_print_margin= Invalid print margin column specified
+AutomakeEditorPreferencePage.empty_input_print_margin= No print margin column specified
+AutomakeEditorPreferencePage.appearance=Appeara&nce
+AutomakeEditorPreferencePage.printMarginColumn=Print margin col&umn:
+AutomakeEditorPreferencePage.showOverviewRuler=Show overview &ruler
+AutomakeEditorPreferencePage.showLineNumbers=Show lin&e numbers
+AutomakeEditorPreferencePage.highlightCurrentLine=Hi&ghlight current line
+AutomakeEditorPreferencePage.showPrintMargin=Sho&w print margin
+AutomakeEditorPreferencePage.color=C&olor:
+AutomakeEditorPreferencePage.appearanceOptions=Appearance co&lor options:
+AutomakeEditorPreferencePage.lineNumberForegroundColor=Line number foreground
+AutomakeEditorPreferencePage.currentLineHighlighColor=Current line highlight
+AutomakeEditorPreferencePage.printMarginColor=Print margin
+AutomakeEditorPreferencePage.Makefile_editor_text_1=Text
+AutomakeEditorPreferencePage.Makefile_editor_processing_instuctions_2=Processing instructions
+AutomakeEditorPreferencePage.Makefile_editor_constMakefile_strings_3=ConstMakefile strings
+AutomakeEditorPreferencePage.Makefile_editor_tags_4=Tags
+AutomakeEditorPreferencePage.Makefile_editor_comments_5=Comments
+AutomakeEditorPreferencePage.tabwidth=Displayed &tab width:
+AutomakeEditorPreferencePage.notabwidth=No tab width specified
+AutomakeEditorPreferencePage.39=Invalid tab width specified
+AutomakeEditorPreferencePage.systemdefault=System de&fault
+AutomakeEditorPreferencePage.spacetabs=&Insert spaces for tabs when typing
+AutomakeEditorPreferencePage.foreground= Selection foreground color
+AutomakeEditorPreferencePage.background= Selection background color
+AutomakeEditorPreferencePage.syntax=Synta&x
+AutomakeEditorPreferencePage.backcolor=Background color
+AutomakeEditorPreferencePage.custom=C&ustom:
+AutomakeEditorPreferencePage.Foreground=Fore&ground:
+AutomakeEditorPreferencePage.bold=&Bold
+AutomakeEditorPreferencePage.italic=I&talic
+
+AutomakeEditorPreferencePage.folding= &Folding
+AutomakeEditorPreferencePage.foldingenable= Enable folding when &opening a new editor
+
+AutomakeEditorPreferencePage.makefile_editor_comment=comment
+AutomakeEditorPreferencePage.makefile_editor_macro_def=macro definition
+AutomakeEditorPreferencePage.makefile_editor_macro_ref=macro reference
+AutomakeEditorPreferencePage.makefile_editor_function=function
+AutomakeEditorPreferencePage.makefile_editor_keyword=keyword
+AutomakeEditorPreferencePage.makefile_editor_target=target
+AutomakeEditorPreferencePage.makefile_editor_default=default
+
+
+AutomakeSettingsPreferencePage.style=Style of Makefile
+AutomakeSettingsPreferencePage.path.label=Makefile include directories
+AutomakeSettingsPreferencePage.path.browse=directory
+
+AutoconfEditorPreferencePage.description=Autoconf Editor settings:
+AutoconfEditorPreferencePage.invalid_input_print_margin= Invalid print margin column specified
+AutoconfEditorPreferencePage.empty_input_print_margin= No print margin column specified
+AutoconfEditorPreferencePage.appearance=Appeara&nce
+AutoconfEditorPreferencePage.printMarginColumn=Print margin col&umn:
+AutoconfEditorPreferencePage.showOverviewRuler=Show overview &ruler
+AutoconfEditorPreferencePage.showLineNumbers=Show lin&e numbers
+AutoconfEditorPreferencePage.highlightCurrentLine=Hi&ghlight current line
+AutoconfEditorPreferencePage.showPrintMargin=Sho&w print margin
+AutoconfEditorPreferencePage.color=C&olor:
+AutoconfEditorPreferencePage.appearanceOptions=Appearance co&lor options:
+AutoconfEditorPreferencePage.lineNumberForegroundColor=Line number foreground
+AutoconfEditorPreferencePage.currentLineHighlighColor=Current line highlight
+AutoconfEditorPreferencePage.printMarginColor=Print margin
+AutoconfEditorPreferencePage.Makefile_editor_text_1=Text
+AutoconfEditorPreferencePage.Makefile_editor_processing_instuctions_2=Processing instructions
+AutoconfEditorPreferencePage.Makefile_editor_constMakefile_strings_3=ConstMakefile strings
+AutoconfEditorPreferencePage.Makefile_editor_tags_4=Tags
+AutoconfEditorPreferencePage.Makefile_editor_comments_5=Comments
+AutoconfEditorPreferencePage.tabwidth=Displayed &tab width:
+AutoconfEditorPreferencePage.notabwidth=No tab width specified
+AutoconfEditorPreferencePage.39=Invalid tab width specified
+AutoconfEditorPreferencePage.systemdefault=System de&fault
+AutoconfEditorPreferencePage.spacetabs=&Insert spaces for tabs when typing
+AutoconfEditorPreferencePage.foreground= Selection foreground color
+AutoconfEditorPreferencePage.background= Selection background color
+AutoconfEditorPreferencePage.syntax=Synta&x
+AutoconfEditorPreferencePage.backcolor=Background color
+AutoconfEditorPreferencePage.custom=C&ustom:
+AutoconfEditorPreferencePage.Foreground=Fore&ground:
+AutoconfEditorPreferencePage.bold=&Bold
+AutoconfEditorPreferencePage.italic=I&talic
+
+AutoconfEditorPreferencePage.folding= &Folding
+AutoconfEditorPreferencePage.foldingenable= Enable folding when &opening a new editor
+
+AutoconfEditorPreferencePage.version= &Version
+AutoconfEditorPreferencePage.autoconfVersion = Default version of Autoconf to use for syntax checking
+AutoconfEditorPreferencePage.automakeVersion = Default version of Automake to use for syntax checking
+AutoconfEditorPreferencePage.autoconf_editor_comment=comment
+AutoconfEditorPreferencePage.autoconf_editor_acmacro=autoconf macro
+AutoconfEditorPreferencePage.autoconf_editor_ammacro=automake macro
+AutoconfEditorPreferencePage.autoconf_editor_var_ref=variable reference
+AutoconfEditorPreferencePage.autoconf_editor_keyword=keyword
+AutoconfEditorPreferencePage.autoconf_editor_var_set=variable set
+AutoconfEditorPreferencePage.autoconf_editor_code_seq=inlined code sequence
+AutoconfEditorPreferencePage.autoconf_editor_default=default \ No newline at end of file
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/ColorEditor.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/ColorEditor.java
new file mode 100644
index 0000000000..fb4ff1094f
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/ColorEditor.java
@@ -0,0 +1,122 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.preferences;
+
+import org.eclipse.jface.resource.JFaceResources;
+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;
+
+/**
+ * A "button" of a certain color determined by the color picker
+ */
+public class ColorEditor {
+
+ private Point fExtent;
+ Image fImage;
+ RGB fColorValue;
+ Color fColor;
+ 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/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/ColorManager.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/ColorManager.java
new file mode 100644
index 0000000000..726af8d295
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/ColorManager.java
@@ -0,0 +1,91 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.preferences;
+
+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;
+
+public class ColorManager implements ISharedTextColors {
+
+ public static final String MAKE_COMMENT_COLOR ="org.eclipse.linuxtools.cdt.autotools.ui.automake.editor.comment"; //$NON-NLS-1$
+ public static final String MAKE_KEYWORD_COLOR = "org.eclipse.linuxtools.cdt.autotools.ui.automake.editor.keyword"; //$NON-NLS-1$
+ public static final String MAKE_FUNCTION_COLOR = "org.eclipse.linuxtools.cdt.autotools.ui.automake.editor.function"; //$NON-NLS-1$
+ public static final String MAKE_MACRO_REF_COLOR = "org.eclipse.linuxtools.cdt.autotools.ui.automake.editor.macro_ref"; //$NON-NLS-1$
+ public static final String MAKE_MACRO_DEF_COLOR = "org.eclipse.linuxtools.cdt.autotools.ui.automake.editor.macro_def"; //$NON-NLS-1$
+ public static final String MAKE_DEFAULT_COLOR = "org.eclipse.linuxtools.cdt.autotools.ui.automake.editor.default"; //$NON-NLS-1$
+
+ public static final String AUTOCONF_COMMENT_COLOR ="org.eclipse.linuxtools.cdt.autotools.ui.autoconf.editor.comment"; //$NON-NLS-1$
+ public static final String AUTOCONF_KEYWORD_COLOR = "org.eclipse.linuxtools.cdt.autotools.ui.autoconf.editor.keyword"; //$NON-NLS-1$
+ public static final String AUTOCONF_VAR_REF_COLOR = "org.eclipse.linuxtools.cdt.autotools.ui.autoconf.editor.var_ref"; //$NON-NLS-1$
+ public static final String AUTOCONF_VAR_SET_COLOR = "org.eclipse.linuxtools.cdt.autotools.ui.autoconf.editor.var_set"; //$NON-NLS-1$
+ public static final String AUTOCONF_ACMACRO_COLOR = "org.eclipse.linuxtools.cdt.autotools.ui.autoconf.editor.acmacro"; //$NON-NLS-1$
+ public static final String AUTOCONF_AMMACRO_COLOR = "org.eclipse.linuxtools.cdt.autotools.ui.autoconf.editor.ammacro"; //$NON-NLS-1$
+ public static final String AUTOCONF_CODESEQ_COLOR = "org.eclipse.linuxtools.cdt.autotools.ui.autoconf.editor.codeseq"; //$NON-NLS-1$
+ public static final String AUTOCONF_DEFAULT_COLOR = "org.eclipse.linuxtools.cdt.autotools.ui.autoconf.editor.default"; //$NON-NLS-1$
+
+ public static final RGB MAKE_COMMENT_RGB = new RGB(128, 0, 0);
+ public static final RGB MAKE_KEYWORD_RGB = new RGB(128, 255, 0);
+ public static final RGB MAKE_FUNCTION_RGB = new RGB(128, 0, 128);
+ public static final RGB MAKE_MACRO_DEF_RGB = new RGB(0, 0, 128);
+ public static final RGB MAKE_MACRO_REF_RGB = new RGB(0, 128, 0);
+ public static final RGB MAKE_DEFAULT_RGB = new RGB(0, 0, 0);
+
+ public static final RGB AUTOCONF_COMMENT_RGB = new RGB(63, 95, 191);
+ public static final RGB AUTOCONF_KEYWORD_RGB = new RGB(127, 0, 85);
+ public static final RGB AUTOCONF_VAR_REF_RGB = new RGB(128, 0, 0);
+ public static final RGB AUTOCONF_VAR_SET_RGB = new RGB(255, 101, 52);
+ public static final RGB AUTOCONF_ACMACRO_RGB = new RGB(0, 0, 128);
+ public static final RGB AUTOCONF_AMMACRO_RGB = new RGB(0, 128, 0);
+ public static final RGB AUTOCONF_CODESEQ_RGB = new RGB(0, 100, 0);
+ public static final RGB AUTOCONF_DEFAULT_RGB = new RGB(0, 0, 0);
+
+ private static ColorManager fgColorManager;
+
+ private ColorManager() {
+ }
+
+ public static ColorManager getDefault() {
+ if (fgColorManager == null) {
+ fgColorManager= new ColorManager();
+ }
+ return fgColorManager;
+ }
+
+ protected Map<RGB, Color> fColorTable = new HashMap<RGB, Color>(10);
+
+ /**
+ * @see IMakefileColorManager#dispose()
+ */
+ public void dispose() {
+ Iterator<Color> 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/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/OverlayPreferenceStore.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/OverlayPreferenceStore.java
new file mode 100644
index 0000000000..3c6a672572
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/OverlayPreferenceStore.java
@@ -0,0 +1,455 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.preferences;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceStore;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
+
+/**
+ * OverlayPreferenceStore
+ */
+/**
+ * An overlaying preference store.
+ */
+class OverlayPreferenceStore implements IPreferenceStore {
+
+
+ public static final class TypeDescriptor {
+ 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);
+ }
+ }
+
+
+ IPreferenceStore fParent;
+ IPreferenceStore fStore;
+ private OverlayKey[] fOverlayKeys;
+
+ private PropertyListener fPropertyListener;
+
+
+ public OverlayPreferenceStore(IPreferenceStore parent, OverlayKey[] overlayKeys) {
+ fParent= parent;
+ fOverlayKeys= overlayKeys;
+ fStore= new PreferenceStore();
+ }
+
+ 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);
+ }
+
+ 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"); //$NON-NLS-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/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/StatusInfo.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/StatusInfo.java
new file mode 100644
index 0000000000..d01fc663e9
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/StatusInfo.java
@@ -0,0 +1,173 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 2006, 2009 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.preferences;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.linuxtools.cdt.autotools.ui.AutotoolsUIPlugin;
+
+
+/**
+ * A settable IStatus.
+ * Can be an error, warning, info or ok. For error, info and warning states,
+ * a message describes the problem.
+ */
+public class StatusInfo implements IStatus {
+
+ private String fStatusMessage;
+ private int fSeverity;
+
+ /**
+ * Creates a status set to OK (no message)
+ */
+ public StatusInfo() {
+ this(OK, null);
+ }
+
+ /**
+ * Creates a status .
+ * @param severity The status severity: ERROR, WARNING, INFO and OK.
+ * @param message The message of the status. Applies only for ERROR,
+ * WARNING and INFO.
+ */
+ public StatusInfo(int severity, String message) {
+ fStatusMessage= message;
+ fSeverity= severity;
+ }
+
+ /**
+ * Returns if the status' severity is OK.
+ */
+ public boolean isOK() {
+ return fSeverity == IStatus.OK;
+ }
+
+ /**
+ * Returns if the status' severity is WARNING.
+ */
+ public boolean isWarning() {
+ return fSeverity == IStatus.WARNING;
+ }
+
+ /**
+ * Returns if the status' severity is INFO.
+ */
+ public boolean isInfo() {
+ return fSeverity == IStatus.INFO;
+ }
+
+ /**
+ * Returns if the status' severity is ERROR.
+ */
+ public boolean isError() {
+ return fSeverity == IStatus.ERROR;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.IStatus#getMessage()
+ */
+ public String getMessage() {
+ return fStatusMessage;
+ }
+
+ /**
+ * Sets the status to ERROR.
+ * @param errorMessage The error message (can be empty, but not null)
+ */
+ public void setError(String errorMessage) {
+ Assert.isNotNull(errorMessage);
+ fStatusMessage= errorMessage;
+ fSeverity= IStatus.ERROR;
+ }
+
+ /**
+ * Sets the status to WARNING.
+ * @param warningMessage The warning message (can be empty, but not null)
+ */
+ public void setWarning(String warningMessage) {
+ Assert.isNotNull(warningMessage);
+ fStatusMessage= warningMessage;
+ fSeverity= IStatus.WARNING;
+ }
+
+ /**
+ * Sets the status to INFO.
+ * @param infoMessage The info message (can be empty, but not null)
+ */
+ public void setInfo(String infoMessage) {
+ Assert.isNotNull(infoMessage);
+ fStatusMessage= infoMessage;
+ fSeverity= IStatus.INFO;
+ }
+
+ /**
+ * Sets the status to OK.
+ */
+ public void setOK() {
+ fStatusMessage= null;
+ fSeverity= IStatus.OK;
+ }
+
+ /*
+ * @see IStatus#matches(int)
+ */
+ public boolean matches(int severityMask) {
+ return (fSeverity & severityMask) != 0;
+ }
+
+ /**
+ * Returns always <code>false</code>.
+ * @see IStatus#isMultiStatus()
+ */
+ public boolean isMultiStatus() {
+ return false;
+ }
+
+ /*
+ * @see IStatus#getSeverity()
+ */
+ public int getSeverity() {
+ return fSeverity;
+ }
+
+ /*
+ * @see IStatus#getPlugin()
+ */
+ public String getPlugin() {
+ return AutotoolsUIPlugin.getPluginId();
+ }
+
+ /**
+ * Returns always <code>null</code>.
+ * @see IStatus#getException()
+ */
+ public Throwable getException() {
+ return null;
+ }
+
+ /**
+ * Returns always the error severity.
+ * @see IStatus#getCode()
+ */
+ public int getCode() {
+ return fSeverity;
+ }
+
+ /**
+ * Returns always <code>null</code>.
+ * @see IStatus#getChildren()
+ */
+ public IStatus[] getChildren() {
+ return new IStatus[0];
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/TabFolderLayout.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/TabFolderLayout.java
new file mode 100644
index 0000000000..bda23b843a
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/TabFolderLayout.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.preferences;
+
+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<count; i++) {
+ Control child = children [i];
+ Point pt = child.computeSize (SWT.DEFAULT, SWT.DEFAULT, flushCache);
+ maxWidth = Math.max (maxWidth, pt.x);
+ maxHeight = Math.max (maxHeight, pt.y);
+ }
+
+ if (wHint != SWT.DEFAULT)
+ maxWidth= wHint;
+ if (hHint != SWT.DEFAULT)
+ maxHeight= hHint;
+
+ return new Point(maxWidth, maxHeight);
+
+ }
+
+ protected void layout (Composite composite, boolean flushCache) {
+ Rectangle rect= composite.getClientArea();
+
+ Control[] children = composite.getChildren();
+ for (int i = 0; i < children.length; i++) {
+ children[i].setBounds(rect);
+ }
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AbstractConfigurePropertyOptionsPage.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AbstractConfigurePropertyOptionsPage.java
new file mode 100644
index 0000000000..f844dd9b55
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AbstractConfigurePropertyOptionsPage.java
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.properties;
+
+import org.eclipse.jface.preference.FieldEditor;
+import org.eclipse.jface.preference.FieldEditorPreferencePage;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.util.PropertyChangeEvent;
+
+public abstract class AbstractConfigurePropertyOptionsPage extends
+ FieldEditorPreferencePage {
+
+ private boolean dirty = false;
+ private String name;
+
+ protected AbstractConfigurePropertyOptionsPage(String name) {
+ this(GRID);
+ this.name = name;
+ }
+
+ protected String getName() {
+ return name;
+ }
+
+ protected AbstractConfigurePropertyOptionsPage(int style) {
+ super(style);
+ noDefaultAndApplyButton();
+ }
+
+ @Override
+ protected void createFieldEditors() {
+ // Get the preference store for the build settings
+ IPreferenceStore settings = getConfigurePrefStore();
+ setPreferenceStore(settings);
+ }
+
+ /**
+ * Return the tool settings preference store
+ */
+ protected AutotoolsConfigurePrefStore getConfigurePrefStore() {
+ return AutotoolsConfigurePrefStore.getInstance();
+ }
+
+ /**
+ * Method called when the value of a dialog field changes
+ */
+ public void propertyChange(PropertyChangeEvent event) {
+ super.propertyChange(event);
+ if (event.getProperty().equals(FieldEditor.VALUE)) {
+ setDirty(true);
+ }
+ }
+
+ public void setDirty(boolean b) { dirty = b; }
+ public boolean isDirty() { return dirty; }
+ public void storeSettings() { super.performOk(); }
+
+ public abstract void updateFields();
+ public abstract void setValues();
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsBuildPropertyPage.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsBuildPropertyPage.java
new file mode 100644
index 0000000000..3ec1077b58
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsBuildPropertyPage.java
@@ -0,0 +1,241 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 Red Hat Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.properties;
+
+import org.eclipse.cdt.core.settings.model.ICResourceDescription;
+import org.eclipse.cdt.managedbuilder.ui.properties.AbstractCBuildPropertyTab;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.linuxtools.cdt.autotools.core.AutotoolsPlugin;
+import org.eclipse.linuxtools.internal.cdt.autotools.core.AutotoolsPropertyConstants;
+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.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.Label;
+import org.eclipse.swt.widgets.Text;
+
+
+public class AutotoolsBuildPropertyPage extends AbstractCBuildPropertyTab {
+
+ private String TRUE = "true"; // $NON-NLS-1$
+ private String FALSE = "false"; // $NON-NLS-1$
+ private String CLEAN_DELETE_LABEL = "CleanDelete.label"; // $NON-NLS-1$
+ private String CLEAN_MAKE_LABEL = "CleanMake.label"; // $NON-NLS-1$
+ private String CLEAN_MAKETARGET_LABEL = "CleanMakeTarget.label"; // $NON-NLS-1$
+ private String CLEAN_MAKETARGET_TOOLTIP = "CleanMakeTarget.tooltip"; // $NON-NLS-1$
+ private String AUTO_BUILDNAME_LABEL = "AutoBuildName.label"; // $NON-NLS-1$
+ private String AUTO_BUILDNAME_TOOLTIP = "AutoBuildName.tooltip"; // $NON-NLS-1$
+
+ protected Button fCleanDelete;
+ protected Button fCleanMake;
+ protected Button fAutoName;
+ protected Text fCleanMakeTarget;
+
+ private IProject getProject() {
+ return (IProject)getCfg().getManagedProject().getOwner();
+ }
+
+ public boolean canBeVisible() {
+ return AutotoolsPlugin.hasTargetBuilder(getProject());
+ }
+
+ public void createControls(Composite parent) {
+ super.createControls(parent);
+ Composite composite= usercomp;
+ // assume parent page uses griddata
+ GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_CENTER | GridData.VERTICAL_ALIGN_FILL | GridData.FILL_HORIZONTAL);
+ composite.setLayoutData(gd);
+ GridLayout layout= new GridLayout();
+ layout.numColumns= 2;
+ //PixelConverter pc= new PixelConverter(composite);
+ //layout.verticalSpacing= pc.convertHeightInCharsToPixels(1) / 2;
+ composite.setLayout(layout);
+
+ Group g = new Group(composite, SWT.SHADOW_ETCHED_IN);
+ g.setText(AutotoolsPropertyMessages.getString("CleanBehavior.title"));
+ gd = new GridData(GridData.HORIZONTAL_ALIGN_CENTER | GridData.VERTICAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
+ g.setLayoutData(gd);
+ layout= new GridLayout();
+ layout.numColumns= 2;
+ g.setLayout(layout);
+
+ fCleanDelete = new Button(g, SWT.RADIO);
+ fCleanDelete.setText(AutotoolsPropertyMessages.getString(CLEAN_DELETE_LABEL));
+ gd= new GridData();
+ gd.horizontalAlignment= GridData.BEGINNING;
+ gd.horizontalSpan = 2;
+ fCleanDelete.setLayoutData(gd);
+ fCleanMake = new Button(g, SWT.RADIO);
+ fCleanMake.setText(AutotoolsPropertyMessages.getString(CLEAN_MAKE_LABEL));
+ gd= new GridData();
+ gd.horizontalAlignment= GridData.BEGINNING;
+ gd.horizontalSpan = 2;
+ fCleanMake.setLayoutData(gd);
+
+ Label label = new Label(g, SWT.LEFT);
+ label.setText(AutotoolsPropertyMessages.getString(CLEAN_MAKETARGET_LABEL));
+ gd= new GridData();
+ gd.horizontalAlignment= GridData.BEGINNING;
+ label.setLayoutData(gd);
+
+ fCleanMakeTarget = new Text(g, SWT.SINGLE | SWT.BORDER);
+ fCleanMakeTarget.setText(AutotoolsPropertyConstants.CLEAN_MAKE_TARGET_DEFAULT);
+ fCleanMakeTarget.setToolTipText(AutotoolsPropertyMessages.getString(CLEAN_MAKETARGET_TOOLTIP));
+ gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL);
+ fCleanMakeTarget.setLayoutData(gd);
+
+ fCleanDelete.addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ fCleanMake.setSelection(false);
+ fCleanDelete.setSelection(true);
+ fCleanMakeTarget.setEnabled(false);
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ // do nothing
+ }
+ });
+
+ fCleanMake.addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ fCleanDelete.setSelection(false);
+ fCleanMake.setSelection(true);
+ fCleanMakeTarget.setEnabled(true);
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ // do nothing
+ }
+ });
+
+ fCleanMakeTarget.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ if (fCleanMakeTarget.getText().equals("")) { // $NON-NLS-1$
+ // FIXME: should probably issue warning here, but how?
+ }
+ }
+ });
+
+ fAutoName = new Button(composite, SWT.LEFT | SWT.CHECK);
+ fAutoName.setText(AutotoolsPropertyMessages.getString(AUTO_BUILDNAME_LABEL));
+ fAutoName.setToolTipText(AutotoolsPropertyMessages.getString(AUTO_BUILDNAME_TOOLTIP));
+ gd= new GridData();
+ gd.horizontalAlignment= GridData.BEGINNING;
+ gd.horizontalSpan = 2;
+ fAutoName.setLayoutData(gd);
+
+ initialize();
+ }
+
+ protected void performOK() {
+ IProject project = getProject();
+ if (fCleanDelete.getSelection()) {
+ try {
+ project.setPersistentProperty(AutotoolsPropertyConstants.CLEAN_DELETE, TRUE);
+ } catch (CoreException ce) {
+ // FIXME: what can we do here?
+ }
+ } else {
+ try {
+ project.setPersistentProperty(AutotoolsPropertyConstants.CLEAN_DELETE, FALSE);
+ } catch (CoreException ce) {
+ // FIXME: what can we do here?
+ }
+ try {
+ project.setPersistentProperty(AutotoolsPropertyConstants.CLEAN_MAKE_TARGET, fCleanMakeTarget.getText());
+ } catch (CoreException ce) {
+ // FIXME: what can we do here?
+ }
+ }
+
+ if (fAutoName.getSelection()) {
+ try {
+ project.setPersistentProperty(AutotoolsPropertyConstants.AUTO_BUILD_NAME, TRUE);
+ } catch (CoreException ce) {
+ // FIXME: what can we do here?
+ }
+ } else {
+ try {
+ project.setPersistentProperty(AutotoolsPropertyConstants.AUTO_BUILD_NAME, FALSE);
+ } catch (CoreException ce) {
+ // FIXME: what can we do here?
+ }
+ }
+
+ }
+
+ protected void performApply(ICResourceDescription src, ICResourceDescription dst) {
+ performOK();
+ }
+
+ protected void performDefaults() {
+ fCleanDelete.setSelection(false);
+ fCleanMake.setSelection(true);
+ fCleanMakeTarget.setText(AutotoolsPropertyConstants.CLEAN_MAKE_TARGET_DEFAULT);
+ fCleanMakeTarget.setEnabled(true);
+ fAutoName.setEnabled(true);
+ }
+
+ public void updateData(ICResourceDescription cfgd) {
+ // what to do here?
+ }
+
+ public void updateButtons() {
+ // what to do here?
+ }
+
+ public void setVisible (boolean b) {
+ super.setVisible(b);
+ }
+
+ private void initialize() {
+ IProject project = getProject();
+ String cleanDelete = null;
+ String autoName = null;
+ String cleanMakeTarget = null;
+ try {
+ cleanDelete = project.getPersistentProperty(AutotoolsPropertyConstants.CLEAN_DELETE);
+ cleanMakeTarget = project.getPersistentProperty(AutotoolsPropertyConstants.CLEAN_MAKE_TARGET);
+ autoName = project.getPersistentProperty(AutotoolsPropertyConstants.AUTO_BUILD_NAME);
+ } catch (CoreException e) {
+ // do nothing
+ }
+
+ if (cleanMakeTarget == null) {
+ cleanMakeTarget = AutotoolsPropertyConstants.CLEAN_MAKE_TARGET_DEFAULT;
+ }
+ fCleanMakeTarget.setText(cleanMakeTarget);
+
+ if (cleanDelete == null || cleanDelete.equals(FALSE)) {
+ fCleanDelete.setSelection(false);
+ fCleanMake.setSelection(true);
+ fCleanMakeTarget.setEnabled(true);
+ } else {
+ fCleanDelete.setSelection(true);
+ fCleanMake.setSelection(false);
+ fCleanMakeTarget.setEnabled(false);
+ }
+
+ if (autoName == null || autoName.equals(TRUE))
+ fAutoName.setSelection(true);
+ else
+ fAutoName.setSelection(false);
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsCategoryPropertyOptionPage.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsCategoryPropertyOptionPage.java
new file mode 100644
index 0000000000..452fa181df
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsCategoryPropertyOptionPage.java
@@ -0,0 +1,139 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.properties;
+
+import java.util.ArrayList;
+
+import org.eclipse.jface.preference.BooleanFieldEditor;
+import org.eclipse.jface.preference.FieldEditor;
+import org.eclipse.jface.preference.StringFieldEditor;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.linuxtools.internal.cdt.autotools.core.configure.AutotoolsConfiguration;
+import org.eclipse.linuxtools.internal.cdt.autotools.core.configure.IAConfiguration;
+import org.eclipse.linuxtools.internal.cdt.autotools.core.configure.IConfigureOption;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+
+public class AutotoolsCategoryPropertyOptionPage extends
+ AbstractConfigurePropertyOptionsPage {
+
+ private String catName = "";
+ private IAConfiguration cfg;
+ // Label class for a preference page.
+ class LabelFieldEditor extends FieldEditor {
+ private String fTitle;
+ private Label fTitleLabel;
+
+ public LabelFieldEditor( Composite parent, String title ) {
+ fTitle = title;
+ this.createControl( parent );
+ }
+
+ protected void adjustForNumColumns( int numColumns ) {
+ ((GridData)fTitleLabel.getLayoutData()).horizontalSpan = 2;
+ }
+
+ protected void doFillIntoGrid( Composite parent, int numColumns ) {
+ fTitleLabel = new Label( parent, SWT.WRAP );
+ fTitleLabel.setText( fTitle );
+ GridData gd = new GridData();
+ gd.verticalAlignment = SWT.TOP;
+ gd.grabExcessHorizontalSpace = false;
+ gd.horizontalSpan = 2;
+ fTitleLabel.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 ArrayList<FieldEditor> fieldEditors;
+
+ public AutotoolsCategoryPropertyOptionPage(ToolListElement element, IAConfiguration cfg) {
+ super(element.getName());
+ this.catName = element.getName();
+ this.cfg = cfg;
+ fieldEditors = new ArrayList<FieldEditor>();
+ }
+
+ public String getName() {
+ return super.getName();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
+ */
+ protected void createFieldEditors() {
+ super.createFieldEditors();
+ Composite parent = getFieldEditorParent();
+// FontMetrics fm = AbstractCPropertyTab.getFontMetrics(parent);
+ AutotoolsConfiguration.Option[] options = AutotoolsConfiguration.getChildOptions(catName);
+ for (int i = 0; i < options.length; ++i) {
+ AutotoolsConfiguration.Option option = options[i];
+ switch (option.getType()) {
+ case IConfigureOption.STRING:
+ case IConfigureOption.INTERNAL:
+ case IConfigureOption.MULTIARG:
+ parent = getFieldEditorParent();
+ StringFieldEditor f = new StringFieldEditor(option.getName(), option.getDescription(), 20, parent);
+ f.getLabelControl(parent).setToolTipText(option.getToolTip());
+ addField(f);
+ fieldEditors.add(f);
+ break;
+ case IConfigureOption.BIN:
+ parent = getFieldEditorParent();
+ BooleanFieldEditor b = new BooleanFieldEditor(option.getName(), option.getDescription(), parent);
+ b.getDescriptionControl(parent).setToolTipText(option.getToolTip());
+ addField(b);
+ fieldEditors.add(b);
+ break;
+ }
+ }
+ }
+
+ protected FieldEditor createLabelEditor( Composite parent, String title ) {
+ return new LabelFieldEditor( parent, title );
+ }
+
+ /**
+ * Update the field editor that displays all the build options
+ */
+ public void updateFields() {
+ setValues();
+ }
+
+ public void setValues() {
+ for (int i = 0; i < fieldEditors.size(); ++i) {
+ fieldEditors.get(i).load();
+ }
+ }
+
+ public void propertyChange(PropertyChangeEvent event) {
+ // allow superclass to handle as well
+ super.propertyChange(event);
+
+ if (event.getSource() instanceof StringFieldEditor) {
+ StringFieldEditor f = (StringFieldEditor)event.getSource();
+ cfg.setOption(f.getPreferenceName(), f.getStringValue());
+ } else if (event.getSource() instanceof BooleanFieldEditor) {
+ BooleanFieldEditor b = (BooleanFieldEditor)event.getSource();
+ cfg.setOption(b.getPreferenceName(), Boolean.toString(b.getBooleanValue()));
+ }
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsConfigurePrefStore.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsConfigurePrefStore.java
new file mode 100644
index 0000000000..6c3c6671f5
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsConfigurePrefStore.java
@@ -0,0 +1,283 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.properties;
+
+import org.eclipse.core.runtime.ListenerList;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.linuxtools.internal.cdt.autotools.core.configure.IAConfiguration;
+import org.eclipse.linuxtools.internal.cdt.autotools.core.configure.IConfigureOption;
+
+/**
+ * @author jjohnstn
+ *
+ */
+public class AutotoolsConfigurePrefStore implements IPreferenceStore {
+
+ public final static String EMPTY_STRING = new String();
+ public final static String ALL_OPTIONS_ID = EMPTY_STRING;
+
+ private static AutotoolsConfigurePrefStore instance = null;
+ private ToolListElement selectedElement;
+ private IAConfiguration cfg;
+ private ListenerList listenerList;
+ private boolean isdirty;
+
+ private AutotoolsConfigurePrefStore() {
+ // private constructor
+ }
+
+ public static AutotoolsConfigurePrefStore getInstance() {
+ if (instance == null)
+ instance = new AutotoolsConfigurePrefStore();
+ return instance;
+ }
+
+ public void setSelection(IAConfiguration cfg, ToolListElement element) {
+ this.cfg = cfg;
+ selectedElement = element;
+ }
+
+ /* (non-Javadoc)
+ *
+ * @see org.eclipse.jface.preference.IPreferenceStore#addPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener)
+ */
+ public void addPropertyChangeListener(IPropertyChangeListener listener) {
+ listenerList.add(listener);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.IPreferenceStore#contains(java.lang.String)
+ */
+ public boolean contains(String name) {
+ return cfg.getOption(name) != null;
+ }
+
+ /* (non-Javadoc)
+ * @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 );
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.IPreferenceStore#getBoolean(java.lang.String)
+ */
+ public boolean getBoolean(String name) {
+ IConfigureOption option = cfg.getOption(name);
+ if (option != null && option.getType() == IConfigureOption.BIN) {
+ return Boolean.parseBoolean(option.getValue());
+ }
+ // otherwise punt
+ return getDefaultBoolean(name);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.IPreferenceStore#getDefaultBoolean(java.lang.String)
+ */
+ public boolean getDefaultBoolean(String name) {
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.IPreferenceStore#getDefaultDouble(java.lang.String)
+ */
+ public double getDefaultDouble(String name) {
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.IPreferenceStore#getDefaultFloat(java.lang.String)
+ */
+ public float getDefaultFloat(String name) {
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.IPreferenceStore#getDefaultInt(java.lang.String)
+ */
+ public int getDefaultInt(String name) {
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.IPreferenceStore#getDefaultLong(java.lang.String)
+ */
+ public long getDefaultLong(String name) {
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.IPreferenceStore#getDefaultString(java.lang.String)
+ */
+ public String getDefaultString(String name) {
+ return EMPTY_STRING;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.IPreferenceStore#getDouble(java.lang.String)
+ */
+ public double getDouble(String name) {
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.IPreferenceStore#getFloat(java.lang.String)
+ */
+ public float getFloat(String name) {
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.IPreferenceStore#getInt(java.lang.String)
+ */
+ public int getInt(String name) {
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.IPreferenceStore#getLong(java.lang.String)
+ */
+ public long getLong(String name) {
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.IPreferenceStore#getString(java.lang.String)
+ */
+ public String getString(String name) {
+ if (name.equals(ALL_OPTIONS_ID) && selectedElement.getType() == IConfigureOption.TOOL) {
+ return cfg.getToolParameters(selectedElement.getName());
+ }
+ IConfigureOption option = cfg.getOption(name);
+ if (option != null) {
+ return option.getValue();
+ }
+ // otherwise punt
+ return getDefaultString(name);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.IPreferenceStore#isDefault(java.lang.String)
+ */
+ public boolean isDefault(String name) {
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.IPreferenceStore#needsSaving()
+ */
+ public boolean needsSaving() {
+ return isdirty;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.IPreferenceStore#putValue(java.lang.String, java.lang.String)
+ */
+ public void putValue(String name, String value) {
+ setValue(name, value);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.IPreferenceStore#removePropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener)
+ */
+ public void removePropertyChangeListener(IPropertyChangeListener listener) {
+ listenerList.remove(listener);
+ }
+
+ protected void setDirty(boolean isdirty) {
+ this.isdirty = isdirty;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.IPreferenceStore#setDefault(java.lang.String, double)
+ */
+ public void setDefault(String name, double value) {}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.IPreferenceStore#setDefault(java.lang.String, float)
+ */
+ public void setDefault(String name, float value) {}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.IPreferenceStore#setDefault(java.lang.String, int)
+ */
+ public void setDefault(String name, int value) {}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.IPreferenceStore#setDefault(java.lang.String, long)
+ */
+ public void setDefault(String name, long value) {}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.IPreferenceStore#setDefault(java.lang.String, java.lang.String)
+ */
+ public void setDefault(String name, String defaultObject) {}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.IPreferenceStore#setDefault(java.lang.String, boolean)
+ */
+ public void setDefault(String name, boolean value) {}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.IPreferenceStore#setToDefault(java.lang.String)
+ */
+ public void setToDefault(String name) {}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.IPreferenceStore#setValue(java.lang.String, double)
+ */
+ public void setValue(String name, double value) {}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.IPreferenceStore#setValue(java.lang.String, float)
+ */
+ public void setValue(String name, float value) {}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.IPreferenceStore#setValue(java.lang.String, int)
+ */
+ public void setValue(String name, int value) {}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.IPreferenceStore#setValue(java.lang.String, long)
+ */
+ public void setValue(String name, long value) {}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.IPreferenceStore#setValue(java.lang.String, java.lang.String)
+ */
+ public void setValue(String name, String value) {
+ IConfigureOption option = cfg.getOption(name);
+ if (option != null)
+ option.setValue(value);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.IPreferenceStore#setValue(java.lang.String, boolean)
+ */
+ public void setValue(String name, boolean value) {
+ IConfigureOption option = cfg.getOption(name);
+ if (option != null)
+ option.setValue(Boolean.toString(value));
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsConfigurePropertyPage.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsConfigurePropertyPage.java
new file mode 100644
index 0000000000..301a1d0881
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsConfigurePropertyPage.java
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 Red Hat Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.properties;
+
+import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
+import org.eclipse.cdt.core.settings.model.extension.CConfigurationData;
+import org.eclipse.cdt.ui.newui.AbstractPage;
+import org.eclipse.linuxtools.internal.cdt.autotools.core.configure.AutotoolsConfigurationManager;
+import org.eclipse.linuxtools.internal.cdt.autotools.core.configure.IAConfiguration;
+
+public class AutotoolsConfigurePropertyPage extends AbstractPage {
+
+ private ICConfigurationDescription cfgd;
+
+ protected boolean isSingle() {
+ return true;
+ }
+
+ /**
+ * Default constructor
+ */
+ public AutotoolsConfigurePropertyPage() {
+ super();
+ }
+
+ public ICConfigurationDescription getCfgd() {
+ return cfgd;
+ }
+
+ public void getAllConfigurationData() {
+ ICConfigurationDescription[] cfgds = getCfgsEditable();
+ for (int i = 0; i < cfgds.length; ++i) {
+ @SuppressWarnings("unused")
+ // Following will trigger an option value handler check which will
+ // clone a configuration if necessary
+ CConfigurationData data = cfgds[i].getConfigurationData();
+ }
+ }
+
+ public IAConfiguration getConfiguration(ICConfigurationDescription cfgd) {
+ IAConfiguration acfg = AutotoolsConfigurationManager.getInstance().getTmpConfiguration(getProject(), cfgd);
+ return acfg;
+ }
+
+ protected void cfgChanged(ICConfigurationDescription _cfgd) {
+ cfgd = _cfgd;
+ // Let super update all pages
+ super.cfgChanged(_cfgd);
+ }
+}
+
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsConfigurePropertyTab.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsConfigurePropertyTab.java
new file mode 100644
index 0000000000..06a3c7447b
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsConfigurePropertyTab.java
@@ -0,0 +1,390 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.properties;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.ListIterator;
+import java.util.Map;
+
+import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
+import org.eclipse.cdt.core.settings.model.ICResourceDescription;
+import org.eclipse.cdt.managedbuilder.core.IConfiguration;
+import org.eclipse.cdt.managedbuilder.core.IMultiConfiguration;
+import org.eclipse.cdt.ui.newui.AbstractPage;
+import org.eclipse.cdt.ui.newui.PageLayout;
+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.linuxtools.internal.cdt.autotools.core.configure.AutotoolsConfigurationManager;
+import org.eclipse.linuxtools.internal.cdt.autotools.core.configure.IAConfiguration;
+import org.eclipse.linuxtools.internal.cdt.autotools.core.configure.IConfigureOption;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.AbstractAutotoolsCPropertyTab;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.custom.ScrolledComposite;
+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.ScrollBar;
+
+public class AutotoolsConfigurePropertyTab extends AbstractAutotoolsCPropertyTab implements IPreferencePageContainer {
+
+ private TreeViewer fTree;
+ private SashForm sashForm;
+ private Composite settingsPageContainer;
+ private AutotoolsConfigurePrefStore settingsStore;
+ private AbstractConfigurePropertyOptionsPage currentSettingsPage;
+ private ScrolledComposite containerSC;
+ private ToolListContentProvider listprovider;
+ private ToolListElement selectedElement;
+ private ICConfigurationDescription icfgd;
+
+ private Map<String, List<AbstractConfigurePropertyOptionsPage>> configToPageListMap;
+
+ private IProject getProject() {
+ return page.getProject();
+ }
+
+ public boolean canBeVisible() {
+ if (page.isForProject() || page.isForPrefs()) {
+ return true;
+ }
+ return false;
+ }
+
+ public IAConfiguration getAutotoolsCfg() {
+ AutotoolsConfigurePropertyPage ap = (AutotoolsConfigurePropertyPage)page;
+ // We call getConfigurationData() to get the name because if the configuration has been renamed,
+ // it will cause the option value handler to clone the IAConfiguration
+ return ap.getConfiguration(icfgd);
+ }
+
+ private void syncClones() {
+ AutotoolsConfigurePropertyPage ap = (AutotoolsConfigurePropertyPage)page;
+ // We call getConfigurationData() to get the name because if the configuration has been renamed,
+ // it will cause the option value handler to clone the IAConfiguration
+ ap.getAllConfigurationData();
+ }
+
+ public IPreferenceStore getPreferenceStore() {
+ return settingsStore;
+ }
+
+ public void createControls(Composite parent) {
+ AutotoolsConfigurationManager.getInstance().clearTmpConfigurations(getProject());
+ syncClones();
+
+ super.createControls(parent);
+ Composite composite= usercomp;
+
+ settingsStore = AutotoolsConfigurePrefStore.getInstance();
+ configToPageListMap = new HashMap<String, List<AbstractConfigurePropertyOptionsPage>>();
+
+ // assume parent page uses griddata
+ GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_CENTER | GridData.VERTICAL_ALIGN_FILL | GridData.FILL_HORIZONTAL
+ | GridData.FILL_VERTICAL);
+ composite.setLayoutData(gd);
+ GridLayout layout= new GridLayout();
+// layout.numColumns= 2;
+ //PixelConverter pc= new PixelConverter(composite);
+ //layout.verticalSpacing= pc.convertHeightInCharsToPixels(1) / 2;
+ composite.setLayout(layout);
+
+ // Create the sash form
+ sashForm = new SashForm(usercomp, SWT.NONE);
+ sashForm.setOrientation(SWT.HORIZONTAL);
+ sashForm.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ layout = new GridLayout(2, true);
+ layout.marginHeight = 5;
+ sashForm.setLayout(layout);
+ createSelectionArea(sashForm);
+ createEditArea(sashForm);
+
+// usercomp.addControlListener(new ControlAdapter() {
+// @Override
+// public void controlResized(ControlEvent e) {
+// specificResize();
+// }});
+
+ }
+
+// private void specificResize() {
+// Point p1 = fTree.getTree().computeSize(-1, -1);
+// Point p2 = fTree.getTree().getSize();
+// Point p3 = usercomp.getSize();
+// p1.x += calcExtra();
+// if (p3.x >= p1.x && (p1.x < p2.x || (p2.x * 2 < p3.x))) {
+// fTree.getTree().setSize(p1.x , p2.y);
+// sashForm.setWeights(new int[] {p1.x, (p3.x - p1.x)});
+// }
+// }
+//
+// private int calcExtra() {
+// int x = fTree.getTree().getBorderWidth() * 2;
+// ScrollBar sb = fTree.getTree().getVerticalBar();
+// if (sb != null) x += sb.getSize().x;
+// return x;
+// }
+
+ protected void createSelectionArea (Composite parent) {
+ fTree = new TreeViewer(parent, SWT.SINGLE|SWT.H_SCROLL|SWT.V_SCROLL|SWT.BORDER);
+ fTree.addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ handleOptionSelection();
+ }});
+ fTree.getControl().setLayoutData(new GridData(GridData.FILL_BOTH));
+ // Create a temporary default AutotoolsConfiguration to use for label info
+ IAConfiguration tmp = AutotoolsConfigurationManager.getInstance().createDefaultConfiguration(getProject(), "");
+ fTree.setLabelProvider(new ToolListLabelProvider(tmp));
+ }
+
+ protected void createEditArea(Composite parent) {
+ containerSC = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
+ containerSC.setExpandHorizontal(true);
+ containerSC.setExpandVertical(true);
+
+ // Add a container for the build settings page
+ settingsPageContainer = new Composite(containerSC, SWT.NONE);
+ settingsPageContainer.setLayout(new PageLayout());
+
+ containerSC.setContent(settingsPageContainer);
+// containerSC.setMinSize(settingsPageContainer.computeSize(SWT.DEFAULT, SWT.DEFAULT));
+ settingsPageContainer.layout();
+ }
+
+ protected void setValues() {
+ /*
+ * This method updates the context of the build property pages
+ * - Which configuration/resource configuration is selected
+ * - Which tool/option category is selected
+ *
+ * It is called:
+ * - When a property page becomes visible
+ * - When the user changes the configuration selection
+ * - When the user changes the "exclude" setting for a resource
+ */
+
+
+ IConfiguration icfg = getCfg(icfgd.getConfiguration());
+ if (icfg instanceof IMultiConfiguration) {
+ fTree.setInput(null);
+ fTree.getControl().setEnabled(false);
+ currentSettingsPage.setVisible(false);
+ return;
+ }
+
+ IAConfiguration currCfg = getAutotoolsCfg();
+
+ // Create the Tree Viewer content provider if first time
+ if (listprovider == null) {
+ listprovider = new ToolListContentProvider();
+ fTree.setContentProvider(listprovider);
+ }
+
+ // Update the selected configuration and the Tree Viewer
+ ToolListElement[] newElements;
+
+ fTree.setInput(currCfg);
+ fTree.getControl().setEnabled(true);
+ newElements = (ToolListElement[])listprovider.getElements(currCfg);
+ fTree.expandAll();
+
+ selectedElement = newElements[0];
+ fTree.setSelection(new StructuredSelection(selectedElement), true);
+
+// // Determine what the selection in the tree should be
+// // If the saved selection is not null, try to match the saved selection
+// // with an object in the new element list.
+// // Otherwise, select the first tool in the tree
+// Object primaryObject = null;
+// if (selectedElement != null) {
+// selectedElement = matchSelectionElement(selectedElement, newElements);
+// }
+//
+// if (selectedElement == null) {
+// selectedElement = (newElements != null && newElements.length > 0 ? newElements[0] : null);
+// }
+//
+// if (selectedElement != null) {
+// primaryObject = selectedElement.getTool();
+// if (primaryObject == null) {
+// primaryObject = selectedElement.getOptionCategory();
+// }
+// if (primaryObject != null) {
+// if (primaryObject instanceof IOptionCategory) {
+// ((ToolSettingsPrefStore)settingsStore).setSelection(getResDesc(), selectedElement, (IOptionCategory)primaryObject);
+// }
+// optionList.setSelection(new StructuredSelection(selectedElement), true);
+// }
+// }
+// specificResize();
+ }
+
+ private void handleOptionSelection() {
+ // Get the selection from the tree list
+ if (fTree == null) return;
+ IStructuredSelection selection = (IStructuredSelection) fTree.getSelection();
+ ToolListElement element = (ToolListElement)selection.getFirstElement();
+ if (element != null) {
+ displayPageForElement(element);
+ }
+
+ ScrollBar sb = containerSC.getHorizontalBar();
+ if (sb != null && sb.isVisible()) {
+ settingsPageContainer.pack(true);
+ containerSC.setMinSize(settingsPageContainer.getSize());
+ ((AbstractPage)page).resize();
+ }
+ }
+
+ private void displayPageForElement(ToolListElement element) {
+ selectedElement = element;
+ settingsStore.setSelection(getAutotoolsCfg(), selectedElement);
+
+ AbstractConfigurePropertyOptionsPage oldPage = currentSettingsPage;
+ currentSettingsPage = null;
+
+ // Create a new settings page if necessary
+ List<AbstractConfigurePropertyOptionsPage> pages = getPagesForConfig();
+ ListIterator<AbstractConfigurePropertyOptionsPage> iter = pages.listIterator();
+
+ while (iter.hasNext()) {
+ AbstractConfigurePropertyOptionsPage page = iter.next();
+ if (page.getName().equals(element.getName())) {
+ currentSettingsPage = page;
+ break;
+ }
+ }
+ if (currentSettingsPage == null) {
+ if (element.getType() == IConfigureOption.TOOL) {
+ currentSettingsPage = new AutotoolsToolPropertyOptionPage(
+ element, getAutotoolsCfg());
+ }
+ else {
+ currentSettingsPage = new AutotoolsCategoryPropertyOptionPage(
+ element, getAutotoolsCfg());
+ }
+ 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);
+ currentSettingsPage.updateFields();
+
+ if (oldPage != null && oldPage != currentSettingsPage)
+ oldPage.setVisible(false);
+
+ // Set the size of the scrolled area
+ containerSC.setMinSize(currentSettingsPage.computeSize());
+ settingsPageContainer.layout();
+
+ }
+
+ /* (non-Javadoc)
+ * Answers the list of settings pages for the selected configuration
+ */
+ private List<AbstractConfigurePropertyOptionsPage> getPagesForConfig() {
+ if (getCfg() == null) return null;
+ List<AbstractConfigurePropertyOptionsPage> pages = configToPageListMap.get(getCfg().getName());
+ if (pages == null) {
+ pages = new ArrayList<AbstractConfigurePropertyOptionsPage>();
+ configToPageListMap.put(getCfg().getName(), pages);
+ }
+ return pages;
+ }
+
+ /**
+ * Returns the "dirty" state
+ */
+ public boolean isDirty() {
+ // Check each settings page
+ List<AbstractConfigurePropertyOptionsPage> pages = getPagesForConfig();
+ // Make sure we have something to work on
+ if (pages == null) {
+ // Nothing to do
+ return false;
+ }
+ ListIterator<AbstractConfigurePropertyOptionsPage> iter = pages.listIterator();
+ while (iter.hasNext()) {
+ AbstractConfigurePropertyOptionsPage page = iter.next();
+ if (page == null) continue;
+ if (page.isDirty()) return true;
+ }
+ return false;
+ }
+
+ protected void performOK() {
+ ICConfigurationDescription[] cfgs = page.getCfgsEditable();
+ AutotoolsConfigurePropertyPage ap = (AutotoolsConfigurePropertyPage)page;
+ Map<String, IAConfiguration> cfgList = new HashMap<String, IAConfiguration>();
+ for (int i = 0; i < cfgs.length; ++i) {
+ ICConfigurationDescription cd = cfgs[i];
+ IAConfiguration acfg = ap.getConfiguration(cd);
+ cfgList.put(cd.getId(), acfg);
+ }
+ IProject project = getProject();
+ AutotoolsConfigurationManager.getInstance().replaceProjectConfigurations(project, cfgList, cfgs);
+ AutotoolsConfigurationManager.getInstance().clearTmpConfigurations(project);
+ }
+
+ protected void performCancel() {
+ AutotoolsConfigurationManager.getInstance().clearTmpConfigurations(getProject());
+ }
+
+ protected void performApply(ICResourceDescription src, ICResourceDescription dst) {
+ IProject project = getProject();
+ ICConfigurationDescription[] cfgs = page.getCfgsEditable();
+ // Apply all changes to existing saved configurations and new configurations, but do not perform
+ // deletions.
+ AutotoolsConfigurationManager.getInstance().applyConfigs(project.getName(), cfgs);
+ }
+
+ protected void performDefaults() {
+ IAConfiguration cfg = getAutotoolsCfg();
+ cfg.setDefaultOptions();
+ setValues();
+ }
+
+ protected void updateData(ICResourceDescription rd) {
+ if (rd == null) return;
+ icfgd = rd.getConfiguration();
+ setValues();
+ }
+
+ public void setVisible (boolean b) {
+ super.setVisible(b);
+ }
+
+ // IPreferencePageContainer methods
+ @Override
+ public void updateButtons() {}
+ public void updateMessage() {}
+ public void updateTitle() {}
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsEditorPropertyTab.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsEditorPropertyTab.java
new file mode 100644
index 0000000000..26d044384b
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsEditorPropertyTab.java
@@ -0,0 +1,276 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 Red Hat Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.properties;
+
+import org.eclipse.cdt.core.settings.model.ICResourceDescription;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.linuxtools.cdt.autotools.core.AutotoolsPlugin;
+import org.eclipse.linuxtools.internal.cdt.autotools.core.AutotoolsPropertyConstants;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.AbstractAutotoolsCPropertyTab;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.preferences.AutotoolsEditorPreferenceConstants;
+import org.eclipse.swt.SWT;
+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.Label;
+
+
+public class AutotoolsEditorPropertyTab extends AbstractAutotoolsCPropertyTab {
+
+ protected Combo fACVersionCombo;
+ protected Combo fAMVersionCombo;
+ IProject project;
+
+// private class ACVersionSelectionListener implements SelectionListener {
+// ICPropertyProvider p;
+// public ACVersionSelectionListener(ICPropertyProvider p) {
+// this.p = p;
+// }
+//
+// public void widgetSelected(SelectionEvent e) {
+// int index = fACVersionCombo.getSelectionIndex();
+// try {
+// AutotoolsEditorPropertyTab.getProject(p).setPersistentProperty(AutotoolsPropertyConstants.AUTOCONF_VERSION, fACVersionCombo.getItem(index));
+// } catch (CoreException ce) {
+// // FIXME: what can we do here?
+// }
+// }
+//
+// public void widgetDefaultSelected(SelectionEvent e) {
+// // do nothing
+// }
+// }
+//
+// private class AMVersionSelectionListener implements SelectionListener {
+// ICPropertyProvider p;
+// public AMVersionSelectionListener(ICPropertyProvider p) {
+// this.p = p;
+// }
+//
+// public void widgetSelected(SelectionEvent e) {
+// int index = fAMVersionCombo.getSelectionIndex();
+// try {
+// AutotoolsEditorPropertyTab.getProject(p).setPersistentProperty(AutotoolsPropertyConstants.AUTOMAKE_VERSION, fAMVersionCombo.getItem(index));
+// } catch (CoreException ce) {
+// // FIXME: what can we do here?
+// }
+// }
+//
+// public void widgetDefaultSelected(SelectionEvent e) {
+// // do nothing
+// }
+// }
+
+ private IProject getProject() {
+ return page.getProject();
+ }
+
+ public boolean canBeVisible() {
+ return true;
+ }
+
+ public void createControls(Composite parent) {
+ // TODO Auto-generated method stub
+ super.createControls(parent);
+ Composite composite= usercomp;
+
+ // assume parent page uses griddata
+ GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_CENTER | GridData.VERTICAL_ALIGN_FILL);
+ composite.setLayoutData(gd);
+ GridLayout layout= new GridLayout();
+ layout.numColumns= 2;
+ //PixelConverter pc= new PixelConverter(composite);
+ //layout.verticalSpacing= pc.convertHeightInCharsToPixels(1) / 2;
+ composite.setLayout(layout);
+
+ project = getProject();
+
+ /* check box for new editors */
+ fACVersionCombo= new Combo(composite, SWT.CHECK | SWT.DROP_DOWN | SWT.READ_ONLY);
+ fACVersionCombo.setItems(AutotoolsPropertyConstants.fACVersions);
+ fACVersionCombo.select(AutotoolsPropertyConstants.fACVersions.length - 1);
+ gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_BEGINNING);
+ fACVersionCombo.setLayoutData(gd);
+
+ Label label= new Label(composite, SWT.LEFT);
+ label.setText(AutotoolsPropertyMessages.getString("ACEditor.autoconfVersion")); //$NON-NLS-1$
+ gd= new GridData();
+ gd.horizontalAlignment= GridData.BEGINNING;
+ label.setLayoutData(gd);
+
+ /* check box for new editors */
+ fAMVersionCombo= new Combo(composite, SWT.CHECK | SWT.DROP_DOWN | SWT.READ_ONLY);
+ fAMVersionCombo.setItems(AutotoolsPropertyConstants.fAMVersions);
+ fAMVersionCombo.select(AutotoolsPropertyConstants.fAMVersions.length - 1);
+ gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_BEGINNING);
+ fAMVersionCombo.setLayoutData(gd);
+
+ Label label2= new Label(composite, SWT.LEFT);
+ label2.setText(AutotoolsPropertyMessages.getString("ACEditor.automakeVersion")); //$NON-NLS-1$
+ gd= new GridData();
+ gd.horizontalAlignment= GridData.BEGINNING;
+ label2.setLayoutData(gd);
+
+ initialize();
+ }
+
+ public void performOK() {
+ String acVer = null;
+ String amVer = null;
+ boolean changed = false;
+ try {
+ acVer = project.getPersistentProperty(AutotoolsPropertyConstants.AUTOCONF_VERSION);
+ amVer = project.getPersistentProperty(AutotoolsPropertyConstants.AUTOMAKE_VERSION);
+ } catch (CoreException e) {
+ acVer = "";
+ amVer = "";
+ }
+ int index = fACVersionCombo.getSelectionIndex();
+ String acVerSelected = fACVersionCombo.getItem(index);
+ if (!acVerSelected.equals(acVer)) {
+ changed = true;
+ try {
+ project.setPersistentProperty(AutotoolsPropertyConstants.AUTOCONF_VERSION, fACVersionCombo.getItem(index));
+ } catch (CoreException ce) {
+ // Not much we can do at this point
+ }
+ }
+
+ index = fAMVersionCombo.getSelectionIndex();
+ String amVerSelected = fAMVersionCombo.getItem(index);
+ if (!amVerSelected.equals(amVer)) {
+ changed = true;
+ try {
+ project.setPersistentProperty(AutotoolsPropertyConstants.AUTOMAKE_VERSION, fAMVersionCombo.getItem(index));
+ } catch (CoreException ce) {
+ // Not much we can do here either
+ }
+ }
+
+ // Notify any Autoconf editors that are open for this project that macro versioning
+ // has changed.
+ if (changed)
+ AutotoolsPropertyManager.getDefault().notifyPropertyListeners(project, AutotoolsPropertyConstants.AUTOCONF_MACRO_VERSIONING);
+ }
+
+ protected void performApply(ICResourceDescription src, ICResourceDescription dst) {
+ performOK();
+ }
+
+ public void performDefaults() {
+ // For default Autoconf and Automake versions, use the setting from the
+ // Autotools preference dialog.
+ String version = AutotoolsPlugin.getDefault().getPreferenceStore().getString(AutotoolsEditorPreferenceConstants.AUTOCONF_VERSION);
+ String[] items = fACVersionCombo.getItems();
+ // Try and find which list item matches the current preference stored and
+ // select it in the list.
+ int i;
+ for (i = 0; i < items.length; ++i) {
+ if (items[i].equals(version))
+ break;
+ }
+ if (i >= items.length)
+ i = items.length - 1;
+ fACVersionCombo.select(i);
+
+ version = AutotoolsPlugin.getDefault().getPreferenceStore().getString(AutotoolsEditorPreferenceConstants.AUTOMAKE_VERSION);
+ items = fAMVersionCombo.getItems();
+ // Try and find which list item matches the current preference stored and
+ // select it in the list
+ for (i = 0; i < items.length; ++i) {
+ if (items[i].equals(version))
+ break;
+ }
+ if (i >= items.length)
+ i = items.length - 1;
+ fAMVersionCombo.select(i);
+ }
+
+ public void updateData(ICResourceDescription cfgd) {
+ // Nothing to do
+ }
+
+ public void updateButtons() {
+ // Nothing to do
+ }
+
+ public void setVisible (boolean b) {
+ super.setVisible(b);
+ }
+
+// private IProject getProject(ICPropertyProvider provider) {
+// Object element = provider.getElement();
+// if (element != null) {
+// if (element instanceof IFile ||
+// element instanceof IProject ||
+// element instanceof IFolder)
+// {
+// IResource f = (IResource) element;
+// return f.getProject();
+// }
+// else if (element instanceof ICProject)
+// return ((ICProject)element).getProject();
+// }
+// return null;
+// }
+
+ private void initialize() {
+ initializeACVersion();
+ initializeAMVersion();
+ }
+
+ void initializeACVersion() {
+ String version = "";
+ try {
+ version = project.getPersistentProperty(AutotoolsPropertyConstants.AUTOCONF_VERSION);
+ if (version == null)
+ version = AutotoolsPlugin.getDefault().getPreferenceStore().getString(AutotoolsEditorPreferenceConstants.AUTOCONF_VERSION);
+ } catch (CoreException e) {
+ // do nothing
+ }
+ String[] items = fACVersionCombo.getItems();
+ // Try and find which list item matches the current preference stored and
+ // select it in the list.
+ int i;
+ for (i = 0; i < items.length; ++i) {
+ if (items[i].equals(version))
+ break;
+ }
+ if (i >= items.length)
+ i = items.length - 1;
+ fACVersionCombo.select(i);
+ }
+
+ void initializeAMVersion() {
+ String version = "";
+ try {
+ version = project.getPersistentProperty(AutotoolsPropertyConstants.AUTOMAKE_VERSION);
+ if (version == null)
+ version = AutotoolsPlugin.getDefault().getPreferenceStore().getString(AutotoolsEditorPreferenceConstants.AUTOMAKE_VERSION);
+ } catch (CoreException e) {
+ // do nothing
+ }
+ String[] items = fAMVersionCombo.getItems();
+ // Try and find which list item matches the current preference stored and
+ // select it in the list.
+ int i;
+ for (i = 0; i < items.length; ++i) {
+ if (items[i].equals(version))
+ break;
+ }
+ if (i >= items.length)
+ i = items.length - 1;
+ fAMVersionCombo.select(i);
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsGeneralPropertyPage.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsGeneralPropertyPage.java
new file mode 100644
index 0000000000..b7f234d49f
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsGeneralPropertyPage.java
@@ -0,0 +1,15 @@
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.properties;
+
+import org.eclipse.cdt.ui.newui.AbstractPage;
+
+public class AutotoolsGeneralPropertyPage extends AbstractPage {
+
+ @Override
+ protected boolean isSingle() {
+ return false;
+ }
+
+ @Override
+ protected boolean showsConfig() { return false; }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsHeadPropertyPage.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsHeadPropertyPage.java
new file mode 100644
index 0000000000..dfba7fc7b8
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsHeadPropertyPage.java
@@ -0,0 +1,15 @@
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.properties;
+
+import org.eclipse.cdt.ui.newui.AbstractPage;
+
+public class AutotoolsHeadPropertyPage extends AbstractPage {
+
+ @Override
+ protected boolean isSingle() {
+ return true;
+ }
+
+ @Override
+ protected boolean showsConfig() { return false; }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsPropertyManager.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsPropertyManager.java
new file mode 100644
index 0000000000..21f27d39f7
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsPropertyManager.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.properties;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.ListenerList;
+
+public class AutotoolsPropertyManager implements IPropertyChangeManager {
+
+ private static AutotoolsPropertyManager fInstance;
+ private Map<IProject, ListenerList> projectList;
+
+ private AutotoolsPropertyManager() {
+ projectList = new HashMap<IProject, ListenerList>();
+ }
+
+ public static AutotoolsPropertyManager getDefault() {
+ if (fInstance == null)
+ fInstance = new AutotoolsPropertyManager();
+ return fInstance;
+ }
+
+ public synchronized void addProjectPropertyListener(IProject project,
+ IProjectPropertyListener listener) {
+ ListenerList list = (ListenerList)projectList.get(project);
+ if (list == null) {
+ list = new ListenerList();
+ projectList.put(project, list);
+ }
+ list.add(listener);
+ }
+
+ public synchronized void notifyPropertyListeners(IProject project, String property) {
+ ListenerList list = (ListenerList)projectList.get(project);
+ if (list != null) {
+ Object[] listeners = list.getListeners();
+ for (int i = 0; i < listeners.length; ++i) {
+ ((IProjectPropertyListener)listeners[i]).handleProjectPropertyChanged(project, property);
+ }
+ }
+ }
+
+ public synchronized void removeProjectPropertyListener(IProject project,
+ IProjectPropertyListener listener) {
+ ListenerList list = (ListenerList)projectList.get(project);
+ if (list != null)
+ list.remove(listener);
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsPropertyMessages.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsPropertyMessages.java
new file mode 100644
index 0000000000..44f2174473
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsPropertyMessages.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 2006, 2009 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.properties;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+/**
+ * MakefilePreferencesMessages
+ */
+public class AutotoolsPropertyMessages {
+
+ /**
+ *
+ */
+ private AutotoolsPropertyMessages() {
+ }
+
+ private static final String BUNDLE_NAME = AutotoolsPropertyMessages.class.getName();
+
+ public static String getString(String key) {
+ try {
+ return ResourceBundle.getBundle(BUNDLE_NAME).getString(key);
+ } catch (MissingResourceException e) {
+ return '!' + key + '!';
+ } catch (NullPointerException e) {
+ return '#' + key + '#';
+ }
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsPropertyMessages.properties b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsPropertyMessages.properties
new file mode 100644
index 0000000000..a9c612595a
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsPropertyMessages.properties
@@ -0,0 +1,44 @@
+###############################################################################
+# Copyright (c) 2007, 2009 Red Hat Inc. and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Red Hat Inc. - initial API and implementation
+###############################################################################
+
+Edit.name=Editors
+Build.name=Build
+
+Autotools.aclocalPath=aclocal
+Autotools.aclocalPath.tooltip=Specify desired aclocal to use for project
+Autotools.automakePath=automake
+Autotools.automakePath.tooltip=Specify desired automake to use for project
+Autotools.autoconfPath=autoconf
+Autotools.autoconfPath.tooltip=Specify desired autoconf to use for project
+Autotools.autoheaderPath=autoheader
+Autotools.autoheaderPath.tooltip=Specify desired autoheader to use for project
+Autotools.autoreconfPath=autoreconf
+Autotools.autoreconfPath.tooltip=Specify desired autoreconf to use for project
+Autotools.libtoolizePath=libtoolize
+Autotools.libtoolizePath.tooltip=Specify desired libtoolize to use for project
+
+ACEditor.version=&Version
+ACEditor.autoconfVersion=Version of Autoconf to use for syntax checking
+ACEditor.automakeVersion=Version of Automake to use for syntax checking
+
+ScannerMakeW.label=Use make -n -w per file to generate scanner info
+ScannerMakeW.tooltip=Use this option only if necessary to get correct include path
+
+CleanBehavior.title=Clean Build Behavior
+
+CleanDelete.label=Delete build directory on "clean" operation
+CleanMake.label=Use make target to clean
+CleanMakeTarget.label=Make target:
+CleanMakeTarget.default=distclean
+CleanMakeTarget.tooltip=Specify a top-level make target to clean build directory
+
+AutoBuildName.label=Automatically generate build directory names for additional configurations
+AutoBuildName.tooltip=When a configuration other than the first configuration is created, generate a unique build directory using the configuration name.
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsToolPropertyOptionPage.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsToolPropertyOptionPage.java
new file mode 100644
index 0000000000..c7f50485ea
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsToolPropertyOptionPage.java
@@ -0,0 +1,142 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc.
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.properties;
+
+import org.eclipse.cdt.ui.newui.AbstractCPropertyTab;
+import org.eclipse.cdt.ui.newui.MultiLineTextFieldEditor;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.preference.FieldEditor;
+import org.eclipse.jface.preference.StringFieldEditor;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.linuxtools.internal.cdt.autotools.core.configure.ConfigureMessages;
+import org.eclipse.linuxtools.internal.cdt.autotools.core.configure.IAConfiguration;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.FontMetrics;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+
+public class AutotoolsToolPropertyOptionPage extends
+ AbstractConfigurePropertyOptionsPage {
+
+ private ToolListElement element;
+ private String toolName = "";
+ private IAConfiguration cfg;
+ // Label class for a preference page.
+ class LabelFieldEditor extends FieldEditor {
+ private String fTitle;
+ private Label fTitleLabel;
+
+ public LabelFieldEditor( Composite parent, String title ) {
+ fTitle = title;
+ this.createControl( parent );
+ }
+
+ protected void adjustForNumColumns( int numColumns ) {
+ ((GridData)fTitleLabel.getLayoutData()).horizontalSpan = 2;
+ }
+
+ protected void doFillIntoGrid( Composite parent, int numColumns ) {
+ fTitleLabel = new Label( parent, SWT.WRAP );
+ fTitleLabel.setText( fTitle );
+ GridData gd = new GridData();
+ gd.verticalAlignment = SWT.TOP;
+ gd.grabExcessHorizontalSpace = false;
+ gd.horizontalSpan = 2;
+ fTitleLabel.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() {}
+ }
+
+ public AutotoolsToolPropertyOptionPage(ToolListElement element, IAConfiguration cfg) {
+ super(element.getName());
+ this.element = element;
+ this.toolName = element.getName();
+ this.cfg = cfg;
+ }
+
+ public String getName() {
+ return super.getName();
+ }
+
+ public ToolListElement getElement() {
+ return element;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
+ */
+ protected void createFieldEditors() {
+ super.createFieldEditors();
+ // Add a string editor to edit the tool command
+ Composite parent = getFieldEditorParent();
+ FontMetrics fm = AbstractCPropertyTab.getFontMetrics(parent);
+ commandStringField = new StringFieldEditor(toolName,
+ ConfigureMessages.getString(COMMAND),
+ parent);
+ commandStringField.setEmptyStringAllowed(false);
+ GridData gd = ((GridData)commandStringField.getTextControl(parent).getLayoutData());
+ gd.grabExcessHorizontalSpace = true;
+ gd.minimumWidth = Dialog.convertWidthInCharsToPixels(fm, 3);
+ addField(commandStringField);
+ // Add a field editor that displays overall build options
+ Composite par = getFieldEditorParent();
+ allOptionFieldEditor = new MultiLineTextFieldEditor(AutotoolsConfigurePrefStore.ALL_OPTIONS_ID,
+ ConfigureMessages.getString(ALL_OPTIONS), par);
+ allOptionFieldEditor.getTextControl(par).setEditable(false);
+// gd = ((GridData)allOptionFieldEditor.getTextControl().getLayoutData());
+ gd.grabExcessHorizontalSpace = true;
+ gd.minimumWidth = Dialog.convertWidthInCharsToPixels(fm, 20);
+ addField(allOptionFieldEditor);
+ }
+
+ protected FieldEditor createLabelEditor( Composite parent, String title ) {
+ return new LabelFieldEditor( parent, title );
+ }
+
+ // field editor that displays all the build options for a particular tool
+ private MultiLineTextFieldEditor allOptionFieldEditor;
+ //tool command field
+ private StringFieldEditor commandStringField;
+ // all build options field editor label
+ private static final String ALL_OPTIONS = "Tool.allopts"; //$NON-NLS-1$
+ // Field editor label for tool command
+ private static final String COMMAND = "Tool.command"; //$NON-NLS-1$
+
+ /**
+ * Update the field editor that displays all the build options
+ */
+ public void updateFields() {
+ allOptionFieldEditor.load();
+ }
+
+ public void setValues(){
+ commandStringField.load();
+ updateFields();
+ }
+
+ public void propertyChange(PropertyChangeEvent event) {
+ // allow superclass to handle as well
+ super.propertyChange(event);
+
+ if(event.getSource() == commandStringField){
+ cfg.setOption(toolName, commandStringField.getStringValue());
+ updateFields();
+ }
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsToolsPropertyTab.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsToolsPropertyTab.java
new file mode 100644
index 0000000000..2d8268e961
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/AutotoolsToolsPropertyTab.java
@@ -0,0 +1,346 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 Red Hat Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.properties;
+
+import org.eclipse.cdt.core.settings.model.ICResourceDescription;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.linuxtools.internal.cdt.autotools.core.AutotoolsPropertyConstants;
+import org.eclipse.linuxtools.internal.cdt.autotools.core.configure.AutotoolsConfiguration;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.AbstractAutotoolsCPropertyTab;
+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;
+
+public class AutotoolsToolsPropertyTab extends AbstractAutotoolsCPropertyTab {
+
+ public static final String DEFAULT_ACLOCAL = "aclocal"; // $NON-NLS-1$
+ public static final String DEFAULT_AUTOMAKE = "automake"; // $NON-NLS-1$
+ public static final String DEFAULT_AUTOCONF = "autoconf"; // $NON-NLS-1$
+ public static final String DEFAULT_AUTOHEADER = "autoheader"; // $NON-NLS-1$
+ public static final String DEFAULT_AUTORECONF = "autoreconf"; // $NON-NLS-1$
+ public static final String DEFAULT_LIBTOOLIZE = "libtoolize"; // $NON-NLS-1$
+
+ protected Text fAclocalPath;
+ protected Text fAutomakePath;
+ protected Text fAutoconfPath;
+ protected Text fAutoheaderPath;
+ protected Text fAutoreconfPath;
+ protected Text fLibtoolizePath;
+ private IProject project;
+
+
+ private IProject getProject() {
+ return page.getProject();
+ }
+
+ public boolean canBeVisible() {
+ return true;
+ }
+
+ public void cfgChanged(AutotoolsConfiguration cfg) {
+ // Nothing to do
+ }
+
+ public void createControls(Composite parent) {
+ // TODO Auto-generated method stub
+ super.createControls(parent);
+ Composite composite= usercomp;
+
+ // assume parent page uses griddata
+ GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_CENTER | GridData.VERTICAL_ALIGN_FILL | GridData.FILL_HORIZONTAL);
+ composite.setLayoutData(gd);
+ GridLayout layout= new GridLayout();
+ layout.numColumns= 2;
+ //PixelConverter pc= new PixelConverter(composite);
+ //layout.verticalSpacing= pc.convertHeightInCharsToPixels(1) / 2;
+ composite.setLayout(layout);
+
+ project = getProject();
+
+ Label label= new Label(composite, SWT.LEFT);
+ label.setText(AutotoolsPropertyMessages.getString("Autotools.aclocalPath")); //$NON-NLS-1$
+ gd= new GridData();
+ gd.horizontalAlignment= GridData.BEGINNING;
+ label.setLayoutData(gd);
+
+ /* text window for aclocal path */
+ fAclocalPath = new Text(composite, SWT.BORDER | SWT.SINGLE);
+ fAclocalPath.setToolTipText(AutotoolsPropertyMessages.getString("Autotools.aclocalPath.tooltip")); // $NON-NLS-1$
+ gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL);
+ fAclocalPath.setLayoutData(gd);
+
+ Label label2= new Label(composite, SWT.LEFT);
+ label2.setText(AutotoolsPropertyMessages.getString("Autotools.automakePath")); //$NON-NLS-1$
+ gd= new GridData();
+ gd.horizontalAlignment= GridData.BEGINNING;
+ label2.setLayoutData(gd);
+
+ /* text window for automake path */
+ fAutomakePath = new Text(composite, SWT.BORDER | SWT.SINGLE);
+ fAutomakePath.setToolTipText(AutotoolsPropertyMessages.getString("Autotools.automakePath.tooltip")); // $NON-NLS-1#
+ gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL);
+ fAutomakePath.setLayoutData(gd);
+
+ Label label3 = new Label(composite, SWT.LEFT);
+ label3.setText(AutotoolsPropertyMessages.getString("Autotools.autoconfPath")); //$NON-NLS-1$
+ gd= new GridData();
+ gd.horizontalAlignment= GridData.BEGINNING;
+ label3.setLayoutData(gd);
+
+ /* text window for autoconf path */
+ fAutoconfPath = new Text(composite, SWT.BORDER | SWT.SINGLE);
+ fAutoconfPath.setToolTipText(AutotoolsPropertyMessages.getString("Autotools.autoconfPath.tooltip")); // $NON-NLS-1$
+ gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL);
+ fAutoconfPath.setLayoutData(gd);
+
+ Label label4= new Label(composite, SWT.LEFT);
+ label4.setText(AutotoolsPropertyMessages.getString("Autotools.autoheaderPath")); //$NON-NLS-1$
+ gd= new GridData();
+ gd.horizontalAlignment= GridData.BEGINNING;
+ label4.setLayoutData(gd);
+
+ /* text window for autoheader path */
+ fAutoheaderPath = new Text(composite, SWT.BORDER | SWT.SINGLE);
+ fAutoheaderPath.setToolTipText(AutotoolsPropertyMessages.getString("Autotools.autoheaderPath.tooltip")); // $NON-NLS-1$
+ gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL);
+ fAutoheaderPath.setLayoutData(gd);
+
+ Label label5= new Label(composite, SWT.LEFT);
+ label5.setText(AutotoolsPropertyMessages.getString("Autotools.autoreconfPath")); //$NON-NLS-1$
+ gd= new GridData();
+ gd.horizontalAlignment= GridData.BEGINNING;
+ label5.setLayoutData(gd);
+
+ /* text window for autoreconf path */
+ fAutoreconfPath = new Text(composite, SWT.BORDER | SWT.SINGLE);
+ fAutoreconfPath.setToolTipText(AutotoolsPropertyMessages.getString("Autotools.autoreconfPath.tooltip")); // $NON-NLS-1$
+ gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL);
+ fAutoreconfPath.setLayoutData(gd);
+
+ Label label6= new Label(composite, SWT.LEFT);
+ label6.setText(AutotoolsPropertyMessages.getString("Autotools.libtoolizePath")); //$NON-NLS-1$
+ gd= new GridData();
+ gd.horizontalAlignment= GridData.BEGINNING;
+ label6.setLayoutData(gd);
+
+ /* text window for libtoolize path */
+ fLibtoolizePath = new Text(composite, SWT.BORDER | SWT.SINGLE);
+ fLibtoolizePath.setToolTipText(AutotoolsPropertyMessages.getString("Autotools.libtoolizePath.tooltip")); // $NON-NLS-1$
+ gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL);
+ fLibtoolizePath.setLayoutData(gd);
+
+ initialize();
+ }
+
+ public void performOK() {
+ String aclocalPath = null;
+ String automakePath = null;
+ String autoconfPath = null;
+ String autoheaderPath = null;
+ String autoreconfPath = null;
+ String libtoolizePath = null;
+ try {
+ aclocalPath = project.getPersistentProperty(AutotoolsPropertyConstants.ACLOCAL_TOOL);
+ } catch (CoreException e1) {
+ aclocalPath = DEFAULT_ACLOCAL;
+ }
+
+ String newAclocalPath = fAclocalPath.getText().trim();
+ if (aclocalPath == null || !newAclocalPath.equals(aclocalPath)) {
+ try {
+ project.setPersistentProperty(AutotoolsPropertyConstants.ACLOCAL_TOOL, newAclocalPath);
+ } catch (CoreException e1) {
+ // Not much we can do at this point
+ }
+ }
+
+ try {
+ automakePath = project.getPersistentProperty(AutotoolsPropertyConstants.AUTOMAKE_TOOL);
+ } catch (CoreException e1) {
+ automakePath = DEFAULT_AUTOMAKE;
+ }
+
+ String newAutomakePath = fAutomakePath.getText().trim();
+ if (automakePath == null || !newAutomakePath.equals(automakePath)) {
+ try {
+ project.setPersistentProperty(AutotoolsPropertyConstants.AUTOMAKE_TOOL, newAutomakePath);
+ } catch (CoreException e2) {
+ // Not much we can do at this point
+ }
+ }
+
+ try {
+ autoconfPath = project.getPersistentProperty(AutotoolsPropertyConstants.AUTOCONF_TOOL);
+ } catch (CoreException e1) {
+ autoconfPath = DEFAULT_AUTOCONF;
+ }
+
+ String newAutoconfPath = fAutoconfPath.getText().trim();
+ if (autoconfPath == null || !newAutoconfPath.equals(autoconfPath)) {
+ try {
+ project.setPersistentProperty(AutotoolsPropertyConstants.AUTOCONF_TOOL, newAutoconfPath);
+ } catch (CoreException e2) {
+ // Not much we can do at this point
+ }
+ }
+
+ try {
+ autoheaderPath = project.getPersistentProperty(AutotoolsPropertyConstants.AUTOHEADER_TOOL);
+ } catch (CoreException e1) {
+ autoheaderPath = DEFAULT_AUTOHEADER;
+ }
+
+ String newAutoheaderPath = fAutoheaderPath.getText().trim();
+ if (autoheaderPath == null || !newAutoheaderPath.equals(autoheaderPath)) {
+ try {
+ project.setPersistentProperty(AutotoolsPropertyConstants.AUTOHEADER_TOOL, newAutoheaderPath);
+ } catch (CoreException e2) {
+ // Not much we can do at this point
+ }
+ }
+
+ try {
+ autoreconfPath = project.getPersistentProperty(AutotoolsPropertyConstants.AUTORECONF_TOOL);
+ } catch (CoreException e1) {
+ autoreconfPath = DEFAULT_AUTORECONF;
+ }
+
+ String newAutoreconfPath = fAutoreconfPath.getText().trim();
+ if (autoreconfPath == null || !newAutoreconfPath.equals(autoreconfPath)) {
+ try {
+ project.setPersistentProperty(AutotoolsPropertyConstants.AUTORECONF_TOOL, newAutoreconfPath);
+ } catch (CoreException e2) {
+ // Not much we can do at this point
+ }
+ }
+
+ try {
+ libtoolizePath = project.getPersistentProperty(AutotoolsPropertyConstants.LIBTOOLIZE_TOOL);
+ } catch (CoreException e1) {
+ libtoolizePath = DEFAULT_LIBTOOLIZE;
+ }
+
+ String newLibtoolizePath = fLibtoolizePath.getText().trim();
+ if (libtoolizePath == null || !newLibtoolizePath.equals(libtoolizePath)) {
+ try {
+ project.setPersistentProperty(AutotoolsPropertyConstants.LIBTOOLIZE_TOOL, newLibtoolizePath);
+ } catch (CoreException e2) {
+ // Not much we can do at this point
+ }
+ }
+ }
+
+ protected void performApply(ICResourceDescription src, ICResourceDescription dst) {
+ performOK();
+ }
+
+ public void performDefaults() {
+ // For default tool settings, simply default the base tool names
+ fAclocalPath.setText(DEFAULT_ACLOCAL);
+ fAutomakePath.setText(DEFAULT_AUTOMAKE);
+ fAutoconfPath.setText(DEFAULT_AUTOCONF);
+ fAutoheaderPath.setText(DEFAULT_AUTOHEADER);
+ fAutoreconfPath.setText(DEFAULT_AUTORECONF);
+ fLibtoolizePath.setText(DEFAULT_LIBTOOLIZE);
+ }
+
+ public void updateData(ICResourceDescription cfgd) {
+ // Nothing to do
+ }
+
+ public void updateButtons() {
+ // Nothing to do
+ }
+
+ public void setVisible (boolean b) {
+ super.setVisible(b);
+ }
+
+ private void initialize() {
+ String aclocalPath = null;
+ String automakePath = null;
+ String autoconfPath = null;
+ String autoheaderPath = null;
+ String autoreconfPath = null;
+ String libtoolizePath = null;
+
+ try {
+ aclocalPath = project.getPersistentProperty(AutotoolsPropertyConstants.ACLOCAL_TOOL);
+ } catch (CoreException e1) {
+ // do nothing
+ }
+
+ if (aclocalPath == null)
+ aclocalPath = DEFAULT_ACLOCAL;
+
+ fAclocalPath.setText(aclocalPath);
+
+ try {
+ automakePath = project.getPersistentProperty(AutotoolsPropertyConstants.AUTOMAKE_TOOL);
+ } catch (CoreException e1) {
+ // do nothing
+ }
+
+ if (automakePath == null)
+ automakePath = DEFAULT_AUTOMAKE;
+
+ fAutomakePath.setText(automakePath);
+
+ try {
+ autoconfPath = project.getPersistentProperty(AutotoolsPropertyConstants.AUTOCONF_TOOL);
+ } catch (CoreException e1) {
+ // do nothing
+ }
+
+ if (autoconfPath == null)
+ autoconfPath = DEFAULT_AUTOCONF;
+
+ fAutoconfPath.setText(autoconfPath);
+
+ try {
+ autoheaderPath = project.getPersistentProperty(AutotoolsPropertyConstants.AUTOHEADER_TOOL);
+ } catch (CoreException e1) {
+ // do nothing
+ }
+
+ if (autoheaderPath == null)
+ autoheaderPath = DEFAULT_AUTOHEADER;
+
+ fAutoheaderPath.setText(autoheaderPath);
+
+ try {
+ autoreconfPath = project.getPersistentProperty(AutotoolsPropertyConstants.AUTORECONF_TOOL);
+ } catch (CoreException e1) {
+ // do nothing
+ }
+
+ if (autoreconfPath == null)
+ autoreconfPath = DEFAULT_AUTORECONF;
+
+ fAutoreconfPath.setText(autoreconfPath);
+
+ try {
+ libtoolizePath = project.getPersistentProperty(AutotoolsPropertyConstants.LIBTOOLIZE_TOOL);
+ } catch (CoreException e1) {
+ // do nothing
+ }
+
+ if (libtoolizePath == null)
+ libtoolizePath = DEFAULT_LIBTOOLIZE;
+
+ fLibtoolizePath.setText(libtoolizePath);
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/IProjectPropertyListener.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/IProjectPropertyListener.java
new file mode 100644
index 0000000000..133b46ee36
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/IProjectPropertyListener.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.properties;
+
+import org.eclipse.core.resources.IProject;
+
+public interface IProjectPropertyListener {
+
+ /**
+ * Handler for property changes
+ *
+ * @param project the project to which the property changed
+ * @param property the name of the property changed
+ */
+ void handleProjectPropertyChanged(IProject project, String property);
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/IPropertyChangeManager.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/IPropertyChangeManager.java
new file mode 100644
index 0000000000..5ae066b558
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/IPropertyChangeManager.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.properties;
+
+import org.eclipse.core.resources.IProject;
+
+public interface IPropertyChangeManager {
+
+ /**
+ * Add a project property listener for given project.
+ *
+ * @param project the project to which the listener is interested
+ * @param listener the listener to notify
+ */
+ void addProjectPropertyListener(IProject project, IProjectPropertyListener listener);
+
+ /**
+ * Remove a project property listener.
+ *
+ * @param listener the listener to remove
+ */
+ void removeProjectPropertyListener(IProject project, IProjectPropertyListener listener);
+
+ /**
+ * Notify all listeners of project that a property has changed.
+ *
+ * @param project the project for which the property has changed
+ * @param property the property that has changed
+ */
+ void notifyPropertyListeners(IProject project, String property);
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/ToolListContentProvider.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/ToolListContentProvider.java
new file mode 100644
index 0000000000..2ca2281438
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/ToolListContentProvider.java
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.properties;
+
+import java.util.ArrayList;
+
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.linuxtools.internal.cdt.autotools.core.configure.AutotoolsConfiguration;
+import org.eclipse.linuxtools.internal.cdt.autotools.core.configure.IConfigureOption;
+
+public class ToolListContentProvider implements ITreeContentProvider {
+
+ private ToolListElement[] elements;
+
+ private ToolListElement[] createElements() {
+ ArrayList<ToolListElement> toolList = new ArrayList<ToolListElement>();
+ AutotoolsConfiguration.Option[] options = AutotoolsConfiguration.getTools();
+ for (int i = 0; i < options.length; ++i) {
+ AutotoolsConfiguration.Option opt = options[i];
+ String optName = opt.getName();
+ ToolListElement tool = new ToolListElement(optName, IConfigureOption.TOOL);
+ toolList.add(tool);
+ AutotoolsConfiguration.Option[] categories =
+ AutotoolsConfiguration.getChildOptions(optName);
+ for (int j = 0; j < categories.length; ++j) {
+ String catName = categories[j].getName();
+ ToolListElement newItem = new ToolListElement(catName, IConfigureOption.CATEGORY);
+ tool.addChild(newItem);
+ }
+ }
+ return toolList.toArray(new ToolListElement[toolList.size()]);
+ }
+
+ public Object[] getChildren(Object parentElement) {
+ if (parentElement instanceof AutotoolsConfiguration) {
+ return elements;
+ }
+ return ((ToolListElement)parentElement).getChildren();
+ }
+
+ public Object getParent(Object element) {
+ return ((ToolListElement)element).getParent();
+ }
+
+ public boolean hasChildren(Object element) {
+ return ((ToolListElement)element).hasChildren();
+ }
+
+ public Object[] getElements(Object inputElement) {
+ return elements;
+ }
+
+ public void dispose() {
+ // nothing needed
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ // TODO Auto-generated method stub
+ elements = createElements();
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/ToolListElement.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/ToolListElement.java
new file mode 100644
index 0000000000..1c3e6bec05
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/ToolListElement.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.properties;
+
+import java.util.ArrayList;
+
+public class ToolListElement {
+
+ private ArrayList<ToolListElement> children;
+ private ToolListElement parent;
+ private String name;
+ private int type;
+
+ public ToolListElement(String name, int type) {
+ this.name = name;
+ this.type = type;
+ this.children = new ArrayList<ToolListElement>();
+ }
+
+ public void setParent(ToolListElement p) {
+ parent = p;
+ }
+
+ public ToolListElement getParent() {
+ return parent;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public int getType() {
+ return type;
+ }
+
+ public void addChild(ToolListElement e) {
+ children.add(e);
+ e.setParent(this);
+ }
+
+ public boolean hasChildren() {
+ return children.size() > 0;
+ }
+
+ public Object[] getChildren() {
+ return children.toArray();
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/ToolListLabelProvider.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/ToolListLabelProvider.java
new file mode 100644
index 0000000000..07b8ce0211
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/properties/ToolListLabelProvider.java
@@ -0,0 +1,92 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 2007, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Rational Software - Initial API and implementation
+ * Red Hat Inc. - Modification for Autotools usage
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.properties;
+
+import org.eclipse.cdt.ui.newui.UIMessages;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ResourceManager;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.linuxtools.internal.cdt.autotools.core.configure.IAConfiguration;
+import org.eclipse.linuxtools.internal.cdt.autotools.core.configure.IConfigureOption;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.AutotoolsUIPluginImages;
+import org.eclipse.swt.graphics.Image;
+
+public class ToolListLabelProvider extends LabelProvider {
+ private final Image IMG_TOOL = AutotoolsUIPluginImages.get(AutotoolsUIPluginImages.IMG_CFG_TOOL);
+ private final Image IMG_CAT = AutotoolsUIPluginImages.get(AutotoolsUIPluginImages.IMG_CFG_CATEGORY);
+ private static final String ERROR_UNKNOWN_ELEMENT = "ConfigurePropertyPage.error.Unknown_tree_element"; //$NON-NLS-1$
+
+ private ImageDescriptor descriptor = null;
+ private ResourceManager manager = null;
+ private IAConfiguration cfg = null;
+
+ public ToolListLabelProvider(IAConfiguration cfg) {
+ this.cfg = cfg;
+ }
+
+ public IAConfiguration getCfg() {
+ return cfg;
+ }
+
+ public void setCfg(IAConfiguration cfg) {
+ this.cfg = cfg;
+ }
+
+ public Image getImage(Object element) {
+ if (!(element instanceof ToolListElement)) {
+ throw unknownElement(element);
+ }
+ Image defaultImage = IMG_CAT;
+ ToolListElement toolListElement = (ToolListElement)element;
+ IConfigureOption cat = cfg.getOption(toolListElement.getName());
+
+ if (cat == null) {
+ defaultImage = IMG_TOOL;
+ }
+
+ // Use default icon for display
+ return defaultImage;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ILabelProvider#getText(Object)
+ */
+ public String getText(Object element) {
+ if (!(element instanceof ToolListElement)) {
+ throw unknownElement(element);
+ }
+ ToolListElement toolListElement = (ToolListElement)element;
+ IConfigureOption cat = cfg.getOption(toolListElement.getName());
+
+ if (cat == null) {
+ return toolListElement.getName();
+ }
+ else {
+ return cat.getDescription();
+ }
+ }
+
+ protected RuntimeException unknownElement(Object element) {
+ return new RuntimeException(UIMessages.getFormattedString(ERROR_UNKNOWN_ELEMENT, element.getClass().getName()));
+ }
+
+ /**
+ * Disposing any images that were allocated for it.
+ *
+ * @since 3.0
+ */
+ public void dispose() {
+ if (descriptor != null && manager != null) {
+ manager.destroyImage(descriptor);
+ }
+ };
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/text/hover/AutoconfPrototype.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/text/hover/AutoconfPrototype.java
new file mode 100644
index 0000000000..88b1702045
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/text/hover/AutoconfPrototype.java
@@ -0,0 +1,82 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.text.hover;
+
+import java.util.ArrayList;
+
+public class AutoconfPrototype {
+ protected String name;
+ protected int numPrototypes;
+ protected ArrayList<Integer> minParms;
+ protected ArrayList<Integer> maxParms;
+ protected ArrayList<ArrayList<String>> parmList;
+
+ public AutoconfPrototype() {
+ numPrototypes = 0;
+ minParms = new ArrayList<Integer>();
+ maxParms = new ArrayList<Integer>();
+ parmList = new ArrayList<ArrayList<String>>();
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String newName) {
+ name = newName;
+ }
+
+ public int getNumPrototypes() {
+ return numPrototypes;
+ }
+
+ public void setNumPrototypes(int num) {
+ numPrototypes = num;
+ }
+
+ public int getMinParms(int prototypeNum) {
+ return ((Integer)minParms.get(prototypeNum)).intValue();
+ }
+
+ public void setMinParms(int prototypeNum, int value) {
+ minParms.add(prototypeNum, new Integer(value));
+ }
+
+ public int getMaxParms(int prototypeNum) {
+ return ((Integer)maxParms.get(prototypeNum)).intValue();
+ }
+
+ public void setMaxParms(int prototypeNum, int value) {
+ maxParms.add(prototypeNum, new Integer(value));
+ }
+
+ public String getParmName(int prototypeNum, int parmNum) {
+ ArrayList<String> parms = parmList.get(prototypeNum);
+ return (String)parms.get(parmNum);
+ }
+
+ // This function assumes that parms will be added in order starting
+ // with lowest prototype first.
+ public void setParmName(int prototypeNum, int parmNum, String value) {
+ ArrayList<String> parms;
+ if (parmList.size() == prototypeNum) {
+ parms = new ArrayList<String>();
+ parmList.add(parms);
+ }
+ else
+ parms = parmList.get(prototypeNum);
+ if (parms.size() == parmNum)
+ parms.add(value);
+ else
+ parms.set(parmNum, value);
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/text/hover/AutoconfTextHover.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/text/hover/AutoconfTextHover.java
new file mode 100644
index 0000000000..624db1921b
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/text/hover/AutoconfTextHover.java
@@ -0,0 +1,596 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2007 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.text.hover;
+
+import java.io.BufferedReader;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.eclipse.cdt.core.CCorePlugin;
+import org.eclipse.core.filesystem.URIUtil;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.DefaultInformationControl;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IInformationControl;
+import org.eclipse.jface.text.IInformationControlCreator;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITextHover;
+import org.eclipse.jface.text.ITextHoverExtension;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.Region;
+import org.eclipse.linuxtools.cdt.autotools.core.AutotoolsPlugin;
+import org.eclipse.linuxtools.cdt.autotools.ui.AutotoolsUIPlugin;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.AutoconfEditor;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.AutoconfMacro;
+import org.eclipse.linuxtools.cdt.autotools.ui.editors.IAutotoolEditorActionDefinitionIds;
+import org.eclipse.linuxtools.internal.cdt.autotools.core.AutotoolsPropertyConstants;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.CWordFinder;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.HTMLPrinter;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.HTMLTextPresenter;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.preferences.AutotoolsEditorPreferenceConstants;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.keys.IBindingService;
+import org.osgi.framework.Bundle;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+
+
+public class AutoconfTextHover implements ITextHover, ITextHoverExtension {
+
+ public static String LOCAL_AUTOCONF_MACROS_DOC_NAME = "macros/acmacros";
+ public static String LOCAL_AUTOMAKE_MACROS_DOC_NAME = "macros/ammacros";
+ public static String AUTOCONF_MACROS_DOC_NAME = "http://www.sourceware.org/eclipse/autotools/acmacros"; //$NON-NLS-1$
+ public static String AUTOMAKE_MACROS_DOC_NAME = "http://www.sourceware.org/eclipse/autotools/ammacros"; //$NON-NLS-1$
+
+ private static class AutotoolsHoverDoc {
+ public Document[] documents = new Document[2];
+ public AutotoolsHoverDoc(Document ac_document, Document am_document) {
+ this.documents[0] = ac_document;
+ this.documents[1] = am_document;
+ }
+ public Document getAcDocument() {
+ return documents[0];
+ }
+ public Document getAmDocument() {
+ return documents[1];
+ }
+ public Document[] getDocuments() {
+ return documents;
+ }
+ };
+
+ private static Map<String, Document> acHoverDocs;
+ private static Map<String, Document> amHoverDocs;
+ private static Map<Document, ArrayList<AutoconfMacro>> acHoverMacros;
+ private static String fgStyleSheet;
+ private static AutoconfEditor fEditor;
+
+ /* Mapping key to action */
+ private static IBindingService fBindingService;
+ {
+ fBindingService= (IBindingService)PlatformUI.getWorkbench().getAdapter(IBindingService.class);
+ }
+
+ public static String getAutoconfMacrosDocName(String version) {
+ return AUTOCONF_MACROS_DOC_NAME + "-" //$NON-NLS-1$
+ + version
+ + ".xml"; //$NON-NLS-1$
+ }
+
+ public static String getLocalAutoconfMacrosDocName(String version) {
+ return LOCAL_AUTOCONF_MACROS_DOC_NAME + "-" //$NON-NLS-1$
+ + version
+ + ".xml"; //$NON-NLS-1$
+ }
+
+ /* Get the preferences default for the autoconf macros document name. */
+ public static String getDefaultAutoconfMacrosVer() {
+ return AutotoolsPlugin.getDefault().getPreferenceStore().getString(AutotoolsEditorPreferenceConstants.AUTOCONF_VERSION);
+ }
+
+ public static String getAutomakeMacrosDocName(String version) {
+ return AUTOMAKE_MACROS_DOC_NAME + "-" //$NON-NLS-1$
+ + version
+ + ".xml"; //$NON-NLS-1$
+ }
+
+ public static String getLocalAutomakeMacrosDocName(String version) {
+ return LOCAL_AUTOMAKE_MACROS_DOC_NAME + "-" //$NON-NLS-1$
+ + version
+ + ".xml"; //$NON-NLS-1$
+ }
+
+ /* Get the preferences default for the autoconf macros document name. */
+ public static String getDefaultAutomakeMacrosVer() {
+ return AutotoolsPlugin.getDefault().getPreferenceStore().getString(AutotoolsEditorPreferenceConstants.AUTOMAKE_VERSION);
+ }
+
+ protected static Document getACDoc(String acDocVer) {
+ Document ac_document = null;
+ if (acHoverDocs == null) {
+ acHoverDocs = new HashMap<String, Document>();
+ }
+ ac_document = (Document)acHoverDocs.get(acDocVer);
+ if (ac_document == null) {
+ Document doc = null;
+ try {
+ // see comment in initialize()
+ try {
+ InputStream docStream = null;
+ try {
+ URI uri = new URI(getLocalAutoconfMacrosDocName(acDocVer));
+ IPath p = URIUtil.toPath(uri);
+ // Try to open the file as local to this plug-in.
+ docStream = FileLocator.openStream(AutotoolsPlugin.getDefault().getBundle(), p, false);
+ } catch (IOException e) {
+ // Local open failed. Try normal external location.
+ URI acDoc = new URI(getAutoconfMacrosDocName(acDocVer));
+ IPath p = URIUtil.toPath(acDoc);
+ if (p == null) {
+ URL url = acDoc.toURL();
+ docStream = url.openStream();
+ } else {
+ docStream = new FileInputStream(p.toFile());
+ }
+ }
+ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ factory.setValidating(false);
+ try {
+ DocumentBuilder builder = factory.newDocumentBuilder();
+ doc = builder.parse(docStream);
+ }
+ catch (SAXParseException saxException) {
+ doc = null;
+ }
+ catch (SAXException saxEx) {
+ doc = null;
+ }
+ catch (ParserConfigurationException pce) {
+ doc = null;
+ }
+ catch (IOException ioe) {
+ doc = null;
+ }
+ } catch (FileNotFoundException e) {
+ AutotoolsPlugin.log(e);
+ } catch (MalformedURLException e) {
+ AutotoolsPlugin.log(e);
+ } catch (URISyntaxException e) {
+ AutotoolsPlugin.log(e);
+ }
+ ac_document = doc;
+ }
+ catch (IOException ioe) {
+ }
+ }
+ acHoverDocs.put(acDocVer, ac_document);
+ return ac_document;
+ }
+
+ protected static Document getAMDoc(String amDocVer) {
+ Document am_document = null;
+ if (amHoverDocs == null) {
+ amHoverDocs = new HashMap<String, Document>();
+ }
+ am_document = (Document)amHoverDocs.get(amDocVer);
+ if (am_document == null) {
+ Document doc = null;
+ try {
+ // see comment in initialize()
+ try {
+ InputStream docStream = null;
+ try {
+ URI uri = new URI(getLocalAutomakeMacrosDocName(amDocVer));
+ IPath p = URIUtil.toPath(uri);
+ // Try to open the file as local to this plug-in.
+ docStream = FileLocator.openStream(AutotoolsPlugin.getDefault().getBundle(), p, false);
+ } catch (IOException e) {
+ // Local open failed. Try normal external location.
+ URI acDoc = new URI(getAutomakeMacrosDocName(amDocVer));
+ IPath p = URIUtil.toPath(acDoc);
+ if (p == null) {
+ URL url = acDoc.toURL();
+ docStream = url.openStream();
+ } else {
+ docStream = new FileInputStream(p.toFile());
+ }
+ }
+ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ factory.setValidating(false);
+ try {
+ DocumentBuilder builder = factory.newDocumentBuilder();
+ doc = builder.parse(docStream);
+ }
+ catch (SAXParseException saxException) {
+ doc = null;
+ }
+ catch (SAXException saxEx) {
+ doc = null;
+ }
+ catch (ParserConfigurationException pce) {
+ doc = null;
+ }
+ catch (IOException ioe) {
+ doc = null;
+ }
+ } catch (FileNotFoundException e) {
+ AutotoolsPlugin.log(e);
+ } catch (MalformedURLException e) {
+ AutotoolsPlugin.log(e);
+ } catch (URISyntaxException e) {
+ AutotoolsPlugin.log(e);
+ }
+ am_document = doc;
+ }
+ catch (IOException ioe) {
+ }
+ }
+ amHoverDocs.put(amDocVer, am_document);
+ return am_document;
+ }
+
+ protected static AutotoolsHoverDoc getHoverDoc(IEditorInput input) {
+ String acDocVer = getDefaultAutoconfMacrosVer();
+ String amDocVer = getDefaultAutomakeMacrosVer();
+ if (input instanceof IFileEditorInput) {
+ IFileEditorInput fe = (IFileEditorInput)input;
+ IFile f = fe.getFile();
+ IProject p = f.getProject();
+ try {
+ String acVer = p.getPersistentProperty(AutotoolsPropertyConstants.AUTOCONF_VERSION);
+ if (acVer != null)
+ acDocVer = acVer;
+ else { // look for compat project properties
+ acVer = p.getPersistentProperty(AutotoolsPropertyConstants.AUTOCONF_VERSION_COMPAT);
+ if (acVer != null)
+ acDocVer = acVer;
+ }
+ } catch (CoreException ce1) {
+ // do nothing
+ }
+ try {
+ String amVer = p.getPersistentProperty(AutotoolsPropertyConstants.AUTOMAKE_VERSION);
+ if (amVer != null)
+ amDocVer = amVer;
+ else { // look for compat project properties
+ amVer = p.getPersistentProperty(AutotoolsPropertyConstants.AUTOMAKE_VERSION_COMPAT);
+ if (amVer != null)
+ amDocVer = amVer;
+ }
+ } catch (CoreException ce2) {
+ // do nothing
+ }
+ }
+ Document ac_document = getACDoc(acDocVer);
+ Document am_document = getAMDoc(amDocVer);
+ return new AutoconfTextHover.AutotoolsHoverDoc(ac_document, am_document);
+ }
+
+ public AutoconfTextHover(AutoconfEditor editor) {
+ fEditor = editor;
+ }
+
+ public static String getIndexedInfo(String name, AutoconfEditor editor) {
+ AutotoolsHoverDoc h = getHoverDoc(editor.getEditorInput());
+ String x = getIndexedInfoFromDocument(name, h.getAcDocument());
+ if (x == null)
+ x = getIndexedInfoFromDocument(name, h.getAmDocument());
+ return x;
+ }
+
+ private static String getIndexedInfoFromDocument(String name, Document document) {
+ StringBuffer buffer = new StringBuffer();
+
+ if (document != null && name != null) {
+ Element elem = document.getElementById(name);
+ if (null != elem) {
+ int prototypeCount = 0;
+ buffer.append("<B>Macro:</B> " + name);
+ NodeList nl = elem.getChildNodes();
+ for (int i = 0; i < nl.getLength(); ++i) {
+ Node n = nl.item(i);
+ String nodeName = n.getNodeName();
+ if (nodeName.equals("prototype")) { //$NON-NLS-1$
+ String prototype = "";
+ ++prototypeCount;
+ if (prototypeCount == 1) {
+ buffer.append(" (");
+ } else
+ buffer.append(" <B>or</B> " + name + " (<I>"); //$NON-NLS-2$
+ NodeList varList = n.getChildNodes();
+ for (int j = 0; j < varList.getLength(); ++j) {
+ Node v = varList.item(j);
+ String vnodeName = v.getNodeName();
+ if (vnodeName.equals("parameter")) { //$NON-NLS-1$
+ NamedNodeMap parms = v.getAttributes();
+ Node parmNode = parms.item(0);
+ String parm = parmNode.getNodeValue();
+ prototype = (prototype.equals(""))
+ ? parm
+ : prototype + ", " + parm;
+ }
+ }
+ buffer.append(prototype + "</I>)<br>"); //$NON-NLS-1$
+ }
+ if (nodeName.equals("synopsis")) { //$NON-NLS-1$
+ Node textNode = n.getLastChild();
+ buffer.append("<br><B>Synopsis:</B> ");
+ buffer.append(textNode.getNodeValue());
+ }
+ }
+ }
+ }
+ if (buffer.length() > 0) {
+ HTMLPrinter.insertPageProlog(buffer, 0);
+ HTMLPrinter.addPageEpilog(buffer);
+ return buffer.toString();
+ }
+
+ return null;
+ }
+
+ public static AutoconfMacro[] getMacroList(AutoconfEditor editor) {
+ IEditorInput input = editor.getEditorInput();
+ AutotoolsHoverDoc hoverdoc = getHoverDoc(input);
+ AutoconfMacro[] macros = getMacroList(hoverdoc);
+ return macros;
+ }
+
+ private static AutoconfMacro[] getMacroList(AutotoolsHoverDoc hoverdoc) {
+ if (acHoverMacros == null) {
+ acHoverMacros = new HashMap<Document, ArrayList<AutoconfMacro>>();
+ }
+
+ ArrayList<AutoconfMacro> masterList = new ArrayList<AutoconfMacro>();
+ Document[] doc = hoverdoc.getDocuments();
+ for (int ix = 0; ix < doc.length; ++ix) {
+ Document macroDoc = doc[ix];
+ ArrayList<AutoconfMacro> list = acHoverMacros.get(macroDoc);
+ if (list == null && macroDoc != null) {
+ list = new ArrayList<AutoconfMacro>();
+ NodeList nl = macroDoc.getElementsByTagName("macro"); //$NON-NLS-1$
+ for (int i = 0; i < nl.getLength(); ++i) {
+ Node macro = nl.item(i);
+ NamedNodeMap macroAttrs = macro.getAttributes();
+ Node n2 = macroAttrs.getNamedItem("id"); //$NON-NLS-1$
+ if (n2 != null) {
+ String name = n2.getNodeValue();
+ String parms = "";
+ NodeList macroChildren = macro.getChildNodes();
+ for (int j = 0; j < macroChildren.getLength(); ++j) {
+ Node x = macroChildren.item(j);
+ if (x.getNodeName().equals("prototype")) { //$NON-NLS-1$
+ // Use parameters for context info.
+ NodeList parmList = x.getChildNodes();
+ int parmCount = 0;
+ for (int k = 0; k < parmList.getLength(); ++k) {
+ Node n3 = parmList.item(k);
+ if (n3.getNodeName() == "parameter") { //$NON-NLS-1$
+ NamedNodeMap parmVals = n3.getAttributes();
+ Node parmVal = parmVals.item(0);
+ if (parmCount > 0)
+ parms = parms + ", "; //$NON-NLS-1$
+ parms = parms + parmVal.getNodeValue();
+ ++parmCount;
+ }
+ }
+ }
+ }
+ AutoconfMacro m = new AutoconfMacro(name, parms);
+ list.add(m);
+ }
+ }
+ // Cache the arraylist of macros for later usage.
+ acHoverMacros.put(macroDoc, list);
+ }
+ masterList.addAll(list);
+ }
+ // Convert to a sorted array of macros and return result.
+ AutoconfMacro[] macros = new AutoconfMacro[masterList.size()];
+ masterList.toArray(macros);
+ Arrays.sort(macros);
+ return macros;
+ }
+
+ public static AutoconfPrototype getPrototype(String name, AutoconfEditor editor) {
+ IEditorInput input = editor.getEditorInput();
+ AutotoolsHoverDoc hoverdoc = getHoverDoc(input);
+ AutoconfPrototype x = getPrototype(name, hoverdoc.getAcDocument());
+ if (x == null)
+ x = getPrototype(name, hoverdoc.getAmDocument());
+ return x;
+ }
+
+ private static AutoconfPrototype getPrototype(String name, Document document) {
+ AutoconfPrototype p = null;
+ if (document != null && name != null) {
+ Element elem = document.getElementById(name);
+ if (null != elem) {
+ int prototypeCount = -1;
+ p = new AutoconfPrototype();
+ p.setName(name);
+ NodeList nl = elem.getChildNodes();
+ for (int i = 0; i < nl.getLength(); ++i) {
+ Node n = nl.item(i);
+ String nodeName = n.getNodeName();
+ if (nodeName.equals("prototype")) { //$NON-NLS-1$
+ ++prototypeCount;
+ int parmCount = 0;
+ int minParmCount = -1;
+ p.setNumPrototypes(prototypeCount + 1);
+ NodeList varList = n.getChildNodes();
+ for (int j = 0; j < varList.getLength(); ++j) {
+ Node v = varList.item(j);
+ String vnodeName = v.getNodeName();
+ if (vnodeName.equals("parameter")) { //$NON-NLS-1$
+ ++parmCount;
+ NamedNodeMap parms = v.getAttributes();
+ Node parmNode = parms.item(0);
+ String parm = parmNode.getNodeValue();
+ // Check for first optional parameter which means
+ // we know the minimum number of parameters needed.
+ if (minParmCount < 0 && (parm.charAt(0) == '[' ||
+ parm.startsWith("...")))
+ minParmCount = parmCount - 1;
+ // Old style documentation sometimes had '[' in
+ // prototypes so look for one at end of a parm too.
+ else if (minParmCount < 0 && parm.endsWith("["))
+ minParmCount = parmCount;
+ p.setParmName(prototypeCount, parmCount - 1, parm);
+ }
+ }
+ p.setMaxParms(prototypeCount, parmCount);
+ // If we see no evidence of optional parameters, then
+ // the min and max number of parameters are equal.
+ if (minParmCount < 0)
+ minParmCount = parmCount;
+ p.setMinParms(prototypeCount, minParmCount);
+ }
+ }
+ }
+ }
+ return p;
+ }
+
+ public String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion) {
+
+ String hoverInfo = null;
+
+ IDocument d = textViewer.getDocument();
+
+ try {
+ String name = d.get(hoverRegion.getOffset(), hoverRegion.getLength());
+ hoverInfo = getIndexedInfo(name, fEditor);
+ } catch (BadLocationException e) {
+ // do nothing
+ }
+ // TODO Auto-generated method stub
+ return hoverInfo;
+ }
+
+ /*
+ * @see ITextHover#getHoverRegion(ITextViewer, int)
+ */
+ public IRegion getHoverRegion(ITextViewer textViewer, int offset) {
+
+ if (textViewer != null) {
+ /*
+ * If the hover offset falls within the selection range return the
+ * region for the whole selection.
+ */
+ Point selectedRange = textViewer.getSelectedRange();
+ if (selectedRange.x >= 0 && selectedRange.y > 0
+ && offset >= selectedRange.x
+ && offset <= selectedRange.x + selectedRange.y)
+ return new Region(selectedRange.x, selectedRange.y);
+ else {
+ return CWordFinder.findWord(textViewer.getDocument(), offset);
+ }
+ }
+ return null;
+ }
+
+ /*
+ * @see ITextHoverExtension#getHoverControlCreator()
+ * @since 3.0
+ */
+ public IInformationControlCreator getHoverControlCreator() {
+ return new IInformationControlCreator() {
+ public IInformationControl createInformationControl(Shell parent) {
+ return new DefaultInformationControl(parent, getTooltipAffordanceString(),
+ new HTMLTextPresenter(false));
+ }
+ };
+ }
+
+ /*
+ * Static member function to allow content assist to add hover help.
+ */
+ public static IInformationControlCreator getInformationControlCreator() {
+ return new IInformationControlCreator() {
+ public IInformationControl createInformationControl(Shell parent) {
+ return new DefaultInformationControl(parent, getTooltipAffordanceString(),
+ new HTMLTextPresenter(false));
+ }
+ };
+ }
+
+ protected static String getTooltipAffordanceString() {
+ if (fBindingService == null)
+ return null;
+
+ String keySequence= fBindingService.getBestActiveBindingFormattedFor(IAutotoolEditorActionDefinitionIds.SHOW_TOOLTIP);
+ if (keySequence == null)
+ return null;
+
+ return HoverMessages.getFormattedString("ToolTipFocus", keySequence == null ? "" : keySequence); //$NON-NLS-1$
+ }
+
+ /**
+ * Returns the style sheet.
+ *
+ * @since 3.2
+ */
+ protected static String getStyleSheet() {
+ if (fgStyleSheet == null) {
+ Bundle bundle= Platform.getBundle(AutotoolsUIPlugin.PLUGIN_ID);
+ URL styleSheetURL= bundle.getEntry("/AutoconfHoverStyleSheet.css"); //$NON-NLS-1$
+ if (styleSheetURL != null) {
+ try {
+ styleSheetURL= FileLocator.toFileURL(styleSheetURL);
+ BufferedReader reader= new BufferedReader(new InputStreamReader(styleSheetURL.openStream()));
+ StringBuffer buffer= new StringBuffer(200);
+ String line= reader.readLine();
+ while (line != null) {
+ buffer.append(line);
+ buffer.append('\n');
+ line= reader.readLine();
+ }
+ fgStyleSheet= buffer.toString();
+ } catch (IOException ex) {
+ CCorePlugin.log(ex);
+ fgStyleSheet= ""; //$NON-NLS-1$
+ }
+ }
+ }
+ return fgStyleSheet;
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/text/hover/HoverMessages.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/text/hover/HoverMessages.java
new file mode 100644
index 0000000000..e3757a4a86
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/text/hover/HoverMessages.java
@@ -0,0 +1,91 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.text.hover;
+
+import java.text.MessageFormat;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+
+/**
+ * AutoconfEditorMessages
+ */
+public class HoverMessages {
+
+ private static final String RESOURCE_BUNDLE= HoverMessages.class.getName();
+
+ private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE);
+
+ private HoverMessages() {
+ }
+
+ 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
+ * @since 3.0
+ */
+ 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 the arguments
+ *
+ * @param key the string used to get the bundle value, must not be null
+ * @since 3.0
+ */
+ public static String getFormattedString(String key, Object arg1, Object arg2) {
+ String format= null;
+ try {
+ format= fgResourceBundle.getString(key);
+ } catch (MissingResourceException e) {
+ return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$
+ }
+ if (arg1 == null)
+ arg1= ""; //$NON-NLS-1$
+ if (arg2 == null)
+ arg2= ""; //$NON-NLS-1$
+ return MessageFormat.format(format, new Object[] { arg1, arg2 });
+ }
+
+ /**
+ * 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
+ * @since 3.0
+ */
+ public static String getFormattedString(String key, boolean arg) {
+ String format= null;
+ try {
+ format= fgResourceBundle.getString(key);
+ } catch (MissingResourceException e) {
+ return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$
+ }
+ return MessageFormat.format(format, new Object[] { new Boolean(arg) });
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/text/hover/HoverMessages.properties b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/text/hover/HoverMessages.properties
new file mode 100644
index 0000000000..d9326d9d0a
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/text/hover/HoverMessages.properties
@@ -0,0 +1,11 @@
+#################################################################################
+# Copyright (c) 2006 Red Hat, Inc.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Red Hat Incorporated - initial API and implementation
+#################################################################################
+ToolTipFocus="Press ''{0}'' for focus." \ No newline at end of file
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/AutotoolsBuildWizard.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/AutotoolsBuildWizard.java
new file mode 100644
index 0000000000..920d80ba5b
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/AutotoolsBuildWizard.java
@@ -0,0 +1,86 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2008, 2009 Intel Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Intel Corporation - initial API and implementation
+ * Red Hat Inc - modification for Autotools project
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.wizards;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.SortedMap;
+
+import org.eclipse.cdt.managedbuilder.buildproperties.IBuildPropertyManager;
+import org.eclipse.cdt.managedbuilder.buildproperties.IBuildPropertyType;
+import org.eclipse.cdt.managedbuilder.buildproperties.IBuildPropertyValue;
+import org.eclipse.cdt.managedbuilder.core.BuildListComparator;
+import org.eclipse.cdt.managedbuilder.core.IProjectType;
+import org.eclipse.cdt.managedbuilder.core.IToolChain;
+import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
+import org.eclipse.cdt.managedbuilder.ui.properties.Messages;
+import org.eclipse.cdt.managedbuilder.ui.wizards.AbstractCWizard;
+import org.eclipse.cdt.managedbuilder.ui.wizards.MBSWizardHandler;
+import org.eclipse.cdt.ui.newui.CDTPrefUtil;
+import org.eclipse.cdt.ui.wizards.EntryDescriptor;
+import org.eclipse.jface.wizard.IWizard;
+
+/**
+ *
+ */
+public class AutotoolsBuildWizard extends AbstractCWizard {
+ public static final String OTHERS_LABEL = Messages.getString("CNewWizard.0"); //$NON-NLS-1$
+ public static final String AUTOTOOLS_PROJECTTYPE_ID = "org.eclipse.linuxtools.cdt.autotools.core.projectType"; //$NON-NLS-1$
+
+ /**
+ * @since 5.1
+ */
+ public static final String EMPTY_PROJECT = Messages.getString("AbstractCWizard.0"); //$NON-NLS-1$
+ /**
+ * Creates and returns an array of items to be displayed
+ */
+ public EntryDescriptor[] createItems(boolean supportedOnly, IWizard wizard) {
+ IBuildPropertyManager bpm = ManagedBuildManager.getBuildPropertyManager();
+ IBuildPropertyType bpt = bpm.getPropertyType(MBSWizardHandler.ARTIFACT);
+ IBuildPropertyValue[] vs = bpt.getSupportedValues();
+ Arrays.sort(vs, BuildListComparator.getInstance());
+ ArrayList<EntryDescriptor> items = new ArrayList<EntryDescriptor>();
+
+ // look for Autotools project type
+ EntryDescriptor oldsRoot = null;
+ SortedMap<String, IProjectType> sm = ManagedBuildManager.getExtensionProjectTypeMap();
+ for (String s : sm.keySet()) {
+ IProjectType pt = (IProjectType)sm.get(s);
+ if (pt.getId().equals(AUTOTOOLS_PROJECTTYPE_ID)) {
+ AutotoolsBuildWizardHandler h = new AutotoolsBuildWizardHandler(pt, parent, wizard);
+ IToolChain[] tcs = ManagedBuildManager.getExtensionToolChains(pt);
+ for(int i = 0; i < tcs.length; i++){
+ IToolChain t = tcs[i];
+ if(t.isSystemObject())
+ continue;
+ if (!isValid(t, supportedOnly, wizard))
+ continue;
+
+ h.addTc(t);
+ }
+
+ String pId = null;
+ if (CDTPrefUtil.getBool(CDTPrefUtil.KEY_OTHERS)) {
+ if (oldsRoot == null) {
+ oldsRoot = new EntryDescriptor(OTHERS_LABEL, null, OTHERS_LABEL, true, null, null);
+ items.add(oldsRoot);
+ }
+ pId = oldsRoot.getId();
+ } else { // do not group to <Others>
+ pId = null;
+ }
+ items.add(new EntryDescriptor(pt.getId(), pId, pt.getName(), true, h, null));
+ }
+ }
+ return (EntryDescriptor[])items.toArray(new EntryDescriptor[items.size()]);
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/AutotoolsBuildWizardHandler.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/AutotoolsBuildWizardHandler.java
new file mode 100644
index 0000000000..35f541a1be
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/AutotoolsBuildWizardHandler.java
@@ -0,0 +1,42 @@
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.wizards;
+
+import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
+import org.eclipse.cdt.managedbuilder.core.IConfiguration;
+import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
+import org.eclipse.cdt.managedbuilder.core.IProjectType;
+import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
+import org.eclipse.cdt.managedbuilder.ui.wizards.MBSWizardHandler;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.linuxtools.cdt.autotools.core.AutotoolsNewProjectNature;
+import org.eclipse.linuxtools.internal.cdt.autotools.core.configure.AutotoolsConfigurationManager;
+import org.eclipse.swt.widgets.Composite;
+
+public class AutotoolsBuildWizardHandler extends MBSWizardHandler {
+ public AutotoolsBuildWizardHandler(Composite p, IWizard w) {
+ super(AutotoolsWizardMessages.getResourceString("AutotoolsBuildWizard.0"), p, w); //$NON-NLS-1$
+ }
+
+ public AutotoolsBuildWizardHandler(IProjectType pt, Composite parent, IWizard wizard) {
+ super(pt, parent, wizard);
+ }
+
+ @Override
+ public void convertProject(IProject proj, IProgressMonitor monitor) throws CoreException {
+ super.convertProject(proj, monitor);
+ AutotoolsNewProjectNature.addAutotoolsNature(proj, monitor);
+
+ // For each IConfiguration, create a corresponding Autotools Configuration
+ IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(proj);
+ IConfiguration[] cfgs = info.getManagedProject().getConfigurations();
+ for (int i = 0; i < cfgs.length; ++i) {
+ IConfiguration cfg = cfgs[i];
+ ICConfigurationDescription cfgd = ManagedBuildManager.getDescriptionForConfiguration(cfg);
+ String id = cfgd.getId();
+ AutotoolsConfigurationManager.getInstance().getConfiguration(proj, id, true);
+ }
+ AutotoolsConfigurationManager.getInstance().saveConfigs(proj);
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/AutotoolsNewCCProjectWizardV2.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/AutotoolsNewCCProjectWizardV2.java
new file mode 100644
index 0000000000..9ab81be4b7
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/AutotoolsNewCCProjectWizardV2.java
@@ -0,0 +1,340 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 2005, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Rational Software - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.wizards;
+
+import java.lang.reflect.InvocationTargetException;
+
+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.IManagedBuildInfo;
+import org.eclipse.cdt.managedbuilder.core.IManagedProject;
+import org.eclipse.cdt.managedbuilder.core.IProjectType;
+import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
+import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
+import org.eclipse.cdt.managedbuilder.core.ManagedCProjectNature;
+import org.eclipse.cdt.managedbuilder.ui.wizards.MBSCustomPageManager;
+import org.eclipse.cdt.ui.newui.CDTHelpContextIds;
+import org.eclipse.cdt.ui.wizards.NewCCProjectWizard;
+import org.eclipse.cdt.ui.wizards.NewCProjectWizardPage;
+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.SubProgressMonitor;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.linuxtools.cdt.autotools.core.AutotoolsNewProjectNature;
+import org.eclipse.linuxtools.cdt.autotools.ui.AutotoolsUIPlugin;
+import org.eclipse.linuxtools.internal.cdt.autotools.core.AutotoolsPropertyConstants;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.PlatformUI;
+
+
+
+@SuppressWarnings("deprecation")
+public class AutotoolsNewCCProjectWizardV2 extends NewCCProjectWizard {
+
+ /* (non-Javadoc)
+ * String constants
+ */
+ protected static final String PREFIX = "WizardAutotoolsNewCCProjectV2"; //$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 WINDOW_TITLE = PREFIX + ".windowTitle"; //$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$
+
+ // Wizard pages
+ protected CProjectPlatformPage projectConfigurationPage;
+ protected NewAutotoolsProjectOptionPage optionPage;
+ protected IProjectType projectType;
+
+ public AutotoolsNewCCProjectWizardV2() {
+ this(AutotoolsUIPlugin.getResourceString(WZ_TITLE), AutotoolsUIPlugin.getResourceString(WZ_DESC));
+ }
+
+ public AutotoolsNewCCProjectWizardV2(String title, String description) {
+ super(title, description);
+ }
+ /**
+ * Method getWzDescriptionResource, allows Wizard description label value
+ * to be changed by subclasses
+ *
+ * @return String
+ */
+ protected static String getWzDescriptionResource() {
+ return AutotoolsUIPlugin.getResourceString(WZ_DESC);
+ }
+
+ /**
+ * Method getWzTitleResource, allows Wizard description label value
+ * to be changed by subclasses
+ *
+ * @return String
+ */
+ protected static String getWzTitleResource() {
+ return AutotoolsUIPlugin.getResourceString(WZ_TITLE);
+ }
+
+ /**
+ * Method getWindowTitleResource, allows Wizard Title label value to be
+ * changed by subclasses
+ *
+ * @return String
+ */
+ protected static String getWindowTitleResource() {
+ return AutotoolsUIPlugin.getResourceString(WINDOW_TITLE);
+ }
+
+ /**
+ * Method getPrefix, allows prefix value to be changed by subclasses
+ *
+ * @return String
+ */
+ protected static String getPrefix() {
+ return PREFIX;
+ }
+
+ public void addPages() {
+ // Add the default page for all new projects
+ super.addPages();
+
+ // Add the configuration selection page
+ projectConfigurationPage = new CProjectPlatformPage(PREFIX, this);
+ projectConfigurationPage.setTitle(AutotoolsUIPlugin.getResourceString(CONF_TITLE));
+ projectConfigurationPage.setDescription(AutotoolsUIPlugin.getResourceString(CONF_DESC));
+ addPage(projectConfigurationPage);
+
+ // Add the options (tabbed) page
+ optionPage = new NewAutotoolsProjectOptionPage(PREFIX, this);
+ optionPage.setTitle(AutotoolsUIPlugin.getResourceString(OPTIONS_TITLE));
+ optionPage.setDescription(AutotoolsUIPlugin.getResourceString(OPTIONS_DESC));
+ addPage(optionPage);
+
+ // add custom pages
+ MBSCustomPageManager.init();
+
+ // add stock pages
+ MBSCustomPageManager.addStockPage(fMainPage, NewCProjectWizardPage.PAGE_ID);
+ MBSCustomPageManager.addStockPage(projectConfigurationPage, CProjectPlatformPage.PAGE_ID);
+ MBSCustomPageManager.addStockPage(optionPage, NewAutotoolsProjectOptionPage.PAGE_ID);
+
+ }
+
+ public void createPageControls(Composite pageContainer) {
+ super.createPageControls( pageContainer );
+
+ IWizardPage [] pages = getPages();
+
+ if (pages != null) {
+ for (int i = 0; i < pages.length; i++) {
+ IWizardPage page = pages[i];
+ if (page instanceof NewCProjectWizardPage) {
+ // Setup the help information
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(pageContainer, CDTHelpContextIds.MAN_PROJ_WIZ_NAME_PAGE);
+ }
+ else if (page instanceof NewAutotoolsProjectOptionPage) {
+ NewAutotoolsProjectOptionPage optionPage = (NewAutotoolsProjectOptionPage) page;
+ optionPage.setupHelpContextIds();
+ }
+ // The other built-in page is the CProjectPlatformPage which already has a help id.
+ }
+ }
+ }
+
+ public void updateProjectTypeProperties() {
+ // Update the error parser list
+ optionPage.updateProjectTypeProperties();
+ }
+
+ protected void addNature(IProgressMonitor monitor) throws CoreException {
+ monitor.beginTask("", 4);
+ monitor.subTask(AutotoolsUIPlugin.getResourceString(MSG_ADD_NATURE));
+ ManagedCProjectNature.addManagedNature(newProject, new SubProgressMonitor(monitor, 1));
+ monitor.subTask(AutotoolsUIPlugin.getResourceString(MSG_ADD_BUILDER));
+ ManagedCProjectNature.addManagedBuilder(newProject, new SubProgressMonitor(monitor, 1));
+ monitor.subTask(AutotoolsUIPlugin.getResourceString(MSG_ADD_NATURE));
+ AutotoolsNewProjectNature.addAutotoolsNature(newProject, new SubProgressMonitor(monitor, 1));
+ monitor.subTask(AutotoolsUIPlugin.getResourceString(MSG_ADD_BUILDER));
+ AutotoolsNewProjectNature.addAutotoolsBuilder(newProject, new SubProgressMonitor(monitor, 1));
+ monitor.done();
+ }
+
+ public IProjectType getProjectType() {
+ return projectConfigurationPage.getProjectType();
+ }
+
+ 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 and builder
+ try {
+ addNature(new SubProgressMonitor(monitor, 2));
+ } catch (CoreException e) {
+ AutotoolsUIPlugin.log(e);
+ }
+ // FIXME: Default scanner property: make -w - eventually we want to use Make core's build scanner
+ newProject.setPersistentProperty(AutotoolsPropertyConstants.SCANNER_USE_MAKE_W, AutotoolsPropertyConstants.TRUE);
+
+ CCorePlugin.getDefault().mapCProjectOwner(newProject, getProjectID(), true);
+
+ // Add the ManagedProject to the project
+ IManagedProject newManagedProject = null;
+ IManagedBuildInfo info = null;
+ try {
+ info = ManagedBuildManager.createBuildInfo(newProject);
+ IProjectType parent = getProjectType();
+ newManagedProject = ManagedBuildManager.createManagedProject(newProject, parent);
+ if (newManagedProject != null) {
+ IConfiguration [] selectedConfigs = getSelectedConfigurations();
+ for (int i = 0; i < selectedConfigs.length; i++) {
+ IConfiguration config = selectedConfigs[i];
+ int id = ManagedBuildManager.getRandomNumber();
+ IConfiguration newConfig = newManagedProject.createConfiguration(config, config.getId() + "." + id); //$NON-NLS-1$
+ newConfig.setArtifactName(newManagedProject.getDefaultArtifactName());
+ }
+ // Now add the first supported config in the list as the default
+ IConfiguration defaultCfg = null;
+ IConfiguration[] newConfigs = newManagedProject.getConfigurations();
+ for(int i = 0; i < newConfigs.length; i++) {
+ if(newConfigs[i].isSupported()){
+ defaultCfg = newConfigs[i];
+ break;
+ }
+ }
+
+ if(defaultCfg == null && newConfigs.length > 0)
+ defaultCfg = newConfigs[0];
+
+ if(defaultCfg != null) {
+ ManagedBuildManager.setDefaultConfiguration(newProject, defaultCfg);
+ ManagedBuildManager.setSelectedConfiguration(newProject, defaultCfg);
+ }
+ ManagedBuildManager.setNewProjectVersion(newProject);
+ ICDescriptor desc = null;
+ try {
+ desc = CCorePlugin.getDefault().getCProjectDescription(newProject, true);
+ desc.create(CCorePlugin.BUILD_SCANNER_INFO_UNIQ_ID, ManagedBuildManager.INTERFACE_IDENTITY);
+ // TODO: The binary parser setting is currently per-project in the rest of CDT.
+ // In the MBS, it is per-coonfiguration. For now, select the binary parsers of the
+ // first configuration.
+// if (newConfigs.length > 0) {
+// IToolChain tc = newConfigs[0].getToolChain();
+// ITargetPlatform targetPlatform = tc.getTargetPlatform();
+// }
+ } catch (CoreException e) {
+ AutotoolsUIPlugin.log(e);
+ }
+ }
+ } catch (BuildException e) {
+ AutotoolsUIPlugin.log(e);
+ }
+
+ // Following is a bit of a hack because changing the project options
+ // causes a change event to be fired which will try to reindex the project.
+ // We are in the middle of setting the project indexer which may end up
+ // being the null indexer. In that case, we don't want the default indexer
+ // (Fast Indexer) to be invoked.
+ //IPDOMManager manager = CCorePlugin.getPDOMManager();
+ //ICProject cproject = CoreModel.getDefault().create(newProject);
+ //manager.setIndexerId(cproject, ConvertToAutotoolsProjectWizard.NULL_INDEXER_ID);
+
+ // Modify the project settings
+ if (newProject != null) {
+ optionPage.performApply(new SubProgressMonitor(monitor, 2));
+ }
+
+ // Save the build options
+ monitor.subTask(AutotoolsUIPlugin.getResourceString(MSG_SAVE));
+ if (info != null) {
+ info.setValid(true);
+ ManagedBuildManager.saveBuildInfo(newProject, true);
+ }
+
+ IStatus initResult = ManagedBuildManager.initBuildInfoContainer(newProject);
+ if (initResult.getCode() != IStatus.OK) {
+ // At this point, I can live with a failure
+ AutotoolsUIPlugin.log(initResult);
+ }
+
+ 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) {
+ // Get my initializer to run
+ if(newProject == null)
+ return;
+
+ IStatus initResult = ManagedBuildManager.initBuildInfoContainer(newProject);
+ if (initResult.getCode() != IStatus.OK) {
+ // At this point, I can live with a failure
+ AutotoolsUIPlugin.log(initResult);
+ }
+
+ // execute any operations specified by custom pages
+ // execute any operations specified by custom pages
+ IRunnableWithProgress operations[] = MBSCustomPageManager.getOperations();
+
+ if (operations != null)
+ {
+ for(int k = 0; k < operations.length; k++)
+ {
+ try {
+ operations[k].run(monitor);
+ } catch(InvocationTargetException e) {
+ //TODO: what should we do?
+ } catch(InterruptedException e) {
+ //TODO: what should we do?
+ }
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.ui.wizards.NewCProjectWizard#getProjectID()
+ */
+ public String getProjectID() {
+// return "org.eclipse.cdt.make.core.make"; //$NON-NLS-1$
+ return ManagedBuilderCorePlugin.MANAGED_MAKE_PROJECT_ID;
+ }
+
+// public IProjectType getSelectedProjectType() {
+// return projectConfigurationPage.getSelectedProjectType();
+// }
+
+ public IConfiguration[] getSelectedConfigurations() {
+ return projectConfigurationPage.getSelectedConfigurations();
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/AutotoolsNewCProjectWizardV2.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/AutotoolsNewCProjectWizardV2.java
new file mode 100644
index 0000000000..3e647b2b92
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/AutotoolsNewCProjectWizardV2.java
@@ -0,0 +1,340 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 2005, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Rational Software - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.wizards;
+
+import java.lang.reflect.InvocationTargetException;
+
+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.IManagedBuildInfo;
+import org.eclipse.cdt.managedbuilder.core.IManagedProject;
+import org.eclipse.cdt.managedbuilder.core.IProjectType;
+import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
+import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
+import org.eclipse.cdt.managedbuilder.core.ManagedCProjectNature;
+import org.eclipse.cdt.managedbuilder.ui.wizards.MBSCustomPageManager;
+import org.eclipse.cdt.ui.newui.CDTHelpContextIds;
+import org.eclipse.cdt.ui.wizards.NewCProjectWizard;
+import org.eclipse.cdt.ui.wizards.NewCProjectWizardPage;
+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.SubProgressMonitor;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.linuxtools.cdt.autotools.core.AutotoolsNewProjectNature;
+import org.eclipse.linuxtools.cdt.autotools.ui.AutotoolsUIPlugin;
+import org.eclipse.linuxtools.internal.cdt.autotools.core.AutotoolsPropertyConstants;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.PlatformUI;
+
+
+
+@SuppressWarnings("deprecation")
+public class AutotoolsNewCProjectWizardV2 extends NewCProjectWizard {
+
+ /* (non-Javadoc)
+ * String constants
+ */
+ protected static final String PREFIX = "WizardAutotoolsNewCProjectV2"; //$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 WINDOW_TITLE = PREFIX + ".windowTitle"; //$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$
+
+ // Wizard pages
+ protected CProjectPlatformPage projectConfigurationPage;
+ protected NewAutotoolsProjectOptionPage optionPage;
+ protected IProjectType projectType;
+
+ public AutotoolsNewCProjectWizardV2() {
+ this(AutotoolsUIPlugin.getResourceString(WZ_TITLE), AutotoolsUIPlugin.getResourceString(WZ_DESC));
+ }
+
+ public AutotoolsNewCProjectWizardV2(String title, String description) {
+ super(title, description);
+ }
+ /**
+ * Method getWzDescriptionResource, allows Wizard description label value
+ * to be changed by subclasses
+ *
+ * @return String
+ */
+ protected static String getWzDescriptionResource() {
+ return AutotoolsUIPlugin.getResourceString(WZ_DESC);
+ }
+
+ /**
+ * Method getWzTitleResource, allows Wizard description label value
+ * to be changed by subclasses
+ *
+ * @return String
+ */
+ protected static String getWzTitleResource() {
+ return AutotoolsUIPlugin.getResourceString(WZ_TITLE);
+ }
+
+ /**
+ * Method getWindowTitleResource, allows Wizard Title label value to be
+ * changed by subclasses
+ *
+ * @return String
+ */
+ protected static String getWindowTitleResource() {
+ return AutotoolsUIPlugin.getResourceString(WINDOW_TITLE);
+ }
+
+ /**
+ * Method getPrefix, allows prefix value to be changed by subclasses
+ *
+ * @return String
+ */
+ protected static String getPrefix() {
+ return PREFIX;
+ }
+
+ public void addPages() {
+ // Add the default page for all new projects
+ super.addPages();
+
+ // Add the configuration selection page
+ projectConfigurationPage = new CProjectPlatformPage(PREFIX, this);
+ projectConfigurationPage.setTitle(AutotoolsUIPlugin.getResourceString(CONF_TITLE));
+ projectConfigurationPage.setDescription(AutotoolsUIPlugin.getResourceString(CONF_DESC));
+ addPage(projectConfigurationPage);
+
+ // Add the options (tabbed) page
+ optionPage = new NewAutotoolsProjectOptionPage(PREFIX, this);
+ optionPage.setTitle(AutotoolsUIPlugin.getResourceString(OPTIONS_TITLE));
+ optionPage.setDescription(AutotoolsUIPlugin.getResourceString(OPTIONS_DESC));
+ addPage(optionPage);
+
+ // add custom pages
+ MBSCustomPageManager.init();
+
+ // add stock pages
+ MBSCustomPageManager.addStockPage(fMainPage, NewCProjectWizardPage.PAGE_ID);
+ MBSCustomPageManager.addStockPage(projectConfigurationPage, CProjectPlatformPage.PAGE_ID);
+ MBSCustomPageManager.addStockPage(optionPage, NewAutotoolsProjectOptionPage.PAGE_ID);
+
+ }
+
+ public void createPageControls(Composite pageContainer) {
+ super.createPageControls( pageContainer );
+
+ IWizardPage [] pages = getPages();
+
+ if (pages != null) {
+ for (int i = 0; i < pages.length; i++) {
+ IWizardPage page = pages[i];
+ if (page instanceof NewCProjectWizardPage) {
+ // Setup the help information
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(pageContainer, CDTHelpContextIds.MAN_PROJ_WIZ_NAME_PAGE);
+ }
+ else if (page instanceof NewAutotoolsProjectOptionPage) {
+ NewAutotoolsProjectOptionPage optionPage = (NewAutotoolsProjectOptionPage) page;
+ optionPage.setupHelpContextIds();
+ }
+ // The other built-in page is the CProjectPlatformPage which already has a help id.
+ }
+ }
+ }
+
+ public void updateProjectTypeProperties() {
+ // Update the error parser list
+ optionPage.updateProjectTypeProperties();
+ }
+
+ protected void addNature(IProgressMonitor monitor) throws CoreException {
+ monitor.beginTask("", 4);
+ monitor.subTask(AutotoolsUIPlugin.getResourceString(MSG_ADD_NATURE));
+ ManagedCProjectNature.addManagedNature(newProject, new SubProgressMonitor(monitor, 1));
+ monitor.subTask(AutotoolsUIPlugin.getResourceString(MSG_ADD_BUILDER));
+ ManagedCProjectNature.addManagedBuilder(newProject, new SubProgressMonitor(monitor, 1));
+ monitor.subTask(AutotoolsUIPlugin.getResourceString(MSG_ADD_NATURE));
+ AutotoolsNewProjectNature.addAutotoolsNature(newProject, new SubProgressMonitor(monitor, 1));
+ monitor.subTask(AutotoolsUIPlugin.getResourceString(MSG_ADD_BUILDER));
+ AutotoolsNewProjectNature.addAutotoolsBuilder(newProject, new SubProgressMonitor(monitor, 1));
+ monitor.done();
+ }
+
+ public IProjectType getProjectType() {
+ return projectConfigurationPage.getProjectType();
+ }
+
+ 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 and builder
+ try {
+ addNature(new SubProgressMonitor(monitor, 2));
+ } catch (CoreException e) {
+ AutotoolsUIPlugin.log(e);
+ }
+ // FIXME: Default scanner property: make -w - eventually we want to use Make core's build scanner
+ newProject.setPersistentProperty(AutotoolsPropertyConstants.SCANNER_USE_MAKE_W, AutotoolsPropertyConstants.TRUE);
+
+ CCorePlugin.getDefault().mapCProjectOwner(newProject, getProjectID(), true);
+
+ // Add the ManagedProject to the project
+ IManagedProject newManagedProject = null;
+ IManagedBuildInfo info = null;
+ try {
+ info = ManagedBuildManager.createBuildInfo(newProject);
+ IProjectType parent = getProjectType();
+ newManagedProject = ManagedBuildManager.createManagedProject(newProject, parent);
+ if (newManagedProject != null) {
+ IConfiguration [] selectedConfigs = getSelectedConfigurations();
+ for (int i = 0; i < selectedConfigs.length; i++) {
+ IConfiguration config = selectedConfigs[i];
+ int id = ManagedBuildManager.getRandomNumber();
+ IConfiguration newConfig = newManagedProject.createConfiguration(config, config.getId() + "." + id); //$NON-NLS-1$
+ newConfig.setArtifactName(newManagedProject.getDefaultArtifactName());
+ }
+ // Now add the first supported config in the list as the default
+ IConfiguration defaultCfg = null;
+ IConfiguration[] newConfigs = newManagedProject.getConfigurations();
+ for(int i = 0; i < newConfigs.length; i++) {
+ if(newConfigs[i].isSupported()){
+ defaultCfg = newConfigs[i];
+ break;
+ }
+ }
+
+ if(defaultCfg == null && newConfigs.length > 0)
+ defaultCfg = newConfigs[0];
+
+ if(defaultCfg != null) {
+ ManagedBuildManager.setDefaultConfiguration(newProject, defaultCfg);
+ ManagedBuildManager.setSelectedConfiguration(newProject, defaultCfg);
+ }
+ ManagedBuildManager.setNewProjectVersion(newProject);
+ ICDescriptor desc = null;
+ try {
+ desc = CCorePlugin.getDefault().getCProjectDescription(newProject, true);
+ desc.create(CCorePlugin.BUILD_SCANNER_INFO_UNIQ_ID, ManagedBuildManager.INTERFACE_IDENTITY);
+ // TODO: The binary parser setting is currently per-project in the rest of CDT.
+ // In the MBS, it is per-coonfiguration. For now, select the binary parsers of the
+ // first configuration.
+// if (newConfigs.length > 0) {
+// IToolChain tc = newConfigs[0].getToolChain();
+// ITargetPlatform targetPlatform = tc.getTargetPlatform();
+// }
+ } catch (CoreException e) {
+ AutotoolsUIPlugin.log(e);
+ }
+ }
+ } catch (BuildException e) {
+ AutotoolsUIPlugin.log(e);
+ }
+
+ // Following is a bit of a hack because changing the project options
+ // causes a change event to be fired which will try to reindex the project.
+ // We are in the middle of setting the project indexer which may end up
+ // being the null indexer. In that case, we don't want the default indexer
+ // (Fast Indexer) to be invoked.
+ //IPDOMManager manager = CCorePlugin.getPDOMManager();
+ //ICProject cproject = CoreModel.getDefault().create(newProject);
+ //manager.setIndexerId(cproject, ConvertToAutotoolsProjectWizard.NULL_INDEXER_ID);
+
+ // Modify the project settings
+ if (newProject != null) {
+ optionPage.performApply(new SubProgressMonitor(monitor, 2));
+ }
+
+ // Save the build options
+ monitor.subTask(AutotoolsUIPlugin.getResourceString(MSG_SAVE));
+ if (info != null) {
+ info.setValid(true);
+ ManagedBuildManager.saveBuildInfo(newProject, true);
+ }
+
+ IStatus initResult = ManagedBuildManager.initBuildInfoContainer(newProject);
+ if (initResult.getCode() != IStatus.OK) {
+ // At this point, I can live with a failure
+ AutotoolsUIPlugin.log(initResult);
+ }
+
+ 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) {
+ // Get my initializer to run
+ if(newProject == null)
+ return;
+
+ IStatus initResult = ManagedBuildManager.initBuildInfoContainer(newProject);
+ if (initResult.getCode() != IStatus.OK) {
+ // At this point, I can live with a failure
+ AutotoolsUIPlugin.log(initResult);
+ }
+
+ // execute any operations specified by custom pages
+ // execute any operations specified by custom pages
+ IRunnableWithProgress operations[] = MBSCustomPageManager.getOperations();
+
+ if (operations != null)
+ {
+ for(int k = 0; k < operations.length; k++)
+ {
+ try {
+ operations[k].run(monitor);
+ } catch(InvocationTargetException e) {
+ //TODO: what should we do?
+ } catch(InterruptedException e) {
+ //TODO: what should we do?
+ }
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.ui.wizards.NewCProjectWizard#getProjectID()
+ */
+ public String getProjectID() {
+// return "org.eclipse.cdt.make.core.make"; //$NON-NLS-1$
+ return ManagedBuilderCorePlugin.MANAGED_MAKE_PROJECT_ID;
+ }
+
+// public IProjectType getSelectedProjectType() {
+// return projectConfigurationPage.getSelectedProjectType();
+// }
+
+ public IConfiguration[] getSelectedConfigurations() {
+ return projectConfigurationPage.getSelectedConfigurations();
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/AutotoolsWizardMessages.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/AutotoolsWizardMessages.java
new file mode 100644
index 0000000000..adccbfd3f9
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/AutotoolsWizardMessages.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007, 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM - Initial API and implementation
+ * Red Hat - Copy from org.eclipse.cdt.wizards to here plus rename
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.wizards;
+
+import java.text.MessageFormat;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+/**
+ * @since 2.0
+ */
+public class AutotoolsWizardMessages {
+ // Bundle ID
+ private static final String BUNDLE_ID = AutotoolsWizardMessages.class.getName();
+ //Resource bundle.
+ private static ResourceBundle resourceBundle;
+
+ static {
+ try {
+ resourceBundle = ResourceBundle.getBundle(BUNDLE_ID);
+ } catch (MissingResourceException x) {
+ resourceBundle = null;
+ }
+ }
+
+ public static String getFormattedString(String key, String arg) {
+ return MessageFormat.format(getResourceString(key), new Object[] { arg });
+ }
+
+ public static String getFormattedString(String key, String[] args) {
+ return MessageFormat.format(getResourceString(key), (Object[])args);
+ }
+
+ public static String getResourceString(String key) {
+ try {
+ return resourceBundle.getString(key);
+ } catch (MissingResourceException e) {
+ return "!" + key + "!"; //$NON-NLS-1$ //$NON-NLS-2$
+ } catch (NullPointerException e) {
+ return "#" + key + "#"; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+
+ private AutotoolsWizardMessages() {
+ // No constructor
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/AutotoolsWizardMessages.properties b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/AutotoolsWizardMessages.properties
new file mode 100644
index 0000000000..5583ca19b5
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/AutotoolsWizardMessages.properties
@@ -0,0 +1,364 @@
+###############################################################################
+# Copyright (c) 2000, 2006, 2007 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# IBM - Initial API and implementation
+# Red Hat - Copy to AutotoolsWizardMessages.properties
+###############################################################################
+
+# ------- Project Update Messages -------
+ManagedBuilderStartup.update.20x.title=Update Managed Make Project
+ManagedBuilderStartup.update.20x.message=The project {0} has been detected in your workspace.\n Its build settings are stored in a format that is no longer supported.\n Would you like to convert them now?
+
+AutotoolsBuildWizard.0=GNU Autotools project
+
+# ------- 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 type of project
+MngMakeProjectWizard.config.desc=Select the platform and configurations you wish to deploy on
+PlatformBlock.tip.platform=Select the type of project for the build goal
+PlatformBlock.tip.forcedconfigs=There are no buildable configurations on this platform for this project type.\n By default, all configurations selected.
+PlatformBlock.label.platform=Project Type:
+PlatformBlock.label.configs=Configurations:
+PlatformBlock.label.showall=Show All Project Types
+PlatformBlock.label.showall.config=Show All Configurations
+PlatformBlock.label.selectAll=Select All
+PlatformBlock.label.deselectAll=Deselect All
+PlatformBlock.message.error.noconfigs=You must select at least one configuration
+
+# -- Strings for the additional options tab
+MngMakeProjectWizard.options.title=Additional Project Settings
+MngMakeProjectWizard.options.desc=Define the inter-project dependencies, if any.
+
+# ----------- Configuration Selection Page -----------
+BuildPropertyPage.label.Platform=Project Type:
+BuildPropertyPage.label.Configuration=Configuration:
+BuildPropertyPage.label.Active=Active configuration
+BuildPropertyPage.label.Settings=Configuration Settings
+BuildPropertyPage.label.AddConfButton=Manage...
+BuildPropertyPage.selection.configuration.all=All configurations
+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
+BuildPropertyPage.error.Unknown_tree_element=Unknown type of element in tree of type {0}
+BuildPropertyPage.error.version_low=The Managed Make project settings for this project are not available.
+BuildPropertyPage.defaults.title=Reset Configuration Tools
+BuildPropertyPage.defaults.message=This action will reset all of the tools in the selected configuration to their default settings.\n\nDo you want to proceed?
+BuildPropertyPage.changes.save.title=Apply Configuration Changes
+BuildPropertyPage.changes.save.question=You have made changes to the {0} configuration.\n\nDo you want to apply these changes before switching to the {1} configuration?
+BuildPropertyPage.changes.save.error=The configuration changes could not be applied.
+BuildPropertyPage.unsupported.proj=The project support is not installed on the system
+BuildPropertyPage.unsupported.config=The configuration support is not installed on the system
+BuildPropertyPage.config.notselected=No configurations selected
+
+# ----------- Managed Build Custom Wizard Page Manager Error Strings -----------
+MBSCustomPageManager.error0=Unknown element type
+MBSCustomPageManager.error1=\ for extension point
+MBSCustomPageManager.error2=Unknown child element type
+MBSCustomPageManager.error3=\ for wizardPage element in extension point
+MBSCustomPageManager.error4=Missing projectType ID
+MBSCustomPageManager.error5=Missing projectType ID
+MBSCustomPageManager.error6=Missing nature ID
+
+
+# ----------- Managed Build Preference Page -----------
+BuildPreferencePage.label.Settings=Workspace Settings
+BuildPreferencePage.job.rebuild=Rebuilding the Managed Projects
+BuildPreferencePage.apply.internal.error=An Internal error has occured please check error log.
+
+#--------------- Resource Configuration Selection Page --------------
+ResourceBuildPropertyPage.defaults.title=Reset Resource Configuration Tool
+ResourceBuildPropertyPage.defaults.message=This action will reset all options of the tool in the current resource configuration to their default settings.\n\nDo you want to proceed?
+
+# ----------- Tools Settings Block -----------
+ToolsSettingsBlock.label.Settings=Tool Settings
+ToolsSettingsBlock.label.ToolTree=Tools
+ToolsSettingsBlock.label.ToolOptions=Options
+
+# ----------- Build Settings Block -----------
+BuildSettingsBlock.label.Settings=Build Settings
+BuildSettingsBlock.label.makecmdgroup=Build command
+BuildSettingsBlock.label.makecmddef=Use default command
+BuildSettingsBlock.label.output.group=Build output
+BuildSettingsBlock.label.output.name=Artifact name:
+BuildSettingsBlock.label.output.extension=Artifact extension:
+BuildSettingsBlock.defaults.title=Reset Build Settings
+BuildSettingsBlock.defaults.message=This action will reset the build settings to their default settings.\n\nDo you want to proceed?
+BuildSettingsBlock.label.macros.group=Build Macros usage
+BuildSettingsBlock.label.macros.expand=Expand Build Environment Macros
+BuildSettingsBlock.label.internal.builder.group=Internal Builder
+BuildSettingsBlock.label.internal.builder.enable=Enable Internal Builder
+BuildSettingsBlock.label.internal.builder.ignore.err=Ignore build errorors
+BuildSettingsBlock.label.internal.builder.experimental.note=NOTE: This is experimental functionality
+
+
+# ----------- Build Steps Block -----------
+BuildStepSettingsBlock.label.Settings=Build Steps
+BuildStepSettingsBlock.label.prebuildstep.group=Pre-build step:
+BuildStepSettingsBlock.label.prebuildstep.cmd=Command:
+BuildStepSettingsBlock.label.prebuildstep.desc=Description:
+BuildStepSettingsBlock.label.postbuildstep.group=Post-build step:
+BuildStepSettingsBlock.label.postbuildstep.cmd=Command:
+BuildStepSettingsBlock.label.postbuildstep.desc=Description:
+BuildStepsSettingsBlock.defaults.title=Reset Build Steps
+BuildStepsSettingsBlock.defaults.message=This action will reset the pre-build and post-build steps to their default settings.\n\nDo you want to proceed?
+
+# ----------- Environment Set Block -----------
+EnvironmentSetBlock.label.environment=Environment
+EnvironmentSetBlock.label.environment.group=Environment variables
+EnvironmentSetBlock.label.tab.configuration=Configuration
+EnvironmentSetBlock.label.tab.project=Project
+EnvironmentSetBlock.label.tab.workspace=Workspace
+EnvironmentSetBlock.label.tab.eclipse=Eclipse Environment
+
+# ----------- Environment Block -----------
+EnvironmentBlock.label.header.name=Name
+EnvironmentBlock.label.header.value=Value
+EnvironmentBlock.label.button.new=New
+EnvironmentBlock.label.button.edit=Edit
+EnvironmentBlock.label.button.delete=Delete
+EnvironmentBlock.label.button.undef=Undefine
+EnvironmentBlock.label.value.undef=<UNDEFINED>
+EnvironmentBlock.label.button.check.chow.parent=Show parent level variables
+EnvironmentBlock.label.user.var=User Variables
+EnvironmentBlock.label.system.var=System Variables
+EnvironmentBlock.label.delete.confirm.title=Variable deletion confirmation
+EnvironmentBlock.label.delete.confirm.message=Are you sure you want to delete the selected user variable(s)?
+EnvironmentBlock.label.delete.all.confirm.title=Variable deletion confirmation
+EnvironmentBlock.label.delete.all.confirm.message=Are you sure you want to delete all user variables?
+
+# ----------- New Env Var Dialog -----------
+NewEnvVarDialog.label.name=Name
+NewEnvVarDialog.label.value=Value
+NewEnvVarDialog.label.delimiter=Delimiter
+NewEnvVarDialog.label.operation=Operation
+NewEnvVarDialog.label.operation.replace=Replace
+NewEnvVarDialog.label.operation.prepend=Prepend
+NewEnvVarDialog.label.operation.append=Append
+NewEnvVarDialog.label.operation.remove=Remove
+NewEnvVarDialog.label.value.prepend=Prepended Value
+NewEnvVarDialog.label.value.append=Appended Value
+NewEnvVarDialog.label.value.undef=<UNDEFINED>
+NewEnvVarDialog.label.title.new=Define a new variable
+NewEnvVarDialog.label.title.edit=Edit existing variable
+NewEnvVarDialog.label.status.cannot.create=The "{0}" Variable can not be created by user
+
+# ----------- Macros Set Block -----------
+MacrosSetBlock.label.macros=Macros
+MacrosSetBlock.label.macros.group=Macros
+MacrosSetBlock.label.tab.configuration=Configuration
+MacrosSetBlock.label.tab.project=Project
+MacrosSetBlock.label.tab.workspace=Workspace
+
+# ----------- Macros Block -----------
+MacrosBlock.label.header.name=Name
+MacrosBlock.label.header.type=Type
+MacrosBlock.label.header.value=Value
+MacrosBlock.label.button.new=New
+MacrosBlock.label.button.edit=Edit
+MacrosBlock.label.button.delete=Delete
+MacrosBlock.label.button.check.chow.parent=Show parent context macros
+MacrosBlock.label.user.macros=User Macros
+MacrosBlock.label.system.macros=System Macros
+MacrosBlock.label.delete.confirm.title=Macro deletion confirmation
+MacrosBlock.label.delete.confirm.message=Are you sure you want to delete the selected user Macro(s)?
+MacrosBlock.label.delete.all.confirm.title=Macro deletion confirmation
+MacrosBlock.label.delete.all.confirm.message=Are you sure you want to delete all user macros?
+MacrosBlock.label.value.eclipse.dynamic=<ECLIPSE DYNAMIC VARIABLE>
+MacrosBlock.label.type.text=String
+MacrosBlock.label.type.text.list=StringList
+MacrosBlock.label.type.path.file=File
+MacrosBlock.label.type.path.dir=Dir
+MacrosBlock.label.type.path.file.list=FileList
+MacrosBlock.label.type.path.dir.list=DirList
+MacrosBlock.label.type.path.any=Path
+MacrosBlock.label.type.path.any.list=PathList
+
+
+# ----------- New Build Macro Dialog -----------
+NewBuildMacroDialog.label.name=Name
+NewBuildMacroDialog.label.value=Value
+NewBuildMacroDialog.label.type=Type
+NewBuildMacroDialog.label.type.text=String
+NewBuildMacroDialog.label.type.text.list=List of Strings
+NewBuildMacroDialog.label.type.path.file=File
+NewBuildMacroDialog.label.type.path.dir=Directory
+NewBuildMacroDialog.label.type.path.file.list=List of Files
+NewBuildMacroDialog.label.type.path.dir.list=List of Directories
+NewBuildMacroDialog.label.type.path.any=File or Directory
+NewBuildMacroDialog.label.type.path.any.list=List of Files or Directories
+NewBuildMacroDialog.label.browse=Browse
+NewBuildMacroDialog.label.title.new=Define a new macro
+NewBuildMacroDialog.label.title.edit=Edit existing macro
+NewBuildMacroDialog.label.list.title=Macro Value
+NewBuildMacroDialog.label.status.cannot.create=The "{0}" Macro can not be created by user
+
+# ------------Resource Configuration Selection Page
+ResourceBuildPropertyPage.label.ActiveResource=Active Resource configuration
+ResourceBuildPropertyPage.label.ResourceSettings=Resource Configuration settings
+ResourceBuildPropertyPage.label.Configuration=Configuration:
+ResourceBuildPropertyPage.label.ExcludeCheckBox= Exclude from build
+ResourceBuildPropertyPage.selection.configuration.all=All configurations
+ResourceBuildPropertyPage.label.ToolTree=Tools
+ResourceBuildPropertyPage.label.ToolOptions=Options
+ResourceBuildPropertyPage.label.NotMBSFile=The project is closed or the file is not contained within a Managed Make project.
+ResourceBuildPropertyPage.error.version_low=The Managed Make project settings for this project are not available.
+ResourceBuildPropertyPage.tip.excludecheck=Exclude the file from building in the selected configuration
+ResourceBuildPropertyPage.tip.config=Select the configuration to edit
+ResourceBuildPropertyPage.unsupported.proj=The project support is not installed on the system
+ResourceBuildPropertyPage.unsupported.config=The configuration support is not installed on the system
+ResourceBuildPropertyPage.config.notselected=No configurations selected
+ResourceBuildPropertyPage.rc.non.build=Managed Build settings for this resource are not available
+ResourceBuildPropertyPage.rc.generated=The selected resource is created by the buildfile generator
+
+# ----------- Resource Custom Build Step Block -----------
+ResourceCustomBuildStepBlock.label.settings=Custom Build Steps
+ResourceCustomBuildStepBlock.label.tool.group=Resource Custom Build Step
+ResourceCustomBuildStepBlock.label.applicability=Custom Build Step Applicability
+ResourceCustomBuildStepBlock.label.applicability.rule.before=Apply Custom Build Step Before Other Tools
+ResourceCustomBuildStepBlock.label.applicability.rule.after=Apply Custom Build Step After Other Tools
+ResourceCustomBuildStepBlock.label.applicability.rule.override=Apply Custom Build Step Overriding Other Tools
+ResourceCustomBuildStepBlock.label.applicability.rule.disable=Disable Custom Build Step
+ResourceCustomBuildStepBlock.label.input.filenames=Additional Input file name(s):
+ResourceCustomBuildStepBlock.label.output.filenames=Output file name(s):
+ResourceCustomBuildStepBlock.label.command.cmd=Command:
+ResourceCustomBuildStepBlock.label.description.desc=Description:
+ResourceCustomBuildStepBlock.tip.applicability=specifies how to apply the custom build step with respect to other resource configuration tools
+ResourceCustomBuildStepBlock.tip.inputs=a semicolon separated list of additional input files for this build step. Paths are interpreted as relative to the Project directory.
+ResourceCustomBuildStepBlock.tip.outputs=a semicolon separated list of the output files produced by this build step. Paths are interpreted as relative to the Build directory.
+ResourceCustomBuildStepBlock.tip.command=a semicolon separated list of commands or a single command to be executed by this build step. Paths are interpreted as relative to the Build directory.
+ResourceCustomBuildStepBlock.tip.announcement=a message to be output in the build log upon execution of this build step
+ResourceCustomBuildStepBlock.defaults.title=Reset Resource Custom Build Step
+ResourceCustomBuildStepBlock.defaults.message=This action will reset the resource custom build step to the default settings.\n\nDo you want to proceed?
+
+# ----------- Entry Dialog -----------
+BrowseEntryDialog.error.Folder_name_invalid = Folder name invalid
+BrowseEntryDialog.message.file = File:
+BrowseEntryDialog.message.directory = Directory:
+BrowseEntryDialog.file.title.add=Add file path
+BrowseEntryDialog.dir.title.add=Add directory path
+BrowseEntryDialog.file.title.edit=Edit file path
+BrowseEntryDialog.dir.title.edit=Edit directory path
+BrowseEntryDialog.wsp.dir.dlg.title=Folder selection
+BrowseEntryDialog.wsp.file.dlg.title=File selection
+BrowseEntryDialog.wsp.dir.dlg.msg=Select a folder from workspace:
+BrowseEntryDialog.wsp.file.dlg.msg=Select a file from workspace:
+BrowseEntryDialog.wsp.file.dlg.err=The selected element is not a file.
+BrowseEntryDialog.fs.dir.dlg.msg=Select a folder from file system:
+
+# ----------- New Configuration -----------
+NewConfiguration.label.name=Name:
+NewConfiguration.label.description=Description:
+NewConfiguration.label.group=Copy settings from
+NewConfiguration.label.copy=Default configuration:
+NewConfiguration.label.clone=Existing configuration:
+NewConfiguration.label.showall=Show unsupported configurations
+NewConfiguration.error.duplicateName=A configuration named "{0}" already exists.
+NewConfiguration.error.caseName=A configuration name that differs only in case to "{0}" exists.
+NewConfiguration.error.invalidName=The name "{0}" is invalid.
+
+# ----------- Rename Configuration -----------
+RenameConfiguration.label.name=Name:
+RenameConfiguration.label.description=Description:
+RenameConfiguration.error.duplicateName=A configuration named "{0}" already exists.
+RenameConfiguration.error.caseName=A configuration name that differs only in case to "{0}" exists.
+RenameConfiguration.error.invalidName=The name "{0}" is invalid.
+
+# ----------- Target/Config management dialog -----------------
+ManageConfig.label.configs=Manage configurations
+ManageConfig.label.rename=Rename
+ManageConfig.label.conversionTargetLabel=Tool chain conversion targets:
+ManageConfig.label.convertTarget=Convert
+ManageConfig.label.new.config.dialog=Create configuration
+ManageConfig.label.rename.config.dialog=Rename configuration
+ManageConfig.deletedialog.message=Are you sure you want to delete the "{0}" configuration?
+ManageConfig.deletedialog.title=Confirm Delete
+
+# Toolchain Conversion Target confirmation Dialog
+ConfigurationConvert.confirmdialog.message=Currently the "{0}" Configuration uses "{1}" tool-chain. After conversion it will use "{2}" tool-chain. Do you want to proceed?
+ConfigurationConvert.confirmdialog.title=Confirm Configuration Conversion
+
+# ----------- 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:
+
+# ----------- Field Editors -----------
+Multiline.error.message=Please give correct input
+
+# ----------- Build Tool Settings -----------
+BuildToolSettingsPage.alloptions=All options:
+BuildToolSettingsPage.tool.command=Command:
+BuildToolSettingsPage.tool.commandLinePattern=Command\nline pattern:
+BuildToolSettingsPage.tool.advancedSettings=Expert settings:
+
+# ----------- File List Control -----------
+FileListControl.add=Add
+FileListControl.delete=Delete
+FileListControl.edit=Edit
+FileListControl.moveup=Move Up
+FileListControl.movedown=Move Down
+FileListControl.filedialog.title=Select File
+FileListControl.dirdialog.title=Select Include Directory
+FileListControl.dirdialog.desc=Select Include Paths
+FileListControl.deletedialog.message=Are you sure you want to delete the selected files or directories?
+FileListControl.deletedialog.title=Confirm Delete
+FileListControl.editdialog.title=Edit Dialog
+FileListControl.newdialog.title=New Dialog
+FileListControl.button.workspace=Workspace...
+FileListControl.button.fs=File system...
+
+# ----------- Property Page ----------
+MngMakeProjectPropertyPage.closedproject=Project Closed
+MngMakeProjectPropertyPage.internalError=An Internal error has occur please check error log.
+
+# Copies from org.eclipse.ui.workbench
+showAdvanced = &Advanced >>
+hideAdvanced = << &Advanced
+NewFolderDialog.folderNameEmpty = Folder name must be specified
+
+# Project Conversion Dialog messages
+ProjectConvert.confirmdialog.title=Confirm Project Conversion
+ProjectConvert.confirmdialog.message=The selected project {0} will be converted. Do you want to proceed ?
+
+ProjectConvert.conversionErrordialog.title=Project Conversion Error
+ProjectConvert.conversionErrordialog.message=Error has occured during the conversion of the project {0} .
+
+ProjectConvert.noConverterErrordialog.title=Project Conversion Error
+ProjectConvert.noConverterErrordialog.message=There are no converters available to convert the project {0} .
+
+ProjectConvert.title=Project Converters for {0}
+ProjectConvert.convertersList=Converters List
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/CProjectPlatformPage.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/CProjectPlatformPage.java
new file mode 100644
index 0000000000..323349d854
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/CProjectPlatformPage.java
@@ -0,0 +1,319 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Rational Software - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.wizards;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.cdt.core.CProjectNature;
+import org.eclipse.cdt.managedbuilder.core.IConfiguration;
+import org.eclipse.cdt.managedbuilder.core.IProjectType;
+import org.eclipse.cdt.managedbuilder.core.IToolChain;
+import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
+import org.eclipse.cdt.managedbuilder.ui.wizards.MBSCustomPageManager;
+import org.eclipse.cdt.ui.newui.CDTHelpContextIds;
+import org.eclipse.cdt.ui.wizards.NewCProjectWizard;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.dialogs.IDialogConstants;
+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.Wizard;
+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.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.Table;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.PlatformUI;
+
+
+/**
+ * Class that implements the project type and configuration selection page in the new
+ * project wizard for managed builder projects.
+ *
+ * @since 1.2
+ */
+public class CProjectPlatformPage extends WizardPage {
+ /*
+ * Dialog variables and string constants
+ */
+ 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 CONFIG_LABEL = LABEL + ".configs"; //$NON-NLS-1$
+ private static final String TARGET_LABEL = LABEL + ".platform"; //$NON-NLS-1$
+ private static final String TARGET_TIP = TIP + ".platform"; //$NON-NLS-1$
+ private static final String FORCEDCONFIG_TIP = TIP + ".forcedconfigs"; //$NON-NLS-1$
+
+ // support for exporting data to custom wizard pages
+ public static final String PAGE_ID = "org.eclipse.cdt.managedbuilder.ui.wizard.platformPage"; //$NON-NLS-1$
+ public static final String PROJECT_TYPE = "projectType"; //$NON-NLS-1$
+ public static final String TOOLCHAIN = "toolchain"; //$NON-NLS-1$
+ public static final String NATURE = "nature"; //$NON-NLS-1$
+
+ protected Wizard parentWizard;
+ protected Text platformSelection;
+ private ArrayList<Object> selectedConfigurations;
+ protected IProjectType projectType;
+ protected Button showAllConfigs;
+ protected boolean showAllConfigsForced;
+ protected CheckboxTableViewer tableViewer;
+ protected IConfiguration configurations[];
+
+ /**
+ * Constructor.
+ * @param pageName
+ * @param wizard
+ */
+ public CProjectPlatformPage(String pageName, Wizard parentWizard) {
+ super(pageName);
+ setPageComplete(false);
+ projectType = ManagedBuildManager.getExtensionProjectType("org.eclipse.linuxtools.cdt.autotools.core.projectType"); //$NON-NLS-1$
+ selectedConfigurations = new ArrayList<Object>(0);
+ this.parentWizard = parentWizard;
+ showAllConfigsForced = false;
+ }
+
+ /**
+ * @see org.eclipse.jface.wizard.IWizardPage#canFlipToNextPage()
+ */
+ public boolean canFlipToNextPage() {
+ return validatePage();
+ }
+
+ private void createConfigSelectionGroup (Composite parent) {
+ // Create the group composite
+ Composite composite = new Composite(parent, SWT.NULL);
+ composite.setFont(parent.getFont());
+ composite.setLayout(new GridLayout());
+ composite.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ // Create a check box table of valid configurations
+ final Label configLabel = new Label(composite, SWT.LEFT);
+ configLabel.setFont(composite.getFont());
+ configLabel.setText(AutotoolsWizardMessages.getResourceString(CONFIG_LABEL));
+
+ Table table = new Table(composite, SWT.CHECK | SWT.BORDER | SWT.MULTI
+ | SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL);
+ table.setLayoutData(new GridData(GridData.FILL_BOTH));
+ 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();
+ }
+ });
+
+ }
+
+ /**
+ * @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 = new Composite(parent, SWT.NULL);
+ composite.setFont(parent.getFont());
+ composite.setLayout(new GridLayout());
+ composite.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ // Setup the help information
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, CDTHelpContextIds.MAN_PROJ_PLATFORM_HELP);
+
+ // Create the widgets
+ createTypeSelectGroup(composite);
+ createConfigSelectionGroup(composite);
+
+ // Publish which project type has been chosen with the custom wizard page manager
+ MBSCustomPageManager.addPageProperty(PAGE_ID, PROJECT_TYPE, projectType.getId());
+
+ // Select configuration
+ populateConfigurations();
+ setPageComplete(validatePage());
+
+ // Do the nasty
+ setErrorMessage(null);
+ setMessage(null);
+ setControl(composite);
+ }
+
+
+ private void createTypeSelectGroup(Composite parent) {
+ // Create the group composite
+ Composite composite = new Composite(parent, SWT.NULL);
+ composite.setFont(parent.getFont());
+ composite.setLayout(new GridLayout(2, false));
+ composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ // Create the platform selection label and combo widgets
+ final Label platformLabel = new Label(composite, SWT.LEFT);
+ platformLabel.setFont(composite.getFont());
+ platformLabel.setText(AutotoolsWizardMessages.getResourceString(TARGET_LABEL));
+
+ platformSelection = new Text(composite, SWT.READ_ONLY);
+// platformSelection = new Combo(composite, SWT.READ_ONLY | SWT.BORDER);
+ platformSelection.setFont(composite.getFont());
+ platformSelection.setToolTipText(AutotoolsWizardMessages.getResourceString(TARGET_TIP));
+ platformSelection.setText("GNU Autotools"); //$NON-NLS-1$
+ platformSelection.addDisposeListener(new DisposeListener() {
+ public void widgetDisposed(DisposeEvent e) {
+ platformSelection = null;
+ }
+ });
+
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ // Make this the same as NewCProjectWizardPage.SIZING_TEXT_FIELD_WIDTH
+ gd.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH + 50;
+ platformSelection.setLayoutData(gd);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.ui.dialogs.ICOptionContainer#getProject()
+ */
+ public IProject getProject() {
+ return ((NewCProjectWizard)getWizard()).getNewProject();
+ }
+
+ /**
+ * @return
+ */
+ public IConfiguration[] getSelectedConfigurations() {
+ return (IConfiguration[]) selectedConfigurations.toArray(new IConfiguration[selectedConfigurations.size()]);
+ }
+
+ /**
+ * Returns the selected project type.
+ *
+ * @return IProjectType Selected type or <code>null</code> if an invalid selection
+ * has been made.
+ */
+ public IProjectType getProjectType() {
+ return projectType;
+ }
+
+ private void handleConfigurationSelectionChange() {
+ // Get the selections from the table viewer
+ selectedConfigurations.clear();
+ selectedConfigurations.addAll(Arrays.asList(tableViewer.getCheckedElements()));
+
+ // support for publishing the toolchains for the selected configs so that custom wizard
+ // pages will know which toolchains have been selected
+
+ // get the toolchains from the selected configs and put them into a set
+ Set<IToolChain> toolchainSet = new LinkedHashSet<IToolChain>();
+ for(int k = 0; k < selectedConfigurations.size(); k++)
+ {
+ IConfiguration config = (IConfiguration) selectedConfigurations.get(k);
+ IToolChain toolchain = config.getToolChain();
+ toolchainSet.add(toolchain);
+ }
+
+ // publish the set of selected toolchains with the custom page manager
+ MBSCustomPageManager.addPageProperty(PAGE_ID, TOOLCHAIN, toolchainSet);
+
+ // TODO: Don't know where this goes and how to find true nature
+ MBSCustomPageManager.addPageProperty(CProjectPlatformPage.PAGE_ID, CProjectPlatformPage.NATURE, CProjectNature.C_NATURE_ID);
+
+ setPageComplete(validatePage());
+ }
+
+ /**
+ * Populate the table viewer with either all known configurations
+ * or only with the supported configurations depending on whether a user
+ * has chosen to display unsupported configurations or not
+ * By default, only supported configurations are selected.
+ */
+ private void populateConfigurations() {
+ if (projectType == null)
+ return;
+ IConfiguration selected[] = null;
+
+ configurations = filterSupportedConfigurations(projectType.getConfigurations());
+ selected = configurations;
+
+ // Check for buildable configs on this platform
+ if (selected.length == 0) {
+ // Indicate that there are no buildable configurations on this platform for this project
+ // type and that all configurations will be selected
+ setMessage(AutotoolsWizardMessages.getResourceString(FORCEDCONFIG_TIP), WARNING);
+ }
+ else {
+ setMessage(null, NONE);
+ }
+
+ tableViewer.setInput(configurations);
+ tableViewer.setCheckedElements(selected);
+ handleConfigurationSelectionChange();
+ }
+
+ /**
+ * Returns the array of supported configurations found in the configurations
+ * passed to this method
+ */
+ IConfiguration[] filterSupportedConfigurations(IConfiguration cfgs[]){
+ ArrayList<IConfiguration> supported = new ArrayList<IConfiguration>();
+ String os = Platform.getOS();
+ String arch = Platform.getOSArch();
+
+ for (int i = 0; i < cfgs.length; i++) {
+ // First, filter on supported state
+ if (cfgs[i].isSupported()) {
+ // Now, apply the OS and ARCH filters to determine if the configuration should be shown
+ // Determine if the configuration's tool-chain supports this OS & Architecture.
+ IToolChain tc = cfgs[i].getToolChain();
+ List<String> osList = Arrays.asList(tc.getOSList());
+ if (osList.contains("all") || osList.contains(os)) { //$NON-NLS-1$
+ List<String> archList = Arrays.asList(tc.getArchList());
+ if (archList.contains("all") || archList.contains(arch)) { //$NON-NLS-1$
+ supported.add(cfgs[i]);
+ }
+ }
+ }
+ }
+ return (IConfiguration[])supported.toArray(new IConfiguration[supported.size()]);
+ }
+
+
+ /**
+ * @return
+ */
+ private boolean validatePage() {
+ // TODO some validation ... maybe
+ if ((tableViewer.getCheckedElements()).length > 0) {
+ setErrorMessage(null);
+ return true;
+ } else {
+ setErrorMessage(AutotoolsWizardMessages.getResourceString("PlatformBlock.message.error.noconfigs")); //$NON-NLS-1$
+ return false;
+ }
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/ConfigurationContentProvider.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/ConfigurationContentProvider.java
new file mode 100644
index 0000000000..7fc4b20343
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/ConfigurationContentProvider.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 2005, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Rational Software - Initial API and implementation
+ * Red Hat Inc. - Copy from CDT 3.1.2 to here
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.wizards;
+
+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 an array of configurations
+ Object array[] = (Object[])parent;
+ return (array == null || array.length == 0) ? new Object[0] : array;
+ }
+
+ public void dispose() {
+ }
+
+ public void inputChanged(
+ Viewer viewer,
+ Object oldInput,
+ Object newInput) {
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/ConfigurationLabelProvider.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/ConfigurationLabelProvider.java
new file mode 100644
index 0000000000..3d7f3de0c2
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/ConfigurationLabelProvider.java
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 2005, 2007 Rational Software Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Rational Software - Initial API and implementation
+ * Red Hat Inc. - Copy from CDT 3.1.2 to here
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.wizards;
+
+
+import org.eclipse.cdt.managedbuilder.core.IConfiguration;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.AutotoolsUIPluginImages;
+import org.eclipse.swt.graphics.Image;
+
+
+public class ConfigurationLabelProvider extends LabelProvider implements ITableLabelProvider {
+ private final Image IMG_CFG =
+ AutotoolsUIPluginImages.get(AutotoolsUIPluginImages.IMG_BUILD_CONFIG);
+
+ //
+ public String getColumnText(Object obj, int index) {
+ if (obj instanceof IConfiguration) {
+ IConfiguration tmpConfig = (IConfiguration) obj;
+
+ if( (tmpConfig.getDescription() == null)|| (tmpConfig.getDescription().equals("")) ) //$NON-NLS-1$
+ return ((IConfiguration) obj).getName();
+ else
+ return ( tmpConfig.getName() + " ( " + tmpConfig.getDescription() + " )"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ return new String();
+ }
+
+ public Image getColumnImage(Object obj, int index) {
+ return IMG_CFG;
+ }
+}
+
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/ConvertToAutotoolsProjectWizard.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/ConvertToAutotoolsProjectWizard.java
new file mode 100644
index 0000000000..a917e47837
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/ConvertToAutotoolsProjectWizard.java
@@ -0,0 +1,218 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2004, 2009 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.wizards;
+
+
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.cdt.managedbuilder.core.IConfiguration;
+import org.eclipse.cdt.managedbuilder.core.IProjectType;
+import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
+import org.eclipse.cdt.managedbuilder.ui.wizards.MBSCustomPageManager;
+import org.eclipse.cdt.ui.wizards.NewCProjectWizardPage;
+import org.eclipse.cdt.ui.wizards.conversion.ConversionWizard;
+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.operation.IRunnableWithProgress;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.linuxtools.cdt.autotools.ui.AutotoolsUIPlugin;
+
+
+/**
+ * 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 ConvertToAutotoolsProjectWizard extends ConversionWizard {
+
+ private static final String WZ_TITLE = "WizardAutotoolsProjectConversion.title"; //$NON-NLS-1$
+ private static final String WZ_DESC = "WizardAutotoolsProjectConversion.description"; //$NON-NLS-1$
+ private static final String PREFIX = "WizardAutotoolsConversion"; //$NON-NLS-1$
+ private static final String WINDOW_TITLE = "WizardAutotoolsConversion.windowTitle"; //$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 MSG_SAVE = PREFIX + ".message.save"; //$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$
+
+ public static final String NULL_INDEXER_ID = "org.eclipse.cdt.core.nullindexer"; //$NON-NLS-1$
+
+ protected CProjectPlatformPage projectConfigurationPage;
+ protected NewAutotoolsProjectOptionPage optionPage;
+
+ protected IProject curProject;
+
+ /**
+ * ConvertToAutotoolsConversionWizard Wizard constructor
+ */
+ public ConvertToAutotoolsProjectWizard() {
+ this(getWindowTitleResource(), getWzDescriptionResource());
+ }
+ /**
+ * ConvertToAutotoolsConversionWizard Wizard constructor
+ *
+ * @param title
+ * @param desc
+ */
+ public ConvertToAutotoolsProjectWizard(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 AutotoolsUIPlugin.getResourceString(WZ_DESC);
+ }
+
+ /**
+ * Method getWzTitleResource, allows Wizard description label value
+ * to be changed by subclasses
+ *
+ * @return String
+ */
+ protected static String getWzTitleResource() {
+ return AutotoolsUIPlugin.getResourceString(WZ_TITLE);
+ }
+
+ /**
+ * Method getWindowTitleResource, allows Wizard Title label value to be
+ * changed by subclasses
+ *
+ * @return String
+ */
+ protected static String getWindowTitleResource() {
+ return AutotoolsUIPlugin.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 ConvertToAutotoolsProjectWizardPage(getPrefix(), this));
+
+ // Add the configuration selection page
+ projectConfigurationPage = new CProjectPlatformPage(PREFIX, this);
+ projectConfigurationPage.setTitle(AutotoolsUIPlugin.getResourceString(CONF_TITLE));
+ projectConfigurationPage.setDescription(AutotoolsUIPlugin.getResourceString(CONF_DESC));
+ addPage(projectConfigurationPage);
+
+ // Add the options (tabbed) page
+ optionPage = new NewAutotoolsProjectOptionPage(PREFIX, this);
+ optionPage.setTitle(AutotoolsUIPlugin.getResourceString(OPTIONS_TITLE));
+ optionPage.setDescription(AutotoolsUIPlugin.getResourceString(OPTIONS_DESC));
+ addPage(optionPage);
+
+ // add custom pages
+ MBSCustomPageManager.init();
+
+ // add stock pages
+ MBSCustomPageManager.addStockPage(fMainPage, NewCProjectWizardPage.PAGE_ID);
+ MBSCustomPageManager.addStockPage(projectConfigurationPage, CProjectPlatformPage.PAGE_ID);
+ MBSCustomPageManager.addStockPage(optionPage, NewAutotoolsProjectOptionPage.PAGE_ID);
+ }
+
+ public String getProjectID() {
+ return ManagedBuilderCorePlugin.MANAGED_MAKE_PROJECT_ID;
+ }
+
+ public IProjectType getProjectType() {
+ return projectConfigurationPage.getProjectType();
+ }
+
+ public IConfiguration[] getSelectedConfigurations() {
+ return projectConfigurationPage.getSelectedConfigurations();
+ }
+
+ protected void setCurrentProject (IProject project) {
+ curProject = project;
+ }
+
+ public IProject getProject() {
+ return curProject;
+ }
+
+ public void applyOptions(IProject project, IProgressMonitor monitor) {
+ // When applying the project options, we need to specify which
+ // project because the conversion wizard allows us to convert
+ // more than one project at once. We accomplish this by setting
+ // the current project we are working on. The optionPage when
+ // applying options will ask the wizard (us) to get the project which
+ // we will report is the current project being converted.
+ setCurrentProject(project);
+ optionPage.performApply(monitor);
+ }
+
+ protected void doRun(IProgressMonitor monitor) throws CoreException {
+ monitor.beginTask(AutotoolsUIPlugin.getResourceString("WizardAutotoolsProjectConversion.monitor.convertingToMakeProject"), 2); //$NON-NLS-1$
+ try {
+ super.doRun(new SubProgressMonitor(monitor, 5));
+ } finally {
+ 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) {
+ // Get my initializer to run
+// if (project == null)
+// return;
+//
+// IStatus initResult = ManagedBuildManager.initBuildInfoContainer(project);
+// if (initResult.getCode() != IStatus.OK) {
+// // At this point, I can live with a failure
+// ManagedBuilderUIPlugin.log(initResult);
+// }
+
+ // execute any operations specified by custom pages
+ IRunnableWithProgress operations[] = MBSCustomPageManager.getOperations();
+
+ if (operations != null)
+ {
+ for(int k = 0; k < operations.length; k++)
+ {
+ try {
+ operations[k].run(monitor);
+ } catch(InvocationTargetException e) {
+ //TODO: what should we do?
+ } catch(InterruptedException e) {
+ //TODO: what should we do?
+ }
+ }
+ }
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/ConvertToAutotoolsProjectWizardPage.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/ConvertToAutotoolsProjectWizardPage.java
new file mode 100644
index 0000000000..ab1c3e489c
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/ConvertToAutotoolsProjectWizardPage.java
@@ -0,0 +1,224 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2004, 2009 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.wizards;
+
+
+import org.eclipse.cdt.core.CCorePlugin;
+import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
+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.IManagedProject;
+import org.eclipse.cdt.managedbuilder.core.IProjectType;
+import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
+import org.eclipse.cdt.managedbuilder.core.ManagedCProjectNature;
+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.IStatus;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.linuxtools.cdt.autotools.core.AutotoolsNewProjectNature;
+import org.eclipse.linuxtools.cdt.autotools.ui.AutotoolsUIPlugin;
+import org.eclipse.linuxtools.internal.cdt.autotools.core.AutotoolsPropertyConstants;
+import org.eclipse.linuxtools.internal.cdt.autotools.core.configure.AutotoolsConfigurationManager;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.wizards.newresource.BasicNewResourceWizard;
+
+
+/**
+ *
+ * ConvertToAutotoolsProjectWizardPage
+ * Standard main page for a wizard that adds a Managed Make 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 Jeff Johnston
+ * @since Feb 8, 2006
+ *<p>
+ * Example useage:
+ * <pre>
+ * mainPage = new ConvertToAutotoolsProjectWizardPage("ConvertProjectPage");
+ * mainPage.setTitle("Project Conversion");
+ * mainPage.setDescription("Add C or C++ Managed Make Nature to a project.");
+ * </pre>
+ * </p>
+ */
+public class ConvertToAutotoolsProjectWizardPage extends ConvertProjectWizardPage {
+
+ private static final String WZ_TITLE = "WizardAutotoolsProjectConversion.title"; //$NON-NLS-1$
+ private static final String WZ_DESC = "WizardAutotoolsProjectConversion.description"; //$NON-NLS-1$
+ private static final String PREFIX = "WizardAutotoolsProjectConversion";
+ 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$
+
+ /**
+ * Constructor for ConvertToStdMakeProjectWizardPage.
+ * @param pageName
+ */
+ public ConvertToAutotoolsProjectWizardPage(String pageName, ConvertToAutotoolsProjectWizard wizard) {
+ super(pageName);
+ setWizard(wizard);
+ }
+
+ /**
+ * Method getWzTitleResource returns the correct Title Label for this class
+ * overriding the default in the superclass.
+ */
+ protected String getWzTitleResource(){
+ return AutotoolsUIPlugin.getResourceString(WZ_TITLE);
+ }
+
+ /**
+ * Method getWzDescriptionResource returns the correct description
+ * Label for this class overriding the default in the superclass.
+ */
+ protected String getWzDescriptionResource(){
+ return AutotoolsUIPlugin.getResourceString(WZ_DESC);
+ }
+
+ /**
+ * Method isCandidate returns true for all projects.
+ *
+ * @param project
+ * @return boolean
+ */
+ public boolean isCandidate(IProject project) {
+ return true; // all
+ }
+
+ protected IProjectType getProjectType() {
+ return ((ConvertToAutotoolsProjectWizard)getWizard()).getProjectType();
+ }
+
+ protected IConfiguration[] getSelectedConfigurations() {
+ return ((ConvertToAutotoolsProjectWizard)getWizard()).getSelectedConfigurations();
+ }
+
+ protected void applyOptions(IProject project, IProgressMonitor monitor) {
+ ((ConvertToAutotoolsProjectWizard)getWizard()).applyOptions(project, monitor);
+ }
+
+ public void convertProject(IProject project, IProgressMonitor monitor, String projectID) throws CoreException {
+ monitor.beginTask(AutotoolsUIPlugin.getResourceString("WizardMakeProjectConversion.monitor.convertingToMakeProject"), 7); //$NON-NLS-1$
+ IConfiguration defaultCfg = null;
+ try {
+ super.convertProject(project, new SubProgressMonitor(monitor, 1), projectID);
+ monitor.subTask(AutotoolsUIPlugin.getResourceString(MSG_ADD_NATURE));
+ ManagedCProjectNature.addManagedNature(project, new SubProgressMonitor(monitor, 1));
+ AutotoolsNewProjectNature.addAutotoolsNature(project, new SubProgressMonitor(monitor, 1));
+ // We need to remove any old Autotools nature, if one exists.
+ AutotoolsNewProjectNature.removeOldAutotoolsNature(project, new SubProgressMonitor(monitor, 1));
+ monitor.subTask(AutotoolsUIPlugin.getResourceString(MSG_ADD_BUILDER));
+// ManagedCProjectNature.addManagedBuilder(project, new SubProgressMonitor(monitor, 1));
+ AutotoolsNewProjectNature.addAutotoolsBuilder(project, new SubProgressMonitor(monitor,1));
+ // FIXME: Default scanner property: make -w - eventually we want to use Make core's build scanner
+ project.setPersistentProperty(AutotoolsPropertyConstants.SCANNER_USE_MAKE_W, AutotoolsPropertyConstants.TRUE);
+ CCorePlugin.getDefault().mapCProjectOwner(project, projectID, true);
+ // Add the ManagedProject to the project
+ IManagedProject newManagedProject = null;
+ IManagedBuildInfo info = null;
+ try {
+ info = ManagedBuildManager.createBuildInfo(project);
+ IProjectType parent = getProjectType();
+ newManagedProject = ManagedBuildManager.createManagedProject(project, parent);
+ if (newManagedProject != null) {
+ IConfiguration [] selectedConfigs = getSelectedConfigurations();
+ for (int i = 0; i < selectedConfigs.length; i++) {
+ IConfiguration config = selectedConfigs[i];
+ int id = ManagedBuildManager.getRandomNumber();
+ IConfiguration newConfig = newManagedProject.createConfiguration(config, config.getId() + "." + id); //$NON-NLS-1$
+ newConfig.setArtifactName(newManagedProject.getDefaultArtifactName());
+ }
+ // Now add the first supported config in the list as the default
+ IConfiguration[] newConfigs = newManagedProject.getConfigurations();
+ for(int i = 0; i < newConfigs.length; i++) {
+ if(newConfigs[i].isSupported()){
+ defaultCfg = newConfigs[i];
+ break;
+ }
+ }
+
+ if(defaultCfg == null && newConfigs.length > 0)
+ defaultCfg = newConfigs[0];
+
+
+ if(defaultCfg != null) {
+ ManagedBuildManager.setDefaultConfiguration(project, defaultCfg);
+ ManagedBuildManager.setSelectedConfiguration(project, defaultCfg);
+ }
+ ManagedBuildManager.setNewProjectVersion(project);
+ }
+ } catch (BuildException e) {
+ AutotoolsUIPlugin.log(e);
+ }
+
+ // Following is a bit of a hack because changing the project options
+ // causes a change event to be fired which will try to reindex the project.
+ // We are in the middle of setting the project indexer which may end up
+ // being the null indexer. In that case, we don't want the default indexer
+ // (Fast Indexer) to be invoked.
+ //IIndexManager manager = CCorePlugin.getIndexManager();
+ //ICProject cproject = CoreModel.getDefault().create(project);
+ //manager.setIndexerId(cproject, ConvertToAutotoolsProjectWizard.NULL_INDEXER_ID);
+
+ // Modify the project settings
+ if (project != null) {
+ applyOptions(project, new SubProgressMonitor(monitor, 2));
+ }
+
+// Set the ScannerInfoProvider. We must do this after
+// applying the options because changing the ScannerInfoProvider
+// is considered a change to the project and a reindex will
+// occur. One of the options being applied above is the indexer
+// selected by the user. Thus, we wait until now.
+// try {
+// AutotoolsUIPlugin.setScannerInfoProvider(project);
+// } catch (CoreException e) {
+// ManagedBuilderUIPlugin.log(e);
+// }
+
+ // Save the build options
+ monitor.subTask(AutotoolsUIPlugin.getResourceString(MSG_SAVE));
+ if (info != null) {
+ info.setValid(true);
+ ManagedBuildManager.saveBuildInfo(project, true);
+ }
+ } finally {
+ // Create a default Autotools configuration and save it.
+ // We must do this after the ManagedBuildManager does a save because
+ // we might not yet have a Configuration Description set up for the
+ // default configuration and we need the id to create our own form
+ // of configuration.
+ ICConfigurationDescription cfgd = ManagedBuildManager.getDescriptionForConfiguration(defaultCfg);
+ String id = cfgd.getId();
+ AutotoolsConfigurationManager.getInstance().getConfiguration(project, id, true);
+ AutotoolsConfigurationManager.getInstance().saveConfigs(project);
+ IStatus initResult = ManagedBuildManager.initBuildInfoContainer(project);
+ if (initResult.getCode() != IStatus.OK) {
+ // At this point, I can live with a failure
+ AutotoolsUIPlugin.log(initResult);
+ }
+ 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/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/ManagedProjectOptionBlock.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/ManagedProjectOptionBlock.java
new file mode 100644
index 0000000000..5ea85f9f4c
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/ManagedProjectOptionBlock.java
@@ -0,0 +1,80 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 2005, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Rational Software - Initial API and implementation
+ * Red Hat - Copy from CDT 3.1.2
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.wizards;
+
+import org.eclipse.cdt.ui.dialogs.BinaryParserBlock;
+import org.eclipse.cdt.ui.dialogs.ICOptionContainer;
+import org.eclipse.cdt.ui.dialogs.TabFolderOptionBlock;
+import org.eclipse.cdt.ui.newui.CDTHelpContextIds;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.ErrorParserBlock;
+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.PlatformUI;
+
+
+public class ManagedProjectOptionBlock extends TabFolderOptionBlock {
+
+ private ErrorParserBlock errParserBlock;
+ private BinaryParserBlock binaryParserBlock;
+
+ /**
+ * @param parent
+ */
+ public ManagedProjectOptionBlock(ICOptionContainer parent) {
+ super(parent, false);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.ui.dialogs.TabFolderOptionBlock#addTabs()
+ */
+ protected void addTabs() {
+ errParserBlock = new ErrorParserBlock(null);
+ addTab(errParserBlock);
+ addTab(binaryParserBlock = new BinaryParserBlock());
+ }
+
+ public BinaryParserBlock getBinaryParserBlock() {
+ return binaryParserBlock;
+ }
+
+ public ErrorParserBlock getErrorParserBlock() {
+ return errParserBlock;
+ }
+
+ public Control createContents(Composite parent) {
+ Control control = super.createContents( parent );
+ ((GridLayout)((Composite)control).getLayout()).marginWidth = 1;
+ GridData gd = new GridData(GridData.FILL_BOTH);
+ ((Composite)control).setLayoutData(gd);
+
+ if (getErrorParserBlock()!= null)
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(getErrorParserBlock().getControl(), CDTHelpContextIds.MAN_PROJ_ERROR_PARSER);
+
+ return control;
+ }
+
+ public void updateValues() {
+ if (getErrorParserBlock()!= null) {
+ getErrorParserBlock().updateValues();
+ }
+ if (getBinaryParserBlock()!= null) {
+ // TODO
+ //getBinaryParserBlock().updateValues();
+ }
+ }
+
+ public void update() {
+ super.update();
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/NewAutotoolsProjectOptionPage.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/NewAutotoolsProjectOptionPage.java
new file mode 100644
index 0000000000..866f7d8e82
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/NewAutotoolsProjectOptionPage.java
@@ -0,0 +1,156 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Rational Software - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.wizards;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.cdt.managedbuilder.ui.properties.ManagedBuilderUIPlugin;
+import org.eclipse.cdt.managedbuilder.ui.wizards.MBSCustomPageManager;
+import org.eclipse.cdt.ui.dialogs.ICOptionPage;
+import org.eclipse.cdt.ui.dialogs.IndexerBlock;
+import org.eclipse.cdt.ui.dialogs.ReferenceBlock;
+import org.eclipse.cdt.ui.dialogs.TabFolderOptionBlock;
+import org.eclipse.cdt.ui.newui.CDTHelpContextIds;
+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.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Preferences;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.ErrorParserBlock;
+import org.eclipse.ui.PlatformUI;
+
+
+@SuppressWarnings("deprecation")
+public class NewAutotoolsProjectOptionPage extends NewCProjectWizardOptionPage {
+
+ public static final String PAGE_ID = "org.eclipse.cdt.managedbuilder.ui.wizard.projectOptionsPage"; //$NON-NLS-1$
+
+ public class ManagedWizardOptionBlock extends ManagedProjectOptionBlock {
+
+ NewAutotoolsProjectOptionPage parent;
+ ErrorParserBlock errorParsers;
+ IndexerBlock indexBlock;
+
+
+ public ManagedWizardOptionBlock(NewAutotoolsProjectOptionPage parentPage) {
+ super(parentPage);
+ parent = parentPage;
+ }
+
+ public class AutotoolsReferenceBlock extends ReferenceBlock {
+ AutotoolsReferenceBlock() {
+ super();
+ }
+
+ public void performApply(IProgressMonitor monitor) throws CoreException {
+ try {
+ super.performApply(monitor);
+ } catch (RuntimeException e) {
+ // TODO: Fix ReferenceBlock not to generate NullPointerException
+ // when no projects are referenced
+ }
+ }
+ }
+ public void updateProjectTypeProperties() {
+ // Update the error parser list
+ if (errorParsers != null) {
+ errorParsers.updateValues();
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.ui.dialogs.TabFolderOptionBlock#addTabs()
+ */
+ protected void addTabs() {
+ addTab(new AutotoolsReferenceBlock());
+ // NOTE: The setting of error parsers is commented out here
+ // because they need to be set per-configuration.
+ // The other tabs on this page are per-project.
+ // Error parsers can be selected per configuration in the
+ // project properties
+ //errorParsers = new ErrorParserBlock();
+ //addTab(errorParsers);
+ addTab(indexBlock = new IndexerBlock());
+ }
+
+ public void setupHelpContextIds(){
+ List<ICOptionPage> pages = getOptionPages();
+
+ Iterator<ICOptionPage> iter = pages.iterator();
+ for( int i = 0; i < 3 && iter.hasNext(); i++ ) {
+ ICOptionPage page = (ICOptionPage) iter.next();
+
+ String id = null;
+ if (page instanceof ReferenceBlock) {
+ id = CDTHelpContextIds.MAN_PROJ_WIZ_PROJECTS_TAB;
+ } else if (page instanceof ErrorParserBlock) {
+ id = CDTHelpContextIds.MAN_PROJ_WIZ_ERRORPARSERS_TAB;
+ } else if (page instanceof IndexerBlock) {
+ id = CDTHelpContextIds.MAN_PROJ_WIZ_INDEXER_TAB;
+ }
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(page.getControl(), id);
+ }
+ }
+ }
+
+ protected ManagedWizardOptionBlock optionBlock;
+ protected NewCProjectWizard parentWizard;
+
+ /**
+ * @param pageName
+ */
+ public NewAutotoolsProjectOptionPage(String pageName, NewCProjectWizard parentWizard) {
+ super(pageName);
+ this.parentWizard = parentWizard;
+ optionBlock = new ManagedWizardOptionBlock(this);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.ui.wizards.NewCProjectWizardOptionPage#createOptionBlock()
+ */
+ protected TabFolderOptionBlock createOptionBlock() {
+ return optionBlock;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.ui.dialogs.ICOptionContainer#getProject()
+ */
+ public IProject getProject() {
+ if (getWizard() instanceof ConvertToAutotoolsProjectWizard)
+ return ((ConvertToAutotoolsProjectWizard)getWizard()).getProject();
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.ui.dialogs.ICOptionContainer#getPreferenceStore()
+ */
+ public Preferences getPreferences() {
+ return ManagedBuilderUIPlugin.getDefault().getPluginPreferences();
+ }
+
+ public void updateProjectTypeProperties() {
+ // Update the error parser list
+ optionBlock.updateProjectTypeProperties();
+ }
+
+ public void setupHelpContextIds(){
+ optionBlock.setupHelpContextIds();
+ }
+
+ public IWizardPage getNextPage()
+ {
+ return MBSCustomPageManager.getNextPage(PAGE_ID); // get first custom page, if any
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/EmptyProject/template.properties b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/EmptyProject/template.properties
new file mode 100644
index 0000000000..d7af2dca95
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/EmptyProject/template.properties
@@ -0,0 +1,14 @@
+###############################################################################
+# Copyright (c) 2008 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+###############################################################################
+
+#Template Default Values
+EmptyProject.template.label=Empty Project
+EmptyProject.template.description=An empty project template
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/EmptyProject/template.xml b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/EmptyProject/template.xml
new file mode 100644
index 0000000000..4ab97961cf
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/EmptyProject/template.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<template type="ProjTempl" version="1.0" supplier="Eclipse.org" revision="1.0" author="Intel Corporation"
+ copyright="Copyright (c) 2007 Intel Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html"
+ id="EmptyProject" label="%EmptyProject.template.label" description="%EmptyProject.template.description"
+ help="help.html">
+
+ <process type="org.eclipse.linuxtools.cdt.autotools.core.NewAutotoolsProject">
+ <simple name="name" value="$(projectName)" />
+ <simple name="artifactExtension" value="exe" />
+ <simple name="isCProject" value="false" />
+ </process>
+
+</template>
+
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCAutotoolsProject/src/AUTHORS b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCAutotoolsProject/src/AUTHORS
new file mode 100644
index 0000000000..9d38b85b26
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCAutotoolsProject/src/AUTHORS
@@ -0,0 +1 @@
+$(author)
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCAutotoolsProject/src/Basename.c b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCAutotoolsProject/src/Basename.c
new file mode 100644
index 0000000000..9f48078cef
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCAutotoolsProject/src/Basename.c
@@ -0,0 +1,17 @@
+/*
+ ============================================================================
+ Name : $(baseName).c
+ Author : $(author)
+ Version :
+ Copyright : $(copyright)
+ Description : Hello World in C, Ansi-style
+ ============================================================================
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+int main(void) {
+ puts("$(message)"); /* prints $(message) */
+ return EXIT_SUCCESS;
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCAutotoolsProject/src/COPYING b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCAutotoolsProject/src/COPYING
new file mode 100644
index 0000000000..54c4590d27
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCAutotoolsProject/src/COPYING
@@ -0,0 +1 @@
+<Place your desired license here.> \ No newline at end of file
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCAutotoolsProject/src/ChangeLog b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCAutotoolsProject/src/ChangeLog
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCAutotoolsProject/src/ChangeLog
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCAutotoolsProject/src/Makefile.am.src b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCAutotoolsProject/src/Makefile.am.src
new file mode 100644
index 0000000000..727c953306
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCAutotoolsProject/src/Makefile.am.src
@@ -0,0 +1,3 @@
+bin_PROGRAMS=a.out
+a_out_SOURCES=$(projectName).c
+
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCAutotoolsProject/src/Makefile.am.top b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCAutotoolsProject/src/Makefile.am.top
new file mode 100644
index 0000000000..3e024d5c91
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCAutotoolsProject/src/Makefile.am.top
@@ -0,0 +1 @@
+SUBDIRS=$(sourceDir)
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCAutotoolsProject/src/NEWS b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCAutotoolsProject/src/NEWS
new file mode 100644
index 0000000000..97e91a4d2e
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCAutotoolsProject/src/NEWS
@@ -0,0 +1 @@
+Sample NEWS file for $(projectName) project.
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCAutotoolsProject/src/README b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCAutotoolsProject/src/README
new file mode 100644
index 0000000000..d791b0b447
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCAutotoolsProject/src/README
@@ -0,0 +1 @@
+Sample readme file for $(projectName) project.
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCAutotoolsProject/src/configure.ac.top b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCAutotoolsProject/src/configure.ac.top
new file mode 100644
index 0000000000..f272ccddd7
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCAutotoolsProject/src/configure.ac.top
@@ -0,0 +1,14 @@
+dnl Process this file with autoconf to produce a configure script.
+
+AC_PREREQ(2.59)
+AC_INIT($(projectName), 1.0)
+
+
+AC_CANONICAL_SYSTEM
+AM_INIT_AUTOMAKE()
+
+AC_PROG_CC
+
+AC_CONFIG_FILES(Makefile $(sourceDir)/Makefile)
+AC_OUTPUT
+
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCAutotoolsProject/template.properties b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCAutotoolsProject/template.properties
new file mode 100644
index 0000000000..ab982e4f15
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCAutotoolsProject/template.properties
@@ -0,0 +1,30 @@
+###############################################################################
+# Copyright (c) 2007, 2009 Symbian Software Private Ltd. and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Bala Torati (Symbian) - initial API and implementation
+# Red Hat Inc - modification to use with Autotools project
+###############################################################################
+
+#Template Default Values
+HelloWorld.CCtemplate.label=Hello World C++ Autotools Project
+HelloWorld.CCtemplate.description=A skeletal C++ Hello World Autotools project. Creates a folder for sources and another for include.
+HelloWorld.CAnsitemplate.label=Hello World ANSI C Autotools Project
+HelloWorld.CAnsitemplate.description=A skeletal C Hello World Autotools project. Creates a folder for sources and another for include.
+HelloWorld.basics.label=Basic Settings
+HelloWorld.basics.description=Basic properties of a project
+HelloWorld.author.label=Author
+HelloWorld.author.description=Name of the author
+HelloWorld.copyright.label=Copyright notice
+HelloWorld.copyright.description=Your copyright notice
+HelloWorld.copyright.default=Your copyright notice
+HelloWorld.message.default=Hello World
+HelloWorld.message.description=Your hello world greeting message
+HelloWorld.message.label=Hello world greeting
+HelloWorld.sourceDir.label=Source
+HelloWorld.sourceDir.description=Directory for hello world project source files
+HelloWorld.sourceDir.default=src
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCAutotoolsProject/template.xml b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCAutotoolsProject/template.xml
new file mode 100644
index 0000000000..a9a56a111a
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCAutotoolsProject/template.xml
@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<template type="ProjTempl" version="1.0" supplier="Eclipse.org" revision="1.0" author="Bala Torati (Symbian)"
+ copyright="Copyright (c) 2007,2009 Symbian Software Limited and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available athttp://www.eclipse.org/legal/epl-v10.html"
+ id="HelloWorldCAutotoolsProject" label="%HelloWorld.CAnsitemplate.label" description="%HelloWorld.CAnsitemplate.description"
+ help="help.html">
+
+ <property-group id="basics" label="%HelloWorld.basics.label" description="%HelloWorld.basics.description" type="PAGES-ONLY" help="help.html">
+ <property id="author"
+ label="%HelloWorld.author.label"
+ description="%HelloWorld.author.description"
+ type="input"
+ pattern=".*"
+ default=""
+ hidden="false"
+ persist="true"/>
+ <property id="copyright"
+ label="%HelloWorld.copyright.label"
+ description="%HelloWorld.copyright.description"
+ type="input"
+ pattern=".*"
+ default="%HelloWorld.copyright.default"
+ hidden="false"
+ persist="true"/>
+ <property id="message"
+ label="%HelloWorld.message.label"
+ description="%HelloWorld.message.description"
+ type="input"
+ pattern=".*"
+ default="%HelloWorld.message.default"
+ hidden="false"
+ persist="true"/>
+ <property id="sourceDir"
+ label="%HelloWorld.sourceDir.label"
+ description="%HelloWorld.sourceDir.description"
+ type="input"
+ default="%HelloWorld.sourceDir.default"
+ pattern="[a-zA-Z0-9]+"
+ mandatory="false"
+ persist="true"/>
+ </property-group>
+
+ <process type="org.eclipse.linuxtools.cdt.autotools.core.NewAutotoolsProject">
+ <simple name="name" value="$(projectName)" />
+ <simple name="artifactExtension" value="exe" />
+ <simple name="isCProject" value="true" />
+ </process>
+
+ <process type="org.eclipse.cdt.core.CreateSourceFolder">
+ <simple name="projectName" value="$(projectName)"/>
+ <simple name="path" value="$(sourceDir)"/>
+ </process>
+
+ <process type="org.eclipse.cdt.core.AddFiles">
+ <simple name="projectName" value="$(projectName)"/>
+ <complex-array name="files">
+ <element>
+ <simple name="source" value="src/Basename.c"/>
+ <simple name="target" value="$(sourceDir)/$(projectName).c"/>
+ <simple name="replaceable" value="true"/>
+ </element>
+ <element>
+ <simple name="source" value="src/configure.ac.top"/>
+ <simple name="target" value="configure.ac"/>
+ <simple name="replaceable" value="true"/>
+ </element>
+ <element>
+ <simple name="source" value="src/AUTHORS"/>
+ <simple name="target" value="AUTHORS"/>
+ <simple name="replaceable" value="true"/>
+ </element>
+ <element>
+ <simple name="source" value="src/NEWS"/>
+ <simple name="target" value="NEWS"/>
+ <simple name="replaceable" value="true"/>
+ </element>
+ <element>
+ <simple name="source" value="src/README"/>
+ <simple name="target" value="README"/>
+ <simple name="replaceable" value="true"/>
+ </element>
+ <element>
+ <simple name="source" value="src/ChangeLog"/>
+ <simple name="target" value="ChangeLog"/>
+ <simple name="replaceable" value="true"/>
+ </element>
+ <element>
+ <simple name="source" value="src/COPYING"/>
+ <simple name="target" value="COPYING"/>
+ <simple name="replaceable" value="true"/>
+ </element>
+ <element>
+ <simple name="source" value="src/Makefile.am.top"/>
+ <simple name="target" value="Makefile.am"/>
+ <simple name="replaceable" value="true"/>
+ </element>
+ <element>
+ <simple name="source" value="src/Makefile.am.src"/>
+ <simple name="target" value="$(sourceDir)/Makefile.am"/>
+ <simple name="replaceable" value="true"/>
+ </element>
+ </complex-array>
+ </process>
+
+</template>
+
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/AUTHORS b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/AUTHORS
new file mode 100644
index 0000000000..9d38b85b26
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/AUTHORS
@@ -0,0 +1 @@
+$(author)
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/Basename.cpp b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/Basename.cpp
new file mode 100644
index 0000000000..8e191ac3c2
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/Basename.cpp
@@ -0,0 +1,18 @@
+/*
+ ============================================================================
+ Name : $(baseName).cpp
+ Author : $(author)
+ Version :
+ Copyright : $(copyright)
+ Description : Hello World in C++,
+ ============================================================================
+ */
+
+#include <iostream>
+
+using namespace std;
+
+int main(void) {
+ cout << "$(message)" << endl; /* prints $(message) */
+ return 0;
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/COPYING b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/COPYING
new file mode 100644
index 0000000000..54c4590d27
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/COPYING
@@ -0,0 +1 @@
+<Place your desired license here.> \ No newline at end of file
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/ChangeLog b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/ChangeLog
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/ChangeLog
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/Makefile.am.src b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/Makefile.am.src
new file mode 100644
index 0000000000..7b3125bbdd
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/Makefile.am.src
@@ -0,0 +1,3 @@
+bin_PROGRAMS=a.out
+a_out_SOURCES=$(projectName).cpp
+
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/Makefile.am.top b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/Makefile.am.top
new file mode 100644
index 0000000000..3e024d5c91
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/Makefile.am.top
@@ -0,0 +1 @@
+SUBDIRS=$(sourceDir)
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/NEWS b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/NEWS
new file mode 100644
index 0000000000..97e91a4d2e
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/NEWS
@@ -0,0 +1 @@
+Sample NEWS file for $(projectName) project.
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/README b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/README
new file mode 100644
index 0000000000..d791b0b447
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/README
@@ -0,0 +1 @@
+Sample readme file for $(projectName) project.
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/configure.ac.top b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/configure.ac.top
new file mode 100644
index 0000000000..e58a4fe1aa
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/configure.ac.top
@@ -0,0 +1,14 @@
+dnl Process this file with autoconf to produce a configure script.
+
+AC_PREREQ(2.59)
+AC_INIT($(projectName), 1.0)
+
+
+AC_CANONICAL_SYSTEM
+AM_INIT_AUTOMAKE()
+
+AC_PROG_CXX
+
+AC_CONFIG_FILES(Makefile $(sourceDir)/Makefile)
+AC_OUTPUT
+
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCPPAutotoolsProject/template.properties b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCPPAutotoolsProject/template.properties
new file mode 100644
index 0000000000..ab982e4f15
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCPPAutotoolsProject/template.properties
@@ -0,0 +1,30 @@
+###############################################################################
+# Copyright (c) 2007, 2009 Symbian Software Private Ltd. and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Bala Torati (Symbian) - initial API and implementation
+# Red Hat Inc - modification to use with Autotools project
+###############################################################################
+
+#Template Default Values
+HelloWorld.CCtemplate.label=Hello World C++ Autotools Project
+HelloWorld.CCtemplate.description=A skeletal C++ Hello World Autotools project. Creates a folder for sources and another for include.
+HelloWorld.CAnsitemplate.label=Hello World ANSI C Autotools Project
+HelloWorld.CAnsitemplate.description=A skeletal C Hello World Autotools project. Creates a folder for sources and another for include.
+HelloWorld.basics.label=Basic Settings
+HelloWorld.basics.description=Basic properties of a project
+HelloWorld.author.label=Author
+HelloWorld.author.description=Name of the author
+HelloWorld.copyright.label=Copyright notice
+HelloWorld.copyright.description=Your copyright notice
+HelloWorld.copyright.default=Your copyright notice
+HelloWorld.message.default=Hello World
+HelloWorld.message.description=Your hello world greeting message
+HelloWorld.message.label=Hello world greeting
+HelloWorld.sourceDir.label=Source
+HelloWorld.sourceDir.description=Directory for hello world project source files
+HelloWorld.sourceDir.default=src
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCPPAutotoolsProject/template.xml b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCPPAutotoolsProject/template.xml
new file mode 100644
index 0000000000..38a4cc6909
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools.ui/templates/projecttemplates/HelloWorldCPPAutotoolsProject/template.xml
@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<template type="ProjTempl" version="1.0" supplier="Eclipse.org" revision="1.0" author="Bala Torati (Symbian)"
+ copyright="Copyright (c) 2007,2009 Symbian Software Limited and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available athttp://www.eclipse.org/legal/epl-v10.html"
+ id="HelloWorldCPPAutotoolsProject" label="%HelloWorld.CCtemplate.label" description="%HelloWorld.CCtemplate.description"
+ help="help.html">
+
+ <property-group id="basics" label="%HelloWorld.basics.label" description="%HelloWorld.basics.description" type="PAGES-ONLY" help="help.html">
+ <property id="author"
+ label="%HelloWorld.author.label"
+ description="%HelloWorld.author.description"
+ type="input"
+ pattern=".*"
+ default=""
+ hidden="false"
+ persist="true"/>
+ <property id="copyright"
+ label="%HelloWorld.copyright.label"
+ description="%HelloWorld.copyright.description"
+ type="input"
+ pattern=".*"
+ default="%HelloWorld.copyright.default"
+ hidden="false"
+ persist="true"/>
+ <property id="message"
+ label="%HelloWorld.message.label"
+ description="%HelloWorld.message.description"
+ type="input"
+ pattern=".*"
+ default="%HelloWorld.message.default"
+ hidden="false"
+ persist="true"/>
+ <property id="sourceDir"
+ label="%HelloWorld.sourceDir.label"
+ description="%HelloWorld.sourceDir.description"
+ type="input"
+ default="%HelloWorld.sourceDir.default"
+ pattern="[a-zA-Z0-9]+"
+ mandatory="false"
+ persist="true"/>
+ </property-group>
+
+ <process type="org.eclipse.linuxtools.cdt.autotools.core.NewAutotoolsProject">
+ <simple name="name" value="$(projectName)" />
+ <simple name="artifactExtension" value="exe" />
+ <simple name="isCProject" value="false" />
+ </process>
+
+ <process type="org.eclipse.cdt.core.CreateSourceFolder">
+ <simple name="projectName" value="$(projectName)"/>
+ <simple name="path" value="$(sourceDir)"/>
+ </process>
+
+ <process type="org.eclipse.cdt.core.AddFiles">
+ <simple name="projectName" value="$(projectName)"/>
+ <complex-array name="files">
+ <element>
+ <simple name="source" value="src/Basename.cpp"/>
+ <simple name="target" value="$(sourceDir)/$(projectName).cpp"/>
+ <simple name="replaceable" value="true"/>
+ </element>
+ <element>
+ <simple name="source" value="src/configure.ac.top"/>
+ <simple name="target" value="configure.ac"/>
+ <simple name="replaceable" value="true"/>
+ </element>
+ <element>
+ <simple name="source" value="src/AUTHORS"/>
+ <simple name="target" value="AUTHORS"/>
+ <simple name="replaceable" value="true"/>
+ </element>
+ <element>
+ <simple name="source" value="src/NEWS"/>
+ <simple name="target" value="NEWS"/>
+ <simple name="replaceable" value="true"/>
+ </element>
+ <element>
+ <simple name="source" value="src/README"/>
+ <simple name="target" value="README"/>
+ <simple name="replaceable" value="true"/>
+ </element>
+ <element>
+ <simple name="source" value="src/ChangeLog"/>
+ <simple name="target" value="ChangeLog"/>
+ <simple name="replaceable" value="true"/>
+ </element>
+ <element>
+ <simple name="source" value="src/COPYING"/>
+ <simple name="target" value="COPYING"/>
+ <simple name="replaceable" value="true"/>
+ </element>
+ <element>
+ <simple name="source" value="src/Makefile.am.top"/>
+ <simple name="target" value="Makefile.am"/>
+ <simple name="replaceable" value="true"/>
+ </element>
+ <element>
+ <simple name="source" value="src/Makefile.am.src"/>
+ <simple name="target" value="$(sourceDir)/Makefile.am"/>
+ <simple name="replaceable" value="true"/>
+ </element>
+ </complex-array>
+ </process>
+
+</template>
+
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/.classpath b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/.classpath
new file mode 100644
index 0000000000..751c8f2e50
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/.cvsignore b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/.cvsignore
new file mode 100644
index 0000000000..50c1b30a80
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/.cvsignore
@@ -0,0 +1,4 @@
+bin
+@dot
+javaCompiler...args
+build.xml
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/.project b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/.project
new file mode 100644
index 0000000000..dd372b35f6
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.linuxtools.cdt.autotools</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/.settings/org.eclipse.jdt.core.prefs b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000000..93e9280e28
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,12 @@
+#Wed Mar 18 16:28:06 EDT 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/.settings/org.eclipse.jdt.ui.prefs b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 0000000000..4c7131801a
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,3 @@
+#Tue Jan 02 14:11:13 EST 2007
+eclipse.preferences.version=1
+internal.default.compliance=default
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/ChangeLog b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/ChangeLog
new file mode 100644
index 0000000000..6e8cfd0250
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/ChangeLog
@@ -0,0 +1,4046 @@
+2010-02-24 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #303616
+ * src/org/eclipse/linuxtools/cdt/autotools/MakeGenerator.java (getAutogenArgs): Fall
+ back to default value for uninitialized environment variable.
+ (getConfigArgs): Ditto.
+ (initializeBuildConfigDirs): Ditto.
+
+2009-12-10 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #297260
+ * plugin.xml: Make org.eclipse.linuxtools.cdt.autotools.builder abstract as it is used as
+ a superclass only.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsBuilder.java (getOutputEntries): Override
+ to ensure we don't use the Builder default for this method which returns an output entry
+ based on the configuration name.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsMakefileBuilder.java (build): Set the
+ build location and makefile generator element for the old builder to ensure the build path
+ set by the configure settings will always be returned.
+
+2009-11-04 Jeff Johnston <jjohnstn@redhat.com>
+
+ * META-INF/MANIFEST.MF: Fix dependencies to support CDT 6.0.0 and up.
+
+2009-11-02 Jeff Johnston <jjohnstn@redhat.com>
+
+ * plugin.properties: Add new messages.
+ * plugin.xml: Add GCCMakefilePerProjectProfile discovery profile ids to configure and
+ autogen.sh inputs.
+
+2009-10-29 Jeff Johnston <jjohnstn@redhat.com>
+
+ Add back some UI elements needed for compatibility.
+
+ * icons/autoconf.gif: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/AbstractAutotoolsHandler.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/AbstractTargetAction.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/AclocalHandler.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/AutoconfHandler.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/AutoheaderHandler.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/AutomakeHandler.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/AutoreconfHandler.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAclocalAction.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAction.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAutoconfAction.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAutoheaderAction.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAutomakeAction.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAutoreconfAction.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeLibtoolizeAction.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeMessages.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeMessages.properties: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/LibtoolizeHandler.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/ReconfigureAction.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/ReconfigureHandler.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/SingleInputDialog.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/TwoInputDialog.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsBuildPropertyPage.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsEditorPropertyPage.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsPropertyMessages.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsPropertyMessages.properties: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsPropertyPage.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsToolsPropertyPage.java: New file.
+ * build.properties: Add icons directory to bin group.
+ * META-INF/MANIFEST.MF: Add autotools.core and autotools.ui dependency and lower cdt.ui requirement.
+ * plugin.xml: Add menus for autotool invocation. Add back old Autotools property page and
+ build settings tabs.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsDefaultBuildDirHandler.java (isOptionVisible): Add
+ a check for includes or symbols in which case return false.
+
+2009-10-21 Jeff Johnston <jjohnstn@redhat.com>
+
+ Change org.eclipse.linuxtools.cdt.autotools to be a compatibility plug-in to
+ support building of old projects. Remove all UI elements except for the Autoconf
+ parser code which was exposed as a public API.
+
+ * .settings/org.eclipse.core.resources.prefs: Removed.
+ * html/maintopic.html: Removed.
+ * html/subtopic.html: Removed.
+ * html/toc.html: Removed.
+ * icons/ac16/acmacro_arg_obj.gif: Removed.
+ * icons/ac16/acmacro_obj.gif: Removed.
+ * icons/ac16/ammacro_obj.gif: Removed.
+ * icons/ac16/case_obj.gif: Removed.
+ * icons/ac16/condition_obj.gif: Removed.
+ * icons/ac16/convert-normal.gif: Removed.
+ * icons/ac16/elif_obj.gif: Removed.
+ * icons/ac16/else_obj.gif: Removed.
+ * icons/ac16/for_obj.gif: Removed.
+ * icons/ac16/if_obj.gif: Removed.
+ * icons/ac16/while_obj.gif: Removed.
+ * icons/autoconf.gif: Removed.
+ * icons/automake.gif: Removed.
+ * icons/dlcl16/build_configs.gif: Removed.
+ * icons/dlcl16/newc_app.gif: Removed.
+ * icons/dlcl16/newcc_app.gif: Removed.
+ * icons/dlcl16/open_include.gif: Removed.
+ * icons/dtool16/alphab_sort_co.gif: Removed.
+ * icons/dtool16/build_menu.gif: Removed.
+ * icons/dtool16/convert-normal.gif: Removed.
+ * icons/dtool16/make.gif: Removed.
+ * icons/dtool16/makefile.gif: Removed.
+ * icons/dtool16/newc_app.gif: Removed.
+ * icons/dtool16/newcc_app.gif: Removed.
+ * icons/dtool16/segment_edit.gif: Removed.
+ * icons/dtool16/target_add.gif: Removed.
+ * icons/dtool16/target_build.gif: Removed.
+ * icons/dtool16/target_delete.gif: Removed.
+ * icons/dtool16/target_edit.gif: Removed.
+ * icons/dtool16/update_old.gif: Removed.
+ * icons/elcl16/build_configs.gif: Removed.
+ * icons/elcl16/newc_app.gif: Removed.
+ * icons/elcl16/newcc_app.gif: Removed.
+ * icons/elcl16/open_include.gif: Removed.
+ * icons/etool16/alphab_sort_co.gif: Removed.
+ * icons/etool16/build_menu.gif: Removed.
+ * icons/etool16/convert-normal.gif: Removed.
+ * icons/etool16/make.gif: Removed.
+ * icons/etool16/makefile.gif: Removed.
+ * icons/etool16/newc_app.gif: Removed.
+ * icons/etool16/newcc_app.gif: Removed.
+ * icons/etool16/segment_edit.gif: Removed.
+ * icons/etool16/target_add.gif: Removed.
+ * icons/etool16/target_build.gif: Removed.
+ * icons/etool16/target_delete.gif: Removed.
+ * icons/etool16/target_edit.gif: Removed.
+ * icons/etool16/target_filter.gif: Removed.
+ * icons/etool16/update_old.gif: Removed.
+ * icons/obj16/acmacro_obj.gif: Removed.
+ * icons/obj16/command_obj.gif: Removed.
+ * icons/obj16/define_obj.gif: Removed.
+ * icons/obj16/environment_obj.gif: Removed.
+ * icons/obj16/envvar_obj.gif: Removed.
+ * icons/obj16/error_obj.gif: Removed.
+ * icons/obj16/hfolder_obj.gif: Removed.
+ * icons/obj16/include_obj.gif: Removed.
+ * icons/obj16/irule_obj.gif: Removed.
+ * icons/obj16/lib_obj.gif: Removed.
+ * icons/obj16/macro_obj.gif: Removed.
+ * icons/obj16/relation_obj.gif: Removed.
+ * icons/obj16/target_obj.gif: Removed.
+ * icons/obj16/trule_obj.gif: Removed.
+ * icons/sample.gif: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/AbstractAutotoolsHandler.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/AbstractTargetAction.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/AclocalHandler.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/AutoconfHandler.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/AutoheaderHandler.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/AutomakeHandler.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/AutoreconfHandler.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAclocalAction.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAction.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAutoconfAction.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAutoheaderAction.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAutomakeAction.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAutoreconfAction.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeLibtoolizeAction.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeMessages.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeMessages.properties: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/LibtoolizeHandler.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/ReconfigureAction.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/ReconfigureHandler.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/SingleInputDialog.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/TwoInputDialog.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsMakeTargetManager.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutoconfSubstRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakeCompletionProcessor.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakeConfigMacro.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakeDocumentProvider.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakeEditor.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakeEditorFactory.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakeErrorHandler.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/Automakefile.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakefileCodeScanner.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakefileContentOutlinePage.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakefileReconcilingStrategy.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakefileSourceConfiguration.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakefileUtil.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakeIfElse.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakeMacroDefinitionRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakeMacroReferenceRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakeTextHover.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakeWordDetector.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/popup/actions/GetDefinedSymbolsAction.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/popup/actions/GetIncludePathAction.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfAnnotationHover.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfCodeScanner.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfDocumentProvider.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfDocumentSetupParticipant.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfEditor.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfEditorMacroValidator.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfEditorMessages.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfEditorMessages.properties: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfErrorHandler.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfIdentifierRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfKeywordDetector.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfM4WordDetector.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacro.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroCodeScanner.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroContentAssistProcessor.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroDamagerRepairer.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroParameterListValidator.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroPartitionRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroProposalContextInformation.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroWordDetector.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfPartitioner.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfPartitionScanner.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfPKGWordDetector.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfReconcilingStrategy.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfSourceViewerConfiguration.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfWhitespaceDetector.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfWordDetector.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/IAutotoolEditorActionDefinitionIds.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/IAutotoolHelpContextIds.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/IAutotoolsEditor.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/InlineDataRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/MultilineRuleDamagerRepairer.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/outline/AutoconfContentOutlinePage.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/outline/AutoconfContentProvider.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/outline/AutoconfLabelProvider.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/ParseException.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/RecursiveSingleLineRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/RestrictedEndOfLineRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsBuildPropertyPage.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsEditorPropertyPage.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsPropertyMessages.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsPropertyMessages.properties: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsPropertyPage.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsToolsPropertyPage.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/wizards/ConvertToAutotoolsProjectWizard.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/wizards/ConvertToAutotoolsProjectWizardPage.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/wizards/CProjectPlatformPage.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/wizards/NewAutotoolsCCProjectWizard.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/wizards/NewAutotoolsCProjectWizard.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/wizards/NewAutotoolsProjectOptionPage.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/AbstractElementListSelectionDialog.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/AbstractMakefile.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/AbstractMakefileCodeScanner.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/AddBuildTargetAction.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/ArchiveTarget.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/BadDirective.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/Command.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/Comment.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/CompletionProposalComparator.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/Conditional.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/DefaultRule.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/DefineVariable.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/DeleteOnErrorRule.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/Directive.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/EditorUtility.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/ElementListSelectionDialog.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/Else.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/EmptyLine.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/Endef.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/Endif.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/ExportAllVariablesRule.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/ExportVariable.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/ExternalEditorInput.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/ExternalEditorInputFactory.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/GNUAutomakefile.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/GNUMakefileConstants.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/GNUMakefileUtil.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/GNUTargetRule.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/GNUVariableDef.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/IAutomakeConditional.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/If.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/Ifdef.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/Ifeq.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/Ifndef.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/Ifneq.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/IgnoreRule.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/IMakefileDocumentProvider.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/IMakefileEditorActionDefinitionIds.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/Include.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/InferenceRule.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/IntermediateRule.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/IReconcilingParticipant.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/ISelectionValidator.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/ITranslationUnitEditorInput.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/LexicalSortingAction.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/LowResolutionTimeRule.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/MacroDefinition.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/MacroDefinitionRule.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/MacroReferenceRule.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/MakefileAnnotationHover.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/MakefileCodeScanner.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/MakefileCompletionProcessor.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/MakeFileConstants.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/MakefileContentOutlinePage.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/MakefileDocumentProvider.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/MakefileDocumentSetupParticipant.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/MakefileEditor.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/MakefileEditorActionContributor.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/MakefileEditorPreferenceConstants.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/MakefileEditorTogglePresentationAction.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/MakefileMessages.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/MakefilePartitionScanner.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/MakefileReader.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/MakefileReconcilingStrategy.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/MakeFileResources.properties: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/MakefileSourceConfiguration.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/MakefileStorageDocumentProvider.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/MakefileTextHover.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/MakefileWordDetector.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/MessageLine.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/NotParallelRule.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/NullMakefile.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/OpenDeclarationAction.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/OpenIncludeAction.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/OverrideDefine.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/OverrideVariable.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/Parent.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/PhonyRule.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/PosixMakefileUtil.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/PosixRule.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/PreciousRule.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/ProjectionMakefileUpdater.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/Rule.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/SccsGetRule.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/SecondaryRule.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/SelectionList.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/SelectionStatusDialog.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/SilentRule.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/SpecialRule.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/StaticTargetRule.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/StatusInfo.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/StatusTool.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/StringMatcher.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/SuffixesRule.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/Target.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/TargetRule.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/TargetVariable.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/Terminal.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/TwoArrayQuickSort.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/UnExport.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/Util.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/VariableDefinition.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/VPath.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/WordPartDetector.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/WorkingCopyManager.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/MakeMessages.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/MakeTarget.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/MakeTargetManager.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ProjectTargets.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/text/hover/AutoconfPrototype.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/text/hover/AutoconfTextHover.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/text/hover/HoverMessages.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/text/hover/HoverMessages.properties: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/AutotoolsPluginImages.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/autoconf/ProjectionFileUpdater.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/ErrorParserBlock.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/HTML2TextReader.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/HTMLTextPresenter.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/MakeResources.properties: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/MakeUIImages.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/MakeUIMessages.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/MessageLine.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/AbstractEditorPreferencePage.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/AutoconfEditorPreferencePage.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/AutomakeEditorPreferencePage.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/AutotoolsPreferencePage.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/AutotoolsPreferencesMessages.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/AutotoolsPreferencesMessages.properties: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/ColorEditor.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/ColorManager.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/TabFolderLayout.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/wizards/AutotoolsBuildWizard.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/wizards/AutotoolsWizardMessages.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/wizards/AutotoolsWizardMessages.properties: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/wizards/ConfigurationContentProvider.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/wizards/ConfigurationLabelProvider.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/wizards/ManagedProjectOptionBlock.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/wizards/NewAutotoolsProject.java: Removed.
+ * templates/projecttemplates/EmptyProject/template.properties: Removed.
+ * templates/projecttemplates/EmptyProject/template.xml: Removed.
+ * templates/projecttemplates/HelloWorldCAutotoolsProject/src/AUTHORS: Removed.
+ * templates/projecttemplates/HelloWorldCAutotoolsProject/src/Basename.c: Removed.
+ * templates/projecttemplates/HelloWorldCAutotoolsProject/src/configure.ac.top: Removed.
+ * templates/projecttemplates/HelloWorldCAutotoolsProject/src/COPYING: Removed.
+ * templates/projecttemplates/HelloWorldCAutotoolsProject/src/Makefile.am.src: Removed.
+ * templates/projecttemplates/HelloWorldCAutotoolsProject/src/Makefile.am.top: Removed.
+ * templates/projecttemplates/HelloWorldCAutotoolsProject/src/NEWS: Removed.
+ * templates/projecttemplates/HelloWorldCAutotoolsProject/src/README: Removed.
+ * templates/projecttemplates/HelloWorldCAutotoolsProject/template.properties: Removed.
+ * templates/projecttemplates/HelloWorldCAutotoolsProject/template.xml: Removed.
+ * templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/AUTHORS: Removed.
+ * templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/Basename.cpp: Removed.
+ * templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/configure.ac.top: Removed.
+ * templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/COPYING: Removed.
+ * templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/Makefile.am.src: Removed.
+ * templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/Makefile.am.top: Removed.
+ * templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/NEWS: Removed.
+ * templates/projecttemplates/HelloWorldCPPAutotoolsProject/src/README: Removed.
+ * templates/projecttemplates/HelloWorldCPPAutotoolsProject/template.properties: Removed.
+ * templates/projecttemplates/HelloWorldCPPAutotoolsProject/template.xml: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfEditorMessages.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfEditorMessages.properties: New file.
+ * build.properties: Remove UI elements that are no longer used.
+ * META-INF/MANIFEST.MF: Update exposed packages and required bundles. Bump to 2.0.0.
+ * plugin.xml: Remove all UI extensions.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsPlugin.java (getTargetManager): Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfParser.java: Fixed to build.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfTokenizer.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/AutotoolsEditorPreferenceConstants.java (initializeDefaultValues):
+ Add latest AM and AC macro version constants as the initial source of these constants has been removed.
+
+2009-10-16 Jeff Johnston <jjohnstn@redhat.com>
+
+ * META-INF/MANIFEST.MF: Bump version to 1.0.5.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/text/hover/AutoconfTextHover.java (getHoverDoc):
+ Change to get document versions and pass these to getACDoc and getAMDoc.
+ (getDefaultAutomakeMacrosVer): New method.
+ (getAMDoc): Change to take doc version rather than name and to support document in local plugin.
+ (getDefaultAutoconfMacrosVer): New method.
+ (getLocalAutoconfMacrosDocName): New method.
+ (getACDoc): Change to take doc version rather than name and to support document in local plugin.
+ (getLocalAutomakeMacrosDocName): New method.
+
+2009-10-15 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/cdt/autotools/wizards/NewAutotoolsCCProjectWizard.java (doRun): Fix warnings.
+ * src/org/eclipse/linuxtools/cdt/autotools/wizards/NewAutotoolsCProjectWizard.java (doRun): Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ProjectTargets.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsPlugin.java (setScannerInfoProvider): Fix
+ deprecated warnings.
+ (verifyScannerInfoProvider): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/MakeGenerator.java: Ditto.
+
+2009-10-15 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/wizards/AutotoolsBuildWizard.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/wizards/NewAutotoolsProject.java: New file.
+ * templates/projecttemplates/EmptyProject/template.properties: New file.
+ * templates/projecttemplates/EmptyProject/template.xml: New file.
+ * templates/projecttemplates/HelloWorldCAutotoolsProject/src: New file.
+ * templates/projecttemplates/HelloWorldCAutotoolsProject/template.properties: New file.
+ * templates/projecttemplates/HelloWorldCAutotoolsProject/template.xml: New file.
+ * templates/projecttemplates/HelloWorldCPPAutotoolsProject/src: New file.
+ * templates/projecttemplates/HelloWorldCPPAutotoolsProject/template.properties: New file.
+ * templates/projecttemplates/HelloWorldCPPAutotoolsProject/template.xml: New file.
+ * build.properties: Add templates directory to binary contents.
+ * plugin.properties: Add new strings to support additions in plugin.xml.
+ * plugin.xml: Remove name from Autotools project type so it will get a category in the C/C++
+ new project wizard UI. Connect the gcc and g++ tools to their proper parents in the CDT.
+ Add template and wizard support for Autotools. Remove project conversion stuff that shouldn't
+ have been checked in.
+
+2009-10-14 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #292272
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsBuilder.java (AutotoolsBuilder): Use
+ a super copy constructor rather than a parent chained super constructor.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsMakefileBuilder.java (clean): Save old
+ builder and replace back when build is complete.
+ (build): Ditto.
+
+2009-09-30 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #289557
+ * plugin.xml: Add ApplicabilityCalculator for includes and symbols for
+ configure tool to prevent values from being added to the command line in the
+ Tool Settings tab.
+
+2009-09-30 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #289558
+ * plugin.xml: Put GNU C++ Project Wizard under C/C++ project category.
+
+2009-09-30 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #289555
+ * plugin.xml: Add back org.eclipse.linuxtools.cdt.autotools.toolchain.tool.gcc and
+ org.eclipse.linuxtools.cdt.autotools.toolchain.tool.gpp to Autotools toolchain to
+ prevent older projects from getting NPEs. Do not tie these tools to the real
+ CDT core gcc and gpp tools and make them unused children of the toolchain so new
+ projects won't put them in the Settings UI nor the .cproject.
+
+2009-09-29 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #289819
+ * plugin.properties: Change convert message to match the same format as CDT's
+ convertor.
+
+ * src/org/eclipse/linuxtools/cdt/autotools/MakeGenerator.java (createDirectory): Changed
+ to use Java File and mkdirs method.
+ (regenerateMakefiles): Use Java File for existence checking and do not use Workspace
+ root because file may be external. As well, share console if autoreconf required
+ prior to configuration.
+ * src/org/eclipse/linuxtools/cdt/autotools/Resources.properties: Add create dir error
+ message.
+
+
+2009-08-13 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #286543
+ * plugin.xml: Add input types for configure tool so we
+ can specify CDT gcc and g++ language ids which are checked
+ for in the CDT New C/C++ Project Wizards. Also add the
+ Autotools build artefact type as a supported property of the
+ Autotools tool chain.
+
+2009-08-06 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #285865
+ * plugin.properties: Change Provider to Eclipse instead of Eclipse.org.
+
+2009-08-05 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #267538
+ * src/org/eclipse/linuxtools/cdt/autotools/MakeGenerator.java (getAbsoluteDirectory):
+ Call getPathString to get the directory path instead of calling toOSString.
+ (getPathString): New method that gets the path string and handles MingW paths.
+ (runScript): Call getPathString to convert the command path instead of
+ using toOSString.
+
+2009-08-04 Jeff Johnston <jjohnstn@redhat.com>
+
+ * META-INF/MANIFEST.MF: Make autotools.tests able to see internal classes.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/text/hover/AutoconfTextHover.java (getAMDoc): Remove
+ printlns and log errors with AutotoolsPlugin instead of CUIPlugin.
+
+2009-08-04 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #267197
+ (getACDoc):
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsDefaultBuildDirHandler.java (handleValue): Continue
+ loop if no tool for config.status is found.
+
+2009-07-30 Jeff Johnston <jjohnstn@redhat.com>
+
+ * META-INF/MANIFEST.MF: Bump release to 1.0.4.
+
+2009-07-30 Jeff Johnston <jjohnstn@redhat.com>
+
+ Rename all internal classes to adhere to Eclipse naming conventions. Change all references appropriately.
+
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/AbstractElementListSelectionDialog.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/AbstractMakefile.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/AbstractMakefileCodeScanner.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/AddBuildTargetAction.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/ArchiveTarget.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/BadDirective.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/Command.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/Comment.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/CompletionProposalComparator.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/Conditional.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/DefaultRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/DefineVariable.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/DeleteOnErrorRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/Directive.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/EditorUtility.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/ElementListSelectionDialog.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/Else.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/EmptyLine.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/Endef.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/Endif.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/ExportAllVariablesRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/ExportVariable.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/ExternalEditorInput.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/ExternalEditorInputFactory.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/GNUAutomakefile.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/GNUMakefileConstants.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/GNUMakefileUtil.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/GNUTargetRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/GNUVariableDef.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/IAutomakeConditional.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/If.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/Ifdef.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/Ifeq.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/Ifndef.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/Ifneq.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/IgnoreRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/IMakefileDocumentProvider.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/IMakefileEditorActionDefinitionIds.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/Include.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/InferenceRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/IntermediateRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/IReconcilingParticipant.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/ISelectionValidator.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/ITranslationUnitEditorInput.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/LexicalSortingAction.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/LowResolutionTimeRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MacroDefinition.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MacroDefinitionRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MacroReferenceRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MakefileAnnotationHover.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MakefileCodeScanner.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MakefileCompletionProcessor.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MakeFileConstants.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MakefileContentOutlinePage.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MakefileDocumentProvider.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MakefileDocumentSetupParticipant.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MakefileEditor.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MakefileEditorActionContributor.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MakefileEditorPreferenceConstants.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MakefileEditorTogglePresentationAction.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MakefileMessages.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MakefilePartitionScanner.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MakefileReader.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MakefileReconcilingStrategy.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MakeFileResources.properties: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MakefileSourceConfiguration.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MakefileStorageDocumentProvider.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MakefileTextHover.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MakefileWordDetector.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MessageLine.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/NotParallelRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/NullMakefile.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/OpenDeclarationAction.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/OpenIncludeAction.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/OverrideDefine.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/OverrideVariable.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/Parent.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/PhonyRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/PosixMakefileUtil.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/PosixRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/PreciousRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/ProjectionMakefileUpdater.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/Rule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/SccsGetRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/SecondaryRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/SelectionList.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/SelectionStatusDialog.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/SilentRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/SpecialRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/StaticTargetRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/StatusInfo.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/StatusTool.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/StringMatcher.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/SuffixesRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/Target.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/TargetRule.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/TargetVariable.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/Terminal.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/TwoArrayQuickSort.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/UnExport.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/Util.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/VariableDefinition.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/VPath.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/WordPartDetector.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/WorkingCopyManager.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/MakeMessages.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/MakeTarget.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/MakeTargetManager.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/MarkerGenerator.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ProjectTargets.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/text/hover/AutoconfPrototype.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/text/hover/AutoconfTextHover.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/text/hover/HoverMessages.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/text/hover/HoverMessages.properties: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/AutotoolsConsole.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/AutotoolsPluginImages.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/CBuildStepsConsole.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/CConfigureConsole.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/Console.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/ConsoleMessages.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/ConsoleMessages.properties: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/CWordFinder.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/editors/autoconf/ProjectionFileUpdater.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/ErrorParserBlock.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/HTML2TextReader.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/HTMLPrinter.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/HTMLTextPresenter.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/LineBreakingReader.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/MakeResources.properties: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/MakeUIImages.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/MakeUIMessages.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/MessageLine.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/preferences/AbstractEditorPreferencePage.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/preferences/AutoconfEditorPreferencePage.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/preferences/AutomakeEditorPreferencePage.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/preferences/AutotoolsEditorPreferenceConstants.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/preferences/AutotoolsPreferencePage.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/preferences/AutotoolsPreferencesMessages.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/preferences/AutotoolsPreferencesMessages.properties: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/preferences/ColorEditor.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/preferences/ColorManager.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/preferences/OverlayPreferenceStore.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/preferences/StatusInfo.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/preferences/TabFolderLayout.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/SingleCharReader.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/SubstitutionTextReader.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/wizards/AutotoolsWizardMessages.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/wizards/AutotoolsWizardMessages.properties: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/wizards/ConfigurationContentProvider.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/wizards/ConfigurationLabelProvider.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/wizards/ManagedProjectOptionBlock.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/MakeMessages.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/MakeTarget.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/MakeTargetManager.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/MarkerGenerator.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ProjectTargets.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/AutotoolsConsole.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/AutotoolsPluginImages.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/CBuildStepsConsole.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/CConfigureConsole.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/Console.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/ConsoleMessages.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/ConsoleMessages.properties: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/CWordFinder.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/ErrorParserBlock.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/HTML2TextReader.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/HTMLPrinter.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/HTMLTextPresenter.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/LineBreakingReader.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/MakeResources.properties: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/MakeUIImages.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/MakeUIMessages.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/MessageLine.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/SingleCharReader.java: New file.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/SubstitutionTextReader.java: New file.
+ * plugin.xml: Change any internal class references to new naming convention.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsMakeTargetManager.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakeCompletionProcessor.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakeConfigMacro.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakeDocumentProvider.java (getWorkingCopy): Ditto.
+ (shutdown): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakeEditor.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakeEditorFactory.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakeErrorHandler.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/Automakefile.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakefileCodeScanner.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakefileReconcilingStrategy.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakefileSourceConfiguration.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakeIfElse.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakeTextHover.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/MakeGenerator.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfAnnotationHover.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfCodeScanner.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfEditor.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfEditorMacroValidator.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroCodeScanner.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroContentAssistProcessor.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfSourceViewerConfiguration.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/IAutotoolsEditor.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/outline/AutoconfLabelProvider.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsEditorPropertyPage.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/wizards/CProjectPlatformPage.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/wizards/NewAutotoolsProjectOptionPage.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/AbstractElementListSelectionDialog.java:
+ Ditto.
+
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/AbstractMakefile.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/AbstractMakefileCodeScanner.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/AddBuildTargetAction.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/ArchiveTarget.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/BadDirective.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/Command.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/Comment.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/CompletionProposalComparator.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/Conditional.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/DefaultRule.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/DefineVariable.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/DeleteOnErrorRule.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/Directive.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/EditorUtility.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/ElementListSelectionDialog.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/Else.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/EmptyLine.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/Endef.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/Endif.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/ExportAllVariablesRule.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/ExportVariable.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/ExternalEditorInput.java (getTranslationUnit): Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/ExternalEditorInputFactory.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/GNUAutomakefile.java (getBuiltins): Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/GNUMakefileConstants.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/GNUMakefileUtil.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/GNUTargetRule.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/GNUVariableDef.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/IAutomakeConditional.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/If.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/Ifdef.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/Ifeq.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/Ifndef.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/Ifneq.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/IgnoreRule.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/IMakefileDocumentProvider.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/IMakefileEditorActionDefinitionIds.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/Include.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/InferenceRule.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/IntermediateRule.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/IReconcilingParticipant.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/ISelectionValidator.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/ITranslationUnitEditorInput.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/LexicalSortingAction.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/LowResolutionTimeRule.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/MacroDefinition.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/MacroDefinitionRule.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/MacroReferenceRule.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/MakefileAnnotationHover.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/MakefileCodeScanner.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/MakefileCompletionProcessor.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/MakeFileConstants.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/MakefileContentOutlinePage.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/MakefileDocumentProvider.java (getWorkingCopy): Ditto.
+ (shutdown):
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/MakefileDocumentSetupParticipant.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/MakefileEditor.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/MakefileEditorActionContributor.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/MakefileEditorPreferenceConstants.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/MakefileEditorTogglePresentationAction.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/MakefileMessages.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/MakefilePartitionScanner.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/MakefileReader.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/MakefileReconcilingStrategy.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/MakefileSourceConfiguration.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/MakefileStorageDocumentProvider.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/MakefileTextHover.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/MakefileWordDetector.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/MessageLine.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/NotParallelRule.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/NullMakefile.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/OpenDeclarationAction.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/OpenIncludeAction.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/OverrideDefine.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/OverrideVariable.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/Parent.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/PhonyRule.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/PosixMakefileUtil.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/PosixRule.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/PreciousRule.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/ProjectionMakefileUpdater.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/Rule.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/SccsGetRule.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/SecondaryRule.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/SelectionList.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/SelectionStatusDialog.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/SilentRule.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/SpecialRule.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/StaticTargetRule.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/StatusInfo.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/StatusTool.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/StringMatcher.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/SuffixesRule.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/Target.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/TargetRule.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/TargetVariable.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/Terminal.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/TwoArrayQuickSort.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/UnExport.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/Util.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/VariableDefinition.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/VPath.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/WordPartDetector.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/editors/automake/WorkingCopyManager.java (removeWorkingCopy): Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/text/hover/AutoconfPrototype.java: Ditto.
+
+
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/text/hover/AutoconfTextHover.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/text/hover/HoverMessages.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/autoconf/ProjectionFileUpdater.java: Ditto.
+
+
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/AbstractEditorPreferencePage.java: Ditto.
+
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/AutoconfEditorPreferencePage.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/AutomakeEditorPreferencePage.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/AutotoolsEditorPreferenceConstants.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/AutotoolsPreferencePage.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/AutotoolsPreferencesMessages.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/ColorEditor.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/ColorManager.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/OverlayPreferenceStore.java: Ditto.l
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/StatusInfo.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/TabFolderLayout.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/wizards/AutotoolsWizardMessages.java: Ditto.
+
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/wizards/ConfigurationContentProvider.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/wizards/ConfigurationLabelProvider.java: Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/wizards/ManagedProjectOptionBlock.java: Ditto.
+
+2009-07-29 Jeff Johnston <jjohnstn@redhat.com>
+
+ * plugin.xml: Fix visibility of Reconfigure Project menu item.
+
+2009-07-27 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/AutotoolsConsole.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/Console.java: New file.
+ * plugin.xml: Add build consoles for Autotools and Build Steps.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAction.java:
+ (executeConsoleCommand): New method to run commands in the console.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAclocalAction.java (run): Use
+ executeConsoleCommand.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAutoconfAction.java (run): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAutoheaderAction.java (run): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAutomakeAction.java (run): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAutoreconfAction.java (run): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeLibtoolizeAction.java (run): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeMessages.properties: Add working directory
+ message and special message for invoking tools.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/CBuildStepsConsole.java (CBuildStepsConsole):
+ Changed to inherit from Console class.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/CConfigureConsole.java (CConfigureConsole): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/ConsoleMessages.properties: Add messages
+ for build steps and autotools console names.
+ * src/org/eclipse/linuxtools/cdt/autotools/MakeGenerator.java (stripEnvVars): Make public static.
+
+2009-07-20 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #283828
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/ReconfigureAction.java (run): Use
+ workspace root scheduling rule instead of project modification rule because MakeTargets
+ may end up saving project description.
+
+2009-07-15 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/ReconfigureAction.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/ReconfigureHandler.java: New file.
+ * plugin.properties: Add messages for new reconfigure action.
+ * plugin.xml: Add new reconfigure command to Project menu.
+ * src/org/eclipse/linuxtools/cdt/autotools/MakeGenerator.java (removeConfigSettings): New
+ method.
+
+2009-07-15 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/cdt/autotools/MakeGenerator.java (saveConfigArgs): Use toFile
+ method for config settings path.
+ (regenerateMakefiles): Ditto.
+
+2009-07-14 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #281850
+ * src/org/eclipse/linuxtools/cdt/autotools/MakeGenerator.java (getConfigSettingsPath): Save configure
+ settings file in project working directory for Autotools plugin.
+
+2009-07-13 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #269974
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsMakefileBuilder.java (build): Look for make target
+ arguments as any arguments added to the build command in a MakeTarget will be stripped off and given as
+ one of the fields in args. Take any make arguments given and set them for the builder.
+
+2009-07-10 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/cdt/autotools/MakeGenerator.java (stripEnvVars): Add support for stripping off
+ recursive env var references even though they are not interpreted. Also remove single and double quotes from
+ env var if variable value is quoted.
+
+2009-07-09 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #282696, #283084
+ * src/org/eclipse/linuxtools/cdt/autotools/MakeGenerator.java (getAutogenPath): Change to
+ strip off environment variable settings prior to command string using stripEnvVars method.
+ (getConfigurePath): Ditto.
+ (runScript): Add additional environment variable parameters.
+ (stripEnvVars): New method.
+ (regenerateMakefiles): Fix needs full reconfiguration to use designated clean method
+ instead of deleting build directory.
+ (makeArray): New method.
+ * src/org/eclipse/linuxtools/cdt/autotools/Resources.properties: Add cleaning build directory
+ message.
+
+2009-07-08 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #281811
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsMakefileBuilder.java (postBuildErrMsg): New.
+ (preBuildErrMsg): Ditto.
+ (clean): Set the build generator element acquired from the AutotoolsPlugin.
+ (build): Add prebuild/postbuild step support. Add sub-directory make target support and fix
+ problem with GNU Make Generator being used by setting the build generator element acquired from the
+ AutotoolsPlugin.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsPlugin.java (getImageDescriptor):
+ (getGeneratorElement): New method.
+ * src/org/eclipse/linuxtools/cdt/autotools/MakeGenerator.java (initializeBuildConfigDirs): Don't set
+ builder working directory since this is done by AutotoolsMakefileBuilder.
+
+2009-07-02 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsMakefileBuilder.java (clean): Don't ask
+ the ManagedBuildManager for the generator as it may default to the GnuMakefileGenerator.
+ (removeBuildDir): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/MakeGenerator.java (regenerateMakefiles): Add
+ MakeTargets when autogen.sh runs configure successfully.
+
+2009-06-25 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #281583, #281582
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsMakefileBuilder.java (build): Don't ask the
+ ManagedBuildManager for the generator as it will default to the GnuMakefileGenerator until we tell
+ it otherwise. Just get a new Autotools MakeGenerator.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsScannerInfo.java (getCompilationString): Add support
+ for g++, top-level builds, and compilation strings with continuation characters.
+
+2009-06-17 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #280696
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAction.java (showSuccess):
+ Changed to issue a information dialog that does not have a cancel button.
+ (executeCommand): Changed to create a ProgressMonitorDialog that is issued
+ until the command completes successfully or with failure.
+ (ExecuteProgressDialog): New private internal class that implements IRunnableWithProgress
+ which is used to run the command for a ProgressMonitorDialog.
+
+2009-06-17 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeMessages.properties:
+ Resolves #280509
+ * META-INF/MANIFEST.MF: Bump version to 1.0.3.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsBuilder.java (getBuildFileGenerator): New
+ method to override Builder method so we get Autotools Makefile generator.
+ * src/org/eclipse/linuxtools/cdt/autotools/MakeGenerator.java (regenerateMakefiles): Add
+ logic to use autoreconf if no configure script and no autogen.sh.
+ * src/org/eclipse/linuxtools/cdt/autotools/Resources.properties: Add messages.
+
+2009-06-17 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #280504, #280505, #280506.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/AutoheaderHandler.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/AutoreconfHandler.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAutoheaderAction.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAutoreconfAction.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeLibtoolizeAction.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/LibtoolizeHandler.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/SingleInputDialog.java: New file.
+ * plugin.properties: Add new messages for additional tools/commands added.
+ * plugin.xml: Change invoking autotools to be a single menu item in Project menu which
+ expands to show all tools available, including aclocal, autoconf, autoheader, automake,
+ autoreconf, and libtoolize.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAction.java (simpleParseOptions): New
+ method to parse options and account for quoted strings.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeMessages.properties: Add support
+ for autoheader, autoreconf, and libtoolize.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsPropertyConstants.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsPropertyMessages.properties: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsToolsPropertyPage.java (createControls):
+ Ditto.
+ (initialize): Ditto.
+ (performDefaults): Ditto.
+ (performOK): Ditto.
+
+2009-06-12 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #280117
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsScannerInfo.java (buildFile): Fix so
+ loop doesn't exit early before finding build directory.
+
+2009-06-05 Andrew Overholt <overholt@redhat.com>
+
+ * Fix up after erroneous SVN operation.
+
+2009-05-29 Jeff Johnston <jjohnstn@redhat.com>
+
+ * .classpath: Updated.
+
+2009-05-28 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #273830
+ * plugin.xml: Remove warnings.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAction.java (executeCommand): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/TwoInputDialog.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsBuilder.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsDefaultBuildDirHandler.java (handleValue): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsMakefileBuilder.java (clean): Ditto.
+ (build): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsPlugin.java (setScannerInfoProvider): Ditto.
+ (verifyScannerInfoProvider): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsScannerInfo.java (buildFile): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsScannerInfoProvider.java (setDirty): Ditto.
+ (getScannerInformation): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutoconfSubstRule.java (DecreasingCharArrayLengthComparator): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakeDocumentProvider.java (connect): Ditto.
+ (shutdown): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakeEditor.java (getAdapter): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakeErrorHandler.java (AutomakeMarker): Ditto.
+ (checkChildren): Ditto.
+ (AutomakeMarker.setAttributes): Ditto.
+ (AutomakeMarker.getAttributes): Ditto.
+ (createMarker): Ditto.
+ (AutomakeMarker.AutomakeMarker): Ditto.
+ (AutomakeMarker.getAdapter): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/EditorUtility.java (getWorkspaceFileAtLocation): Ditto.
+ (isLinked): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/ElementListSelectionDialog.java (open): Ditto.
+ (setElements): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/ExternalEditorInput.java (getAdapter): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/GNUAutomakefile.java (getBuiltins): Ditto.
+ (addDirective): Ditto.
+ (parseVPath): Ditto.
+ (getDirectives): Ditto.
+ (parse): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/LexicalSortingAction.java (LexicalCSorter.isSorterProperty): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MakefileCompletionProcessor.java (DirectiveComparator): Ditto.
+ (computeContextInformation): Ditto.
+ (computeCompletionProposals): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MakefileContentOutlinePage.java (MakefileContentProvider.getElements): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MakefileDocumentProvider.java (shutdown): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MakefileEditor.java (getAdapter): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MakefileMessages.java (getFormattedString): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MakefilePartitionScanner.java (MakefilePartitionScanner): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/NullMakefile.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/OpenIncludeAction.java (resolveIncludeLink): Ditto.
+ (findFile): Ditto.
+ (getIncludeStatement): Ditto.
+ (chooseFile): Ditto.
+ (run): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/Parent.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/PosixMakefileUtil.java (findTargets): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/ProjectionMakefileUpdater.java (createAnnotationMap): Ditto.
+ (fCollapseConditional): Ditto.
+ (fCollapseRule): Ditto.
+ (fCollapseMacroDef): Ditto.
+ (match): Ditto.
+ (processReconcile): Ditto.
+ (computeAdditions): Ditto.
+ (initialize): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/Rule.java (getCommands): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/SelectionStatusDialog.java (setInitialSelection): Ditto.
+ (getPrimaryInitialSelection): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/StringMatcher.java (parseWildCards): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/WorkingCopyManager.java (setWorkingCopy): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/MakeTarget.java (getAdapter): Ditto.
+ (getEnvironment): Ditto.
+ (setEnvironment): Ditto.
+ (build): Ditto.
+ (getExpandedEnvironment): Ditto.
+ (getAttributeMap): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/MakeTargetManager.java (initializeBuilders): Ditto.
+ (getTargetBuilders): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ProjectTargets.java (findTarget): Ditto.
+ (remove): Ditto.
+ (get): Ditto.
+ (getAsXML): Ditto.
+ (translateCDTProjectToDocument): Ditto.
+ (translateDocumentToCDTProject): Ditto.
+ (contains): Ditto.
+ (add): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/editors/autoconf/ProjectionFileUpdater.java (createAnnotationMap): Ditto.
+ (match): Ditto.
+ (processReconcile): Ditto.
+ (computeAdditions): Ditto.
+ (initialize): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/ErrorParserBlock.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/HTML2TextReader.java (static initializer): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/HTMLTextPresenter.java (updatePresentation): Ditto.
+ (adaptTextPresentation): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/preferences/ColorManager.java (dispose): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/preferences/StatusInfo.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/MakeGenerator.java (runScript): Ditto.
+ (runCommand): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/popup/actions/GetDefinedSymbolsAction.java (run): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfDocumentProvider.java (shutdown): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfEditor.java (getAdapter): Ditto.
+ (InformationDispatchAction.makeTextHoverFocusable): Ditto.
+ (.createInformationControl): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfErrorHandler.java (AutoconfMarker.getAttributes): Ditto.
+ (handleError): Ditto.
+ (AutoconfMarker.getAdapter): Ditto.
+ (createMarker): Ditto.
+ (AutoconfMarker.setAttributes): Ditto.
+ (removeExistingMarkers): Ditto.
+ (AutoconfMarker.AutoconfMarker): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfIdentifierRule.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacro.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroDamagerRepairer.java (createPresentation): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroParameterListValidator.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/IAutotoolsEditor.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/InlineDataRule.java (evaluate): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfOutlineErrorHandler.java (handleError): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/RecursiveSingleLineRule.java (RecursiveSingleLineRule): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/RestrictedEndOfLineRule.java (RestrictedEndOfLineRule): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsPropertyManager.java (AutotoolsPropertyManager): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsToolsPropertyPage.java (performOK): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/wizards/ConvertToAutotoolsProjectWizardPage.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/wizards/CProjectPlatformPage.java (handleConfigurationSelectionChange): Ditto.
+ (CProjectPlatformPage): Ditto.
+ (filterSupportedConfigurations): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/wizards/NewAutotoolsCCProjectWizard.java (doRun): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/wizards/NewAutotoolsCProjectWizard.java (doRun): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/wizards/NewAutotoolsProjectOptionPage.java (ManagedWizardOptionBlock.setupHelpContextIds): Ditto.
+
+2009-05-14 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #276204
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsProjectNature.java (removeNature):
+ (addAutotoolsBuilder): Fix compiler warnings.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakeCompletionProcessor.java (DirectiveComparator): Ditto.
+ (computeContextInformation): Ditto.
+ (computeCompletionProposals): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakefileCodeScanner.java (createRules): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakefileContentOutlinePage.java (AutomakefileContentProvider.getElements): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/AbstractElementListSelectionDialog.java (setSelectionListElements): Ditto.
+ (getWidgetSelection): Ditto.
+ (verifyCurrentSelection): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/AbstractMakefile.java (getMacroDefinitions): Ditto.
+ (getBuiltinInferenceRules): Ditto.
+ (getRules): Ditto.
+ (getInferenceRules): Ditto.
+ (getTargetRules): Ditto.
+ (getBuiltinMacroDefinitions): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/AddBuildTargetAction.java (getTargetRules): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/CompletionProposalComparator.java (compare): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/SelectionList.java (getSelection): Ditto.
+ (setElements): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/text/hover/AutoconfPrototype.java (AutoconfPrototype): Ditto.
+ (getParmName): Ditto.
+ (setParmName): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/text/hover/AutoconfTextHover.java (getAMDoc): Ditto.
+ (getMacroList): Ditto.
+ (getACDoc): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/preferences/AutoconfEditorPreferencePage.java (fHighlightingColorList): Ditto.
+ (ColorListContentProvider.getElements): Ditto.
+ (addTextKeyToCover): Ditto.
+ (createSyntaxPage): Ditto.
+ (createOverlayStore): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/preferences/AutomakeEditorPreferencePage.java (fHighlightingColorList): Ditto.
+ (ColorListContentProvider.getElements): Ditto.
+ (addTextKeyToCover): Ditto.
+ (createSyntaxPage): Ditto.
+ (createOverlayStore): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfAnnotationHover.java (getMarkersForLine): Ditto.
+ (select): Ditto.
+ (getHoverInfo): Ditto.
+ (formatMultipleMessages): Ditto.
+ (.createInformationControl): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfCodeScanner.java (AutoconfCodeScanner): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfMacroContentAssistProcessor.java (computeCompletionProposals): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfPartitionScanner.java (AutoconfPartitionScanner): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/outline/AutoconfContentOutlinePage.java (updateSelection): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfElement.java (AutoconfElement): Ditto.
+ (toString): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfParser.java (ExprEndCondition): Ditto.
+ (ExprEndCondition.serialVersionUID): Ditto.
+ (BlockEndCondition): Ditto.
+ (checkBlockValidity): Ditto.
+ (BlockEndCondition.serialVersionUID): Ditto.
+
+2009-05-06 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAclocalAction.java (run): Fix to
+ add type for result of InvokeAction.executeCommand call.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAutoconfAction.java (run): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAutomakeAction.java (run): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAction.java (separateTargets): Fix
+ compiler warnings.
+ (separateOptions): Ditto.
+ (executeCommand): Add type for resulting Collection. Regress previous fix until Galileo
+ build catches up to recent CDT changes.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsScannerInfo.java (buildFile): Regress
+ previous fix until Galileo build catches up to recent CDT changes.
+ (getDefinedSymbols): Fix compiler warnings.
+ (getIncludePaths): Ditto.
+ (definedSymbols): Ditto.
+
+2009-05-04 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAction.java (executeCommand): Use new
+ launcher execute method which isn't deprecated and handle CoreException.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsScannerInfo.java (buildFile): Ditto.
+
+2009-04-30 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #249199
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/AbstractAutotoolsHandler.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/AutoconfHandler.java: New file.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/AutomakeHandler.java: New file.
+ * plugin.properties: Add messages for invoking autotools.
+ * plugin.xml: Change invoke autotools actions from Actions in an ActionSet to instead
+ use org.eclipse.ui.menus, org.eclipse.ui.commands, and org.eclipse.ui.handlers and
+ do not add these actions to project menu if not an Autotools project.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/AclocalHandler.java (execute): Implemented.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAclocalAction.java (run): Add check
+ for null container.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAutoconfAction.java (run): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAutomakeAction.java (run): Ditto.
+
+2009-04-27 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #270518.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsMakefileBuilder.java (getPostBuildErrMsg):
+ New method.
+ (getPreBuildErrMsg): Ditto.
+ (getTargets): Fix warnings.
+ (makeArrayList): Ditto.
+ (build): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/MakeGenerator.java (addMakeTargetsToManager): Add
+ check for non-existent Makefile.
+ (regenerateMakefiles): Check for Makefile at end and if not present, always return error.
+ * src/org/eclipse/linuxtools/cdt/autotools/Resources.properties: Change message for
+ non-generation of Makefile.
+
+2009-04-20 Andrew Overholt <overholt@redhat.com>
+
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/HTMLTextPresenter.java
+ (updatePresentation): Fix compiler warnings.
+
+2009-04-20 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #272924
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/OpenIncludeAction.java (run):
+ Fix compiler warnings.
+ (getIncludeStatement): Ditto.
+ (chooseFile): Ditto.
+ (.visit): Ditto.
+ (findFile): Ditto.
+
+2009-04-20 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #272923
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MakefileMessages.java (getFormattedString): Fix
+ compiler warnings.
+
+2009-04-20 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #272922
+ * src/org/eclipse/linuxtools/cdt/autotools/MakeGenerator.java (getAutogenArgs): Fix compiler
+ warnings.
+ (addMakeTargetsToManager): Ditto.
+ (runScript): Ditto.
+ (getConfigArgs): Ditto.
+ (MakeTargetComparator): Ditto.
+ (makeArray): Ditto.
+ (runCommand): Ditto.
+
+2009-04-20 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #272921
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeMessages.java (getFormattedString):
+ Cast 2nd argument for message fomatting to avoid compile warnings.
+
+2009-04-20 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #272920
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/wizards/AutotoolsWizardMessages.java (getFormattedString):
+ Cast 2nd argument for message formatting to avoid compiler warnings.
+ (getFormattedString): Ditto.
+
+2009-04-20 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #272919
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/AutotoolsPluginImages.java (makeIconFileURL):
+ Fix static member reference to avoid compiler warning.
+ (static initializer): Ditto.
+
+2009-04-20 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #272918
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsPlugin.java (getFormattedString): Cast
+ 2nd argument to avoid compiler warning.
+
+2009-04-20 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #272917
+ * .settings: Updated.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/preferences/AbstractEditorPreferencePage.java (validatePositiveNumber):
+ Properly template containers.
+ (getTextFields): Ditto.
+ (initializeFields): Ditto.
+ (updateStatus): Ditto.
+ (getCheckBoxes): Ditto.
+ (getNumberFields): Ditto.
+
+2009-04-20 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #272916.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakefileCodeScanner.java (createRules): Use templated
+ List.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/MakefileCodeScanner.java (createRules): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/editors/automake/AbstractMakefileCodeScanner.java (createTextAttribute):
+ Correctly access static member function.
+ (initializeRules): Use templated List.
+
+2009-04-03 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #270680
+
+ * plugin.xml: Fix Autotools properties page to only show up for Autotools nature.
+ Add gcc and g++ to Toolchain so indexing will work.
+
+2009-03-27 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsMakefileBuilder.java (build): Add
+ logic to also respect the makefile command being changed in the Makefile target.
+
+2009-03-26 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #269974
+
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsMakefileBuilder.java (build): Add
+ logic to handle a makefile target being for a subdirectory Makefile as opposed to
+ the main Makefile.
+
+2009-03-05 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsMakefileBuilder.java (build): Use
+ System.arraycopy rather than Arrays.copyOfRange because the latter is a 1.6 API.
+
+2009-03-03 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #265996
+
+ * src/org/eclipse/linuxtools/cdt/autotools/MakeGenerator.java (regenerateMakefiles): If we are
+ doing full reconfigure, use same cleaning method on build directory as "clean" build.
+ (makeArray): New method to convert String into array of Strings.
+ * src/org/eclipse/linuxtools/cdt/autotools/Resources.properties: Add message when cleaning
+ build directory prior to reconfigure.
+
+2009-03-02 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #266451
+
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsMakefileBuilder.java (build): Use
+ property "line.separator" instead of "lineSeparator".
+ * src/org/eclipse/linuxtools/cdt/autotools/MakeGenerator.java (initializeBuildConfigDirs):
+ Store a workspace-neutral builddir that can be moved to another workspace.
+ Use IBuilder.setBuildPath method instead of IBuilder.setBuildAttribute to set the new build
+ dir. Also, check to see if the builddir has changed first.
+
+2009-03-02 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #264935
+
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/CBuildStepsConsole.java: New file.
+ * plugin.xml: Add CBuildSteps console.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsMakefileBuilder.java (build): Perform
+ prebuild and postbuild steps if present.
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/ui/ConsoleMessages.properties: Add name
+ for Build Steps console.
+
+2009-02-24 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #265873
+
+ * META-INF/MANIFEST.MF: Add dependency on org.eclipse.core.net.
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsPlugin.java (stop): Add call to
+ ServiceTracker close() method.
+ (start): Add ServiceTracker open() call for IProxyService.
+ (getProxyService): New method to get IProxyService.
+
+2009-01-20 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #261717
+
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/text/hover/AutoconfTextHover.java (getMacroList):
+ Don't bother processing macros if the macro document turns out to be null.
+
+2009-01-15 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #261257
+
+ * META-INF/MANIFEST.MF: Update plug-in to add .qualifier to id and update
+ to 1.0.2.qualifier.
+ * plugin.xml: Update invoke autotools action set to set visible to true.
+
+2009-01-06 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/cdt/autotools/MakeGenerator.java (getConfigArgs): If there
+ are no -- args in the user arguments, still pass them on to configure.
+
+2008-11-26 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves #472731
+
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsMakefileBuilder.java (hasTargetBuilder):
+ Add check for ManagedProject being null which is apparently possible.
+
+2008-11-25 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakeDocumentProvider.java: Change
+ Copyright to make Red Hat a contributor to the copyright of the original file modified to make
+ this new class.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakeEditor.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/Automakefile.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakefileCodeScanner.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakefileContentOutlinePage.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakefileReconcilingStrategy.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakefileSourceConfiguration.java: Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakeMacroDefinitionRule.java: Ditto.
+
+2008-11-03 Andrew Overholt <overholt@redhat.com>
+
+ * build.properties: Remove libhoverdocs/.
+
+2008-10-31 Andrew Overholt <overholt@redhat.com>
+
+ * META-INF/MANIFEST.MF: Use plugin.properties for provider.
+ * plugin.properties: Add "(Incubation)" to Bundle-Name.
+
+2008-10-28 Andrew Overholt <overholt@redhat.com>
+
+ * META-INF/MANIFEST.MF: Update BREE to J2SE-1.5.
+
+2008-10-14 Jeff Johnston <jjohnstn@redhat.com>
+
+ * META-INF/MANIFEST.MF: Bump up release to 1.0.1.
+
+2008-10-10 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsMakefileBuilder.java (build): Add check for default
+ configuration coming back null from buildinfo.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsBuildPropertyPage.java (performDefaults):
+ Set make -w default to be true.
+ * src/org/eclipse/linuxtools/cdt/autotools/wizards/ConvertToAutotoolsProjectWizardPage.java (convertProject):
+ Set make -w project property to true and don't turn off indexer.
+ * src/org/eclipse/linuxtools/cdt/autotools/wizards/NewAutotoolsCCProjectWizard.java (doRun): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/wizards/NewAutotoolsCProjectWizard.java (doRun): Ditto.
+
+2008-10-10 Jeff Johnston <jjohnstn@redhat.com>
+
+ Fix for #249416
+
+ * src/org/eclipse/linuxtools/cdt/autotools/MakeGenerator.java: Fix addition of MakeTargets to run faster.
+ (addMakeTargetsToManager): Rewritten to not use MakeTargetManager addTarget or removeTarget methods which
+ cause a rewrite of the .cproject file each time.
+ (isValidTarget): Remove checking MakeTargetManager existing target.
+ (translateDocumentToCDTProject): New method which outputs the MakeTargets to the .cproject file.
+ (MakeTargetComparator): New Comparator for sorting MakeTargets.
+ (createTargetElement): New method.
+ * src/org/eclipse/linuxtools/cdt/autotools/Resources.properties: Add subtask message for refreshing Make Targets
+ which might take some time.
+
+2008-10-07 Jeff Johnston <jjohnstn@redhat.com>
+
+ Fix for #249231
+
+ * src/org/eclipse/linuxtools/cdt/autotools/MakeGenerator.java (getAutogenArgs): Add
+ support to resolve build macros.
+ (getConfigArgs): Ditto.
+ (initializeBuildConfigDirs): Ditto.
+
+2008-10-03 Jeff Johnston <jjohnstn@redhat.com>
+
+ Fix for #249644.
+
+ * plugin.xml: Change visible to true for invoke autotools action set. Also add
+ new popupmenus for running autoconf directly on configure.ac or configure.in.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAclocalAction.java (run): Use
+ getCWD to get the relative current working directory and pass a string to the new
+ TwoInputDialog constructor.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAutomakeAction.java (run): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAction.java (getCWD): New method
+ to get the relative CWD for an autotools action.
+ * src/org/eclipse/linuxtools/cdt/autotools/actions/TwoInputDialog.java (createDialogArea):
+ Use CLabel instead of Label for first label (the CWD).
+ (TwoInputDialog): Change to accept a String for the first message instead of an IPath.
+ * src/org/eclipse/linuxtools/cdt/autotools/MakeGenerator.java (addMakeTargetsToManager):
+ Temporarily disable.
+
+2008-10-01 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsScannerInfo.java (getIncludePaths): Fix bug that
+ was properly resolving relative paths. Also add support for parsing -isystem specifiers and putting
+ the paths on the include path list.
+
+2008-09-19 Jeff Johnston <jjohnstn@redhat.com>
+
+ * META-INF/MANIFEST.MF: Change Eclipse-AutoStart over to Bundle-ActivationPolicy.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/LibHover.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/LibHoverMessages.java: Removed.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/LibHoverMessages.properties: Removed.
+ * plugin.xml: Remove CHelpProvider library hover extension as this functionality
+ has been moved into its own plugin.
+
+2008-09-18 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/cdt/autotools/editors/automake/AutomakefileCodeScanner.java (createRules):
+ Specify Token.UNDEFINED for WordRules default token. Otherwise, just getting the first possible
+ character of a word detector will result in default token being returned and no further parsing.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfCodeScanner.java (AutoconfCodeScanner):
+ Ditto.
+
+2008-09-17 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/cdt/autotools/AutotoolsScannerInfoProvider.java (getScannerInformation):
+ Return null if project is not an Autotools project.
+ (unsubscribe): Check scanner info for null before accessing.
+
+2008-09-17 Jeff Johnston <jjohnstn@redhat.com>
+
+ Refactored from com.redhat.eclipse.cdt.autotools to org.eclipse.linuxtools.cdt.autotools
+
+ * src/org/eclipse/linuxtools/cdt/autotools/internal/text/hover/AutoconfTextHover.java:
+ (AUTOCONF_MACROS_DOC_NAME): Change to use default URL pointing to sourceware.org.
+ (AUTOMAKE_MACROS_DOC_NAME): Ditto.
+ (getHoverDoc): Remove unused variable.
+ (getAMDoc): Modify to handle either a file or URL.
+ (getACDoc): Ditto.
+ (.createInformationControl): Switch to use non-deprecated constructor.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/LibHover.java (getLibHoverDocs): Modify to handle
+ either an external file name or URL.
+ (getLibHoverDocName): New method that returns default URL pointing to sourceware.org.
+ (HelpResource.getHref): Change to return URL.
+ (getFunctionInfo): Remove unread variable.
+
+2008-09-09 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsMakefileBuilder(hasTargetBuilder): Change logic
+ to look for ProjectType id rather than looking at builder id of configuration since ManagedProject
+ might have had configuration removed. Resolves #461647.
+ * plugin.xml: Fix typo in referenced nature of autoolsNature. Resolves #461201.
+
+2008-08-08 Jeff Johnston <jjohnstn@redhat.com>
+
+ * META-INF/MANIFEST.MF: Update version number to 1.0.0 and specify minimum/maximum versions
+ for all dependencies now that CDT 5.0 and Eclipse 3.4 must be used.
+
+2008-07-04 Jeff Johnston <jjohnstn@redhat.com>
+
+ * icons/ac16/acmacro_arg_obj.gif: New File.
+ * src/com/redhat/eclipse/cdt/autotools/ui/properties/AutotoolsEditorPropertyPage.java:
+ (getproject): Remove.
+ * META-INF/MANIFEST.MF: Add org.eclipse.core.filesystem as dependency.
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java: Update imports.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/outline/AutoconfLabelProvider.java (getImage):
+ Use special image for acmacro argument.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/AutoconfEditorPreferencePage.java:
+ Update imports.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/AutotoolsPluginImages.java: Add image for
+ acmacro argument.
+ * src/com/redhat/eclipse/cdt/autotools/internal/text/hover/AutoconfTextHover.java: Update imports.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeEditor.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileReconcilingStrategy.java (reconcile):
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeDocumentProvider.java: Update imports.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MakefileReconcilingStrategy.java (reconcile):
+ Call new form of parse method.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/Directive.java:
+ (getMakefile): New required method.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/GNUAutomakefile.java:
+ (parse): New required method.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/AbstractMakefile.java:
+ (getFileURI): New required method.
+ (getMakefile): Ditto.
+ (setFileURI): Ditto.
+ (getMakefileReaderProvider): Ditto.
+ (parse): Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/OpenDeclarationAction.java:
+ (openInEditor): Use URI instead of File.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/NullMakefile.java:
+ (parse): New required method to implement.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MakefileDocumentProvider.java (createMakefile):
+ Add throws modifier.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfMacroCodeScanner.java: Update imports.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfMacroContentAssistProcessor.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfDocumentProvider.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfMacroDamagerRepairer.java: Ditto.
+
+2008-07-04 Jeff Johnston <jjohnstn@redhat.com>
+
+ * META-INF/MANIFEST.MF: Bump release to 0.9.7.
+
+2008-04-17 14:12 Ed Swartz <ed.swartz@nokia.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/:
+ internal/ui/editors/autoconf/ProjectionFileUpdater.java,
+ ui/editors/AutoconfCodeScanner.java,
+ ui/editors/AutoconfPKGWordDetector.java,
+ ui/editors/outline/AutoconfLabelProvider.java: Collapse and
+ decorate long macro arguments, and notice PKG_ macros
+
+2008-04-17 13:13 Ed Swartz <ed.swartz@nokia.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/:
+ internal/ui/editors/autoconf/ProjectionFileUpdater.java,
+ ui/editors/AutoconfEditorMacroValidator.java,
+ ui/editors/parser/AutoconfElement.java,
+ ui/editors/parser/AutoconfParser.java: Fix editor collapsing and
+ remove line number metadata from AutoconfElement, since the "end
+ line" is only meaningful in the context of the client.
+
+2008-04-17 10:43 Ed Swartz <ed.swartz@nokia.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/:
+ AutoconfEditorMessages.properties,
+ outline/AutoconfContentOutlinePage.java,
+ parser/AutoconfCaseConditionElement.java,
+ parser/AutoconfCaseElement.java, parser/AutoconfElement.java,
+ parser/AutoconfElifElement.java, parser/AutoconfElseElement.java,
+ parser/AutoconfForElement.java, parser/AutoconfIfElement.java,
+ parser/AutoconfMacroDetector.java,
+ parser/AutoconfMacroElement.java,
+ parser/AutoconfOutlineErrorHandler.java,
+ parser/AutoconfParser.java, parser/AutoconfRootElement.java,
+ parser/AutoconfTokenizer.java, parser/AutoconfWhileElement.java,
+ parser/OldAutoconfParser.java, parser/Token.java: More autoconf
+ parser work. Remove old parser and standardize AST node
+ constructors. Add more tests and fix some bugs.
+
+2008-04-10 15:40 Ed Swartz <ed.swartz@nokia.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/:
+ internal/ui/editors/autoconf/ProjectionFileUpdater.java,
+ ui/editors/AutoconfEditor.java,
+ ui/editors/AutoconfEditorMacroValidator.java,
+ ui/editors/AutoconfEditorMessages.properties,
+ ui/editors/AutoconfErrorHandler.java,
+ ui/editors/AutoconfReconcilingStrategy.java,
+ ui/editors/outline/AutoconfLabelProvider.java,
+ ui/editors/parser/AutoconfElement.java,
+ ui/editors/parser/AutoconfMacroArgumentElement.java,
+ ui/editors/parser/AutoconfMacroElement.java,
+ ui/editors/parser/AutoconfParser.java,
+ ui/editors/parser/AutoconfParser2.java,
+ ui/editors/parser/AutoconfSelectElement.java,
+ ui/editors/parser/AutoconfTokenizer.java,
+ ui/editors/parser/AutoconfUntilElement.java,
+ ui/editors/parser/AutoconfWhileElement.java,
+ ui/editors/parser/ITokenConstants.java,
+ ui/editors/parser/OldAutoconfParser.java,
+ ui/editors/parser/ParseException.java: More autoconf parser work.
+
+2008-04-09 14:38 Ed Swartz <ed.swartz@nokia.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/:
+ AutoconfEditorMacroValidator.java,
+ AutoconfEditorMessages.properties, AutoconfErrorHandler.java,
+ parser/AutoconfCaseConditionElement.java,
+ parser/AutoconfElement.java,
+ parser/AutoconfMacroArgumentElement.java,
+ parser/AutoconfMacroDetector.java, parser/AutoconfParser.java,
+ parser/AutoconfParser2.java, parser/AutoconfTokenizer.java,
+ parser/IAutoconfErrorHandler.java,
+ parser/IAutoconfMacroDetector.java, parser/IMacroDetector.java,
+ parser/ITokenConstants.java, parser/Token.java: New autoconf
+ parser work in progress
+
+2008-04-07 14:06 Ed Swartz <ed.swartz@nokia.com>
+
+ * META-INF/MANIFEST.MF,
+ src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfEditor.java,
+ src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfEditorMacroValidator.java,
+ src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfErrorHandler.java,
+ src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfMacroPartitionRule.java,
+ src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfMacroWordDetector.java,
+ src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfReconcilingStrategy.java,
+ src/com/redhat/eclipse/cdt/autotools/ui/editors/ParseException.java,
+ src/com/redhat/eclipse/cdt/autotools/ui/editors/outline/AutoconfLabelProvider.java,
+ src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfElement.java,
+ src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfMacroArgumentElement.java,
+ src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfMacroElement.java,
+ src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfOutlineErrorHandler.java,
+ src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfParser.java,
+ src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/IAutoconfErrorHandler.java,
+ src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/IAutoconfMacroValidator.java,
+ src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/ParseException.java:
+ Initial checkpoint for autotools parser changes
+
+
+2008-01-28 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/actions/AclocalHandler.java: New file for
+ future menu support.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsProjectNature.java: New file.
+ * META-INF/MANIFEST.MF: Release updated.
+ * plugin.properties: Add some new messages for autotools tool invocation.
+ * plugin.xml: Update release to 0.9.6. Add autotools project nature. Make
+ autotools commands enablement dependent on autotools project nature.
+ Specify enablesFor 1 for all autotools tool actions.
+ * src/com/redhat/eclipse/cdt/autotools/actions/AbstractTargetAction.java (setSelectedContainer): New
+ method for future menu support.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsMakefileBuilder.java (hasTargetBuilder): Use
+ AutotoolsProjectNature static addAutotoolsBuilder method.
+ (addAutotoolsBuilder): Moved to AutotoolsProjectNature.
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java (runScript): New method to
+ run scripts.
+ (regenerateMakefiles): Use runScript method to run configuration scripts. Use
+ runCommand for executables like "make".
+ (runCommand): Added comments.
+ * src/com/redhat/eclipse/cdt/autotools/wizards/ConvertToAutotoolsProjectWizardPage.java (convertProject):
+ Add new autotools project nature.
+ * src/com/redhat/eclipse/cdt/autotools/wizards/NewAutotoolsCCProjectWizard.java (addNature):
+ Ditto plus set up autotools builder.
+ (doRun): Don't set up autotools builder since it is done in addNature.
+ * src/com/redhat/eclipse/cdt/autotools/wizards/NewAutotoolsCProjectWizard.java (addNature):
+ Add new autotools project nature and set up autotools builder.
+ (doRun): Don't set up autotools builder since it is done in addNature.
+
+2007-12-05 Jeff Johnston <jjohnstn@redhat.com>
+
+ * plugin.xml: Update release to 0.9.5.3.
+
+2007-12-05 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #412651, #412661
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java (getConfigurePath): Fetch tool command
+ name instead of hard-wiring to "configure".
+ (autogenExists): Fetch command name from autogen.sh options.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsMakefileBuilder.java: (removeBuildDir): New method.
+ (clean): If user has specified remove build directory, then use removeBuildDir method.
+ * src/com/redhat/eclipse/cdt/autotools/Resources.properties: New messages for supporting
+ build directory removal operation.
+
+2007-11-28 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/LibHoverMessages.java: New File.
+ * src/com/redhat/eclipse/cdt/autotools/ui/LibHoverMessages.properties: New File.
+ * src/com/redhat/eclipse/cdt/autotools/ui/LibHover.java: Add references to
+ LibHoverMessages instead of hard-coded strings.
+ * libhoverdocs/glibc-2.7-2.xml: Regenerated.
+
+2007-11-27 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/LibHover.java
+ (HelpResource.getHref): Use latest glibc doc version.
+ (getLibHoverDocs): Ditto.
+ * libhoverdocs/glibc-2.7-2.xml: New C library docs based on glibc-2.7-2 manual.
+ * libhoverdocs/glibc.xml: Old glibc docs removed.
+
+2007-11-19 Jeff Johnston <jjohnstn@redhat.com>
+
+ * plugin.xml: Update release to 0.9.5.2. Also clear all OS lists for build definitions to
+ default to "all" OSes.
+
+2007-11-15 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #385991
+ * src/com/redhat/eclipse/cdt/autotools/ui/LibHover.java (getMatchingFunctions): New method.
+ (FunctionSummary.compareTo): New method to support Comparable interface.
+ (FunctionSummary.getIncludes): Fix to avoid type cast exception/
+ (getFunctionInfo): Revised to call getFunctionSummaryFromNode method.
+ (FunctionSummary): Add Comparable interface.
+ (getFunctionSummaryFromNode): New method.
+ (FunctionSummary.FunctionPrototypeSummary.getPrototypeString): Add NLS
+ comments.
+
+
+2007-11-01 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/properties/AutotoolsToolsPropertyPage.java: New File for
+ setting tool paths for the various autotools.
+ * src/com/redhat/eclipse/cdt/autotools/actions/InvokeAclocalAction.java (run): Use the
+ project properties setting to determine what tools to use.
+ * src/com/redhat/eclipse/cdt/autotools/actions/InvokeAutoconfAction.java (run): Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/actions/InvokeAutomakeAction.java (run): Ditto.
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/properties/AutotoolsPropertyMessages.properties: New
+ messages.
+ * src/com/redhat/eclipse/cdt/autotools/ui/properties/AutotoolsPropertyConstants.java: Add new
+ constants for setting the tool paths for aclocal, automake, and autoconf.
+ * plugin.xml: Add tools settings property page for Autotools.
+ * plugin.properties: New message for added property page.
+
+2007-10-30 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #359311, #359301, #359321
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfMacro.java: New File.
+ * src/com/redhat/eclipse/cdt/autotools/ui/properties/AutotoolsPropertyManager.java: New File.
+ * src/com/redhat/eclipse/cdt/autotools/ui/properties/IProjectPropertyListener.java: New File.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsProjectPropertyTester.java: New File.
+ * src/com/redhat/eclipse/cdt/autotools/ui/properties/IPropertyChangeManager.java: New File.
+ * src/com/redhat/eclipse/cdt/autotools/internal/text/hover/AutoconfTextHover.java:
+ (getAMDoc): New method.
+ (fBindingService):
+ (getAutomakeMacrosDocName): Modified to take a version parameter.
+ (getAutoconfMacrosDocName): Ditto.
+ (getPrototype): Changed to take an editor input.
+ (getAutoconfMacrosDocName): Ditto.
+ (AutotoolsHoverDoc): New internal class.
+ (getMacroList): New method to merge AC and AM macros together based on version
+ properties.
+ (getACDoc): New method.
+ (getIndexedInfo): Changed to take editor input.
+ (getHoverDoc): New metohd.
+ (getIndexedInfoFromDocument): New method that will parse the given document.
+ (getDefaultAutoconfMacrosDocName): New method to get the default preference
+ Autoconf macros doc name.
+ (getHoverRegion): Modified to get editor from elsewhere.
+ (getDefaultAutomakeMacrosDocName): New method to get the default preference
+ Autoconf AM macros doc name.
+ (getHoverInfo): Changed to take an editor input.
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfMacroParser.java: Removed.
+
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/editors/autoconf/ProjectionFileUpdater.java (initialize):
+ (processReconcile): Use stored editor.
+ (install): Change input parameter to AutoconfEditor.
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfParser.java (parseMacro):
+ (parse): Modified to take IEditorInput argument and pass that on to AutoconfErrorHandler.
+ (AutoconfParser): Modified to take an editor parameter.
+
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsDefaultBuildDirHandler.java: Updated
+ copyright to just Red Hat Inc.
+ * plugin.properties: New messages.
+ * plugin.xml: Add ICPropertyTab extension for editor properties. Add properties
+ page for Autotools properties.
+ * src/com/redhat/eclipse/cdt/autotools/ui/properties/AutotoolsEditorPropertyPage.java: New file.
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/properties/AutotoolsPropertyPage.java: Rewritten.
+ * src/com/redhat/eclipse/cdt/autotools/ui/properties/AutotoolsBuildPropertyPage.java:
+ * src/com/redhat/eclipse/cdt/autotools/ui/properties/AutotoolsPropertyConstants.java:
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfErrorHandler.java (AutoconfErrorHandler):
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfSourceViewerConfiguration.java
+ (AutoconfSourceViewerConfiguration): Take editor as parameter.
+ (getPresentationReconciler): Pass along or use editor passed in.
+ (getContentAssistant): Ditto.
+ (getReconciler): Ditto.
+ (getTextHover): Ditto.
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfDocumentProvider.java (connect):
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfMacroDamagerRepairer.java:
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfMacroContentAssistProcessor.java (computeCompletionProposals):
+ (AutoconfMacroContentAssistProcessor): Take editor input.
+ (computeMacroStart): Use editor.
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfReconcilingStrategy.java (reconcile):
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfEditor.java: Make this implement
+ IProjectPropertyListener
+ (handlePreferenceStoreChanged): Modified to call handleVersionChange method if a
+ autoconf or automake macro version preference change has occurred.
+ (doSetInput): Deregister editor as property listener if editor was for a project
+ file previously and register editor as property listener if editor is now for a
+ project.
+ (getAutoconfDocumentProvider): Make static.
+ (getAutoconfCodeScanner): Pass this to constructor.
+ (handleVersionChange): New method.
+ (handleProjectPropertyChanged): New IProjectPropertyListener method.
+ (initializeEditor): Pass this to source viewer configuration constructor.
+ (getAutoconfParser): Pass this to constructor.
+ (dispose): Deregister editor as property listener for a project if applicable.
+ (getAutoconfMacroCodeScanner): Pass this to constructor.
+
+2007-10-23 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfMacroCodeScanner.java: New File.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/RestrictedEndOfLineRule.java: New File.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfPartitionScanner.java (AutoconfPartitionScanner):
+ Move macro partitioning ahead of comments.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfSourceViewerConfiguration.java (getPresentationReconciler):
+ Use AutoconfMacroCodeScanner for macro damager repairer.
+ (getContentAssistant): Use AutoconfMacroCodeScanner for macro content assist.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfCodeScanner.java (nextToken):
+ New method that simply defaults to super.nextToken to be used for debugging purposes.
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfEditor.java (getAutoconfMacroCodeScanner):
+
+ * plugin.xml: Update to release 0.9.5.1.
+
+2007-10-23 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #330701
+ * src/com/redhat/eclipse/cdt/autotools/ui/properties/AutotoolsBuildPropertyPage.java: New File to
+ add property settings for how to clean an Autotools project and whether or not to use the
+ current Autotools info scanner.
+ * src/com/redhat/eclipse/cdt/autotools/ui/properties/AutotoolsPropertyMessages.java: New File.
+ * src/com/redhat/eclipse/cdt/autotools/ui/properties/AutotoolsPropertyConstants.java: New File.
+ * src/com/redhat/eclipse/cdt/autotools/ui/properties/AutotoolsPropertyMessages.properties: New File.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfParser.java (parseLines):
+ Process macros ahead of stripping out comments as this prevents removing quotes inside the
+ macro which have precedence over # (e.g. used to specify #include and not meaning a
+ comment to end of line).
+ (parseWhile): Change comment typo.
+ (parseFor): Ditto.
+ * plugin.properties: Add new messages regarding property pages.
+ * plugin.xml: Add Autotools build IcPropertyTab (AutotoolsBuildPropertyPage). Also
+ specify that AutotoolsDefaultBuildDirHandler is also an option applicability tester.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/AutotoolsPreferencesMessages.properties:
+ Change the message for autoconf and automake versions to include the word "Default".
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfPartitioner.java (computePartitioning):
+ Add override method as way to print out partitions. Cannot compute and print out partitions at
+ connect time as in 4.0.1 we initially are given an empty document that is later filled.
+ (printPartitions): Change argument to be an array of partition regions.
+
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsMakefileBuilder.java (build):
+ (clean): New method. Pay attention to user clean method preference.
+ (getTargets): Pay attention to user clean target preference.
+
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsScannerInfo.java (getCompilationString):
+ Pay attention to user preference on scanner info retrieval and disable if need be.
+ (createIncludeChain): Use AutotoolsPropertyConstants to get property names to use.
+ (followIncludeChain): Ditto.
+ (getMakefile): Add nls comments.
+ (AutotoolsScannerInfo): Ditto.
+ (getDefinedSymbols): Ditto.
+ (buildFile): Ditto.
+
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java (regenerateMakefiles): Don't
+ call AutotoolsScannerInfoProvider.setDirty method anymore. Instead, set a project property
+ to indicate the scanner info is dirty.
+ (addMakeTargetsToManager): Add a try/catch statement to prevent duplicate entries from
+ stopping loop that adds make targets.
+ (initializeBuildConfigDirs): Formatting change.
+
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsScannerInfoProvider.java (getScannerInformation):
+ Add a check for project property indicating the scanner info is dirty in which case call
+ setDirty method.
+ (setDirty): Make private.
+
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsDefaultBuildDirHandler.java: Now implements
+ IOptionApplicability.
+ (isOptionEnabled): New interface method to implement.
+ (isOptionVisible): Ditto.
+ (isOptionUsedInCommandLine): Ditto (set to false).
+
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsBuilder.java (getProject): New method.
+ (AutotoolsBuilder): Add project argument.
+ (getCleanBuildTarget): Implemented using new Autotools CLEAN_MAKE_TARGET property.
+
+ * src/com/redhat/eclipse/cdt/autotools/Resources.properties: Add new message.
+
+2007-10-09 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #323641
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsScannerInfo.java (getDefinedSymbols): Use
+ the patch provided by Jose Fonseca to provide a proper regular expression for parsing
+ the defined symbols from the make output.
+
+2007-10-05 Jeff Johnston <jjohnstn@redhat.com>
+
+ * plugin.xml: Ensure the ids for InvokeAutoconf and InvokeAutomake actions are unique.
+
+2007-10-04 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsDefaultBuildDirHandler.java (handleValue):
+ Add some place holders for supporting the user manually setting the build directory.
+ * src/com/redhat/eclipse/cdt/autotools/Resources.properties: Add some dialog messages for
+ future usage.
+ * plugin.xml: Update version to 0.9.5.
+
+2007-10-02 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #315811
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsDefaultBuildDirHandler.java: New File.
+ * plugin.xml: Change build definition to version 4.0.0. Remove unused project converter
+ extension. For build directory, specify an option handler which is implemented by
+ AutotoolsDefaultBuildDirHandler.
+
+2007-09-24 Andrew Overholt <overholt@redhat.com>
+
+ * plugin.xml: Update version to 0.9.4.
+
+2007-09-21 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/actions/InvokeAutoconfAction.java (run):
+ Fix array indexing.
+
+2007-09-18 Jeff Johnston <jjohnstn@redhat.com>
+
+ * plugin.xml: Add ELF and GNU_ELF binary parsers as default for an Autotools project.
+
+2007-09-05 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #274551
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsScannerInfo.java (getCompilationString): Support
+ the case where the file isn't part of the build and there is no scanner info to gather.
+ (buildFile): Minor cosmetic changes.
+
+ * META-INF/MANIFEST.MF: Update release.
+
+2007-09-04 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java (regenerateMakefiles): Add a
+ clause to check for the case whereby there was no way to generate the Makefile and one
+ didn't already exist.
+ * src/com/redhat/eclipse/cdt/autotools/Resources.properties (Makegenerator.didnt.generate):
+ New message.
+
+2007-08-24 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #254248
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/outline/AutoconfContentOutlinePage.java (selectionChanged):
+ Make call to editor.selectAndReveal method to focus editor page on selected outline item.
+
+2007-08-24 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #254246
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/CWordFinder.java (findWord): Fix
+ to handle being in the first word of the file.
+
+2007-08-17 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #253331
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsMakefileBuilder.java (build): Enable
+ autobuilding.
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java (regenerateMakefiles): If
+ the configuration options change, clean the previous build directory so a full rebuild
+ will occur.
+
+2007-08-15 Jeff Johnston <jjohnstn@redhat.com>
+
+ * META-INF/MANIFEST.MF: Change release to 0.9.2 and specify minimum java runtime as
+ 1.4.
+
+2007-08-15 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #251412
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsMakefileBuilder.java (addAutotoolsBuilder):
+ When calling IProject.setDescription(), pass a NullProgressMonitor instead of
+ null, despite what the function API says because an isCancelled() call may occur
+ and will result in an exception thrown. Also, use a try/catch block to handle any
+ of the legitimate exceptions that might occur in this operation.
+
+2007-08-15 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/Resources.properties: Add new messages
+ for new C and C++ project wizards.
+ * src/com/redhat/eclipse/cdt/autotools/wizards/NewAutotoolsProjectWizard.java: Renamed...
+ * src/com/redhat/eclipse/cdt/autotools/wizards/NewAutotoolsCProjectWizard.java: ..to this.
+ (doRun): Rewritten based on conversion wizard to properly set up project.
+ (getProjectType): New method.
+ * src/com/redhat/eclipse/cdt/autotools/wizards/NewAutotoolsCCProjectWizard.java: New file
+ copied from NewAutotoolsCProjectWizard but inherits from NewCCProjectWizard.
+
+ * icons/dlcl16/newc_app.gif: New gif.
+ * icons/dlcl16/newcc_app.gif: Ditto.
+ * icons/elcl16/newc_app.gif: Ditto.
+ * icons/elcl16/newcc_app.gif: Ditto.
+
+ * plugin.properties: Add new strings for new C and C++ project wizards.
+ * plugin.xml: Add new C and C++ project wizards.
+
+2007-08-09 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #251604
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java (getAutogenArgs): New method.
+ (regenerateMakefiles): Pass user-specified autogen.sh options when invoking autogen.sh.
+ * plugin.xml: Add autogen.sh tool support with user options.
+ * plugin.properties: Add new autogen tool message strings.
+
+2007-07-24 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfEditor.java
+ (handlePreferenceStoreChanged): Add support for changing automake macros version.
+ * src/com/redhat/eclipse/cdt/autotools/internal/text/hover/AutoconfTextHover.java
+ (getAutomakeMacrosDocument):
+ New method.
+ (getIndexInfo, getPrototype): Create private versions of these that take a document
+ as an input parameter. Change the public static methods to call the private
+ versions with the autoconf macro document and the automake macro document, if
+ the macro isn't found yet.
+ (init): Set up the autoconf macro document and automake macro document.
+ (reinit): Reset both the autoconf and automake macro documents.
+
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/AutoconfEditorPreferencePage.java
+ (LATEST_VERSION): Replace with LATEST_AC_VERSION and LATEST_AM_VERSION.
+ (createOverlayStore): Add automake version setting.
+ (initializeVersion): Replace with initializeACVersion and initializeAMVersion.
+ (initialize): Call the two replacements of initializeVersion.
+ (createVersionTabContent): Add automake version support.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/AutotoolsEditorPreferenceConstants.java
+ Add automake version support.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/AutotoolsPreferencesMessages.properties:
+ Add messages used in automake version preference.
+
+ * libhoverdocs/ammacros-1.4-p6.xml: New automake macro docs for 1.4-p6.
+ * libhoverdocs/ammacros-1.9.5.xml: New automake macro docs for 1.9.5.
+ * libhoverdocs/ammacros-1.9.6.xml: New automake macro docs for 1.9.6.
+
+2007-07-17 Jeff Johnston <jjohnstn@redhat.com>
+
+ * MANIFEST.MF: Bump up release to 0.9.1.
+
+2007-07-16 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/GNUAutomakefile.java
+ (parse): Fix Automake if/else constructs to be child/parent directives as appropriate.
+ (bypassIf, bypassElse, isTrue): Removed.
+ (parseIf): Add rules parameter.
+ (addDirective): Remove caveat when dealing with automake if/else.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/IAutomakeConditional.java
+ (getRules, setRules): New methods for the interface.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/Else.java: Add ICommand
+ interface and implement required methods including new ones add to IAutomakeConditional.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/If.java: Ditto.
+
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeErrorHandler.java
+ (update): Change to call checkChildren for makefile.
+ (checkChildren): New recursive method to check for bad directives.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileContentOutlinePage.java
+ (AutomakefileLabelProvider.getImage): Add support for IAutomakeConditional elements and
+ remove reference to AutomakeIfElse class.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeMacroDefinitionRule.java
+ (isValidCharacter): Add support for "+-$()@" chars.
+
+2007-07-11 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/GNUAutomakefile.java
+ (parseIf): Add @if support.
+ (isTrue): Default to true for if conditions.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/GNUMakefileConstants.java:
+ Add @if and @endif macros.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/GNUMakefileUtil.java
+ (isIf): Add @if support.
+ (isEndif): Add @endif support.
+
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileCodeScanner.java:
+ Add support for @if and @endif keywords.
+ (createRules): Add support for whitespace and simple identifiers.
+
+2007-07-09 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #247518
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileCodeScanner.java
+ (createRules): Use new AutoconfSubstRule class for identifying autoconf substituitions.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileUtil.java (isConfigMacro):
+ Refine so that macro must start and end with @ and contain at least one valid char.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutoconfSubstRule.java: New file.
+
+2007-07-06 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #246153
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeDocumentProvider.java (createFileInfo):
+ Rewrite to handle workspace files as well as external ones.
+ (createMakefile): Change to accept a file name rather than an IFile.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeEditor
+ (getDefault): New method.
+ (doSetInput): Ditto.
+ (initializeEditor): Add a few lines that would have been performed by
+ base class initializeEditor.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeErrorHandler
+ (AutomakeMarker): New internal class for error marking.
+ (update): Switch to using internal markers and directly updating the
+ Annotation model.
+ (removeExistingMarkers): Directly reference the annotation model.
+ (AutomakeErrorHandler): Fetch and store the annotation model for the input.
+ Change prototype.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileReconcilingStrategy.java
+ (AutomakefileReconcilingStrategy): Change to store an IEditorInput. Use new
+ AutomakeErrorHandler interface.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MakefileEditor.java
+ (initializeEditor): Remove fixme comment.
+
+2007-07-04 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #246783
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeEditor.java:
+ (initializeEditor): Call AutotoolsEditorPreferenceConstants.initializeDefaultValues
+ to ensure the editor default values are set.
+
+2007-06-29 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #246154
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsBuilder.java: New proxy
+ class to wrap an existing IBuilder and override build path functionality.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsMakefileBuilder.java:
+ (build): Wrap the builder using the new AutotoolsBuilder class so the
+ build path will work properly.
+
+2007-06-28 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #246134
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfErrorHandler.java:
+ (AutoconfErrorHandler): Change constructor to just take IDocument input.
+ (AutoconfMarker): New private class for marking autoconf document.
+ (createMarker): New private method to create AutoconfMarker in document.
+ (handleError): Create a marker and add it to annotation model durectly
+ instead of using MarkerUtilities.
+ (removeAllMarkers): Remove directly from annotation model instead of using file.
+ (removeExistingMarkers): Ditto.
+ (getDocument): New method.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfDocumentProvider.java:
+ (connect): Change constructor call to AutoconfErrorHandler.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfEditor.java:
+ (getViewer): New method to return the source viewer for the editor.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfMacroParser.java:
+ (AutoconfMacroParser): Change constructor call to AutoconfErrorHandler.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfParser.java:
+ Change all uses of AutoconfOutlineErrorHandler to AutoconfErrorHandler.
+
+2007-06-26 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #245820
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileUtil.java (isAutomakeCommand):
+ New method.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/Conditional.java (isIf): New
+ method.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/IAutomakeConditional.java:
+ New interface.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/Else.java: Changed to
+ implement new IAutomakeConditional interface.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/If.java: New file.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/GNUAutomakefile.java
+ (parse): Add Automake if/else parsing and support for Makefile.in processed if/else blocks.
+ (bypassIf, bypassElse, parseIf): New private methods.
+ (addDirective): Don't add directives to an Automake if or else construct.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/GNUMakefileConstants.java:
+ Add CONDITIONAL_IF constant.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/GNUMakefileUtil.java
+ (isIf): New method.
+
+2007-06-25 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MakefileEditorTogglePresentationAction.java:
+ New file.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MakefileEditorActionContributor.java: Ditto.
+
+ * icons/etool16/alphab_sort_co.gif: New icon.
+ * icons/etool16/build_menu.gif: Ditto.
+ * icons/etool16/convert_normal.gif: Ditto.
+ * icons/etool16/make.gif: Ditto.
+ * icons/etool16/makefile.gif: Ditto.
+ * icons/etool16/newc_app.gif: Ditto.
+ * icons/etool16/newcc_app.gif: Ditto.
+ * icons/etool16/segment_edit.gif: Ditto.
+ * icons/etool16/target_add.gif: Ditto.
+ * icons/etool16/target_build.gif: Ditto.
+ * icons/etool16/target_delete.gif: Ditto.
+ * icons/etool16/target_edit.gif: Ditto.
+ * icons/etool16/target_filter.gif: Ditto.
+ * icons/etool16/update_old.gif: Ditto.
+
+ * plugin.xml: Change Automake editor to use new internal MakefileEditorActionContributor
+ class rather than point to the internal one in internal CDT make.
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfDocumentSetupParticipant.java:
+ (setup): Don't bother registering this as document listener.
+ (documentAboutToBeChanged): Remove body of method as this is no longer needed.
+
+2007-06-25 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #245611
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfMacroContentAssistProcessor.java
+ (getMacroList): Change to call AutoconfTextHover to get the name of the macros
+ document since it will depend on current preferences.
+ * src/com/redhat/eclipse/cdt/autotools/internal/text/hover/AutoconfTextHover.java
+ (getAutoconfMacrosDocName): New static method.
+
+2007-06-19 Jeff Johnston <jjohnstn@redhat.com>
+
+ * libhoverdocs/acmacros-2.59.xml: New autoconf hover text and syntax info
+ for autoconf 2.59.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/AutoconfEditorPreferencePage.java:
+ Add 2.59 support.
+
+2007-06-18 Jeff Johnston <jjohnstn@redhat.com>
+
+ * libhoverdocs/acmacros-2.13.xml: New autoconf hover text and syntax info
+ for autoconf 2.13.
+ * libhoverdocs/acmacros-2.61.xml: New autoconf hover text and syntax info
+ for autoconf 2.61.
+ * libhoverdocs/acmacros.xml: Replaced with files above.
+
+ * src/com/redhat/eclipse/cdt/autotools/internal/text/hover (init): Change document
+ to be dependent on autoconf version preference.
+ (reinit): New method to force reinitialization of help document.
+ (getPrototype): Fix to allow for earlier versions which specify multiple
+ prototypes in one using "[,", for example.
+
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/AutoconfEditorPreferencePage.java:
+ Add version preference support.
+ (createOverlayStore): Add version support.
+ (createContents): Add version tab.
+ (initializeVersion): New method.
+ (createVersionTabContents): Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/AutotoolsEditorPreferenceConstants.java:
+ Add AUTOCONF_VERSION and initialize the default autoconf version value to be the
+ highest possible.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/AutotoolsPreferencesMessages.properties:
+ Add new messages pertaining to autoconf version.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfEditor.java (handlePreferenceStoreChanged):
+ If the autoconf version is changed, invalidate the document and force a reparse.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfEditorMessages.java (getFormattedString):
+ Add new method which takes 3 replacement strings.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfEditorMessages.properties:
+ Change macro error messages to take the autoconf version as a parameter.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfParser.java: Fix
+ typo for too many args message id.
+ (parseMacro): For wrong number of argument messages, get the current autoconf version preference
+ and pass it in to the message.
+
+2007-06-07 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/Automakefile.java: Rebase on
+ GNUAutomakefile class. Remove all parsing methods.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeDocumentProvider.java: Fix
+ comments to refer to internal Autotools classes as appropriate.
+
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/Conditional.java: New file.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/DefineVariable.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/DeleteOnErrorRule.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/Else.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/Endef.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/Endif.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/ExportAllVariablesRule.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/ExternalEditorInput.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/GNUAutomakefile.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/GNUTargetRule.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/GNUVariableDef.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/Ifdef.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/Ifeq.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/Ifndef.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/Ifneq.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/Include.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/IntermediateRule.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/LowResolutionTimeRule.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/NotParallelRule.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/OverrideDefine.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/OverrideVariable.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/PhonyRule.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/SecondaryRule.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/StaticTargetRule.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/TargetVariable.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/Terminal.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/UnExport.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/VPath.java: Ditto.
+
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/ExternalEditorInput.java: Update comments
+ that should refer to internal Autotools classes.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/MakefileDocumentProvider.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/ProjectionMakefileUpdater.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/WorkingCopyManager.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/editors/autoconf/ProjectionFileUpdater.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/AutoconfEditorPreferencePage.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/AutomakeEditorPreferencePage.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfDocumentProvider.java: Ditto.
+
+2007-06-07 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #243184
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeConfigMacro.java: New file.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/Automakefile.java (parse): Add
+ support for autoconf macros.
+ (parseConfigMacro): New method.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileCodeScanner.java
+ (createRules): Add rule for configure macros.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileContentOutlinePage.java
+ (getImage): Add support for AutomakeConfigMacro.
+ (getText): Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileUtil.java (isConfigMacro):
+ New method.
+
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/MakeUIImages.java: Add acmacro_obj image.
+ * icons/obj16/acmacro_obj.gif: New icon.
+
+2007-06-05 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/actions/BuildSpecial.java: Removed. No
+ longer used now that MakeTargets work.
+ * src/com/redhat/eclipse/cdt/autotools/actions/CheckboxTablePart.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/actions/MakeContentProvider.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/actions/MakeTargetDialog.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/actions/SharedPart.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/actions/SharedPartWithButtons.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/actions/StructuredViewerPart.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/actions/TargetListViewerPart.java: Ditto.
+
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/editors/autoconf/ProjectionFileUpdater.java: New file.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/AutotoolsEditorPreferenceConstants.java:
+ Add new constants for Autoconf editor folding.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/IAutotoolsEditor.java: New interface.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfEditor.java: Make class
+ implement IAutotoolsEditor interface. This allows ProjectionFileUpdater class to
+ work. Add folding support based on MakefileEditor class.
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfElement.java
+ (getStartOffset, setStartOffset, getEndLineNumber, setEndLineNumber): New methods.
+ (getEndOffset, setEndOffset, getLastChild): Ditto.
+ (AutoconfElement): New constructor which takes start offset.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfCaseElement.java:
+ Add new constructor to match that of AutoconfElement.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfElifElement.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfElseElement.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfForElement.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfIfElement.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfMacroElement.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfWhileElement.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfParser.java:
+ (AutoconfLineReader): New internal class to replace LineNumberReader class. Change
+ all internal parse routines to use this class instead of LineNumberReader.
+ (parseLines): When a semicolon is found that denotes a multistatement line, update the end
+ offset of the previous construct and set the start offset for the next construct to be after
+ the semicolon and additional whitespace.
+ (parseMacro, parseIf, parseElif, parseElse, parseCase, parseFor, parseWhile): Construct with
+ start offset based on previous mark. After processing, set the end line number for the
+ element.
+
+2007-06-01 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeEditor.java:
+ Refactor AutomakeEditorPreferenceConstants to AutotoolsEditorPreferenceConstants.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/ColorManager.java: Moved from here to..
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/ColorManager.java: ...here
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeEditorFactory.java:
+ Changed due to movement of ColorManager class.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileCodeScanner.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/AbstractMakefileCodeScanner.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MakefileCodeScanner.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MakefileSourceConfiguration.java: Ditto.
+
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/AbstractAutomakeEditorPreferencePaga.java:
+ Refactored to be...
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/AbstractEditorPreferencePage.java:
+ ...this.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/AutoconfEditorPreferencePage.java: New file.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/AutomakeEditorPreferenceConstants.java:
+ Refactored to be...
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/AutotoolsEditorPreferenceConstants.java:
+ ...this.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/AutomakePreferencesMessages.java:
+ Refactored to be...
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/AutotoolsPreferencesMessages.java:
+ ...this.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/AutomakePreferencesMessages.properties:
+ Refactored to be...
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/AutotoolsPreferencesMessages.properties:
+ ...this.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/AutomakeEditorPreferencePage.java:
+ Use new refactored classes.
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfCodeScanner.java: Add color preference
+ support.
+ (AutoconfCodeScanner): A color provider is no longer needed as input.
+ (getToken, getTokenProperties, addToken, indexOf, affectsBehavior): New methods.
+ (adaptToPreferenceChange, adaptToColorChange, adaptToStyleChange); Ditto.
+ (createTextAttribute, initialize): Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfColorProvider.java: Removed and replaced
+ with ColorManager.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfEditor.java: Change to use
+ ColorManager.
+ (initializeEditor): Set the preference change store and initialize the editor preferences.
+ (getAutoconfCodeScanner): Changed to match new AutoconfCodeScanner constructor.
+ (getPreferenceColor): New method.
+ (getColorProvider): Removed.
+ (handlePreferenceStoreChanged): New method.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfSourceViewerConfiguration.java:
+ Inherit from TextSourceViewerConfiguration. Store the preference store.
+ * plugin.properties: Add new internationalized string for Autoconf editor preferences.
+ * plugin.xml: Add Autoconf editor preference page.
+
+2007-05-30 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #241908
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java (addMakeTargetsToManager):
+ Change builder id used to one used in plugin.xml.
+
+2007-05-30 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #241782
+ * src/com/redhat/eclipse/cdt/autotools/Resources.properties: Add new message
+ for Autotools preference page.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeEditor.java
+ (initializeEditor): Initialize color and folding preference defaults.
+ (handlePreferenceStoreChanges): Call super method to refresh editor.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/ColorManager.java:
+ Change constants to be in Autotools domain.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/AbstractAutomakeEditorPreferencePage.java:
+ New file.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/AutomakeEditorPreferenceConstants.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/AutomakeEditorPreferencePage.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/AutomakePreferencesMessages.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/AutomakePreferencesMessages.properties:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/AutotoolsPreferencePage.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/ColorEditor.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/OverlayPreferenceStore.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/StatusInfo.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/preferences/TabFolderLayout.java: Ditto.
+
+ * plugin.properties: Add new internationalized strings from plugin.xml.
+ * plugin.xml: Add Autotools and Automake Editor preference pages. Also
+ clean up some extensions to use internationalized strings.
+
+2007-05-28 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #241612
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsPlugin.java:
+ Add utility methods from MakeUIPlugin to log messages and
+ issue error dialogs, etc..
+ * src/com/redhat/eclipse/cdt/autotools/actions/MakeTargetDialog.java:
+ Use MakeUIMessages instead of MakeUIPlugin for messages.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeCompletionProcessor.java:
+ Replace internal CDT classes with internal Autotools classes.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeDocumentProvider.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeEditor.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeEditorFactory.java:
+ Ditto.
+ (getPreferenceColor): New method.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeErrorHandler.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/Automakefile.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileCodeScanner.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileContentOutlinePage.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileReconcilingStrategy.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileSourceConfiguration.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeIfElse.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeMacroDefinitionRule.java:
+ Ditto.
+ (evaluate): Remove unused local variable ch.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeTextHover.java: Ditto.
+
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/AbstractElementListSelectionDialog.java:
+ New file transported from CDT internals.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/AbstractMakefile.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/AbstractMakefileCodeScanner.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/AddBuildTargetAction.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/ArchiveTarget.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/BadDirective.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/ColorManager.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/Command.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/Comment.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/CompletionProposalComparator.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/DefaultRule.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/Directive.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/EditorUtility.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/ElementListSelectionDialog.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/EmptyLine.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/ExternalEditorInput.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/ExternalEditorInputFactory: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/GNUMakefileConstants.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/IgnoreRule.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/IMakefileDocumentProvider.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/IMakefileEditorActionDefinitionIds.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/InferenceRule.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/IReconcilingParticipant.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/ISelectionValidator.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/ITranslationUnitEditorInput.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/LexicalSortingAction.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MacroDefinition.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MacroDefinitionRule.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MacroReferenceRule.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MakefileAnnotationHover.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MakefileCodeScanner.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MakefileCompletionProcessor.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MakefileConstants.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MakefileContentOutlinePage.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MakefileDocumentProvider.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MakefileDocumentSetupParticipant.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MakefileEditor.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MakefileEditorPreferenceConstants.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MakefileMessages.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MakefilePartitionScanner.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MakefileReader.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MakefileReconcilingStrategy.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MakeFileResources.properties: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MakefileSourceConfiguration.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MakefileStorageDocumentProvider.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MakefileTextHover.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MakefileWordDetector.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/MessageLine.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/NullMakefile.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/OpenDeclarationAction.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/OpenIncludeAction.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/Parent.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/PosixMakefileUtil.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/PosixRule.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/PreciousRule.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/ProjectionMakefileUpdater.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/Rule.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/SccsGetRule.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/SelectionList.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/SilentRule.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/SpecialRule.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/StatusInfo.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/StringMatcher.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/SuffixesRule.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/Target.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/TargetRule.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/TwoArrayQuickSort.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/Util.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/VariableDefinition.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/WordPartDetector.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/editors/automake/WorkingCopyManager.java: Ditto.
+
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/AutotoolsPluginImages.java: Switch to
+ use new ac16 icon directory instead of etools16.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/ErrorParserBlock.java: Use
+ MakeUIMessages instead of MakeUIPlugin for messages.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/MakeUIImages.java: Use
+ AutotoolsPlugin for error dialogs. Add new images.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/MakeUIMessages.java: New file.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/MakeUIPlugin.java: Removed.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/MessageLine.java: Fix typo.
+
+ * src/com/redhat/eclipse/cdt/autotools/internal/wizards/AutotoolsWizardMessages.java:
+ Fix bundle id for messages.
+
+ * plugin.xml: Fix icon references.
+
+ * icons/ac16: New folder containing icons that used to be in etool16.
+ * icons/dlcl16/build_configs.gif: New icon.
+ * icons/dlcl16/open_include.gif: Ditto.
+ * icons/elcl16/build_configs.gif: Ditto.
+ * icons/elcl16/open_include.gif: Ditto.
+ * icons/dtool16/alphab_sort_co.gif: Ditto.
+ * icons/dtool16/build_menu.gif: Ditto.
+ * icons/dtool16/convert-normal.gif: Ditto.
+ * icons/dtool16/make.gif: Ditto.
+ * icons/dtool16/makefile.gif: Ditto.
+ * icons/dtool16/newc_app.gif: Ditto.
+ * icons/dtool16/newcc_app.gif: Ditto.
+ * icons/dtool16/segment_edit.gif: Ditto.
+ * icons/dtool16/target_add.gif: Ditto.
+ * icons/dtool16/target_build.gif: Ditto.
+ * icons/dtool16/target_delete.gif: Ditto.
+ * icons/dtool16/target_edit.gif: Ditto.
+ * icons/dtool16/update_old.gif: Ditto.
+ * icons/etool16: Move autoconf editor icons to ac16 folder.
+ * icons/obj16/command_obj.gif: New icon.
+ * icons/obj16/define_obj.gif: Ditto.
+ * icons/obj16/environment_obj.gif: Ditto.
+ * icons/obj16/envvar_obj.gif: Ditto.
+ * icons/obj16/error_obj.gif: Ditto.
+ * icons/obj16/hfolder_obj.gif: Ditto.
+ * icons/obj16/include_obj.gif: Ditto.
+ * icons/obj16/irule_obj.gif: Ditto.
+ * icons/obj16/lib_obj.gif: Ditto.
+ * icons/obj16/macro_obj.gif: Ditto.
+ * icons/obj16/relation_obj.gif: Ditto.
+ * icons/obj16/target_obj.gif: Ditto.
+ * icons/obj16/trule_obj.gif: Ditto.
+
+2007-05-14 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java:
+ (addMakeTargetsToManager): Use MakeCorePlugin to get an IMakefile
+ rather than use the internal PosixMakefile class directly.
+
+2007-05-14 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java:
+ (initialize): Store the configuration for later usage.
+ (getConfigSettingsPath): Use stored configuration instead of fetching
+ it each time.
+ (runCommand): Ditto.
+ (addMakeTargetsToManager): Use the real MakeTargetManager to store
+ targets. Mark targets added by parsing the Makefile with special
+ tag. Delete all MakeTargets with special tag before adding the
+ new targets.
+ (initializeBuildConfigDirs): Use stored configuration to get the
+ tool options rather than the ManagedBuildInfo.
+ (getConfigArgs): Ditto.
+ (addMakeTargetsToManager):
+
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsMakefileBuilder.java:
+ Inherit from CommonBuilder.
+ (build): Change to fetch make target name from args map and store for
+ later use.
+ (getTargets): Change to get make target from stored make target name.
+
+ * plugin.xml: Remove Build Special Targets menu item as it is no longer
+ needed. Add MakeTargetBuilder extension so we can use MakeTargets.
+
+2007-05-11 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #239886
+ * src/com/redhat/eclipse/cdt/autotools/actions/InvokeAclocalAction.java (run):
+ Pass the CWD to TwoInputDialog and use it when executing the command. On
+ success, show a success dialog.
+ * src/com/redhat/eclipse/cdt/autotools/actions/InvokeAutoconfAction.java (run):
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/actions/TwoInputDialog.java (TwoInputDialog):
+ Take the CWD as a parameter.
+ (createDialogArea): Add label with CWD.
+
+ * src/com/redhat/eclipse/cdt/autotools/actions/InvokeAutomakeAction.java (run):
+ * src/com/redhat/eclipse/cdt/autotools/actions/InvokeMessages.java (getString):
+ Add comments.
+ (getFormattedString): New method.
+
+ * src/com/redhat/eclipse/cdt/autotools/actions/InvokeAction.java (getExecDir):
+ New method to return the CWD.
+ (showSuccess): New method to display a success dialog.
+
+ * src/com/redhat/eclipse/cdt/autotools/actions/InvokeMessages.properties: Add new
+ messages.
+
+2007-05-10 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #238173
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfIdentifierRule.java (evaluate):
+ Cast read character to char before invoking Character methods to avoid gcj bug.
+
+2007-04-30 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #238493
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/RecursiveSingleLineRule.java (evaluate):
+ Add check for scanner column < 0 which means we are already at EOF.
+
+2007-04-25 jjohnstn <jjohnstn@toocool.toronto.redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/wizards/NewAutotoolsProjectOptionPage.java (ManagedWizardOptionBlock.setupHelpContextIds):
+ Switch to use CDTHelpContextIds for static help context id.
+ * src/com/redhat/eclipse/cdt/autotools/wizards/CProjectPlatformPage.java (createControl):
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/wizards/ManagedProjectOptionBlock.java (createContents):
+ Ditto.
+
+2007-04-25 Jeff Johnston <jjohnstn@redhat.com>
+
+ Bugzilla #182821
+
+ 2007-04-25 Mikhail Sennikovsky
+ * plugin.xml: Add plugin extensions which let the CDT know that includes and
+ defined symbols are supported for the Autotools tool-chain.
+
+2007-04-12 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #236304
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java (runCommand): Use the
+ job description as a message in the console.
+ (regenerateMakefiles): Fix autogen.sh logic to run configure after invoking
+ autogen.sh if config.status doesn't exist. Make sure console is reused for
+ 2nd step. Change some of the status messages with new ones.
+ (autogenExists): Fix bug where path to autogen.sh wasn't being set on return.
+ * src/com/redhat/eclipse/cdt/autotools/Resources.properties: Add new MakeGenerator messages.
+
+2007-04-11 jjohnstn <jjohnstn@toocool.toronto.redhat.com>
+
+ Bugzilla #236077
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/CWordFinder.java: New file.
+ * src/com/redhat/eclipse/cdt/autotools/internal/text/hover/AutoconfTextHover.java: Replace
+ CDT internal classes with Autotools internal classes.
+ * src/com/redhat/eclipse/cdt/autotools/internal/wizards/ManagedProjectOptionBlock.java (createContents):
+ Replace WorkbenchHelp reference with non-deprecated alternative.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsMakeTargetManager.java: Fix
+ imports.
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java (runCommand): Replace
+ deprecated environmental variable method being used.
+ (createFile): Make protected instead of private.
+ (getInvalidDirList): Remove.
+ * src/com/redhat/eclipse/cdt/autotools/wizards/ConvertToAutotoolsProjectWizardPage.java (convertProject):
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsPlugin.java (getWorkingCopyManager):
+ Moved into AutomakeEditorFactory.
+ (getAutomakefileDocumentProvider): Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeEditorFactory.java: New file.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeCompletionProcessor.java:
+ Change all calls to getWorkingCopyManager and getAutomakefileDocumentProvider to use
+ new AutomakeEditorFactory class.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeEditor.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileContentOutlinePage.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileReconcilingStrategy.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeCompletionProcessor.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfEditorMessages.java (getResourceBundle):
+ New method.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfEditorMessages.properties: Add
+ new messages that were formerly fetched internally from CDT.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfEditor.java: Comment out unused
+ projectSupport.
+ (createActions): Use AutoconfEditorMessages.
+ (InformationDispatchAction.makeAnnotationHoverFocusable): Ditto.
+ (fProjectionModelUpdater): Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfAnnotationHover.java (formatMultipleMessages):
+ Use AutoconfEditorMessages instead of CUIMessages.
+ * src/com/redhat/eclipse/cdt/autotools/interenal/ui/ErrorParserBlock.java: New file.
+ * src/com/redhat/eclipse/cdt/autotools/wizards/CProjectPlatformPage.java (createControl): Remove
+ usage of WorkbenchHelp class which is deprecated.
+ * src/com/redhat/eclipse/cdt/autotools/wizards/NewAutotoolsProjectOptionPage.java (ManagedWizardOptionBlock.setupHelpContextIds):
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/wizards/ConvertToAutotoolsProjectWizardPage.java (convertProject):
+ Remove unused code. Switch to use non-deprecated interface for getting
+ indexer.
+
+2007-04-10 jjohnstn <jjohnstn@toocool.toronto.redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/wizards/NewAutotoolsProjectWizard.java:
+ Removed.
+ * src/com/redhat/eclipse/cdt/autotools/wizards/NewAutotoolsProjectOptionPage.java:
+ Use new internal ManagedProjectOptionBlock class.
+ * src/com/redhat/eclipse/cdt/autotools/wizards/CProjectPlatformPage.java:
+ Switch to use new AutotoolsWizardMessages internal class.
+ * src/com/redhat/eclipse/cdt/autotools/wizards/ConvertToAutotoolsProjectWizardPage.java:
+ Fix imports.
+ * src/com/redhat/eclipse/cdt/autotools/wizards/ConvertToAutotoolsProjectWizard.java (doRunEpilogue):
+ Switch to new IRunnableWithProgress interface.
+ * src/com/redhat/eclipse/cdt/autotools/internal/wizards/AutotoolsWizardMessages.java:
+ New file to support old wizard code.
+ * src/com/redhat/eclipse/cdt/autotools/internal/wizards/AutotoolsWizardMessages.properties:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/wizards/ConfigurationContentProvider.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/wizards/ConfigurationLabelProvider.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/wizards/ManagedProjectOptionBlock:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/AutotoolsPluginImages.java:
+ Add build_configs.gif for Wizard support.
+ * src/com/redhat/eclipse/cdt/autotools/internal/MarkerGenerator.java (addMarker):
+ New method required by IMarkerGenerator interface.
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java (getProject):
+ New method.
+ (initializeBuildConfigDirs): Change the default build directory
+ for the configuration's builder.
+ Add support for CDT 4.0 M6.
+ * cdtpatches/*: Removed.
+ * icons/eclcl16: New icon directory.
+ * icons/eclcl16/build_configs.gif: New icon.
+ * plugin.properties: Add new strings used in plugin.xml.
+ * plugin.xml: Add buildType and buildArtefactType extensions. Add
+ toolchain to Autotools project buildDefinitions extension.
+
+2007-04-04 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #235076
+ * src/com/redhat/eclipse/cdt/autotools/wizards/CProjectPlatformPage.java (CProjectPlatformPage):
+ Add missing NLS comment.
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java (makefileCvsExists): Use
+ getMakefileCVSPath method.
+ (configureExists): Use getConfigurePath method.
+ (getConfigurePath): New method.
+ (getMakefileCVSPath): New method.
+ (regenerateMakefiles): Use getConfigurePath and getMakefileCVSPath to get the
+ command to use when either of these is found to exist.
+ (autogenExists): Change to protected method.
+
+2007-03-30 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfMacroDamagerRepairer.java (createPresentation):
+ Comment out macro parsing as this is now done by the reconciler and overall parsing.
+ * src/com/redhat/eclipse/cdt/autotools/internal/text/hover/AutoconfTextHover.java (getPrototype):
+ Fix so it is properly setting minimum and maximum parm counts for a macro.
+ * src/com/redhat/eclipse/cdt/autotools/internal/text/hover/AutoconfPrototype.java (setMaxParms):
+ Fix typo.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfParser.java (matchParentheses):
+ Update logic.
+ (parseMacro): Add error checking for minimum and maximum parameters as well as unmatched
+ parentheses or square-brackets.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfMacroElement.java (setParmCount):
+ New method.
+ (setQuoteDepth): Ditto.
+ (getParmCount): Ditto.
+ (getQuoteDepth): Ditto.
+ (setDepth): Ditto.
+ (getDepth): Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfEditorMessages.properties: Add
+ new error messages for parsing of macros.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/outline/AutoconfContentOutlinePage (update):
+ Use viewer refresh instead of redraw when updating.
+ (updateSelection): New method.
+
+2007-03-19 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/Makegenerator.java (regenerateMakefiles):
+ Refine algorithm so we don't cause a reconfigure if the configuration settings
+ file doesn't contain the project name. If the configuration arguments are
+ unchanged and the settings file is the old style, rewrite with project
+ name.
+
+2007-03-19 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #230128
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java (saveConfigArgs): Add
+ the project name as first argument saved.
+ (regenerateMakefiles): Read off first argument and verify that it matches the
+ current project name.
+
+2007-03-19 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #232965
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java (runCommand):
+ Change prototype to accept a console and a boolean which when true
+ means to restart the console which may possibly clear the console.
+ (regenerateMakefiles): Change calls to runCommand. For multiple
+ actions (e.g. autogen.sh then configure), opt for the 2nd, 3rd, etc...
+ calls to not clear the console. Don't run config.status unless
+ the top-level Makefile is missing.
+ * src/com/redhat/eclipse/cdt/autotools/Resources.properties: Add new
+ MakeGenerator.unsupportedConfig message.
+
+2007-03-16 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java (regenerateMakefiles):
+ If configuration parameters have changed, mark all Scanner Info as dirty.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsScannerInfoProvider.java (getCollectionName):
+ Make synchronized to avoid concurrent access of the infoCollection.
+ (getScannerInformation): Ditto.
+ (setDirty): New method.
+
+2007-03-14 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzilla #230493
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsScannerInfo.java (getDefinedSymbols):
+ Recalculate each time if compilation string is null.
+ (getIncludePaths): Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsScannerInfoProvider.java (getScannerInformation):
+ Use a map of configurations to keep ScannerInfo seperate per configuration. Use
+ current configuration to fetch scanner info.
+
+2007-02-27 Jeff Johnston <jjohnstn@redhat.com>
+
+ * plugin.xml: Bump up release to 0.0.8.1.
+
+2007-02-27 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves Bugzillas #230253, #205310.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsMakeTargetManager.java (addTargets):
+ New method to do mass add of MakeTargets for performance improvement.
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java:
+ (addMakeTargetsToManager): Use new AutotoolsMakeTargetManager addTargets method.
+ * src/com/redhat/eclipse/cdt/autotools/wizards/NewAutotoolsProjectWizard.java (doRun):
+ Set indexer to NullIndexer before applying options.
+ * src/com/redhat/eclipse/cdt/autotools/wizards/ConvertToAutotoolsProjectWizardPage.java (convertProject):
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/wizards/ConvertToAutotoolsProjectWizard.java:
+ Add new NULL_INDEXER_ID.
+ * src/com/redhat/eclipse/cdt/autotools/internal/MakeTargetManager.java: Expose
+ projectTargetMap to inheriting classes.
+
+2007-02-23 Jeff Johnston <jjohnstn@redhat.com>
+
+ Fix for Bugzilla 229891.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsMakefileBuilder.java (getMakeTargets):
+ Use Make Target info to find the real build target which may have been set by the
+ Build Special Targets action.
+ (build): Set up the IMakeBuildInfo needed to fetch Make Target from.
+
+2007-02-22 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/actions/InvokeMessages.properties: Fix a few
+ typos.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfDocumentSetupParticipant.java (setup):
+ Use IDocumentExtension3 version of setDocumentParitioner if document is an instance of
+ IDocumentExtension3.
+
+2007-02-22 Andrew Overholt <overholt@redhat.com>
+
+ * icons/automake.gif: New craptacular icon for automake editor.
+ * icons/autoconf.gif: Another manifestation of my poor artistic skills.
+ * plugin.xml: Use new icons.
+
+2007-02-21 Jeff Johnston <jjohnstn@redhat.com>
+
+ Fix for Bugzilla 229893.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfDocumentProvider.java: Switch
+ to superclass TextFileDocumentProvider instead of FileDocumentProvider so as to fix
+ undo support.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfDocumentSetupParticipant.java:
+ New file.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfEditorMessages.properties: Fix typo.
+ * plugin.xml: Add extension for document setup that ties document setup for configuration
+ files to AutoconfDocumentSetupParticipant.
+
+2007-02-20 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfParser.java (findDelimeter): Ignore
+ escaped character.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfPartitionScanner.java (AutoconfPartitionScanner):
+ Add escape character for # format comment and eat "\#" as character.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfCodeScanner.java (AutoconfCodeScanner):
+ Ditto.
+ * plugin.xml: Update release to 0.0.8.
+
+2007-02-20 Andrew Overholt <overholt@redhat.com>
+
+ Patch from Jordy Potman
+ http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=229352
+
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileSourceConfiguration.java
+ (AutomakefileSourceConfiguration): Update super constructor call to reflect
+ change in CDT 3.1.2.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeEditor.java
+ (initializeEditor): Likewise.
+
+2007-02-20 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfElement.java: New class.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfElifElement: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfElseElement.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfOutlineErrorHandler.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfMacroElement.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfIfElement.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfRootElement.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfWhileElement.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfCaseElement.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfForElement.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfCaseConditionElement.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfCodeScanner.java (AutoconfCodeScanner):
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/parser/AutoconfParser.java: New class to
+ do Autoconf file parsing and error marking.
+ Add AutoconfIdentifierRule and InlineDataRule.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfDocumentProvider.java (createDocument):
+ Changed to use new AutoconfErrorHandler interface.
+ (documentAboutToBeChanged): Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfErrorHandler.java (removeExistingMarkers):
+ Add verification that file exists.
+ (removeAllExistingMarkers): Ditto.
+ (handleError): Ditto.
+ (getCharOffset): Reformatted.
+ (AutoconfErrorHandler): Change constructor to take an IStorageEditorInput rather than
+ an IFile. This allows external files to be edited without error handling.
+ * src/com/redhat/eclipse/cdt/autotools/editors/AutoconfEditorMessages.properties: New messages
+ added for outline parsing.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfPartitionScanner.java (AutoconfPartitionScanner):
+ Use new AutoconfIdentifierRule.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfSourceViewerConfiguration.java (getPresentationReconciler):
+ Change default partition to use MultilineRuleDamagerRepairer.
+ (getReconciler): New method.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfMacroDamagerRepairer.java (createPresentation):
+ Change to use new AutoconfErrorHandler constructor.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfMacroParser.java (AutoconfMacroParser): Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfEditor.java (doSetInput): New.
+ (getInputDocument): Ditto.
+ (getRootElement): Ditto.
+ (getAutoconfParser): Ditto.
+ (getAdapter): Ditto.
+ (InformationProvider): Ditto.
+ (getOutlinePage): Ditto.
+ (setRootElement): Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/outline/AutoconfContentOutlinePage.java: New file.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/outline/AutoconfContentProvider.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/outline/AutoconfLabelProvider.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfIdentifierRule.java: New class to
+ prevent matches of other strings that happen to be inside common identifiers.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/InlineDataRule.java: New class to
+ recognize inline data files.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/MultilineRuleDamagerRepairer.java: New class
+ to handle damage/repair when multiline rules are used.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfReconciliingStrategy.java: New class
+ for delayed document-change parsing.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/AutotoolsPluginImages.java: New class
+ to handle image repository.
+ * icons/etool16/acmacro_obj.gif: New image for Autoconf outline view.
+ * icons/etool16/ammacro_obj.gif: Ditto.
+ * icons/etool16/case_obj.gif: Ditto.
+ * icons/etool16/condition_obj.gif: Ditto.
+ * icons/etool16/elif_obj.gif: Ditto.
+ * icons/etool16/for_obj.gif: Ditto.
+ * icons/etool16/if_obj.gif: Ditto.
+ * icons/etool16/while_obj.gif: Ditto.
+ * plugin.xml: Add new error marker extension for outline view.
+
+2007-02-02 Andrew Overholt <overholt@redhat.com>
+
+ * cdtpatches/README: Fix CVS location of managedbuilder.
+
+2007-02-02 Andrew Overholt <overholt@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeCompletionProcessor.java:
+ New file.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/Automakefile.java (getBuiltins):
+ Add $<, $@, and $?.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileSourceConfiguration.java
+ (getContentAssistant): Make use of AutomakeCompletionProcessor.
+
+2007-01-31 Jeff Johnston <jjohnstn@redhat.com>
+
+ * cdtpatches/cdt.ui.buildconsole.patch: New file that contains the
+ 3.1.1 version of the patch for Bugzilla 153816 which adds multiple
+ build console support to CDT 4.0.
+ * cdtpatches/cdt.ui.patch: Altered to remove any build console patches.
+ * cdtpatches/README: Updated to include the new patch.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/CConfigureConsole.java (CConfigureConsole):
+ Modified to use new CUIPlugin build console manager interface.
+
+2007-01-31 Andrew Overholt <overholt@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeErrorHandler.java: New class.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfDocumentProvider.java: Remove unnecessary import.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeDocumentProvider.java
+ (connect): New method. Update error markers at document load time.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileReconcilingStrategy.java
+ (reconcile): Update error markers.
+ (AutomakefileReconcilingStrategy): Set class-wide variables.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeEditor.java
+ (getAutomakeErrorHandler): New method.
+
+2007-01-26 Jeff Johnston <jjohnstn@redhat.com>
+
+ Fix for Bugzilla 224644.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsMakefileBuilder.java (getMakeTargets):
+ Don't add "clean" for fullbuild anymore. It causes unnecessary extra building to occur.
+ (build): Set a flag that build was called.
+ (clean): Only clean if this method is called directly and via a call to build method.
+ Clean by doing a make clean rather than calling super.clean.
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java (runCommand): When an
+ error occurs in configure, we want to set the status of the project to "needs rebuild".
+ (getConfigSettingsPath): New method to generate name of config settings file.
+ (saveConfigArgs): Use new getConfigSettingsPath method.
+ (regenerateMakefiles): Ditto, when checking if config options have changed.
+ (autogenExists): Clean up unused variables.
+ (getMakefileName): Return "Makefile" instead of "makefile".
+
+2007-01-22 Andrew Overholt <overholt@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileCodeScanner.java:
+ Update copyright.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeDocumentProvider.java:
+ Likewise.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeIfElse.java:
+ Likewise.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileReconcilingStrategy.java:
+ Likewise.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileUtil.java:
+ Likewise.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/Automakefile.java:
+ Likewise.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileSourceConfiguration.java:
+ Likewise.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeEditor.java
+ (getAutomakeSourceViewer): New method. Update copyright.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileContentOutlinePage.java:
+ Update copyright.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeTextHover.java
+ (getHoverInfo): Remove debugging println. Update copyright.
+
+2007-01-19 Jeff Johnston <jjohnstn@redhat.com>
+
+ Fix for Bugzilla 214624.
+ * src/com/redhat/eclipse/cdt/autotools/internal/MarkerGenerator.java: New file.
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java (runCommand): Add check
+ for return code being 0 or 1 to reveal whether command ran correctly.
+ (regenerateMakefiles): Add boolean checking for runCmd calls and also quit
+ if runCmd fails. For autogen.sh cases, check if configure is run by autogen.sh
+ and don't bother calling configure afterwards if true. Add error checking to
+ ensure a second command is not run if the first fails.
+ (PathVar): New private class.
+ (autogenExists): Fixed to take a path parameter to fill in. It also looks for
+ any file that ends in autogen.sh to handle projects like Gnome.
+ * Resources.properties: Add new messages used by MakeGenerator.
+ * cdtpatches/managedbuilder.core.patch: New patch to cause ManagedMake build
+ to stop if an error occurs generating Makefile.
+ * cdtpatches/README: Add details on how to install new patch.
+
+2007-01-16 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfMacroParser.java: New code
+ to parse an Autoconf macro.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfMacroDamagerRepairer.java (createPresentation):
+ Use new AutoconfMacroParser.parse method instead of embedding the code. Remove
+ all corresponding parse methods.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfDocumentProvider.java (documentAboutToBeChanged):
+ Add checks for whether we should remove the error markers in an autoconf_macro
+ partition.
+
+2007-01-12 Jeff Johnston <jjohnstn@redhat.com>
+
+ * about.html: New EPL license file.
+
+2007-01-12 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/ParseException.java: New file.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfEditorMessages.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfErrorHandler.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/text/hover/AutoconfPrototype.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfAnnotationHover.java: Ditto.
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfCodeScanner.java: Add
+ copyright info.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfColorProvider.java: Ditto.
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfDocumentProvider.java: Ditto.
+ (createDocument): New method.
+ (documentChanged): Ditto.
+ (documentAboutToBeChanged): Ditto.
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfEditor.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfKeywordDetector.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfM4WordDetector.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfMacroContentAssistProcessor.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfMacroDamagerRepairer.java: Ditto.
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfMacroPartitionRule.java : Ditto.
+ (matchParentheses): Fix up logic.
+ (evaluate):
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfMacroRule.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfMacroWordDetector.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfPartitioner.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfPartitionScanner.java: Ditto.
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfSourceViewerConfiguration.java: Ditto.
+ (getPresentationReconciler): Use AutoconfMacroDamagerRepairer for macro partition.
+ (getAnnotationHover): New method.
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfWhitespaceDetector.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfWordDetector.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/IAutotoolEditorActionDefinitionIds.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/IAutotoolHelpContextIds.java: Ditto.
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/RecursiveSingleLineRule.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/LibHover.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/popup/actions/GetDefinedSymbolsAction.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/popup/actions/GetIncludePathAction.java: Ditto.
+
+ * src/com/redhat/eclipse/cdt/autotools/internal/text/hover/AutoconfTextHover.java: Ditto.
+ (getIndexedInfo): New method.
+ (getPrototype): Ditto.
+
+ * src/com/redhat/eclipse/cdt/autotools/internal/text/hover/HoverMessages.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeWordDetector.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/actions/BuildSpecial.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/actions/InvokeAclocalAction.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/actions/InvokeAction.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/actions/InvokeAutoconfAction.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/actions/InvokeAutomakeAction.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/actions/InvokeMessages.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/actions/TwoInputDialog.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsScannerInfoProvider.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsScannerInfo.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsPlugin.java: Ditto.
+
+2007-01-12 Andrew Overholt <overholt@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeTextHover.java: New class. Hover help provider for automake editor.
+ (getHoverControlCreator): New method. Return null for now.
+ (AutomakeTextHover): New method.
+ (getHoverRegion): New method. Return an IRegion from an offset in the document.
+ (findWord): New method. Return an IRegion of the hover region.
+ (getHoverInfo): New method. Return the hover information for a particular region.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileSourceConfiguration.java (getTextHover): New method.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/Automakefile.java (getDirectiveContainingLine): Likewise.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeEditor.java (getMakefile): Likewise.
+
+2007-01-09 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfDocumentProvider.java: Revert
+ to version 1.2 prior to 2006-11-27. This reversion is required because the previous
+ fix causes a regression in autoconf partitioning.
+
+2007-01-08 Andrew Overholt <overholt@redhat.com>
+
+ * libhoverdocs/acmacros.xml: Add PKG_* macros from pkgconfig.
+
+2007-01-05 Andrew Overholt <overholt@redhat.com>
+
+ * libhoverdocs/acmacros.xml: Add AM_* macros from automake's Public-macros.html.
+
+2007-01-05 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java (regenerateMakefiles):
+ Add check for Makefile.cvs ahead of configure check. Use resource strings
+ for runCommand descriptions.
+ (makefileCvsExists): New internal method.
+ * src/com/redhat/eclipse/cdt/autotools/Resources.properties: Add new
+ resource strings.
+
+2007-01-02 Andrew Overholt <overholt@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileCodeScanner.java
+ (automaticVariables): New $<, etc. variables.
+ (createRules): Add automatic variables as keywords. Also add @AC_SUBST_VAR@
+ highlighting.
+ (nextToken): New method.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeDocumentProvider.java
+ (getDocument): New method.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeWordDetector.java:
+ New file.
+
+2006-12-15 Andrew Overholt <overholt@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileSourceConfiguration.java
+ (getAutomakeCodeScanner): New method.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeEditor.java
+ (getAutomakeSourceViewerConfiguration): Likewise.
+ (getAutomakefileDocumentProvider): Likewise
+ (initializeEditor): Set up field variables.
+
+2006-12-12 Andrew Overholt <overholt@redhat.com>
+
+ * META-INF/MANIFEST.MF: Add package visibility for tests.
+ * plugin.xml: Add filename associations for AutomakeEditor.
+
+2006-12-11 Jeff Johnston <jjohnstn@redhat.com>
+
+ * MANIFEST.MF: Update release to 0.0.6.
+
+2006-12-11 Kyu Lee <klee@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/actions/TwoInputDialog.java: New class
+ for getting 2 text field inputs.
+ * src/com/redhat/eclipse/cdt/autotools/actions/InvokeMessages.java: New class
+ for NLS strings.
+ * src/com/redhat/eclipse/cdt/autotools/actions/InvokeAutomakeAction.java: New
+ class for handling invoke automake.
+ * src/com/redhat/eclipse/cdt/autotools/actions/InvokeAutoconfAction.java: New
+ class for handling invoke autoconf.
+ * src/com/redhat/eclipse/cdt/autotools/actions/InvokeAction.java: New super
+ class for invoking autotools classes.
+ * src/com/redhat/eclipse/cdt/autotools/actions/InvokeAclocalAction.java: New
+ class for handling invoke aclocal.
+ * src/com/redhat/eclipse/cdt/autotools/actions/InvokeMessages.properties:
+ Property file for NLS strings.
+ * plugin.xml: Added menu options for invoking autotools under project menu.
+
+2006-12-11 Andrew Overholt <overholt@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsPlugin.java
+ (getWorkingCopyManager): New method.
+ (getAutomakefileDocumentProvider): Likewise.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeEditor.java
+ (initializeEditor): New method.
+ (getAutomakeOutlinePage): Likewise.
+ (createPartControl): Likewise.
+ (getAdapter): Likewise.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeDocumentProvider.java:
+ New file.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeMacroReferenceRule.java:
+ Likewise.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeMacroDefinitionRule.java:
+ Likewise.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeIfElse.java:
+ Likewise.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileUtil.java:
+ Likewise.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileSourceConfiguration.java:
+ Likewise.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileReconcilingStrategy.java:
+ Likewise.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakefileContentOutlinePage.java:
+ Likewise.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/Automakefile.java:
+ Likewise.
+
+2006-12-08 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/wizards/ConvertToAutotoolsProjectWizard.java
+ (setCurrentProject): Make protected to allow subclasses to use.
+ * MANIFEST.MF: Export org.eclipse.linuxtools.cdt.autotools.wizards classes to the
+ autotools.tests plug-in.
+
+2006-12-01 Andrew Overholt <overholt@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake: New directory.
+ * src/com/redhat/eclipse/cdt/autotools/editors/automake/AutomakeEditor.java: New
+ file. Simple extension of MakefileEditor for now.
+ * plugin.xml: Add automake editor.
+
+2006-11-29 Jeff Johnston <jjohnstn@redhat.com>
+
+ * plugin.xml: Add .m4 file support to the Autoconf editor.
+
+2006-11-27 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfEditor.java
+ (performRevert): Method copied from CDT and JDT editors.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfDocumentProvider.java:
+ Change base class to be TextFileDocumentProvider. This means no longer providing
+ a createDocument() method.
+ (createDocument): Deleted.
+ (AutoconfStorageDocumentProvider.AutoconfStorageDocumentProvider): New internal
+ class based on StorageDocumentProvider.
+ (AutoconfStorageDocumentProvider.setupDocument): New method of internal class.
+ (AutoconfDocumentProvider): New constructor which sets up a
+ TextFileDocumentProvider that takes the internal AutoconfStorageDocumentProvider
+ class as parent DocumentProvider. This emulates what the CDT CEditor does and is
+ done to provide proper edit reversion support.
+
+2006-11-22 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/IAutotoolHelpContextIds.java:
+ Add CONTENT_ASSIST string.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfSourceViewerConfiguration.java
+ (getContentAssistant): New routine to add content assist support.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfEditor.java
+ (createActions): Add action for content assist.
+ * src/com/redhat/eclipse/cdt/autotools/internal/text/hover/AutoconfTextHover.java
+ (getIndexedInfo):
+ (getInformationControlCreator): New method.
+ (getTooltipAffordanceString): Make static.
+ (init): Ditto.
+ (getIndexedInfo): Ditto plus add call to init.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfMacroContentAssistProcessor.java:
+ New class for macro content assist.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfMacroParameterListValidator.java:
+ New class for content assist to help with macro call parameters.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfMacroProposalContextInformation.java:
+ New file for parameter context assist information.
+
+2006-11-14 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfPartitionScanner.java
+ (AutoconfPartitionScanner): Change partitions to be comments, macros, and
+ default.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfSourceViewerConfiguration.java
+ (getPresentationReconciler): Change to match new paritioning. Use a special new
+ MultiLineDamagerRepairer for macros.
+ (getConfiguredContentTypes): Change to list of new partitions.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfEditor.java
+ (createPartControl): Specify new AUTOCONF_MACRO partition.
+ (InformationDispatchAction.makeAnnotationHoverFocusable): Ditto.
+ (InformationDispatchAction.makeTextHoverFocusable): Ditto.
+ (getAutoconfInlineCodeScanner, getAutoconfStringScanner): Removed.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfInlineCodeScanner.java:
+ Removed.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfSectionRule.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfStringScanner.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfCodeScanner.java
+ (AutoconfCodeScanner): Change rules to add a recursive single line rule for
+ strings and a multiline rule for inlined code. Also add a rule to discover m4
+ macros.
+ * src/com/redhat/eclipse.cdt/autotools/ui/editors/AutoconfM4WordDetector.java:
+ New file.
+ * src/com/redhat/eclipse.cdt/autotools/ui/editors/AutoconfMacroPartitionRule.java:
+ Ditto.
+ * src/com/redhat/eclipse.cdt/autotools/ui/editors/MultiLineDamagerRepairer.java:
+ Ditto.
+ * src/com/redhat/eclipse.cdt/autotools/ui/editors/RecursiveSingleLineRule.java:
+ Ditto.
+
+2006-10-31 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/internal/text/hover/AutoconfTextHover.java
+ (init): Turn off parser validation.
+ * libhoverdocs/acmacros.xml: Update including m4 macros.
+
+2006-10-30 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfDocumentProvider.java:
+ Remove unneeded import.
+ * src/com/redhat/eclipse/cdt/autotools/ui/LibHover.java
+ (getLibHoverDocs): Specify no xml validation since there may be duplicate
+ function ids due to multiple standard definitions used in glibc.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfSourceViewerConfiguration.java
+ (getTextHover): New method to add text hover for autoconf editor.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfPartitioner.java
+ (connect): Remove calls to print debug messages.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfEditor.java
+ (isFoldingEnabled):
+ (InformationDispatchAction.InformationDispatchAction): New for scrollable
+ tooltip support.
+ (createPartControl): Ditto.
+ (fProjectionModelUpdater): Ditto.
+ (InformationProvider.getInformation): Ditto.
+ (InformationDispatchAction): Ditto.
+ (initializeKeyBindingScopes): Ditto.
+ (InformationDispatchAction.makeTextHoverFocusable): Ditto.
+ (InformationProvider.getInformation2): Ditto.
+ (InformationProvider): Ditto.
+ (InformationDispatchAction.computeOffsetAtLocation): Ditto.
+ (fInformationPresenter): Ditto.
+ (.createInformationControl): Ditto.
+ (InformationProvider.getInformationPresenterControlCreator): Ditto.
+ (createActions): Ditto.
+ (InformationDispatchAction..createInformationControl): Ditto.
+ (InformationDispatchAction.run): Ditto.
+ (InformationDispatchAction.fTextOperationAction): Ditto.
+ (InformationDispatchAction.makeAnnotationHoverFocusable): Ditto.
+ (fProjectionSupport): Ditto.
+ (InformationProvider.getSubject): Ditto.
+ (InformationProvider.InformationProvider): Ditto.
+ * src/libhoverdocs/acmacros.xml: New file containing autoconf hover help.
+ * src/libhoverdocs/glibc.xml: Updated.
+ * src/libhoverdocs/LIBHOVERDOCS.LICENSE: New file with licensing info.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/IAutotoolEditorActionDefinitionIds.java:
+ New file.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editoros/IAutotoolHelpContextIds.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/text/hover/AutoconfTextHover.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/text/hover/HoverMessages.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/text/hover/HoverMessages.properties:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/HTML2TextReader.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/HTMLPrinter.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/HTMLTextPresenter.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/LineBreakingReader.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/SingleCharReader.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/SubstitutionTextReader.java:
+ Ditto.
+ * plugin.xml: Fix autoconf editor to look for configure.in or configure.ac. Add
+ hover help for autoconf editor and set up F2 key binding for scrollable tooltips.
+ * plugin.properties: Add autoconf editor strings.
+
+2006-10-16 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfCodeScanner.java: New
+ file.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfWordDetector.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfWhitespaceDetector.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfStringScanner.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfSourceViewerConfiguration.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfSectionRule.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfPartitionScanner.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfPartitioner.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfMacroWordDetector.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfMacroRule.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfKeywordDetector.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfInlineCodeScanner.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfEditor.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfDocumentProvider.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/ui/editors/AutoconfColorProvider.java:
+ Ditto.
+ * plugin.properties: Add Autoconf editor name.
+ * plugin.xml: Add Autoconf editor.
+
+2006-10-03 Jeff Johnston <jjohnstn@redhat.com>
+
+ Fix for Bugzilla 209161.
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java
+ (initializeBuildConfigDirs): New method.
+ (initialize): Call initializeBuildConfigDirs().
+ (regenerateMakefiles): Ditto if configuration parameters have changed.
+ (createDirectory): Return project path if input directory is empty string or
+ ".".
+
+2006-09-29 Jeff Johnston <jjohnstn@redhat.com>
+
+ * build.properties: Update so plugin.properties built into binary.
+ * build.xml: New file.
+
+2006-09-28 Jeff Johnston <jjohnstn@redhat.com>
+
+ * plugin.xml: Bump up release number to 0.0.5.
+
+2006-09-15 Jeff Johnston <jjohnstn@redhat.com>
+
+ Fix for Bugzilla 206719
+ * plugin.xml: Comment out deprecated ManagedBuildInfo extension and replace with
+ new org.eclipse.cdt.managedbuilder.core.buildDefinitions extension point.
+ * plugin.properties: Add new strings from new build definition.
+ * src/com/redhat/eclipse/cdt/autotools/wizards/CProjectPlatformPage.java
+ (CProjectPlatformPage): Fix project type reference to refer to new project type
+ id in build definition.
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java
+ (initialize): Switch over to new option ids in new build definition.
+ (getConfigArgs): Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsScannerInfo.java
+ (getCompilationString): Don't bother if input resource isn't a file.
+ (buildFile): Fix how build directory is fetched to work with new build
+ definition.
+ (AutotoolsScannerInfo): Save the original resource reference.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsMakefileBuilder.java
+ (AUTOTOOLS_CONFIG_ID): Change to match new build definition.
+
+2006-09-13 Jeff Johnston <jjohnstn@redhat.com>
+
+ Fix for Bugzilla 206359
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsPlugin.java
+ (verifyScannerInfoProvider): New method to check ScannerInfoProvider and set it
+ only if necessary.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsMakefileBuilder.java
+ (hasTargetBuilder): Call verifyScannerInfoProvider instead of
+ setScannerInfoProvider to prevent changing the project file every time the
+ hasTargetBuilder check is made.
+
+2006-09-12 Jeff Johnston <jjohnstn@redhat.com>
+
+ Fix for Bugzilla 206164.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsScannerInfo.java
+ (followIncludeChain): Follow the session property as far as possible. When it
+ ends try looking for the new OPEN_INCLUDE_P persistent property to re-establish
+ the chain.
+ (createIncludeChain): Set a new persistent property OPEN_INCLUDE_P that is the
+ location of the resource.
+
+2006-09-11 Jeff Johnston <jjohnstn@redhat.com>
+
+ * cdtpatches/cdt.ui.patch: Update patch to include defined symbol hover help.
+
+2006-09-11 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsScannerInfo.java
+ (getDefinedSymbols): Prepare code for failure to get compilation string.
+
+2006-09-06 Jeff Johnston <jjohnstn@redhat.com>
+
+ * cdtpatches/README: New file to instruct how to apply patches to the CDT.
+ * cdtpatches/cdt.core.patch: Patch for org.eclipse.cdt.core.
+ * cdtpatches/cdt.ui.patch: Patch for org.eclipse.cdt.ui.
+
+2006-08-28 Jeff Johnston <jjohnstn@redhat.com>
+
+ * plugin.xml: Replace DynamicScannerInfo extension hack with existing CDT
+ ScannerInfoProvider extension. Change version to 0.0.4.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/CConfigureConsole.java
+ (CConfigureConsole): Use new getSubConsoleManager method of CUIPlugin.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/ConfigureConsole.java: No
+ longer needed, so removed.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/ConfigureConsoleDocument.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/ConfigureConsoleManager.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/ConfigureConsolePage.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/ConfigureConsolePartition.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/ConfigureConsolePartitioner.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/ConfigureConsoleStream.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/ConfigureConsoleViewer.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/ConsoleEvent.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/ConsoleOutputTextStore.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/ScrollLockAction.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/wizards/ConvertToAutotoolsProjectWizardPage.java
+ (convertProject): Set scanner info provider for project.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsScannerInfoProvider.java: Extend
+ AbstractCExtension.
+ (getScannerInformation): Call AutotoolsScannerInfo.followIncludeChain method to
+ get real underlying resource to get dynamic build info from.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsScannerInfo.java: Implement new
+ interface IScannerInfoPlus.
+ (followIncludeChain): New method to adhere to new interface.
+ (createIncludeChain): New method.
+ (getDefinedSymbols): Add defined symbols found by ManagedBuildManager.
+ (getIncludePaths): Append include path found by ManagedBuildManager.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsPlugin.java
+ (setScannerInfoProvider): New method.
+ (getConsoleManager): Removed.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsMakefileBuilder.java:
+ (hasTargetBuilder): Replace the default scanner provider for Managed Make
+ projects with AutotoolsScannerInfoProvider.
+
+2006-08-21 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/actions/BuildSpecial.java
+ (run): If there are no targets yet
+ (i.e. no makefile), try and regenerate the makefile.* src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java (getConfigArgs):
+ Make sure there is an "other" string to process rather than adding an empty
+ argument.
+
+2006-08-16 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java
+ (regenerateMakefiles): Add logic to check if the configuration arguments have
+ changed since the last configuration and reconfigure if they have.
+ (saveConfigArgs): New method.
+
+2006-08-03 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsMakefileBuilder.java
+ (addAutotoolsBuilder): Check for ManagedMake's genmakebuilder and remove if
+ found.
+ (hasTargetBuilder): Look for Autotools default configuration and if found, add
+ the Autotools Makefile builder.
+
+2006-07-31 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/LibHover.java
+ (getLibHoverDocs): New method which replaces buildDocPath and fetches libhover
+ base data file from the plugin's jar.
+ * src/com/redhat/eclipse/cdt/autotools/ui/LibHover.java
+ (buildDocPath): Replaced by getLibHoverDocs. Change all callers.
+ * src/com/redhat/eclipse/cdt/autotools/ui/LibHover.java
+ (getDocument): Removed.
+
+2006-07-24 Jeff Johnston <jjohnstn@redhat.com>
+
+ * plugin.xml: Remove unused sample extensions.
+ * src/com/redhat/eclipse/cdt/autotools/editors/*: Remove all files.
+ * src/com/redhat/eclipse/cdt/autotools/preferences/*: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/properties/*: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/views/*: Ditto.
+
+2006-07-24 Jeff Johnston <jjohnstn@redhat.com>
+
+ * plugin.xml: Update release.
+ * META-INF/MANIFEST.MF: Export libhoverdocs.
+
+2006-07-13 Jeff Johnston <jjohnstn@redhat.com>
+
+ * plugin.xml: Update release.
+
+2006-07-11 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsMakefileBuilder.java
+ (getMakeTargets): Use IMakeBuildInfo.BUILD_TARGET_INCREMENTAL instead of
+ IMakeBuildInfo.BUILD_TARGET_FULL which is now obsoleted and not set by the
+ MakeTargets.
+ (clean): Ditto.
+
+2006-07-10 Jeff Johnston <jjohnstn@redhat.com>
+
+ * plugin.xml: Add new "other" option which allows the end-user to specify any
+ configuration option manually.
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java
+ (getConfigArgs): New function to get configure arguments from preferences.
+ (runCommand): Change prototype to take an argument array.
+ (regenerateMakefiles): Only when running full configure, pass args to runCommand
+ and get these from getConfigArgs method.
+
+2006-07-05 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsScannerInfo.java
+ (getCompilationString): Don't use previous compilation string if we have marked
+ the scanner info as dirty.
+ (getIncludePaths): Don't continue processing if the compilation string is null.
+
+2006-06-26 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/popup/actions/GetDefinedSymbolsAction.java:
+ New file.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsScannerInfo.java
+ (getDefinedSymbols): Fill in function details to fetch flags used in dynamic
+ compilation info.
+ (getCompilationString): New function to get and save the actual compilation
+ string from the make invocation.
+ (getIncludePaths): Move logic into getCompilationString.
+ (compilationString): New field to store compilation string.
+ (definedSymbols): New field to store map of defined symbols.
+ * plugin.xml: Add defined symbols menu item.
+
+2006-06-20 jjohnstn <jjohnstn@toy.toronto.redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/popup/actions/GetIncludePathAction.java:
+ Remove unused imports.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/MakeUIImages.java: New class
+ copied from Std Make internal packages to local internal package.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/MessageLine.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/MakeUIPlugin.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/MakeResources.properties: New
+ properties message file used by MakeUIPlugin.
+ * src/com/redhat/eclipse/cdt/autotools/actions/TargetListViewerPart.java: Use
+ Autotools StructureViewPart instead of internal one from Std Make plugin.
+ * src/com/redhat/eclipse/cdt/autotools/actions/MakeTargetDialog.java: Use new
+ Autotools internal classes rather than internal ones from Std Make plugin.
+ * src/com/redhat/eclipse/cdt/autotools/actions/AbstractTargetAction.java
+ (getShell): Use new AutotoolsPlugin getActiveWorkbenchShell method instead of
+ the one in internal MakeUIPlugin.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsMakefileBuilder.java: Remove
+ unused imports.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsPlugin.java
+ (getActiveWorkbenchShell): New method.
+
+2006-06-19 Jeff Johnston <jjohnstn@redhat.com>
+
+ * plugin.xml: Add dependency on org.eclipse.core.variables.
+ * src/com/redhat/eclipse/cdt/autotools/internal/MakeTargetManager: New internal
+ class copied from Std Make projects.
+ * src/com/redhat/eclipse/cdt/autotools/internal/MakeTarget: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ProjectTargets: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/MakeMessages: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsMakeTargetManager: Base on local
+ internal MakeTargetManager class rather than unpublished Std Make internal class.
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator: Remove reference to Std
+ Make MakeMessages internal class.
+ * src/com/redhat/eclipse/cdt/autotools/Resources.properties: Add new message
+ about invoking make for the project.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsPlugin.java
+ (getFormattedString): New method to get resource string with arguments.
+
+2006-06-16 Jeff Johnston <jjohnstn@redhat.com>
+
+ * plugin.xml: Added "org.eclipse.cdt.core.DynamicScannerInfoProvider" extension.
+ * src/com/redhat/eclipse/cdt/autotools/popup/actions/GetIncludePathAction.java
+ (run): Altered to use new AutotoolsScannerInfo class.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsScannerInfoProvider.java: New
+ class used to hook up to added extension point:
+ org.eclipse.cdt.core.DynamicScannerInfoProvider.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsScannerInfo.java: New file based
+ on AutotoolsMakefileMiner.java. Class implements IScannerInfo interface.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsMakefileMiner.java: Transformed
+ into AutotoolsScannerInfo.java.
+
+2006-06-14 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/popup/actions/GetIncludePathAction.java:
+ Fix up imports.
+
+2006-06-08 Jeff Johnston <jjohnstn@redhat.com>
+
+ * plugin.xml: Make provider Red Hat.
+
+2006-06-08 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsMakefileMiner.java: New file.
+ * src/com/redhat/eclipse/cdt/autotools/popup/actions: GetIncludePathAction.java:
+ Ditto.
+ * plugin.xml: Add extensions to create menu for source files that will grab the
+ dynamic include path for the build and display it in a message dialog. This is
+ just a temporary test.
+
+2006-05-19 Andrew Overholt <overholt@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/actions/BuildSpecial.java
+ (run): Create our target selection dialog in-line. Make this dialog have a
+ filter for selection of make target.
+ * src/com/redhat/eclipse/cdt/autotools/actions/BuildTargetDialog.java: Remove:
+ no longer necessary.
+
+2006-05-18 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsMakefileBuilder.java
+ (clean): Overriding method to check for MakeTargets in which case we don't want
+ to clean out directory.
+ * plugin.xml: Remove unneeded extension.
+
+2006-04-28 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/LibHover.java
+ (getHref): Change to reference the glibc book rather than the Gnu help.
+
+2006-04-28 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/ui/LibHover.java: New file based on Chris
+ Moller's hover help, using ICHelpProvider interface.
+ * plugin.xml: Add CHelpProvider extension to supply hover help.
+ * libhoverdocs/glibc.xml: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/AutoconfPlugin.java: Refactored.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsPlugin.java: Refactored from
+ AutoconfPlugin.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/CConfigureConsole.java:
+ Refactor AutoconfPlugin to AutotoolsPlugin.
+ * src/com/redhat/eclipse/cdt/autotools/wizards/CProjectPlatformPage.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/wizards/ConvertToAutotoolsProjectWizard.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/wizards/ConvertToAutotoolsProjectWizardPage.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/preferences/PreferenceInitializer.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/actions/TargetListViewerPart.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/actions/MakeTargetDialog.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/actions/MakeContentProvider.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/actions/BuildTargetDialog.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/actions/BuildSpecial.java: Ditto.
+
+2006-04-18 Jeff Johnston <jjohnstn@redhat.com>
+
+ * plugin.xml: Remove toc extension since we have moved docs to a separate
+ plug-in.
+ * getdocs.sh: Moved to autotools-doc plugin.
+ * doc.zip: Ditto.
+ * toc.xml: Ditto.
+ * testToc.xml: Removed.
+
+2006-04-07 Jeff Johnston <jjohnstn@redhat.com>
+
+ * toc.xml: Add references for Gnu Tools documents.
+ * doc.zip: New file containing zipped up html files for Gnu tools.
+ * getdocs.sh: Shell script to get html files from the web and build doc.zip.
+ * plugin.xml: Connect toc extension to toc.xml so that Gnu tools help is
+ provided with Autotools plugin.
+
+2006-03-21 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/AutoconfPlugin.java
+ (getConsoleManager): New method.
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java
+ (runCommand): Specify the Autotools configure console to use for configuration
+ output.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/CConfigureConsole.java: New
+ file stodified from ManagedBuild Project internal directory.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/ConfigureConsoleDocument.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/ConfigureConsoleManager.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/ConfigureConsolePage.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/ConfigureConsolePartitioner.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/ConfigureConsolePartition.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/ConfigureConsoleStream.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/ConfigureConsoleViewer.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/ConfigureConsole.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/ConsoleEvent.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/ConsoleMessages.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/ConsoleMessages.properties:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/internal/ui/ScrollLockAction.java: Ditto.
+ * plugin.xml: Set up CBuildConsole extension to be CConfigureConsole.
+
+2006-03-15 Andrew Overholt <overholt@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java
+ (addMakeTargetsToManager): New method.
+ (regenerateMakefiles): Call addMakeTargetsToManager after Makefile is generated.
+
+2006-03-13 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/wizards/NewAutotoolsProjectOptionPage.java
+ (getProject): If dealing with a ConvertToAutotoolsProjectWizard, use it's
+ getProject method.
+ * src/com/redhat/eclipse/cdt/autotools/wizards/ConvertToAutotoolsProjectWizard.java
+ (setCurrentProject): New method.
+ (applyOptions): Change prototype to accept project as input. Call
+ setCurrentProject method using the project variable before getting the optionPage
+ to performApply.
+ * src/com/redhat/eclipse/cdt/autotools/wizards/ConvertToAutotoolsProjectWizardPage.java
+ (applyOptions): Add project as input variable and pass this on call.
+ (convertProject): Pass project when calling applyOptions method.
+
+2006-03-09 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsMakefileBuilder.java
+ (getMakeTargets): When doing a full build, we don't want to do a "clean" if the
+ target is not "all".
+
+2006-03-09 Andrew Overholt <overholt@redhat.com>
+
+ * .cvsignore: Initial checkin. Ignore bin.
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java
+ (regenerateMakefiles): Rename CONFIG_STATUS_NAME to CONFIG_STATUS. Call
+ autogen.sh first if configure does not exist.
+ (configureExists): New method.
+ (autogenExists): New method.
+ (runCommand): New method. Run configure or autogen and report success.
+ * plugin.properties: Change "CVS Autotools" to Autotools.
+ * plugin.xml: Likewise.
+ * src/com/redhat/eclipse/cdt/autotools/wizards/NewAutotoolsProjectWizard.java
+ (NewAutotoolsProjectWizard): Likewise.
+
+2006-03-08 Jeff Johnston <jjohnstn@redhat.com>
+
+ * plugin.xml: Set up default gcc scanner in our ManagedMakeProject target
+ extension -
+ org.eclipse.cdt.managedbuilder.internal.scannerconfig.DefaultGCCScannerInfoCollector.
+ * src/com/redhat/eclipse/cdt/autotools/wizards/ConvertToAutotoolsProjectWizardPage.java
+ (convertProject): Remove commented code about setting ScannerConfig as we now
+ set the default GCC scanner collector in our ManagedMakeProject extension.
+
+2006-03-07 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/AutoconfPlugin.java
+ (ftargetManager): New field.
+ (getUniqueIdentifier): New method.
+ (getTargetManager): Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsMakefileBuilder.java: New
+ builder that extends ManagedMakeProject's GeneratedMakefileBuilder and allows us
+ to override behavior.
+ * src/com/redhat/eclipse/cdt/autotools/AutotoolsMakeTargetManager.java: New
+ class that extends a Std MakeProject's MakeTargetManager and allows us to
+ override behavior.
+ * src/com/redhat/eclipse/cdt/autotools/Resources.properties: New strings added
+ to support BuildSpecial functionality.
+ * src/com/redhat/eclipse/cdt/autotools/AbstractTargetAction.java: New file based
+ on Std MakeProject class.
+ * src/com/redhat/eclipse/cdt/autotools/actions/BuildSpecial.java: Rewritten to
+ extend AbstractTargetAction and to create a dialog rather than print out hello
+ world.
+ * src/com/redhat/eclipse/cdt/autotools/actions/BuildTargetDialog.java: New file
+ that implements the Build Special Targets dialog. Based on a Std Make Project's
+ BuildTargetDialog.
+ * src/com/redhat/eclipse/cdt/autotools/actions/CheckboxTablePart.java: New file
+ to support new dialogs.
+ * src/com/redhat/eclipse/cdt/autotools/actions/MakeContentProvider.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/actions/MakeTargetDialog.java: New file
+ that implements the Make Target dialog allowing management of make targets. Based
+ on Std Make Project's MakeTargetDialog.
+ * src/com/redhat/eclipse/cdt/autotools/actions/SharedPartWithButtons.java:
+ Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/actions/StructuredViewerPart.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/actions/TargetListViewerPart.java: Ditto.
+ * src/com/redhat/eclipse/cdt/autotools/wizards/ConvertToAutotoolsProjectWizardPage.java:
+ Instead of adding a ManagedProject builder, add our new AutotoolsMakefileBuilder.
+ * plugin.xml: Add our new AutotoolsMakefileBuilder as an official builder.
+
+2006-02-24 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/com/redhat/eclipse/cdt/autotools/MakeGenerator.java: Remove some warnings.
+ * plugin.xml: Fix duplicate target configuration options and re-add in --build
+ option.
+
+2006-02-23 Jeff Johnston <jjohnstn@redhat.com>
+
+ * Initial import.
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/META-INF/MANIFEST.MF b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..a9de97b862
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/META-INF/MANIFEST.MF
@@ -0,0 +1,34 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name.0
+Bundle-SymbolicName: org.eclipse.linuxtools.cdt.autotools;singleton:=true
+Bundle-Version: 2.0.0.qualifier
+Bundle-Activator: org.eclipse.linuxtools.cdt.autotools.AutotoolsPlugin
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.core.runtime;bundle-version="3.4.0",
+ org.eclipse.jface.text;bundle-version="3.4.0",
+ org.eclipse.core.resources;bundle-version="3.4.0",
+ org.eclipse.cdt.managedbuilder.core;bundle-version="5.0.100",
+ org.eclipse.cdt.core;bundle-version="5.1.0",
+ org.eclipse.cdt.managedbuilder.ui;bundle-version="5.0.100",
+ org.eclipse.cdt.managedbuilder.gnu.ui;bundle-version="5.0.100",
+ org.eclipse.cdt.make.core;bundle-version="5.1.0",
+ org.eclipse.ui.console;bundle-version="3.3.0",
+ org.eclipse.help;bundle-version="3.3.100",
+ org.eclipse.core.variables;bundle-version="3.2.100",
+ org.eclipse.ui.views;bundle-version="3.3.0",
+ org.eclipse.core.filesystem;bundle-version="1.2.0",
+ org.eclipse.ui;bundle-version="3.5.0",
+ org.eclipse.cdt.ui;bundle-version="5.1.0",
+ org.eclipse.ui.ide;bundle-version="3.5.0",
+ org.eclipse.ui.editors;bundle-version="3.5.0",
+ org.eclipse.linuxtools.cdt.autotools.core;bundle-version="1.0.0",
+ org.eclipse.linuxtools.cdt.autotools.ui;bundle-version="1.0.0"
+Bundle-ActivationPolicy: lazy
+Bundle-Vendor: %provider
+Export-Package: org.eclipse.linuxtools.cdt.autotools;x-friends:="org.eclipse.linuxtools.cdt.autotools.tests",
+ org.eclipse.linuxtools.cdt.autotools.ui.properties;x-friends:="org.eclipse.linuxtools.cdt.autotools.tests",
+ org.eclipse.linuxtools.internal.cdt.autotools;x-friends:="org.eclipse.linuxtools.cdt.autotools.tests",
+ org.eclipse.linuxtools.internal.cdt.autotools.ui;x-friends:="org.eclipse.linuxtools.cdt.autotools.tests",
+ org.eclipse.linuxtools.internal.cdt.autotools.ui.preferences;x-friends:="org.eclipse.linuxtools.cdt.autotools.tests"
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/about.html b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/about.html
new file mode 100644
index 0000000000..44e229003e
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/about.html
@@ -0,0 +1,33 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html>
+<head>
+<title>About</title>
+<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>8th September, 2004</p>
+<h3>License</h3>
+<p>The Eclipse Software Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<h3>Contributions</h3>
+
+<p>If this Content is licensed to you under the terms and conditions of the EPL, any Contributions, as defined in the EPL, uploaded, submitted, or otherwise
+made available to the Eclipse Foundation, its members and/or the host of the Eclipse Foundation web site, by you that relate to such
+Content are provided under the terms and conditions of the <a href="http://www.eclipse.org/legal/termsofuse.html">Terms of Use</a>
+for the Eclipse Foundation web site and can be made available to others under the terms of the licenses as set out in the
+<a href="http://www.eclipse.org/legal/termsofuse.html">Terms of Use</a>.</p>
+
+<p>If this Content is licensed to you under license terms and conditions other than the EPL (&quot;Other License&quot;), any modifications, enhancements and/or
+other code and/or documentation (&quot;Modifications&quot;) uploaded, submitted, or otherwise made available to the Eclipse Foundation, its members and/or the
+host of the Eclipse Foundation web site, 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 <a href="http://www.eclipse.org/legal/termsofuse.html">Terms of Use</a>
+for the Eclipse Foundation web site and such Modifications can be made available to others under the terms of the licenses as set out in the
+<a href="http://www.eclipse.org/legal/termsofuse.html">Terms of Use</a>.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/build.properties b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/build.properties
new file mode 100644
index 0000000000..592910e922
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/build.properties
@@ -0,0 +1,8 @@
+source.. = src/
+output.. = bin/
+bin.includes = plugin.xml,\
+ META-INF/,\
+ .,\
+ plugin.properties,\
+ icons/
+
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/icons/autoconf.gif b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/icons/autoconf.gif
new file mode 100644
index 0000000000..98afb3e2f0
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/icons/autoconf.gif
Binary files differ
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/plugin.properties b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/plugin.properties
new file mode 100644
index 0000000000..128cd2af8e
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/plugin.properties
@@ -0,0 +1,170 @@
+#################################################################################
+# Copyright (c) 2006, 2008, 2009 Red Hat, Inc.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Red Hat Incorporated - initial API and implementation
+#################################################################################
+ConvertWizard.description=Convert to C/C++ Autotools Project
+NewCProject.description=GNU C Autotools Project
+NewCCProject.description=GNU C++ Autotools Project
+NewCWizard.name=GNU C Autotools Project
+NewCCWizard.name=GNU C++ Autotools Project
+
+Autotools.wizard.name=GNU Autotools Build Wizard
+
+Autoconf.editor.name=Autoconf Editor
+
+BuildProperty.value.name.default=Default;
+BuildProperty.type.name.autotools=GNU Autotools
+
+PreferenceAutotools.name=Autotools
+PreferenceAutomakeEditor.name=Automake Editor
+PreferenceAutoconfEditor.name=Autoconf Editor
+
+PropertyAutotools.name=Autotools
+PropertyTabEditor.name=Editors
+AutotoolsBuildPropertyTab.name=Autotools
+AutotoolsEditorsPropertyTab.name=Editors
+AutotoolsToolsPropertyTab.name=Tools Settings
+
+PropertyTabEditor.tooltip=Set options for Autotools-specific editors
+PropertyTabBuild.tooltip=Set additional Autotools build options
+
+Makefile.builder.name=Autotools Makefile Generator
+Autotools.projecttype.name=GNU Autotools
+AutotoolsNature.name=Autotools Project Nature
+Configuration.build.name=Build (GNU)
+Autotools.targetplatform.name=GNU Autotools Target Platform
+Autotools.gnu.toolchain.name=GNU Autotools Toolchain
+Configure.outputType=Configure Output (config.status)
+Autogen.outputType=Autogen Output (configure)
+
+CommandCategorySource.name=Source
+CommandCategorySource.description=Source commands
+CommandCategoryTools.name=Tools
+CommandCategoryTools.description=Autotool tools
+ShowTooltip.name=Show Tooltip Description
+ShowTooltip.description=Shows the tooltip description for the element at the cursor
+
+# Scope and Key Commands
+ACeditor.scope.name=Autoconf Editor
+ACeditor.scope.description=Editor for Autoconf Configuration Source Files
+
+Tool.configure=configure
+
+OptionCategory.configure.general=General
+Option.configure.builddir=Build directory
+Option.configure.builddir.tip=Subdirectory off of project where build will occur
+Option.configure.configdir=Configure tool directory
+Option.configure.configdir.tip=Subdirectory to change to before invoking configure
+Option.configure.cache_file=Name of configuration cache file (--cache-file)
+Option.configure.cache_file.tip=Specify the name of the configuration cache file [config.cache]
+Option.configure.no_create=Turn off file creation <not advised> (--no-create)
+Option.configure.no_create.tip=This tells configuration not to generate the output files as part of configuration
+Option.configure.quiet=Turn off checking messages (--quiet)
+Option.configure.quiet.tip=This turns off "checking ..." style messages from the configuration console output
+Option.configure.help=Display help contents of top-level configuration (--help)
+Option.configure.help.tip=Ask configuration file to display its help documentation
+Option.configure.version=Display version of autotools used to create configuration (--version)
+Option.configure.version.tip=This outputs the version of the Autotools used to create the configuration files
+
+OptionCategory.configure.platform=Platform Specifiers
+Option.configure.host=Host platform (--host)
+Option.configure.host.tip=Platform that project will run on
+Option.configure.target=Target platform (--target)
+Option.configure.target.tip=Platform that project will target output for
+Option.configure.build=Build platform (--build)
+Option.configure.build.tip=Platform where project is being built
+
+OptionCategory.configure.directories=Directory specifiers
+Option.configure.prefix=Arch-independent install directory (--prefix)
+Option.configure.prefix.tip=Place where architecture-independent files are installed [/usr/local]
+Option.configure.exec_prefix=Arch-dependent install directory (--exec-prefix)
+Option.configure.exec_prefix.tip=Place where architecture-dependent files are installed [PREFIX]
+Option.configure.libdir=Object code library directory (--libdir)
+Option.configure.libdir.tip=Place where object code libraries are installed [EPREFIX/lib]
+Option.configure.bindir=User executable directory (--bindir)
+Option.configure.bindir.tip=Place where binary executables are installed [EPREFIX/bin]
+Option.configure.sbindir=System admin executable directory (--sbindir)
+Option.configure.sbindir.tip=Place where system admin executables are installed [EPREFIX/sbin]
+Option.configure.includedir=C Header file directory (--includdir)
+Option.configure.includedir.tip=Place where header files will be installed [PREFIX/include]
+Option.configure.datadir=Read-only architecture-independent data (--datadir)
+Option.configure.datadir.tip=Place where read-only architecture-independent data is installed [PREFIX/share]
+Option.configure.sysconfdir=Read-only single-machine data directory (--syconfdir)
+Option.configure.sysconfdir.tip=Place where read-only single-machine data is stored [PREFIX/etc]
+Option.configure.infodir=Info file documentation directory (--infodir)
+Option.configure.infodir.tip=Place where info files are installed [PREFIX/info]
+Option.configure.mandir=Man file documentation directory (--mandir)
+Option.configure.mandir.tip=Place where man file documentation is installed [PREFIX/man]
+Option.configure.srcdir=Sources directory (--srcdir)
+Option.configure.srcdir.tip=Place where configure can find sources [configure directory or ..]
+Option.configure.localstatedir=Modifiable single-machine data directory (--localstatedir)
+Option.configure.localstatedir.tip=Place where modifiable single-machine data is installed [PREFIX/var]
+Option.configure.sharedstatedir=Modifiable architecture-independent data directory (--sharedstatedir)
+Option.configure.sharedstatedir.tip=Place where modifiable architecture-independent data is installed [PREFIX/com}
+Option.configure.libexecdir=Program executable directory (--libexecdir)
+Option.configure.libexecdir=Place where program executables will be installed [EPREFIX/libexec]
+Option.configure.oldincludedir=Non-gcc C header file directory (--oldincludedir)
+Option.configure.oldincludedir.tip=Place where non-gcc C header files are installed [/usr/include]
+
+OptionCategory.configure.filenames=File-name transformations
+Option.configure.program_prefix=Installed program prefix (--program-prefix)
+Option.configure.program_prefix.tip=Prepend PREFIX to the beginning of installed program names
+Option.configure.program_suffix=Installed program suffix (--program-suffix)
+Option.configure.program_suffix.tip=Append SUFFIX to the end of installed program names
+Option.configure.program_transform_name=Installed program name transform (--program-transform-name)
+Option.configure.program_transform_name.tip=A sed string used to transform installed program names
+
+OptionCategory.configure.features=Features and packages
+Option.configure.enable_maintainer_mode=Enable maintainer mode (--enable-maintainer-mode)
+Option.configure.enable_maintainer_mode.tip=Specify this to have Makefiles generated with checks for Autotool configuration file changes
+Option.configure.user=User-specified configuration options
+Option.configure.user.tip=Specify one or more configuration options (e.g. --enable-FEATURE, --disable-FEATURE, or --with-PACKAGE)
+
+Tool.autogen = autogen.sh
+
+OptionCategory.autogen.general=Options
+Option.autogen.user=Command line options
+Option.autogen.user.tip=Specify options to pass to the top-level autogen.sh script
+
+RedHatVendor.name = Red Hat
+Bundle-Name.0 = Autotools Plug-in (Incubation)
+provider=Eclipse
+ConvertWizard.name = Convert to a C/C++ Autotools Project
+InvokeAutotools.label = Invoke Autotools
+InvokeAutotools.mnemonic = I
+InvokeAutoconf.label = Invoke Autoconf
+InvokeAutoconf.mnemonic = c
+InvokeAutoconf.description = Run autoconf in the selected directory
+InvokeAutoheader.label = Invoke Autoheader
+InvokeAutoheader.mnemonic = h
+InvokeAutoheader.description = Run autoheader from the selected directory
+InvokeAutomake.label = Invoke Automake
+InvokeAutomake.mnemonic = m
+InvokeAutomake.description = Run automake from the selected directory
+InvokeAutoreconf.label = Invoke Autoreconf
+InvokeAutoreconf.mnemonic = r
+InvokeAutoreconf.description = Run autoreconf from the selected directory
+InvokeAclocal.label = Invoke Aclocal
+InvokeAclocal.mnemonic = l
+InvokeAclocal.description = Run aclocal from the selected directory
+InvokeLibtoolize.label = Invoke Libtoolize
+InvokeLibtoolize.mnemonic = t
+InvokeLibtoolize.description = Run libtoolize in the selected directory
+Reconfigure.label = Reconfigure Project
+Reconfigure.mnemonic = f
+Reconfigure.description = Run configuration scripts for project
+DynamicBuild.label = Dynamic Build Info
+GetIncludePath.label = Get Include Path
+GetDefinedSymbols.label = Get Defined Symbols
+IncludesOption.name = includes
+SymbolsOption.name = symbols
+AutomakeEditor.name = AutomakeEditor
+Automake.name = automake
+ConfigureScript.name=Configure Script
+AutogenScript.name=Autogen Script \ No newline at end of file
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/plugin.xml b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/plugin.xml
new file mode 100644
index 0000000000..04c6fa3dbf
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/plugin.xml
@@ -0,0 +1,1031 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+
+ <extension
+ id="autotoolsProperties"
+ name="Autotools Build Properties"
+ point="org.eclipse.cdt.managedbuilder.core.buildProperties">
+ <propertyValue
+ property="org.eclipse.cdt.build.core.buildType"
+ id="org.eclipse.linuxtools.cdt.autotools.buildType.default"
+ name="%BuildProperty.value.name.default"/>
+ <propertyValue
+ property="org.eclipse.cdt.build.core.buildArtefactType"
+ id="org.eclipse.linuxtools.cdt.autotools.buildArtefactType.autotools"
+ name="%BuildProperty.type.name.autotools"/>
+ </extension>
+ <extension
+ id="cdt.autootols.managed.build.info"
+ name="Autotools Managed Build Info"
+ point="org.eclipse.cdt.managedbuilder.core.buildDefinitions">
+ <managedBuildRevision fileVersion="4.0.0"/>
+ <tool
+ command="configure"
+ id="org.eclipse.linuxtools.cdt.autotools.tool.configure"
+ isAbstract="false"
+ name="%Tool.configure"
+ natureFilter="both">
+ <optionCategory
+ id="org.eclipse.linuxtools.cdt.autotools.optionCategory.configure.general"
+ name="%OptionCategory.configure.general"
+ owner="org.eclipse.linuxtools.cdt.autotools.tool.configure"/>
+ <option
+ applicabilityCalculator="org.eclipse.linuxtools.cdt.autotools.AutotoolsDefaultBuildDirHandler"
+ category="org.eclipse.linuxtools.cdt.autotools.optionCategory.configure.general"
+ defaultValue="build"
+ id="org.eclipse.linuxtools.cdt.autotools.option.configure.builddir"
+ isAbstract="false"
+ name="%Option.configure.builddir"
+ resourceFilter="all"
+ tip="%Option.configure.builddir.tip"
+ valueHandler="org.eclipse.linuxtools.cdt.autotools.AutotoolsDefaultBuildDirHandler"
+ valueType="string"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.optionCategory.configure.general"
+ id="org.eclipse.linuxtools.cdt.autotools.option.configure.configdir"
+ isAbstract="false"
+ name="%Option.configure.configdir"
+ resourceFilter="all"
+ tip="%Option.configure.configdir.tip"
+ valueType="string"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.optionCategory.configure.general"
+ command="--cache-file="
+ id="org.eclipse.linuxtools.cdt.autotools.option.configure.cache_file"
+ isAbstract="false"
+ name="%Option.configure.cache_file"
+ resourceFilter="all"
+ tip="%Option.configure.cache_file.tip"
+ valueType="string"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.optionCategory.configure.general"
+ command="--help"
+ defaultValue="false"
+ id="org.eclipse.linuxtools.cdt.autotools.option.configure.help"
+ isAbstract="false"
+ name="%Option.configure.help"
+ resourceFilter="all"
+ tip="%Option.configure.help.tip"
+ valueType="boolean"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.optionCategory.configure.general"
+ command="--no-create"
+ defaultValue="false"
+ id="org.eclipse.linuxtools.cdt.autotools.option.configure.no_create"
+ isAbstract="false"
+ name="%Option.configure.no_create"
+ resourceFilter="all"
+ tip="%Option.configure.no_create.tip"
+ valueType="boolean"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.optionCategory.configure.general"
+ command="--quiet"
+ defaultValue="false"
+ id="org.eclipse.linuxtools.cdt.autotools.option.configure.quiet"
+ isAbstract="false"
+ name="%Option.configure.quiet"
+ resourceFilter="all"
+ tip="%Option.configure.quiet.tip"
+ valueType="boolean"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.optionCategory.configure.general"
+ command="--version"
+ defaultValue="false"
+ id="org.eclipse.linuxtools.cdt.autotools.option.configure.version"
+ isAbstract="false"
+ name="%Option.configure.version"
+ resourceFilter="all"
+ tip="%Option.configure.version.tip"
+ valueType="boolean"/>
+ <optionCategory
+ id="org.eclipse.linuxtools.cdt.autotools.configure.optionCategory.configure.platform"
+ name="%OptionCategory.configure.platform"
+ owner="org.eclipse.linuxtools.cdt.autotools.tool.configure"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.configure.optionCategory.configure.platform"
+ command="--host="
+ id="org.eclipse.linuxtools.cdt.autotools.option.configure.host"
+ isAbstract="false"
+ name="%Option.configure.host"
+ resourceFilter="all"
+ tip="%Option.configure.host.tip"
+ valueType="string"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.configure.optionCategory.configure.platform"
+ command="--target="
+ id="org.eclipse.linuxtools.cdt.autotools.option.configure.target"
+ isAbstract="false"
+ name="%Option.configure.target"
+ resourceFilter="all"
+ tip="%Option.configure.target.tip"
+ valueType="string"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.configure.optionCategory.configure.platform"
+ command="--build="
+ id="org.eclipse.linuxtools.cdt.autotools.option.configure.build"
+ isAbstract="false"
+ name="%Option.configure.build"
+ resourceFilter="all"
+ tip="%Option.configure.build.tip"
+ valueType="string"/>
+ <optionCategory
+ id="org.eclipse.linuxtools.cdt.autotools.optionCategory.configure.directories"
+ name="%OptionCategory.configure.directories"
+ owner="org.eclipse.linuxtools.cdt.autotools.tool.configure"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.optionCategory.configure.directories"
+ command="--prefix="
+ id="org.eclipse.linuxtools.cdt.autotools.option.configure.prefix"
+ isAbstract="false"
+ name="%Option.configure.prefix"
+ resourceFilter="all"
+ tip="%Option.configure.prefix.tip"
+ valueType="string"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.optionCategory.configure.directories"
+ command="--exec-prefix="
+ id="org.eclipse.linuxtools.cdt.autotools.option.configure.exec_prefix"
+ isAbstract="false"
+ name="%Option.configure.exec_prefix"
+ resourceFilter="all"
+ tip="%Option.configure.exec_prefix.tip"
+ valueType="string"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.optionCategory.configure.directories"
+ command="--libdir="
+ id="org.eclipse.linuxtools.cdt.autotools.option.configure.libdir"
+ isAbstract="false"
+ name="%Option.configure.libdir"
+ resourceFilter="all"
+ tip="%Option.configure.libdir.tip"
+ valueType="string"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.optionCategory.configure.directories"
+ command="--bindir="
+ id="org.eclipse.linuxtools.cdt.autotools.option.configure.bindir"
+ isAbstract="false"
+ name="%Option.configure.bindir"
+ resourceFilter="all"
+ tip="%Option.configure.bindir.tip"
+ valueType="string"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.optionCategory.configure.directories"
+ command="--sbindir="
+ id="org.eclipse.linuxtools.cdt.autotools.option.configure.sbindir"
+ isAbstract="false"
+ name="%Option.configure.sbindir"
+ resourceFilter="all"
+ tip="%Option.configure.sbindir.tip"
+ valueType="string"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.optionCategory.configure.directories"
+ command="--includedir="
+ id="org.eclipse.linuxtools.cdt.autotools.option.configure.includedir"
+ isAbstract="false"
+ name="%Option.configure.includedir"
+ resourceFilter="all"
+ tip="%Option.configure.includedir.tip"
+ valueType="string"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.optionCategory.configure.directories"
+ command="--datadir="
+ id="org.eclipse.linuxtools.cdt.autotools.option.configure.datadir"
+ isAbstract="false"
+ name="%Option.configure.datadir"
+ resourceFilter="all"
+ tip="%Option.configure.datadir.tip"
+ valueType="string"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.optionCategory.configure.directories"
+ command="--sysconfdir="
+ id="org.eclipse.linuxtools.cdt.autotools.option.configure.sysconfdir"
+ isAbstract="false"
+ name="%Option.configure.sysconfdir"
+ resourceFilter="all"
+ tip="%Option.configure.sysconfdir.tip"
+ valueType="string"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.optionCategory.configure.directories"
+ command="--infodir="
+ id="org.eclipse.linuxtools.cdt.autotools.option.configure.infodir"
+ isAbstract="false"
+ name="%Option.configure.infodir"
+ resourceFilter="all"
+ tip="%Option.configure.infodir.tip"
+ valueType="string"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.optionCategory.configure.directories"
+ command="--mandir="
+ id="org.eclipse.linuxtools.cdt.autotools.option.configure.mandir"
+ isAbstract="false"
+ name="%Option.configure.mandir"
+ resourceFilter="all"
+ tip="%Option.configure.mandir.tip"
+ valueType="string"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.optionCategory.configure.directories"
+ command="--srcdir="
+ id="org.eclipse.linuxtools.cdt.autotools.option.configure.srcdir"
+ isAbstract="false"
+ name="%Option.configure.srcdir"
+ resourceFilter="all"
+ tip="%Option.configure.srcdir.tip"
+ valueType="string"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.optionCategory.configure.directories"
+ command="--localstatedir="
+ id="org.eclipse.linuxtools.cdt.autotools.option.configure.localstatedir"
+ isAbstract="false"
+ name="%Option.configure.localstatedir"
+ resourceFilter="all"
+ tip="%Option.configure.localstatedir"
+ valueType="string"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.optionCategory.configure.directories"
+ command="--sharedstatedir="
+ id="org.eclipse.linuxtools.cdt.autotools.option.configure.sharedstatedir"
+ isAbstract="false"
+ name="%Option.configure.sharedstatedir"
+ resourceFilter="all"
+ tip="%Option.configure.sharedstatedir"
+ valueType="string"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.optionCategory.configure.directories"
+ command="--libexecdir="
+ id="org.eclipse.linuxtools.cdt.autotools.option.configure.libexecdir"
+ isAbstract="false"
+ name="%Option.configure.libexecdir"
+ resourceFilter="all"
+ tip="%Option.configure.libexecdir"
+ valueType="string"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.optionCategory.configure.directories"
+ command="--oldincludedir="
+ id="org.eclipse.linuxtools.cdt.autotools.option.configure.oldincludedir"
+ isAbstract="false"
+ name="%Option.configure.oldincludedir"
+ resourceFilter="all"
+ tip="%Option.configure.oldincludedir.tip"
+ valueType="string"/>
+ <optionCategory
+ id="org.eclipse.linuxtools.cdt.autotools.optionCategory.configure.filenames"
+ name="%OptionCategory.configure.filenames"
+ owner="org.eclipse.linuxtools.cdt.autotools.tool.configure"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.optionCategory.configure.filenames"
+ command="--program-prefix="
+ id="org.eclipse.linuxtools.cdt.autotools.option.configure.program_prefix"
+ isAbstract="false"
+ name="%Option.configure.program_prefix"
+ resourceFilter="all"
+ tip="%Option.configure.program_prefix.tip"
+ valueType="string"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.optionCategory.configure.filenames"
+ command="--program-suffix="
+ id="org.eclipse.linuxtools.cdt.autotools.option.program_suffix"
+ isAbstract="false"
+ name="%Option.configure.program_suffix"
+ resourceFilter="all"
+ tip="%Option.configure.program_suffix.tip"
+ valueType="string"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.optionCategory.configure.filenames"
+ command="--program-transform-name="
+ id="org.eclipse.linuxtools.cdt.autotools.option.configure.program_transform_name"
+ isAbstract="false"
+ name="%Option.configure.program_transform_name"
+ resourceFilter="all"
+ tip="%Option.configure.program_transform_name.tip"
+ valueType="string"/>
+ <optionCategory
+ id="org.eclipse.linuxtools.cdt.autotools.optionCategory.configure.features"
+ name="%OptionCategory.configure.features"
+ owner="org.eclipse.linuxtools.cdt.autotools.tool.configure"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.optionCategory.configure.features"
+ command="--enable-maintainer-mode"
+ defaultValue="false"
+ id="org.eclipse.linuxtools.cdt.autotools.option.configure.enable_maintainer_mode"
+ isAbstract="false"
+ name="%Option.configure.enable_maintainer_mode"
+ resourceFilter="all"
+ tip="%Option.configure.enable_maintainer_mode.tip"
+ valueType="boolean"/>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.optionCategory.configure.features"
+ id="org.eclipse.linuxtools.cdt.autotools.option.configure.user"
+ isAbstract="false"
+ name="%Option.configure.user"
+ resourceFilter="all"
+ tip="%Option.configure.user.tip"
+ valueType="string"/>
+ <option
+ applicabilityCalculator="org.eclipse.linuxtools.cdt.autotools.AutotoolsDefaultBuildDirHandler"
+ category="org.eclipse.linuxtools.cdt.autotools.optionCategory.configure.general"
+ id="org.eclipse.linuxtools.cdt.autotools.option.configure.includes"
+ isAbstract="false"
+ name="%IncludesOption.name"
+ valueType="includePath">
+ <enablement type="UI_VISIBILITY|UI_ENABLEMENT">
+ <false/>
+ </enablement>
+ </option>
+ <option
+ applicabilityCalculator="org.eclipse.linuxtools.cdt.autotools.AutotoolsDefaultBuildDirHandler"
+ category="org.eclipse.linuxtools.cdt.autotools.optionCategory.configure.general"
+ id="org.eclipse.linuxtools.cdt.autotools.option.configure.symbols"
+ isAbstract="false"
+ name="%SymbolsOption.name"
+ valueType="definedSymbols">
+ <enablement type="UI_VISIBILITY|UI_ENABLEMENT">
+ <false/>
+ </enablement>
+ </option>
+ <outputType
+ id="org.eclipse.linuxtools.cdt.autotools.outputType.configure"
+ name="%Configure.outputType"
+ outputs="status"
+ primaryOutput="true"/>
+ <inputType
+ id="org.eclipse.linuxtools.cdt.autotools.inputType.configure"
+ scannerConfigDiscoveryProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"
+ languageId="org.eclipse.cdt.core.gcc">
+ </inputType>
+ <inputType
+ id="org.eclipse.linuxtools.cdt.autotools.inputType.configure1"
+ scannerConfigDiscoveryProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"
+ languageId="org.eclipse.cdt.core.g++">
+ </inputType>
+ </tool>
+ <tool
+ command="autogen.sh"
+ id="org.eclipse.linuxtools.cdt.autotools.tool.autogen"
+ isAbstract="false"
+ name="%Tool.autogen"
+ natureFilter="both">
+ <optionCategory
+ id="org.eclipse.linuxtools.cdt.autotools.optionCategory.autogen.general"
+ name="%OptionCategory.autogen.general"
+ owner="org.eclipse.linuxtools.cdt.autotools.tool.autogen">
+ </optionCategory>
+ <option
+ category="org.eclipse.linuxtools.cdt.autotools.optionCategory.autogen.general"
+ id="org.eclipse.linuxtools.cdt.autotools.option.autogen.user"
+ isAbstract="false"
+ name="%Option.autogen.user"
+ resourceFilter="all"
+ tip="%Option.autogen.user.tip"
+ valueType="string">
+ </option>
+ <outputType
+ id="org.eclipse.linuxtools.cdt.autotools.autogen.outputType"
+ name="%Autogen.outputType"
+ outputNames="configure"
+ primaryOutput="true">
+ </outputType>
+ <inputType
+ id="org.eclipse.linuxtools.cdt.autotools.autogen.inputType"
+ multipleOfType="false"
+ name="autogenScript"
+ scannerConfigDiscoveryProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile"
+ sourceContentType="org.eclipse.linuxtools.cdt.autotools.autogenScript">
+ </inputType>
+ </tool>
+ <builder
+ arguments="-k"
+ buildfileGenerator="org.eclipse.linuxtools.cdt.autotools.MakeGenerator"
+ command="make"
+ id="org.eclipse.linuxtools.cdt.autotools.builder"
+ isAbstract="true"
+ isVariableCaseSensitive="false"
+ name="%Makefile.builder.name"/>
+ <targetPlatform
+ archList="all"
+ binaryParser="org.eclipse.cdt.core.ELF;org.eclipse.cdt.core.GNU_ELF"
+ id="org.eclipse.linuxtools.cdt.autotools.targetPlatform"
+ isAbstract="false"
+ name="%Autotools.targetplatform.name"/>
+ <projectType
+ buildArtefactType="org.eclipse.linuxtools.cdt.autotools.buildArtefactType.autotools"
+ id="org.eclipse.linuxtools.cdt.autotools.projectType"
+ isAbstract="false">
+ <configuration
+ buildProperties="org.eclipse.linuxtools.cdt.autotools.buildType.default"
+ cleanCommand="rm -rf"
+ errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.GASErrorParser"
+ id="org.eclipse.linuxtools.cdt.autotools.configuration.build"
+ name="%Configuration.build.name">
+ <toolChain
+ archList="all"
+ id="org.eclipse.linuxtools.cdt.autotools.toolChain"
+ name="%Autotools.gnu.toolchain.name"
+ scannerConfigDiscoveryProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProject"
+ targetTool="org.eclipse.linuxtools.cdt.autotools.tool.configure"
+ unusedChildren="org.eclipse.linuxtools.cdt.autotools.toolchain.tool.gcc;org.eclipse.linuxtools.cdt.autotools.toolchain.tool.gpp">
+ <tool
+ id="org.eclipse.linuxtools.cdt.autotools.gnu.toolchain.tool.configure"
+ isAbstract="false"
+ natureFilter="both"
+ superClass="org.eclipse.linuxtools.cdt.autotools.tool.configure"/>
+ <tool
+ id="org.eclipse.linuxtools.cdt.autotools.toolchain.tool.autogen"
+ isAbstract="false"
+ natureFilter="both"
+ superClass="org.eclipse.linuxtools.cdt.autotools.tool.autogen">
+ </tool>
+ <tool
+ id="org.eclipse.linuxtools.cdt.autotools.toolchain.tool.gcc"
+ isAbstract="false"
+ superClass="cdt.managedbuild.tool.gnu.c.compiler">
+ </tool>
+ <tool
+ id="org.eclipse.linuxtools.cdt.autotools.toolchain.tool.gpp"
+ isAbstract="false"
+ superClass="cdt.managedbuild.tool.gnu.cpp.compiler">
+ </tool>
+ <builder
+ id="org.eclipse.linuxtools.cdt.autotools.toolchain.builder"
+ isAbstract="false"
+ isVariableCaseSensitive="false"
+ superClass="org.eclipse.linuxtools.cdt.autotools.builder"/>
+ <targetPlatform
+ id="org.eclipse.linuxtools.cdt.autotools.toolchain.targetPlatform"
+ isAbstract="false"
+ name="%Autotools.targetplatform.name"
+ superClass="org.eclipse.linuxtools.cdt.autotools.targetPlatform">
+ </targetPlatform>
+ <supportedProperties>
+ <property
+ id="org.eclipse.cdt.build.core.buildArtefactType">
+ <value
+ id="org.eclipse.linuxtools.cdt.autotools.buildArtefactType.autotools">
+ </value>
+ </property>
+ </supportedProperties>
+ </toolChain>
+ </configuration>
+ </projectType>
+ </extension>
+ <extension
+ id="genmakebuilder"
+ name="Autotools generated make builder"
+ point="org.eclipse.core.resources.builders">
+ <builder
+ callOnEmptyDelta="true"
+ hasNature="false">
+ <run class="org.eclipse.linuxtools.cdt.autotools.AutotoolsMakefileBuilder"/>
+ </builder>
+ </extension>
+ <extension
+ point="org.eclipse.cdt.core.CBuildConsole">
+ <CBuildConsole
+ class="org.eclipse.linuxtools.internal.cdt.autotools.ui.CConfigureConsole"
+ id="org.eclipse.linuxtools.cdt.autotools.configureConsole"/>
+ <CBuildConsole
+ class="org.eclipse.linuxtools.internal.cdt.autotools.ui.CBuildStepsConsole"
+ id="org.eclipse.linuxtools.cdt.autotools.buildStepsConsole">
+ </CBuildConsole>
+ <CBuildConsole
+ class="org.eclipse.linuxtools.internal.cdt.autotools.ui.AutotoolsConsole"
+ id="org.eclipse.linuxtools.cdt.autotools.autotoolsConsole">
+ </CBuildConsole>
+ </extension>
+ <extension
+ id="AutotoolsScannerInfoProvider"
+ point="org.eclipse.cdt.core.ScannerInfoProvider">
+ <cextension>
+ <run
+ class="org.eclipse.linuxtools.cdt.autotools.AutotoolsScannerInfoProvider">
+ </run>
+ </cextension>
+ </extension>
+ <extension
+ id="parsefileerror"
+ name="Autotools Parse Error Marker"
+ point="org.eclipse.core.resources.markers">
+ <super type="org.eclipse.core.resources.problemmarker"/>
+ <super type="org.eclipse.core.resources.textmarker"/>
+ <persistent value="true"/>
+ </extension>
+ <extension
+ id="outlineparsefileerror"
+ name="Autotools Outline Page Parse Error"
+ point="org.eclipse.core.resources.markers">
+ <super type="org.eclipse.core.resources.problemmarker"/>
+ <super type="org.eclipse.core.resources.textmarker"/>
+ <persistent value="true"/>
+ </extension>
+ <extension
+ point="org.eclipse.cdt.make.core.MakeTargetBuilder">
+ <builder
+ builderID="org.eclipse.linuxtools.cdt.autotools.genmakebuilder"
+ id="org.eclipse.linuxtools.cdt.autotools.builder1">
+ </builder>
+ </extension>
+ <extension
+ point="org.eclipse.core.expressions.propertyTesters">
+ <propertyTester
+ class="org.eclipse.linuxtools.cdt.autotools.AutotoolsProjectPropertyTester"
+ id="org.eclipse.linuxtools.cdt.autotools.propertyTester.isAutotoolsProject"
+ namespace="org.eclipse.linuxtools.cdt.autotools"
+ properties="isAutotoolsProject"
+ type="org.eclipse.core.resources.IResource">
+ </propertyTester>
+ </extension>
+ <extension
+ id="autotoolsNature"
+ name="%AutotoolsNature.name"
+ point="org.eclipse.core.resources.natures">
+ <requires-nature
+ id="org.eclipse.cdt.managedbuilder.core.managedBuildNature">
+ </requires-nature>
+ <runtime>
+ <run
+ class="org.eclipse.linuxtools.cdt.autotools.AutotoolsProjectNature">
+ </run>
+ </runtime>
+ </extension>
+ <extension
+ point="org.eclipse.ui.menus">
+ <menuContribution
+ locationURI="menu:project?after=additions">
+ <menu
+ id="invokeAutotoolsOld"
+ label="%InvokeAutotools.label"
+ mnemonic="%InvokeAutotools.mnemonic">
+ <visibleWhen
+ checkEnabled="false">
+ <and>
+ <count
+ value="1">
+ </count>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <adapt
+ type="org.eclipse.core.resources.IResource">
+ <test
+ property="org.eclipse.core.resources.projectNature"
+ value="org.eclipse.linuxtools.cdt.autotools.autotoolsNature">
+ </test>
+ </adapt>
+ </iterate>
+ </and>
+ </visibleWhen>
+ </menu>
+ </menuContribution>
+ </extension>
+ <extension
+ point="org.eclipse.ui.menus">
+ <menuContribution
+ locationURI="menu:project?after=additions">
+ <command
+ commandId="org.eclipse.linuxtools.cdt.autotools.command.reconfigure"
+ id="reconfigure"
+ label="%Reconfigure.label"
+ mnemonic="%Reconfigure.mnemonic"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <and>
+ <count
+ value="1">
+ </count>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <adapt
+ type="org.eclipse.core.resources.IResource">
+ <test
+ property="org.eclipse.core.resources.projectNature"
+ value="org.eclipse.linuxtools.cdt.autotools.autotoolsNature">
+ </test>
+ </adapt>
+ </iterate>
+ </and>
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ </extension>
+ <extension
+ point="org.eclipse.ui.menus">
+ <menuContribution
+ locationURI="menu:invokeAutotoolsOld">
+ <command
+ commandId="org.eclipse.linuxtools.cdt.autotools.command.autoconf"
+ id="autoconf"
+ label="%InvokeAutoconf.label"
+ mnemonic="%InvokeAutoconf.mnemonic"
+ style="push">
+ </command>
+ <command
+ commandId="org.eclipse.linuxtools.cdt.autotools.command.autoheader"
+ id="autoheader"
+ label="%InvokeAutoheader.label"
+ mnemonic="%InvokeAutoheader.mnemonic"
+ style="push">
+ </command>
+ <command
+ commandId="org.eclipse.linuxtools.cdt.autotools.command.automake"
+ id="automake"
+ label="%InvokeAutomake.label"
+ mnemonic="%InvokeAutomake.mnemonic"
+ style="push">
+ </command>
+ <command
+ commandId="org.eclipse.linuxtools.cdt.autotools.command.autoreconf"
+ id="autoreconf"
+ label="%InvokeAutoreconf.label"
+ mnemonic="%InvokeAutoreconf.mnemonic"
+ style="push">
+ </command>
+ <command
+ commandId="org.eclipse.linuxtools.cdt.autotools.command.aclocal"
+ id="aclocal"
+ label="%InvokeAclocal.label"
+ mnemonic="%InvokeAclocal.mnemonic"
+ style="push">
+ </command>
+ <command
+ commandId="org.eclipse.linuxtools.cdt.autotools.command.libtoolize"
+ id="libtoolize"
+ label="%InvokeLibtoolize.label"
+ mnemonic="%InvokeLibtoolize.mnemonic"
+ style="push">
+ </command>
+ </menuContribution>
+ </extension>
+ <extension
+ id="org.eclipse.linuxtools.cdt.autotools.commands"
+ name="Autoconf"
+ point="org.eclipse.ui.commands">
+ <category
+ id="org.eclipse.linuxtools.cdt.autotools.category.invokeAutotools"
+ name="%InvokeAutotools.label">
+ </category>
+ <command
+ categoryId="org.eclipse.linuxtools.cdt.autotools.category.invokeAutotools"
+ description="%InvokeAutoconf.description"
+ id="org.eclipse.linuxtools.cdt.autotools.command.autoconf"
+ name="%InvokeAutoconf.label">
+ </command>
+ <command
+ categoryId="org.eclipse.linuxtools.cdt.autotools.category.invokeAutotools"
+ description="%InvokeAutoheader.description"
+ id="org.eclipse.linuxtools.cdt.autotools.command.autoheader"
+ name="%InvokeAutoheader.label">
+ </command>
+ <command
+ categoryId="org.eclipse.linuxtools.cdt.autotools.category.invokeAutotools"
+ description="%InvokeAutomake.description"
+ id="org.eclipse.linuxtools.cdt.autotools.command.automake"
+ name="%InvokeAutomake.label">
+ </command>
+ <command
+ categoryId="org.eclipse.linuxtools.cdt.autotools.category.invokeAutotools"
+ description="%InvokeAutoreconf.description"
+ id="org.eclipse.linuxtools.cdt.autotools.command.autoreconf"
+ name="%InvokeAutoreconf.label">
+ </command>
+ <command
+ categoryId="org.eclipse.linuxtools.cdt.autotools.category.invokeAutotools"
+ description="%InvokeAclocal.description"
+ id="org.eclipse.linuxtools.cdt.autotools.command.aclocal"
+ name="%InvokeAclocal.label">
+ </command>
+ <command
+ categoryId="org.eclipse.linuxtools.cdt.autotools.category.invokeAutotools"
+ description="%InvokeLibtoolize.description"
+ id="org.eclipse.linuxtools.cdt.autotools.command.libtoolize"
+ name="%InvokeLibtoolize.label">
+ </command>
+ <command
+ categoryId="org.eclipse.linuxtools.cdt.autotools.category.invokeAutotools"
+ description="%Reconfigure.description"
+ id="org.eclipse.linuxtools.cdt.autotools.command.reconfigure"
+ name="%Reconfigure.label">
+ </command>
+ </extension>
+ <extension
+ point="org.eclipse.ui.handlers">
+ <handler
+ class="org.eclipse.linuxtools.cdt.autotools.actions.AutoconfHandler"
+ commandId="org.eclipse.linuxtools.cdt.autotools.command.autoconf">
+ <activeWhen>
+ <with
+ variable="selection">
+ <count
+ value="1">
+ </count>
+ <iterate
+ operator="and">
+ <adapt
+ type="org.eclipse.core.resources.IResource">
+ </adapt>
+ </iterate>
+ </with>
+ </activeWhen>
+ <enabledWhen>
+ <with
+ variable="selection">
+ <count
+ value="1">
+ </count>
+ <iterate
+ operator="and">
+ <adapt
+ type="org.eclipse.core.resources.IResource">
+ </adapt>
+ </iterate>
+ </with>
+ </enabledWhen>
+ </handler>
+ <handler
+ class="org.eclipse.linuxtools.cdt.autotools.actions.AutoheaderHandler"
+ commandId="org.eclipse.linuxtools.cdt.autotools.command.autoheader">
+ <activeWhen>
+ <with
+ variable="selection">
+ <count
+ value="1">
+ </count>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <adapt
+ type="org.eclipse.core.resources.IResource">
+ </adapt>
+ </iterate>
+ </with>
+ </activeWhen>
+ <enabledWhen>
+ <with
+ variable="selection">
+ <count
+ value="1">
+ </count>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <adapt
+ type="org.eclipse.core.resources.IResource">
+ </adapt>
+ </iterate>
+ </with>
+ </enabledWhen>
+ </handler>
+ <handler
+ class="org.eclipse.linuxtools.cdt.autotools.actions.AutomakeHandler"
+ commandId="org.eclipse.linuxtools.cdt.autotools.command.automake">
+ <activeWhen>
+ <with
+ variable="selection">
+ <count
+ value="1">
+ </count>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <adapt
+ type="org.eclipse.core.resources.IResource">
+ </adapt>
+ </iterate>
+ </with>
+ </activeWhen>
+ <enabledWhen>
+ <with
+ variable="selection">
+ <count
+ value="1">
+ </count>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <adapt
+ type="org.eclipse.core.resources.IResource">
+ </adapt>
+ </iterate>
+ </with>
+ </enabledWhen>
+ </handler>
+ <handler
+ class="org.eclipse.linuxtools.cdt.autotools.actions.AutoreconfHandler"
+ commandId="org.eclipse.linuxtools.cdt.autotools.command.autoreconf">
+ <activeWhen>
+ <with
+ variable="selection">
+ <count
+ value="1">
+ </count>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <adapt
+ type="org.eclipse.core.resources.IResource">
+ </adapt>
+ </iterate>
+ </with>
+ </activeWhen>
+ <enabledWhen>
+ <with
+ variable="selection">
+ <count
+ value="1">
+ </count>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <adapt
+ type="org.eclipse.core.resources.IResource">
+ </adapt>
+ </iterate>
+ </with>
+ </enabledWhen>
+ </handler>
+ <handler
+ class="org.eclipse.linuxtools.cdt.autotools.actions.AclocalHandler"
+ commandId="org.eclipse.linuxtools.cdt.autotools.command.aclocal">
+ <activeWhen>
+ <with
+ variable="selection">
+ <count
+ value="1">
+ </count>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <adapt
+ type="org.eclipse.core.resources.IResource">
+ </adapt>
+ </iterate>
+ </with>
+ </activeWhen>
+ <enabledWhen>
+ <with
+ variable="selection">
+ <count
+ value="1">
+ </count>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <adapt
+ type="org.eclipse.core.resources.IResource">
+ </adapt>
+ </iterate>
+ </with>
+ </enabledWhen>
+ </handler>
+ <handler
+ class="org.eclipse.linuxtools.cdt.autotools.actions.LibtoolizeHandler"
+ commandId="org.eclipse.linuxtools.cdt.autotools.command.libtoolize">
+ <activeWhen>
+ <with
+ variable="selection">
+ <count
+ value="1">
+ </count>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <adapt
+ type="org.eclipse.core.resources.IResource">
+ </adapt>
+ </iterate>
+ </with>
+ </activeWhen>
+ <enabledWhen>
+ <with
+ variable="selection">
+ <count
+ value="1">
+ </count>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <adapt
+ type="org.eclipse.core.resources.IResource">
+ </adapt>
+ </iterate>
+ </with>
+ </enabledWhen>
+ </handler>
+ <handler
+ class="org.eclipse.linuxtools.cdt.autotools.actions.ReconfigureHandler"
+ commandId="org.eclipse.linuxtools.cdt.autotools.command.reconfigure">
+ <activeWhen>
+ <with
+ variable="selection">
+ <count
+ value="1">
+ </count>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <adapt
+ type="org.eclipse.core.resources.IResource">
+ </adapt>
+ </iterate>
+ </with>
+ </activeWhen>
+ <enabledWhen>
+ <with
+ variable="selection">
+ <count
+ value="1">
+ </count>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <adapt
+ type="org.eclipse.core.resources.IResource">
+ </adapt>
+ </iterate>
+ </with>
+ </enabledWhen>
+ </handler>
+ </extension>
+ <extension
+ point="org.eclipse.cdt.core.CBuildConsole">
+ <CBuildConsole
+ class="org.eclipse.linuxtools.internal.cdt.autotools.ui.CConfigureConsole"
+ id="org.eclipse.linuxtools.cdt.autotools.configureConsole"/>
+ <CBuildConsole
+ class="org.eclipse.linuxtools.internal.cdt.autotools.ui.CBuildStepsConsole"
+ id="org.eclipse.linuxtools.cdt.autotools.buildStepsConsole">
+ </CBuildConsole>
+ <CBuildConsole
+ class="org.eclipse.linuxtools.internal.cdt.autotools.ui.AutotoolsConsole"
+ id="org.eclipse.linuxtools.cdt.autotools.autotoolsConsole">
+ </CBuildConsole>
+ </extension>
+ <extension
+ point="org.eclipse.ui.propertyPages">
+ <page
+ class="org.eclipse.linuxtools.cdt.autotools.ui.properties.AutotoolsPropertyPage"
+ id="org.eclipse.linuxtools.cdt.autotools.propertypage"
+ name="%PropertyAutotools.name"
+ >
+ <filter
+ name="projectNature"
+ value="org.eclipse.linuxtools.cdt.autotools.autotoolsNature">
+ </filter>
+ <enabledWhen>
+ <or>
+ <instanceof value="org.eclipse.core.resources.IProject"/>
+ <instanceof value="org.eclipse.cdt.core.model.ICProject"/>
+
+ <instanceof value="org.eclipse.core.resources.IFolder"/>
+ <instanceof value="org.eclipse.cdt.core.model.ICContainer"/>
+
+ <instanceof value="org.eclipse.core.resources.IFile"/>
+ <instanceof value="org.eclipse.cdt.core.model.ITranslationUnit"/>
+ </or>
+ </enabledWhen>
+ </page>
+ </extension>
+ <extension
+ point="org.eclipse.cdt.ui.cPropertyTab">
+ <tab
+ class="org.eclipse.linuxtools.cdt.autotools.ui.properties.AutotoolsBuildPropertyPage"
+ icon="icons/autoconf.gif"
+ name="%AutotoolsBuildPropertyTab.name"
+ parent="org.eclipse.cdt.managedbuilder.ui.properties.Page_BuildSettings"
+ tooltip="%PropertyTabBuild.tooltip"
+ weight="002">
+ </tab>
+ <tab
+ class="org.eclipse.linuxtools.cdt.autotools.ui.properties.AutotoolsEditorPropertyPage"
+ name="%AutotoolsEditorsPropertyTab.name"
+ parent="org.eclipse.linuxtools.cdt.autotools.ui.properties.AutotoolsPropertyPage">
+ </tab>
+ <tab
+ class="org.eclipse.linuxtools.cdt.autotools.ui.properties.AutotoolsToolsPropertyPage"
+ name="%AutotoolsToolsPropertyTab.name"
+ parent="org.eclipse.linuxtools.cdt.autotools.ui.properties.AutotoolsPropertyPage">
+ </tab>
+ </extension>
+ <extension
+ point="org.eclipse.core.contenttype.contentTypes">
+ <content-type
+ id="org.eclipse.linuxtools.cdt.autotools.configureScript"
+ name="%ConfigureScript.name"
+ priority="high">
+ </content-type>
+ <content-type
+ id="org.eclipse.linuxtools.cdt.autotools.autogenScript"
+ name="%AutogenScript.name"
+ priority="high">
+ </content-type>
+ <file-association
+ content-type="org.eclipse.linuxtools.cdt.autotools.configureScript"
+ file-names="configure">
+ </file-association>
+ <file-association
+ content-type="org.eclipse.linuxtools.cdt.autotools.autogenScript"
+ file-names="autogen.sh">
+ </file-association>
+ </extension>
+ </plugin>
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/AutotoolsBuilder.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/AutotoolsBuilder.java
new file mode 100644
index 0000000000..f51c2b64d7
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/AutotoolsBuilder.java
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools;
+
+import org.eclipse.cdt.core.settings.model.COutputEntry;
+import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
+import org.eclipse.cdt.core.settings.model.ICOutputEntry;
+import org.eclipse.cdt.managedbuilder.core.IBuilder;
+import org.eclipse.cdt.managedbuilder.internal.core.Builder;
+import org.eclipse.cdt.managedbuilder.internal.core.ToolChain;
+import org.eclipse.cdt.managedbuilder.makegen.IManagedBuilderMakefileGenerator;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.linuxtools.cdt.autotools.ui.properties.AutotoolsPropertyConstants;
+
+
+
+// Proxy class for IBuilder to allow overriding of getBuildLocation().
+
+@SuppressWarnings("restriction")
+public class AutotoolsBuilder extends Builder {
+
+ private String buildPath;
+ private IProject project;
+
+ public AutotoolsBuilder(IBuilder builder, IProject project, ToolChain toolChain) {
+ super(toolChain, builder.getId(), builder.getName(), (Builder)builder);
+ this.project = project;
+ }
+
+ protected IProject getProject() {
+ return project;
+ }
+
+
+ public String getBuildPath() {
+ // TODO Auto-generated method stub
+ return buildPath;
+ }
+
+
+ public void setBuildPath(String path) {
+ // TODO Auto-generated method stub
+ this.buildPath = path;
+ }
+
+ public String getCleanBuildTarget() {
+ String target = null;
+ try {
+ target = getProject().getPersistentProperty(AutotoolsPropertyConstants.CLEAN_MAKE_TARGET);
+ } catch (CoreException ce) {
+ // do nothing
+ }
+ if (target == null)
+ target = AutotoolsPropertyConstants.CLEAN_MAKE_TARGET_DEFAULT;
+ return target;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.managedbuilder.core.IBuilder#getBuildFileGenerator()
+ */
+ public IManagedBuilderMakefileGenerator getBuildFileGenerator() {
+ return new MakeGenerator();
+ }
+
+ /* @override */
+ public ICOutputEntry[] getOutputEntries() {
+ return new ICOutputEntry[]{new COutputEntry(buildPath, null, ICLanguageSettingEntry.VALUE_WORKSPACE_PATH | ICLanguageSettingEntry.RESOLVED)};
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/AutotoolsDefaultBuildDirHandler.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/AutotoolsDefaultBuildDirHandler.java
new file mode 100644
index 0000000000..e1a3e5ae59
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/AutotoolsDefaultBuildDirHandler.java
@@ -0,0 +1,155 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools;
+
+import java.util.SortedSet;
+import java.util.TreeSet;
+
+import org.eclipse.cdt.managedbuilder.core.BuildException;
+import org.eclipse.cdt.managedbuilder.core.IBuildObject;
+import org.eclipse.cdt.managedbuilder.core.IConfiguration;
+import org.eclipse.cdt.managedbuilder.core.IHoldsOptions;
+import org.eclipse.cdt.managedbuilder.core.IManagedOptionValueHandler;
+import org.eclipse.cdt.managedbuilder.core.IOption;
+import org.eclipse.cdt.managedbuilder.core.IOptionApplicability;
+import org.eclipse.cdt.managedbuilder.core.ITool;
+import org.eclipse.cdt.managedbuilder.core.ManagedOptionValueHandler;
+
+public class AutotoolsDefaultBuildDirHandler extends ManagedOptionValueHandler
+ implements IOptionApplicability {
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.managedbuilder.core.IManagedOptionValueHandler#handleValue(IConfiguration,IToolChain,IOption,String,int)
+ */
+
+ public final static String DEFAULT_BUILD_DIR = "build"; //$NON-NLS-1$
+ public final static String CONFIGURE_TOOL_ID = "org.eclipse.linuxtools.cdt.autotools.gnu.toolchain.tool.configure"; //$NON-NLS-1$
+ public final static String BUILD_DIR_OPTION_ID = "org.eclipse.linuxtools.cdt.autotools.option.configure.builddir"; //$NON-NLS-1$
+ public final static String BUILD_DIR_APPLY = "BuildDir.apply"; //$NON-NLS-1$
+ public final static String BUILD_DIR_DEFAULT_QUESTION = "BuildDir.default"; //$NON-NLS-1$
+ public final static String BUILD_DIR_YES = "BuildDir.yes"; //$NON-NLS-1$
+ public final static String BUILD_DIR_NO = "BuildDir.no"; //$NON-NLS-1$
+
+ //FIXME: Use holder to set option value, not the "option" parameter
+ public boolean handleValue(IBuildObject buildObject,
+ IHoldsOptions holder,
+ IOption option,
+ String extraArgument, int event)
+ {
+ // Get the current value of the build dir option.
+ String value = (String)option.getValue();
+ String valueBase = value;
+
+ if (buildObject instanceof IConfiguration &&
+ (event == IManagedOptionValueHandler.EVENT_OPEN)) {
+// || event == IManagedOptionValueHandler.EVENT_APPLY)) {
+ SortedSet<Integer> nums = new TreeSet<Integer>();
+ IConfiguration configuration = (IConfiguration)buildObject;
+ IConfiguration[] cfgs = configuration.getManagedProject().getConfigurations();
+ int index = 1;
+ boolean valueFound = false;
+ for (int i = 0; i < cfgs.length; ++i) {
+ IConfiguration config = cfgs[i];
+ if (config == null || config.getName().equals(configuration.getName())) {
+ continue;
+ }
+ ITool tool = config.getToolFromOutputExtension("status"); //$NON-NLS-1$
+ if (tool == null) // can happen if user has purposely mixed autotools and non-autotools cfgs
+ continue;
+
+ // We now want to get the builddir option for the tool. If we use
+ // getOptionById(), we must know the full id which in our case has a generated
+ // numeric extension at the end. Otherwise, the base builddir option id
+ // will get us the default option, not the one for the configuration we
+ // are currently looking at. We use getOptionBySuperClassId() instead
+ // which will find us options that are based off the original builddir
+ // option which include those with generated extensions at the end.
+ IOption buildDirOption = tool.getOptionBySuperClassId(BUILD_DIR_OPTION_ID);
+ String buildDir = (String)buildDirOption.getValue();
+ if (buildDir.equals(value)) {
+ valueFound = true;
+ }
+ // For "buildXX" values, store the XX values in a list of used extensions.
+ if (buildDir.startsWith(DEFAULT_BUILD_DIR)) {
+ String numstr = buildDir.substring(DEFAULT_BUILD_DIR.length());
+ try {
+ Integer k = Integer.valueOf(numstr);
+ // Assume the value to start with is the last value in the list
+ // plus 1.
+ index = k.intValue() + 1;
+ nums.add(k);
+ } catch (NumberFormatException e) {
+ // ignore
+ }
+ }
+ }
+
+ // If there is no name collision for the configurations, then we simply return.
+ if (!valueFound)
+ return true;
+
+// // If the user has applied a change and it matches an existing build directory,
+// // then warn and ask if the user wants the value defaulted to a safe value.
+// if (event == EVENT_APPLY) {
+// String title = AutotoolsPlugin.getResourceString(BUILD_DIR_APPLY);
+// String question = AutotoolsPlugin.getResourceString(BUILD_DIR_DEFAULT_QUESTION);
+// String[] buttonLabels = new String[2];
+// buttonLabels[0] = AutotoolsPlugin.getResourceString(BUILD_DIR_YES);
+// buttonLabels[1] = AutotoolsPlugin.getResourceString(BUILD_DIR_NO);
+// MessageDialog d = new MessageDialog(AutotoolsPlugin.getActiveWorkbenchShell(),
+// title, null, question, MessageDialog.QUESTION, buttonLabels, 0);
+// int result = d.open();
+// if (result == 1)
+// return true;
+// }
+
+ // For defaulted buildXX values, we support defaulting a unique XX value.
+ if (value.startsWith(DEFAULT_BUILD_DIR)) {
+ valueBase = DEFAULT_BUILD_DIR;
+ // Try and establish a unique "buildXX" name that hasn't been used yet.
+ while (nums.contains(Integer.valueOf(index))) {
+ ++index;
+ }
+ }
+
+ // Reset the default build directory for this opened configuration.
+ try {
+ IOption optionToSet = holder.getOptionToSet(option, false);
+ optionToSet.setValue(valueBase + index);
+ } catch (BuildException e) {
+ return false;
+ }
+ }
+
+ // The event was not handled, thus return false
+ return true;
+ }
+
+ // IOptionApplicability methods
+
+ public boolean isOptionEnabled(IBuildObject configuration,
+ IHoldsOptions holder, IOption option) {
+ return true;
+ }
+
+ public boolean isOptionUsedInCommandLine(IBuildObject configuration,
+ IHoldsOptions holder, IOption option) {
+ return false;
+ }
+
+ public boolean isOptionVisible(IBuildObject configuration,
+ IHoldsOptions holder, IOption option) {
+ if (option.getName().equals("includes") || option.getName().equals("symbols"))
+ return false;
+ return true;
+ }
+
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/AutotoolsMakefileBuilder.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/AutotoolsMakefileBuilder.java
new file mode 100644
index 0000000000..198d89d075
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/AutotoolsMakefileBuilder.java
@@ -0,0 +1,512 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 2005, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Rational Software - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.cdt.core.CCorePlugin;
+import org.eclipse.cdt.core.CommandLauncher;
+import org.eclipse.cdt.core.ConsoleOutputStream;
+import org.eclipse.cdt.core.envvar.IEnvironmentVariable;
+import org.eclipse.cdt.core.resources.IConsole;
+import org.eclipse.cdt.make.core.IMakeCommonBuildInfo;
+import org.eclipse.cdt.managedbuilder.core.IBuilder;
+import org.eclipse.cdt.managedbuilder.core.IConfiguration;
+import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
+import org.eclipse.cdt.managedbuilder.core.IManagedProject;
+import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
+import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
+import org.eclipse.cdt.managedbuilder.core.ManagedCProjectNature;
+import org.eclipse.cdt.managedbuilder.internal.core.Builder;
+import org.eclipse.cdt.managedbuilder.internal.core.CommonBuilder;
+import org.eclipse.cdt.managedbuilder.internal.core.ToolChain;
+import org.eclipse.cdt.managedbuilder.macros.BuildMacroException;
+import org.eclipse.cdt.managedbuilder.macros.IBuildMacroProvider;
+import org.eclipse.cdt.managedbuilder.makegen.IManagedBuilderMakefileGenerator;
+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.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.Path;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.linuxtools.cdt.autotools.ui.properties.AutotoolsPropertyConstants;
+
+
+/**
+ * This is the incremental builder associated with a managed build project. It dynamically
+ * decides the makefile generator it wants to use for a specific target.
+ *
+ * @since 1.2
+ */
+@SuppressWarnings("restriction")
+public class AutotoolsMakefileBuilder extends CommonBuilder {
+ public static final String BUILDER_NAME = "genmakebuilder"; //$NON-NLS-1$
+ public static final String BUILDER_ID = AutotoolsPlugin.getUniqueIdentifier() + "." + BUILDER_NAME; //$NON-NLS-1$
+ public static final String MANAGED_BUILDER_ID = ManagedBuilderCorePlugin.getUniqueIdentifier() + "." + BUILDER_NAME; //$NON-NLS-1$
+ public static final String AUTOTOOLS_CONFIG_ID = AutotoolsPlugin.getUniqueIdentifier() + ".configuration.build"; //$NON-NLS-1$
+ public static final String AUTOTOOLS_PROJECT_TYPE_ID = AutotoolsPlugin.getUniqueIdentifier() + ".projectType"; //$NON-NLS-1$
+
+ private static final String BUILD_FINISHED = "AutotoolsMakefileBuilder.message.finished"; //$NON-NLS-1$
+ private static final String TYPE_CLEAN = "AutotoolsMakefileBuilder.type.clean"; //$NON-NLS-1$
+ private static final String CONSOLE_HEADER = "AutotoolsMakefileBuilder.message.console.header"; //$NON-NLS-1$
+
+ private static final String EMPTY_STRING = new String();
+ public final String WHITESPACE = " "; //$NON-NLS-1$
+
+ protected boolean buildCalled;
+
+ private String makeTargetName;
+
+ @SuppressWarnings("unused")
+ private String preBuildErrMsg = new String();
+ @SuppressWarnings("unused")
+ private String postBuildErrMsg = new String();
+
+ public static String getBuilderId() {
+ return BUILDER_ID;
+ }
+
+ public static boolean hasTargetBuilder(IProject project) {
+ try {
+ // When a project is converted to an Autotools project, we
+ // replace the ManagedMake builder with a special one that
+ // handles MakeTargets. If a project is brought into Eclipse and
+ // uses the New Project Wizard to create a ManagedMake project that
+ // is of type: Autotools, this added step is not done. If we know
+ // we have an Autotools project from the configuration id, then
+ // we should add the builder now. We also should replace the
+ // default ManagedMake scanner provider with the Autotools one,
+ // then return true.
+ if (project.getNature(ManagedCProjectNature.MNG_NATURE_ID) != null) {
+ IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project);
+ IManagedProject m = info.getManagedProject();
+ if (m != null && m.getProjectType().getId().equals(AUTOTOOLS_PROJECT_TYPE_ID)) {
+ AutotoolsProjectNature.addAutotoolsBuilder(project, new NullProgressMonitor());
+ AutotoolsPlugin.verifyScannerInfoProvider(project);
+ return true;
+ }
+ }
+ } catch (CoreException e) {
+ // Don't care...fall through to not found.
+ } catch (Exception f) {
+ // Don't care...fall through to not found.
+ }
+ // Otherwise not found.
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.internal.events.InternalBuilder#build(int, java.util.Map, org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @SuppressWarnings({ "unchecked", "deprecation" })
+ protected IProject[] build(int kind, Map args, IProgressMonitor monitor) throws CoreException {
+ IProject[] results = null;
+ IProject project = getProject();
+ IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project);
+ IManagedBuilderMakefileGenerator generator = null;
+ try {
+ // Figure out the working directory for the build and make sure there is a makefile there
+ // If not, mark a rebuild is required so that configuration will get
+ // invoked.
+ IWorkspace workspace = project.getWorkspace();
+ if (workspace != null) {
+ IWorkspaceRoot root = workspace.getRoot();
+ if (root != null) {
+ if (info.getDefaultConfiguration() == null)
+ return null;
+ generator = new MakeGenerator();
+ generator.initialize(getProject(), info, monitor);
+ IPath buildDir = project.getLocation().append(generator.getBuildWorkingDir());
+ IPath makefilePath = buildDir.append(generator.getMakefileName());
+ IFile makefile = root.getFileForLocation(makefilePath);
+ if (makefile == null || !makefile.exists()) {
+ info.setRebuildState(true);
+ }
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ } finally {
+ makeTargetName = (String)args.get("org.eclipse.cdt.make.core.build.target.inc"); //$NON-NLS-1$
+
+ buildCalled = true;
+ /**
+ * @see IncrementalProjectBuilder#build
+ */
+// fBuildSet.start(this);
+
+ // Hijack the build. This is because the CommonBuilder code will
+ // try and create builders for a MakeTarget build. We don't want
+ // that because this will default to using the GnuMakefileGenerator
+ // which fails. We want to use our Autotools MakeGenerator and
+ // perform a make from the top-level.
+ if(VERBOSE)
+ outputTrace(project.getName(), ">>build requested, type = " + kind); //$NON-NLS-1$
+
+ IConfiguration cfg = info.getDefaultConfiguration();
+
+ // Assemble the information needed to generate the targets
+ String prebuildStep = cfg.getPrebuildStep();
+ try{
+ //try to resolve the build macros in the prebuild step
+ prebuildStep = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(
+ prebuildStep,
+ EMPTY_STRING,
+ WHITESPACE,
+ IBuildMacroProvider.CONTEXT_CONFIGURATION,
+ cfg);
+ } catch (BuildMacroException e){
+ }
+ prebuildStep = prebuildStep.trim(); // Remove leading and trailing whitespace (and control characters)
+
+ String postbuildStep = cfg.getPostbuildStep();
+ try{
+ //try to resolve the build macros in the postbuild step
+ postbuildStep = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(
+ postbuildStep,
+ EMPTY_STRING,
+ WHITESPACE,
+ IBuildMacroProvider.CONTEXT_CONFIGURATION,
+ cfg);
+
+ } catch (BuildMacroException e){
+ }
+ postbuildStep = postbuildStep.trim(); // Remove leading and trailing whitespace (and control characters)
+ String preannouncebuildStep = cfg.getPreannouncebuildStep();
+ String postannouncebuildStep = cfg.getPostannouncebuildStep();
+
+ IConsole console = null;
+ ConsoleOutputStream consoleOutStream = null;
+ CommandLauncher launcher = null;
+ String[] env = null;
+ Process proc = null;
+ OutputStream stdout = null;
+ OutputStream stderr = null;
+
+ // If we have a prebuild or postbuild step, set up a command launcher to use.
+ if (!prebuildStep.equals("") || !postbuildStep.equals("")) {
+ console = CCorePlugin.getDefault().getConsole("org.eclipse.linuxtools.cdt.autotools.buildStepsConsole"); // $NON-NLS-1$
+ console.start(project);
+ consoleOutStream = console.getOutputStream();
+ stdout = consoleOutStream;
+ stderr = consoleOutStream;
+ launcher = new CommandLauncher();
+ // Set the environment
+ IEnvironmentVariable variables[] = ManagedBuildManager
+ .getEnvironmentVariableProvider().getVariables(cfg, true);
+ ArrayList<String> envList = new ArrayList<String>();
+ if (variables != null) {
+ for (int i = 0; i < variables.length; i++) {
+ envList.add(variables[i].getName()
+ + "=" + variables[i].getValue()); //$NON-NLS-1$
+ }
+ env = (String[]) envList.toArray(new String[envList.size()]);
+ }
+ }
+
+ // Check for a prebuild step and execute it if it exists.
+ if (!prebuildStep.equals("")) {
+ monitor.subTask(preannouncebuildStep);
+
+ StringBuffer buffer = new StringBuffer();
+ buffer.append(preannouncebuildStep);
+ buffer.append(System.getProperty("line.separator", "\n")); // $NON-NLS-1$ // $NON-NLS-2$
+
+ try {
+ consoleOutStream.write(buffer.toString().getBytes());
+ consoleOutStream.flush();
+ } catch (IOException e) {
+ // do nothing
+ }
+
+ launcher.showCommand(true);
+ String[] tmp = prebuildStep.split("\\s");
+ String[] cmdargs = new String[tmp.length - 1];
+ if (tmp.length > 1)
+ System.arraycopy(tmp, 1, cmdargs, 0, tmp.length - 1);
+ proc = launcher.execute(new Path(tmp[0]), cmdargs, env,
+ project.getLocation().append(generator.getBuildWorkingDir()), monitor);
+ 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) {
+ preBuildErrMsg = launcher.getErrorMessage();
+ }
+ }
+ }
+
+ // Perform build
+
+ ToolChain toolChain = (ToolChain)cfg.getToolChain();
+ IBuilder oldBuilder = cfg.getBuilder();
+ String workingDir = generator.getBuildWorkingDir().toString();
+ IPath location = project.getLocation().append(workingDir);
+ oldBuilder.setBuildPath(location.toString());
+ oldBuilder.setBuildFileGeneratorElement(AutotoolsPlugin.getDefault().getGeneratorElement());
+ IBuilder builder = new AutotoolsBuilder(cfg.getEditableBuilder(), project, toolChain);
+ String buildLocation = null;
+ String buildCommand = null;
+ String buildArguments = null;
+ if (makeTargetName != null) {
+ // We have a MakeTarget. Get the location and command.
+ buildLocation = (String)args.get("org.eclipse.cdt.make.core.build.location"); // $NON-NLS-1$
+ buildCommand = (String)args.get("org.eclipse.cdt.make.core.build.command"); // $NON-NLS-1$
+ buildArguments = (String)args.get("org.eclipse.cdt.make.core.build.arguments"); // $NON-NLS-1$
+ }
+ if (buildLocation == null) {
+ builder.setBuildPath(location.toString());
+ }
+ else {
+ IWorkspace workspace = project.getWorkspace();
+ builder.setBuildPath(workspace.getRoot().getLocation().append(buildLocation).toString());
+ builder.setManagedBuildOn(false); // needed to avoid ManagedBuild from defaulting directory of makefile.
+ }
+ if (buildCommand != null)
+ builder.setBuildAttribute(IMakeCommonBuildInfo.BUILD_COMMAND, buildCommand);
+ if (buildArguments != null)
+ builder.setBuildAttribute(IMakeCommonBuildInfo.BUILD_ARGUMENTS, buildArguments);
+ builder.setAutoBuildEnable(true);
+ builder.setCleanBuildEnable(false); // Don't want clean build done ahead of our build.
+ // Following is needed to circumvent the CommonBuilder from using the default
+ // GNUMakefileGenerator.
+ builder.setBuildFileGeneratorElement(AutotoolsPlugin.getDefault().getGeneratorElement());
+ toolChain.setBuilder((Builder)builder);
+
+ IProject[] projects = null;
+ try {
+ projects = super.build(kind, args, monitor);
+ } finally {
+ // Must ensure we reset everything back so configuration will be run in future.
+ toolChain.setBuilder((Builder)oldBuilder);
+ }
+
+ if(VERBOSE)
+ outputTrace(project.getName(), "<<done build requested, type = " + kind); //$NON-NLS-1$
+
+ results = projects;
+ buildCalled = false;
+ // Check for a postbuild step and execute it if it exists.
+ if (!postbuildStep.equals("")) {
+ monitor.subTask(postannouncebuildStep);
+ StringBuffer buffer = new StringBuffer();
+ buffer.append(postannouncebuildStep);
+ buffer.append(System.getProperty("line.separator", "\n")); // $NON-NLS-1$ // $NON-NLS-2$
+
+ try {
+ consoleOutStream.write(buffer.toString().getBytes());
+ consoleOutStream.flush();
+ } catch (IOException e) {
+ // do nothing
+ }
+ String[] tmp = postbuildStep.split("\\s");
+ String[] cmdargs = new String[tmp.length - 1];
+ if (tmp.length > 1)
+ System.arraycopy(tmp, 1, cmdargs, 0, tmp.length - 1);
+ proc = launcher.execute(new Path(tmp[0]), cmdargs, env,
+ project.getLocation().append(generator.getBuildWorkingDir()), monitor);
+ 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) {
+ postBuildErrMsg = launcher.getErrorMessage();
+ }
+ }
+ }
+ }
+ return results;
+ }
+
+ @SuppressWarnings({ "unchecked", "deprecation" })
+ protected void clean(IProgressMonitor monitor) throws CoreException {
+ // See what type of cleaning the user has set up in the
+ // build properties dialog.
+ String cleanDelete = null;
+ try {
+ cleanDelete = getProject().getPersistentProperty(AutotoolsPropertyConstants.CLEAN_DELETE);
+ } catch (CoreException ce) {
+ // do nothing
+ }
+
+ if (cleanDelete != null && cleanDelete.equals(AutotoolsPropertyConstants.TRUE))
+ removeBuildDir(monitor);
+ else {
+ IProject project = getProject();
+ IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project);
+ IConfiguration cfg = info.getDefaultConfiguration();
+ IManagedBuilderMakefileGenerator generator = new MakeGenerator();
+ generator.initialize(getProject(), info, monitor);
+
+// // Hijack the builder itself so that instead of ManagedMake
+// // policy of defaulting the build path to the configuration name,
+// // we get the build occurring in the builddir configure tool setting.
+// builders[0] = new AutotoolsBuilder(cfg.getEditableBuilder(), project);
+// builders[0].setBuildPath(project.getLocation().append(generator.getBuildWorkingDir()).toOSString());
+// builders[0].setAutoBuildEnable(true);
+// builders[0].setCleanBuildEnable(true);
+// builders[0].setManagedBuildOn(false);
+
+ ToolChain toolChain = (ToolChain)cfg.getToolChain();
+ IBuilder oldBuilder = cfg.getBuilder();
+ IBuilder builder = new AutotoolsBuilder(cfg.getEditableBuilder(), project, toolChain);
+ builder.setBuildPath(project.getLocation().append(generator.getBuildWorkingDir()).toOSString());
+ builder.setAutoBuildEnable(true);
+ builder.setCleanBuildEnable(true);
+ builder.setManagedBuildOn(false);
+ // Following is needed to circumvent the CommonBuilder from using the default
+ // GNUMakefileGenerator.
+ builder.setBuildFileGeneratorElement(AutotoolsPlugin.getDefault().getGeneratorElement());
+ toolChain.setBuilder((Builder)builder);
+
+ try {
+ super.build(CLEAN_BUILD, (Map)null, monitor);
+ } finally {
+ toolChain.setBuilder((Builder)oldBuilder);
+ }
+ }
+ }
+
+ protected void removeBuildDir(IProgressMonitor monitor) {
+ try {
+ // use brute force approach
+ IProject project = getProject();
+ IWorkspace workspace = AutotoolsPlugin.getWorkspace();
+ IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project);
+ IConfiguration cfg = info.getDefaultConfiguration();
+ IManagedBuilderMakefileGenerator generator = new MakeGenerator();
+ generator.initialize(getProject(), info, monitor);
+ String buildPath = project.getFullPath().append(generator.getBuildWorkingDir()).toOSString();
+ IResource rc = workspace.getRoot().findMember(buildPath);
+ if (rc == null || rc.getType() != IResource.FOLDER)
+ return;
+ IFolder buildDir = (IFolder)rc;
+ String status = AutotoolsPlugin.getFormattedString("AutotoolsMakefileBuilder.message.clean.deleting.output", new String[]{buildDir.getName()}); //$NON-NLS-1$
+ monitor.subTask(status);
+ workspace.delete(new IResource[]{buildDir}, true, monitor);
+ StringBuffer buf = new StringBuffer();
+ // write to the console
+
+// IConsole console = CCorePlugin.getDefault().getConsole();
+// console.start(getProject());
+ // Get a build console for the project
+ IConsole console = CCorePlugin.getDefault().getConsole();
+ console.start(project);
+// IConsole console = bInfo.getConsole();
+ ConsoleOutputStream consoleOutStream = console.getOutputStream();
+ String[] consoleHeader = new String[3];
+ consoleHeader[0] = AutotoolsPlugin.getResourceString(TYPE_CLEAN);
+ consoleHeader[1] = cfg.getName();
+ consoleHeader[2] = project.getName();
+ buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$ //$NON-NLS-2$
+ buf.append(AutotoolsPlugin.getFormattedString(CONSOLE_HEADER, consoleHeader));
+ buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$ //$NON-NLS-2$
+ consoleOutStream.write(buf.toString().getBytes());
+ consoleOutStream.flush();
+ buf = new StringBuffer();
+ // Report a successful clean
+ String successMsg = AutotoolsPlugin.getFormattedString(BUILD_FINISHED, new String[]{project.getName()});
+ buf.append(successMsg);
+ buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$//$NON-NLS-2$
+ consoleOutStream.write(buf.toString().getBytes());
+ consoleOutStream.flush();
+ consoleOutStream.close();
+ } catch (IOException io) {
+ // Ignore console failures...
+ } catch (CoreException e) {
+ // Ignore console failures...
+ }
+ }
+
+ /* (non-javadoc)
+ * Answers an array of strings with the proper make targets
+ * for a build with no custom prebuild/postbuild steps
+ *
+ * @param fullBuild
+ * @return
+ */
+ protected String[] getTargets(int kind, IBuilder builder) {
+ List<String> args = new ArrayList<String>();
+ String buildTarget = "all";
+ switch (kind) {
+ case CLEAN_BUILD:
+ // For a clean build, we use the clean make target set up by the user
+ // in the build properties dialog. Otherwise, we use the default for
+ // an autotools project.
+ String target = null;
+ try {
+ target = getProject().getPersistentProperty(AutotoolsPropertyConstants.CLEAN_MAKE_TARGET);
+ } catch (CoreException ce) {
+ // do nothing
+ }
+ if (target == null)
+ target = AutotoolsPropertyConstants.CLEAN_MAKE_TARGET_DEFAULT;
+ args.add(target);
+ break;
+ case FULL_BUILD:
+ if (makeTargetName != null)
+ buildTarget = makeTargetName;
+ case AUTO_BUILD:
+ case INCREMENTAL_BUILD:
+ args.addAll(makeArrayList(buildTarget));
+ break;
+ }
+ return (String[])args.toArray(new String[args.size()]);
+ }
+
+ // Turn the string into an array.
+ ArrayList<String> makeArrayList(String string) {
+ string.trim();
+ char[] array = string.toCharArray();
+ ArrayList<String> aList = new ArrayList<String>();
+ 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 aList;
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/AutotoolsPlugin.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/AutotoolsPlugin.java
new file mode 100644
index 0000000000..5e2e495cbe
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/AutotoolsPlugin.java
@@ -0,0 +1,324 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2007 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools;
+
+import java.lang.reflect.InvocationTargetException;
+import java.text.MessageFormat;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+import org.eclipse.cdt.core.CCorePlugin;
+import org.eclipse.cdt.core.ICDescriptor;
+import org.eclipse.cdt.core.ICExtensionReference;
+import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
+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.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.jface.resource.ImageDescriptor;
+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;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The main plugin class to be used in the desktop.
+ */
+@SuppressWarnings("deprecation")
+public class AutotoolsPlugin extends AbstractUIPlugin {
+
+ //The shared instance.
+ private static AutotoolsPlugin plugin;
+ private ResourceBundle resourceBundle;
+
+ public static final String PLUGIN_ID = "org.eclipse.linuxtools.cdt.autotools"; //$NON-NLS-1$
+
+ private IConfigurationElement generatorElement;
+
+ public static final String EXTENSION_POINT_ID = ManagedBuilderCorePlugin.getUniqueIdentifier() + ".buildDefinitions"; //$NON-NLS-1$
+ public static final String BUILDER = "builder"; //$NON-NLS-1$
+ public static final String ID_ELEMENT_NAME = "id"; // $NON-NLS-1$
+ public static final String AUTOTOOLS_BUILDER_ID = PLUGIN_ID + ".builder"; // $NON-NLS-1$
+
+ /**
+ * The constructor.
+ */
+ public AutotoolsPlugin() {
+ plugin = this;
+ try {
+ resourceBundle = ResourceBundle.getBundle("org.eclipse.linuxtools.cdt.autotools.Resources"); //$NON-NLS-1$
+ } catch (MissingResourceException x) {
+ resourceBundle = null;
+ }
+
+ }
+
+ public static String getPluginId() {
+ return PLUGIN_ID;
+ }
+
+ 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().getBundle().getSymbolicName();
+ }
+
+ public static void verifyScannerInfoProvider(IProject project) throws CoreException {
+ boolean found = false;
+ ICDescriptor desc = CCorePlugin.getDefault().getCProjectDescription(project, true);
+ ICExtensionReference[] refs = desc.get(CCorePlugin.BUILD_SCANNER_INFO_UNIQ_ID);
+ for (int i = 0; i < refs.length; ++i) {
+ if (refs[i].getID().equals(AutotoolsScannerInfoProvider.INTERFACE_IDENTITY))
+ found = true;
+ }
+ if (!found) {
+ setScannerInfoProvider(project);
+ }
+ }
+
+ public static void setScannerInfoProvider(IProject project) throws CoreException {
+ ICDescriptor desc = CCorePlugin.getDefault().getCProjectDescription(project, true);
+ desc.remove(CCorePlugin.BUILD_SCANNER_INFO_UNIQ_ID);
+ desc.create(CCorePlugin.BUILD_SCANNER_INFO_UNIQ_ID, AutotoolsScannerInfoProvider.INTERFACE_IDENTITY);
+ }
+
+ /**
+ * This method is called upon plug-in activation
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ }
+
+ /**
+ * This method is called when the plug-in is stopped
+ */
+ public void stop(BundleContext context) throws Exception {
+ super.stop(context);
+ plugin = null;
+ }
+
+ /**
+ * Returns the shared instance.
+ */
+ public static AutotoolsPlugin getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Returns active shell.
+ */
+ public static Shell getActiveWorkbenchShell() {
+ IWorkbenchWindow window = getDefault().getWorkbench().getActiveWorkbenchWindow();
+ if (window != null) {
+ return window.getShell();
+ }
+ return null;
+ }
+
+ /**
+ * Returns the string from the plugin's resource bundle,
+ * or 'key' if not found.
+ *
+ * @param key the message key
+ * @return the resource bundle message
+ */
+ public static String getResourceString(String key) {
+ ResourceBundle bundle = AutotoolsPlugin.getDefault().getResourceBundle();
+ try {
+ return bundle.getString(key);
+ } catch (MissingResourceException e) {
+ return key;
+ }
+ }
+
+ /**
+ * Returns the string from the plugin's resource bundle,
+ * or 'key' if not found.
+ *
+ * @param key the message key
+ * @param args an array of substituition strings
+ * @return the resource bundle message
+ */
+ public static String getFormattedString(String key, String[] args) {
+ return MessageFormat.format(getResourceString(key), (Object[])args);
+ }
+
+ /**
+ * Returns the plugin's resource bundle,
+ */
+ public ResourceBundle getResourceBundle() {
+ return resourceBundle;
+ }
+
+ /**
+ * Get the configuration element for the Autotools Makefile generator
+ * @return the generator element
+ */
+ public IConfigurationElement getGeneratorElement() {
+ if (generatorElement == null) {
+ IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(EXTENSION_POINT_ID);
+ if( extensionPoint != null) {
+ IExtension[] extensions = extensionPoint.getExtensions();
+ if (extensions != null) {
+ for (int i = 0; i < extensions.length; ++i) {
+ IExtension extension = extensions[i];
+
+ IConfigurationElement[] elements = extension.getConfigurationElements();
+
+ // Get the managedBuildRevsion of the extension.
+ for (int j = 0; j < elements.length; j++) {
+ IConfigurationElement element = elements[j];
+ if (element.getName().equals(BUILDER)) {
+ String id = element.getAttribute(ID_ELEMENT_NAME);
+ if (id.equals(AUTOTOOLS_BUILDER_ID)) {
+ generatorElement = element;
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ return generatorElement;
+ }
+
+ /**
+ * Returns an image descriptor for the image file at the given
+ * plug-in relative path.
+ *
+ * @param path the path
+ * @return the image descriptor
+ */
+ public static ImageDescriptor getImageDescriptor(String path) {
+ return AbstractUIPlugin.imageDescriptorFromPlugin("org.eclipse.linuxtools.cdt.autotools", path);
+ }
+
+ 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, AutotoolsPlugin.getUniqueIdentifier(), -1, "Internal Error: ", t); //$NON-NLS-1$
+ }
+ ErrorDialog.openError(shell, title, message, status);
+ }
+
+ /**
+ * Returns the workspace instance.
+ */
+ public static IWorkspace getWorkspace() {
+ return ResourcesPlugin.getWorkspace();
+ }
+
+ /**
+ * Returns the active workbench window or <code>null</code> if none
+ */
+ public static IWorkbenchWindow getActiveWorkbenchWindow() {
+ return getDefault().getWorkbench().getActiveWorkbenchWindow();
+ }
+
+ /**
+ * Returns the active workbench page or <code>null</code> if none.
+ */
+ public static IWorkbenchPage getActivePage() {
+ IWorkbenchWindow window= getActiveWorkbenchWindow();
+ if (window != null) {
+ return window.getActivePage();
+ }
+ return null;
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/AutotoolsProjectNature.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/AutotoolsProjectNature.java
new file mode 100644
index 0000000000..5a7f311a29
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/AutotoolsProjectNature.java
@@ -0,0 +1,175 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat Inc.. and others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial implementation
+ * IBM Rational Software - add and remove nature static methods
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools;
+
+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.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+
+public class AutotoolsProjectNature implements IProjectNature {
+
+ public static final String AUTOTOOLS_NATURE_ID = AutotoolsPlugin.getUniqueIdentifier() + ".autotoolsNature"; //$NON-NLS-1$
+
+ private IProject project;
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.resources.IProjectNature#configure()
+ */
+ public void configure() throws CoreException {
+ addAutotoolsBuilder(project, new NullProgressMonitor());
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.resources.IProjectNature#deconfigure()
+ */
+ public void deconfigure() throws CoreException {
+ // TODO remove builder from here
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.resources.IProjectNature#getProject()
+ */
+ public IProject getProject() {
+ return project;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.resources.IProjectNature#setProject(org.eclipse.core.resources.IProject)
+ */
+ public void setProject(IProject project) {
+ this.project = project;
+ }
+
+ /**
+ * Add the Autotools builder to the project
+ * @param project
+ * @param monitor
+ * @throws CoreException
+ */
+ public static void addAutotoolsBuilder(IProject project, IProgressMonitor monitor) throws CoreException {
+ // Add the builder to the project
+ IProjectDescription description = project.getDescription();
+ ICommand[] commands = description.getBuildSpec();
+
+ // TODO Remove the cbuilder check when the new StandardBuild nature adds the cbuilder
+ for (int i = 0; i < commands.length; i++) {
+ ICommand command = commands[i];
+ String builderName = command.getBuilderName();
+ // If there is a ManagedMake makefile generator, remove it as it will
+ // cause an additional build "all" to occur when we are making any target.
+ if (builderName.equals("org.eclipse.cdt.core.cbuilder") ||
+ builderName.equals(AutotoolsMakefileBuilder.MANAGED_BUILDER_ID)) { //$NON-NLS-1$
+ // Remove the command
+ Vector<ICommand> vec = new Vector<ICommand>(Arrays.asList(commands));
+ vec.removeElementAt(i);
+ vec.trimToSize();
+ ICommand[] tempCommands = (ICommand[]) vec.toArray(new ICommand[commands.length-1]);
+ description.setBuildSpec(tempCommands);
+ project.setDescription(description, new NullProgressMonitor());
+ 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(AutotoolsMakefileBuilder.BUILDER_ID)) {
+ found = true;
+ break;
+ }
+ }
+ if (!found) {
+ //add builder to project
+ ICommand command = description.newCommand();
+ command.setBuilderName(AutotoolsMakefileBuilder.BUILDER_ID);
+ 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, new NullProgressMonitor());
+ }
+ }
+
+ /**
+ * Utility method for adding an autotools nature to a project.
+ *
+ * @param proj the project to add the autotools nature to.
+ * @param monitor a progress monitor to indicate the duration of the operation, or
+ * <code>null</code> if progress reporting is not required.
+ */
+ public static void addAutotoolsNature(IProject project, IProgressMonitor monitor) throws CoreException {
+ addNature(project, AUTOTOOLS_NATURE_ID, monitor);
+ }
+
+ /**
+ * 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
+ * <code>null</code> 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 to remove the autotools nature from a project.
+ *
+ * @param project to remove the autotools nature from
+ * @param mon progress monitor to indicate the duration of the operation, or
+ * <code>null</code> if progress reporting is not required.
+ * @throws CoreException
+ */
+ public static void removeAutotoolsNature(IProject project, IProgressMonitor mon) throws CoreException {
+ removeNature(project, AUTOTOOLS_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
+ * <code>null</code> 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<String> newNatures = new ArrayList<String>(Arrays.asList(prevNatures));
+ newNatures.remove(natureId);
+ description.setNatureIds((String[])newNatures.toArray(new String[newNatures.size()]));
+ project.setDescription(description, monitor);
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/AutotoolsProjectPropertyTester.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/AutotoolsProjectPropertyTester.java
new file mode 100644
index 0000000000..a561d6a4d8
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/AutotoolsProjectPropertyTester.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools;
+
+import org.eclipse.core.expressions.PropertyTester;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+
+public class AutotoolsProjectPropertyTester extends PropertyTester {
+
+ public AutotoolsProjectPropertyTester() {
+ // nothing needed
+ }
+
+ public boolean test(Object receiver, String property, Object[] args,
+ Object expectedValue) {
+ IProject project = null;
+ IResource resource = (IResource)receiver;
+ project = resource.getProject();
+ return AutotoolsMakefileBuilder.hasTargetBuilder(project);
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/AutotoolsScannerInfo.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/AutotoolsScannerInfo.java
new file mode 100644
index 0000000000..83c331d6e1
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/AutotoolsScannerInfo.java
@@ -0,0 +1,431 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2007 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools;
+
+import java.io.ByteArrayOutputStream;
+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 java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.eclipse.cdt.core.CCorePlugin;
+import org.eclipse.cdt.core.CommandLauncher;
+import org.eclipse.cdt.core.parser.IScannerInfo;
+import org.eclipse.cdt.core.parser.IScannerInfoChangeListener;
+import org.eclipse.cdt.managedbuilder.core.BuildException;
+import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
+import org.eclipse.cdt.managedbuilder.core.IOption;
+import org.eclipse.cdt.managedbuilder.core.ITool;
+import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
+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.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.linuxtools.cdt.autotools.ui.properties.AutotoolsPropertyConstants;
+
+
+// This class is used to get and store information from the Autotools
+// makefiles for a specific file in a specific Autotools project.
+// It gets information by invoking make with special options
+// to find out what occurs if the file in question has changed.
+public class AutotoolsScannerInfo implements IScannerInfo {
+
+ private IResource res;
+ private IProject project;
+ private IPath filePath;
+ private String[] includePaths;
+ @SuppressWarnings("unchecked")
+ private HashMap definedSymbols;
+ private boolean isDirty;
+ private String compilationString;
+ private String dirName;
+ private HashSet<IScannerInfoChangeListener> listeners = new HashSet<IScannerInfoChangeListener>();
+
+ public AutotoolsScannerInfo (IResource res) {
+ this.res = res;
+ this.project = res.getProject();
+ this.filePath = res.getFullPath();
+ }
+
+ public void addListener(IScannerInfoChangeListener listener) {
+ if (!listeners.contains(listener)) {
+ listeners.add(listener);
+ }
+ }
+
+ public void removeListener(IScannerInfoChangeListener listener) {
+ if (listeners.contains(listener)) {
+ listeners.remove(listener);
+ }
+ }
+
+ // TODO: Should make a listener to watch all Makefiles up the
+ // tree from the resource. If any change, the include
+ // paths and options passed to make the file in question
+ // could change.
+ public void setDirty (boolean isDirty) {
+ this.isDirty = isDirty;
+ }
+
+ private String buildFile (IPath filePath, IFile makefile, IManagedBuildInfo info) {
+ String outString = "";
+ IPath dir = makefile.getFullPath().removeLastSegments(1);
+ IPath relFilePath = filePath.removeFirstSegments(dir.segmentCount());
+ CommandLauncher launcher = new CommandLauncher();
+ String[] env = null;
+ ByteArrayOutputStream stdout = new ByteArrayOutputStream();
+ ByteArrayOutputStream stderr = stdout;
+ IPath makeCommandPath = new Path(info.getBuildCommand());
+ ITool tool = info.getToolFromOutputExtension("status"); // $NON-NLS-1$
+ IOption[] options = tool.getOptions();
+ IPath runPath = null;
+ boolean done = false;
+
+ for (int i = 0; i < options.length && !done; ++i) {
+ try {
+ if (options[i].getValueType() == IOption.STRING) {
+ String value = (String) options[i].getValue();
+ String id = options[i].getId();
+ if (id.indexOf("builddir") > 0) { // $NON-NLS-1$
+ runPath = makefile.getProject().getLocation().append(value.trim());
+ done = true;
+ }
+ }
+ } catch (BuildException e) {
+ // do nothing
+ }
+ }
+
+ IProgressMonitor monitor = new NullProgressMonitor();
+ String errMsg = null;
+ String[] makeArgs = new String[3];
+ makeArgs[0] = "-n"; // $NON-NLS-1$
+ makeArgs[1] = "all"; // $NON-NLS-1$
+ makeArgs[2] = "MAKE=make -W " + relFilePath.toOSString(); //$NON-NLS-1$
+
+ try {
+ Process proc = launcher.execute(makeCommandPath, makeArgs, env,
+ runPath, new NullProgressMonitor());
+ 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();
+ }
+ outString = stdout.toString();
+ } else {
+ errMsg = launcher.getErrorMessage();
+ }
+ } catch (CoreException e) {
+ errMsg = e.getLocalizedMessage();
+ AutotoolsPlugin.logErrorMessage(errMsg);
+ }
+ return outString;
+ }
+
+ private IFile getMakefile (IManagedBuildInfo info, IPath filePath) {
+ IWorkspaceRoot root = CCorePlugin.getWorkspace().getRoot();
+ IPath dir = filePath.removeLastSegments(1);
+ IFile makefile = null;
+ boolean done = false;
+ IPath makefilePath = null;
+ // Look starting at source file directory for the
+ // Makefile.in or Makefile for the given file.
+ while (!done) {
+ makefilePath = dir.append("Makefile.in"); // $NON-NLS-1$
+ makefile = root.getFile(makefilePath);
+ if (makefile != null && makefile.exists()) {
+ done = true;
+ continue;
+ }
+ makefilePath = dir.append("Makefile"); // $NON-NLS-1$
+ makefile = root.getFile(makefilePath);
+ if (makefile != null && makefile.exists()) {
+ done = true;
+ }
+ else {
+ dir = dir.removeLastSegments(1);
+ if (dir.lastSegment() == null)
+ done = true;
+ }
+ }
+ return makefile;
+ }
+
+ private String getCompilationString() {
+ if (compilationString != null && !isDirty)
+ return compilationString;
+ String makeWEnabled = null;
+ try {
+ makeWEnabled = project.getPersistentProperty(AutotoolsPropertyConstants.SCANNER_USE_MAKE_W);
+ } catch (CoreException e) {
+ // do nothing
+ }
+ if (!(res instanceof IFile) ||
+ makeWEnabled == null ||
+ makeWEnabled.equals("false")) // $NON-NLS-1$
+ return null;
+ isDirty = false;
+ IWorkspaceRoot root = CCorePlugin.getWorkspace().getRoot();
+ IFile file = root.getFile(filePath);
+ IFile makefile = null;
+ IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project);
+ // If the given file exists and we have a ManagedBuild, we may have
+ // an Autotools project source file.
+ if (file != null && file.exists() && info != null) {
+ makefile = getMakefile(info, filePath);
+ }
+ // We now have the closest directory to the given path
+ // that contains a Makefile.in or Makefile. This Makefile
+ // should contain a relative reference to the file in
+ // question. We now want to try and extract the include
+ // path from the top-level make run with the assumption
+ // that the file in question has been altered.
+ if (makefile != null) {
+ IPath dir = makefile.getFullPath().removeLastSegments(1);
+ // Get relative name of file as we assume the Makefile will
+ // refer to it this way.
+ String out = buildFile(filePath, makefile, info);
+ try {
+ boolean topLevel = dir.equals(project.getFullPath());
+ Pattern p = null;
+ Matcher m = null;
+ if (!topLevel) {
+ String regex1 = "^Making.*in.*" + dir.lastSegment(); // $NON-NLS-1$
+ p = Pattern.compile(regex1, Pattern.MULTILINE);
+ m = p.matcher(out);
+ }
+ if (topLevel || m.find()) {
+ Pattern p2 = null;
+ Matcher m2 = null;
+ String substr2 = out;
+ if (!topLevel) {
+ substr2 = out.substring(m.end());
+ String regex2 = "^make.*Entering directory.*`(.*)'"; // $NON-NLS-1$
+ p2 = Pattern.compile(regex2, Pattern.MULTILINE);
+ m2 = p2.matcher(substr2);
+ }
+ if (topLevel || m2.find()) {
+ String substr3 = null;
+ if (!topLevel) {
+ dirName = m2.group(1);
+ substr3 = substr2.substring(m2.start());
+ } else {
+ dirName = "";
+ substr3 = out;
+ }
+ // We need to test for both gcc and g++ compilers.
+ String regex3 = "^.*gcc.*?-I.*?" + filePath.lastSegment(); // $NON-NLS-1$
+ String regex4 = "^.*g[+][+].*?-I.*?" + filePath.lastSegment(); // $NON-NLS-1$
+ // Replace all continuation markers so we don't have to worry about newlines in
+ // the middle of a compilation string.
+ substr3 = substr3.replaceAll("\\\\\\n", "");
+ Pattern p3 = Pattern.compile(regex3, Pattern.MULTILINE);
+ Matcher m3 = p3.matcher(substr3);
+ if (m3.find())
+ compilationString = substr3.substring(m3.start(),m3.end());
+ else {
+ String substr4 = substr3;
+ Pattern p4 = Pattern.compile(regex4, Pattern.MULTILINE);
+ Matcher m4 = p4.matcher(substr4);
+ if (m4.find())
+ compilationString = substr3.substring(m4.start(),m4.end());
+ }
+ }
+ } else if (!out.equals("")) {
+ compilationString = "";
+ }
+ } catch (IllegalStateException t) {
+ // Mark as dirty for next time.
+ isDirty = true;
+ }
+ }
+ return compilationString;
+ }
+
+ public String[] getIncludePaths() {
+ String[] pathArray = new String[0];
+ if (project == null || filePath == null)
+ return pathArray;
+ if (includePaths != null && !isDirty && compilationString != null) {
+ return includePaths;
+ }
+ ArrayList<String> pathList = new ArrayList<String>();
+ String cs = getCompilationString();
+ if (cs != null) {
+ // Grab include paths specified via -I
+ Pattern p4 = Pattern.compile(" -I");
+ String[] tokens = p4.split(cs);
+ for (int j = 1; j < tokens.length; ++j) {
+ String x = tokens[j].trim();
+ int firstSpace = x.indexOf(' ');
+ if (firstSpace != -1) {
+ x = x.substring(0, firstSpace);
+ }
+ if (x.charAt(0) == '/') {
+ pathList.add(x);
+ } else {
+ IPath relPath = new Path(dirName);
+ relPath = relPath.append(x);
+ pathList.add(relPath.toOSString());
+ }
+ }
+ // Grab include paths that are specified via -isystem
+ Pattern p5 = Pattern.compile(" -isystem");
+ tokens = p5.split(cs);
+ for (int j = 1; j < tokens.length; ++j) {
+ String x = tokens[j].trim();
+ int firstSpace = x.indexOf(' ');
+ if (firstSpace != -1) {
+ x = x.substring(0, firstSpace);
+ }
+ if (x.charAt(0) == '/') {
+ pathList.add(x);
+ } else {
+ IPath relPath = new Path(dirName);
+ relPath = relPath.append(x);
+ pathList.add(relPath.toOSString());
+ }
+ }
+ }
+
+ // The ManagedBuildManager is the normal default IScannerInfoProvider
+ // for Managed Projects. It has the ability to check gcc for the
+ // default include paths and we don't want to lose that. Append
+ // the include paths from it to the end of our list which is dynamically
+ // picking up the -I options.
+
+ // TODO: Should we even allow the user-defined includePaths in settings?
+ // These will be picked up by the ManagedBuildManager.
+ IScannerInfo info = (IScannerInfo)ManagedBuildManager.getBuildInfo(project);
+ if (info != null) {
+ String[] extraIncludePaths = info.getIncludePaths();
+ for (int i = 0; i < extraIncludePaths.length; ++i) {
+ pathList.add(extraIncludePaths[i]);
+ }
+ }
+
+ includePaths = (String[])pathList.toArray(pathArray);
+
+ // FIXME: Info has been updated. Is this the best place to notify listeners?
+ Iterator<IScannerInfoChangeListener> i = listeners.iterator();
+ while (i.hasNext()) {
+ IScannerInfoChangeListener listener = (IScannerInfoChangeListener)i.next();
+ listener.changeNotification(project, this);
+ }
+ return includePaths;
+ }
+
+ @SuppressWarnings("unchecked")
+ public Map getDefinedSymbols () {
+ HashMap symbolMap = new HashMap();
+ if (project == null || filePath == null)
+ return symbolMap;
+ if (definedSymbols != null && !isDirty && compilationString != null) {
+ return definedSymbols;
+ }
+ // Extract -D directives from the compilation string.
+ // TODO: Handle -U directives as well.
+ String cs = getCompilationString();
+ if (cs != null) {
+ Pattern p4 = Pattern.compile("\\s-D([^\\s=]+)(?:=(\\\\\".*?\\\\\"|\\S*))?"); // $NON-NLS-1$
+ Matcher m = p4.matcher(cs);
+ while(m.find()) {
+ String name = m.group(1);
+ String value = m.group(2);
+ if(value != null)
+ symbolMap.put(name, value.replace("\\", "")); // $NON-NLS-1$ $NON-NLS-2$
+ else
+ symbolMap.put(name, "");
+ }
+ }
+ // Add the defined symbols from ManagedBuildManager. This will include
+ // the builtin implicit defines from the compiler and the user-set
+ // defines from settings. Since these are added last, they will overwrite
+ // existing defines fished out of the Makefiles above. For the user-defined
+ // symbols, this is the correct behavior. For the implicit defines,
+ // this is not; however, this is not valid programming behavior and
+ // the compiler definitely warns against it.
+ IScannerInfo info = (IScannerInfo)ManagedBuildManager.getBuildInfo(project);
+ if (info != null) {
+ Map builtinDefinedSymbols = info.getDefinedSymbols();
+ symbolMap.putAll(builtinDefinedSymbols);
+ }
+
+ definedSymbols = symbolMap;
+ return definedSymbols;
+ }
+
+ public void createIncludeChain(IFile include, IResource res) {
+ try {
+ // We store two different values. The first only lasts for the
+ // the session and is the actual resource. We prefer to work with
+ // this form as it is quicker. To handle persistence across
+ // sessions, we also store a persistent copy of the resource's
+ // path. When the session is brought back again, we will recreate
+ // the session chain again using the persistent data.
+ include.setSessionProperty(AutotoolsPropertyConstants.OPEN_INCLUDE, res);
+ include.setPersistentProperty(AutotoolsPropertyConstants.OPEN_INCLUDE_P, res.getLocation().toPortableString());
+ } catch (CoreException e) {
+ // Do nothing
+ }
+ }
+
+ /**
+ *
+ * @param resource the resource we are scanning
+ * @return the final resource in the include chain if one exists
+ * otherwise the resource itself
+ */
+ public static IResource followIncludeChain(IResource resource) {
+ IResource res = resource;
+ try {
+ boolean done = false;
+ // In the case of include files, we chain to the file that
+ // included the header file. This may end up ultimately as
+ // a source file which has build parameters such as flag
+ // defines and a separate include path.
+ while (!done) {
+ while (res.getSessionProperty(AutotoolsPropertyConstants.OPEN_INCLUDE) != null)
+ res = (IResource)res.getSessionProperty(AutotoolsPropertyConstants.OPEN_INCLUDE);
+ String chainPath = res.getPersistentProperty(AutotoolsPropertyConstants.OPEN_INCLUDE_P);
+ if (chainPath != null) {
+ IPath location = Path.fromPortableString(chainPath);
+ IResource next = res.getWorkspace().getRoot().getFileForLocation(location);
+ res.setSessionProperty(AutotoolsPropertyConstants.OPEN_INCLUDE, next);
+ res = next;
+ } else
+ done = true;
+ }
+ } catch (CoreException e) {
+ // Do nothing
+ } finally {
+ resource = res;
+ }
+ return resource;
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/AutotoolsScannerInfoProvider.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/AutotoolsScannerInfoProvider.java
new file mode 100644
index 0000000000..572ce76d5e
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/AutotoolsScannerInfoProvider.java
@@ -0,0 +1,112 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2007 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.eclipse.cdt.core.AbstractCExtension;
+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.managedbuilder.core.IManagedBuildInfo;
+import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.linuxtools.cdt.autotools.ui.properties.AutotoolsPropertyConstants;
+
+
+public class AutotoolsScannerInfoProvider extends AbstractCExtension implements IScannerInfoProvider {
+
+ static private Map<String, Map<IResource, AutotoolsScannerInfo>> infoCollections = new HashMap<String, Map<IResource, AutotoolsScannerInfo>>();
+ static public final String INTERFACE_IDENTITY =
+ AutotoolsPlugin.PLUGIN_ID + "." + "AutotoolsScannerInfoProvider"; // $NON-NLS-1$
+
+ protected String getCollectionName(IProject project) {
+ IManagedBuildInfo buildInfo = ManagedBuildManager.getBuildInfo(project);
+ String config = project.getName() + "." + buildInfo.getConfigurationName();
+ return config;
+ }
+
+ public synchronized IScannerInfo getScannerInformation(IResource resource) {
+ IResource res = AutotoolsScannerInfo.followIncludeChain(resource);
+ // We keep scanner info separate per configuration.
+ // This is because one configuration may result in a file being
+ // compiled with one include path while another configuration
+ // may change the include path / defined symbols.
+ IProject project = resource.getProject();
+
+ // We punt for non-Autotools projects. This ScannerInfoProvider is used for
+ // all C Projects and we might get called for a non-Autotools project (e.g.
+ // unsubscribe operation when converting to C project).
+ if (!AutotoolsMakefileBuilder.hasTargetBuilder(project))
+ return null;
+
+ // Check if the scanner info has been marked dirty, in which case we need
+ // to mark all entries dirty.
+ Boolean isDirty = Boolean.FALSE;
+ try {
+ isDirty = (Boolean)project.getSessionProperty(AutotoolsPropertyConstants.SCANNER_INFO_DIRTY);
+ } catch (CoreException e) {
+ // do nothing
+ }
+ if (isDirty != null && isDirty.equals(Boolean.TRUE)) {
+ setDirty(project);
+ try {
+ project.setSessionProperty(AutotoolsPropertyConstants.SCANNER_INFO_DIRTY, Boolean.FALSE);
+ } catch (CoreException ce) {
+ // do nothing
+ }
+ }
+ String config = getCollectionName(project);
+ // Get the ScannerInfo collection for current configuration or else
+ // create an empty collection if one doesn't already exist.
+ Map<IResource, AutotoolsScannerInfo> infoCollection = infoCollections.get(config);
+ if (infoCollection == null) {
+ infoCollection = new HashMap<IResource, AutotoolsScannerInfo>();
+ infoCollections.put(config, infoCollection);
+ }
+ AutotoolsScannerInfo info = (AutotoolsScannerInfo)infoCollection.get(res);
+ if (info == null) {
+ info = new AutotoolsScannerInfo(res);
+ infoCollection.put(res, info);
+ }
+ return info;
+ }
+
+ private void setDirty(IProject project) {
+ String config = getCollectionName(project);
+ Map<IResource, AutotoolsScannerInfo> infoCollection = infoCollections.get(config);
+ if (infoCollection != null) {
+ Collection<AutotoolsScannerInfo> s = infoCollection.values();
+ for (Iterator<AutotoolsScannerInfo> i = s.iterator(); i.hasNext();) {
+ AutotoolsScannerInfo info = (AutotoolsScannerInfo)i.next();
+ info.setDirty(true);
+ }
+ }
+ }
+
+ public void subscribe(IResource resource,
+ IScannerInfoChangeListener listener) {
+ AutotoolsScannerInfo info = (AutotoolsScannerInfo)getScannerInformation(resource);
+ info.addListener(listener);
+ }
+
+ public void unsubscribe(IResource resource,
+ IScannerInfoChangeListener listener) {
+ AutotoolsScannerInfo info = (AutotoolsScannerInfo)getScannerInformation(resource);
+ if (info != null)
+ info.removeListener(listener);
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/MakeGenerator.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/MakeGenerator.java
new file mode 100644
index 0000000000..aca5677d0e
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/MakeGenerator.java
@@ -0,0 +1,1374 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2007 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools;
+
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.ByteArrayInputStream;
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.EOFException;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.eclipse.cdt.core.CCorePlugin;
+import org.eclipse.cdt.core.CommandLauncher;
+import org.eclipse.cdt.core.ConsoleOutputStream;
+import org.eclipse.cdt.core.ICDescriptor;
+import org.eclipse.cdt.core.envvar.IEnvironmentVariable;
+import org.eclipse.cdt.core.resources.IConsole;
+import org.eclipse.cdt.core.settings.model.ICStorageElement;
+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.IMakefile;
+import org.eclipse.cdt.make.core.makefile.ITarget;
+import org.eclipse.cdt.make.core.makefile.ITargetRule;
+import org.eclipse.cdt.managedbuilder.core.BuildException;
+import org.eclipse.cdt.managedbuilder.core.IBuilder;
+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.ITool;
+import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
+import org.eclipse.cdt.managedbuilder.macros.BuildMacroException;
+import org.eclipse.cdt.managedbuilder.macros.IBuildMacroProvider;
+import org.eclipse.cdt.managedbuilder.makegen.IManagedBuilderMakefileGenerator;
+import org.eclipse.cdt.managedbuilder.makegen.IManagedBuilderMakefileGenerator2;
+import org.eclipse.cdt.newmake.core.IMakeCommonBuildInfo;
+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.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.MultiStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.linuxtools.cdt.autotools.ui.properties.AutotoolsPropertyConstants;
+import org.eclipse.linuxtools.internal.cdt.autotools.MarkerGenerator;
+
+
+@SuppressWarnings("deprecation")
+public class MakeGenerator extends MarkerGenerator implements IManagedBuilderMakefileGenerator, IManagedBuilderMakefileGenerator2 {
+
+ public final String CONFIG_STATUS = "config.status"; //$NON-NLS-1$
+ public final String MAKEFILE = "Makefile"; //$NON-NLS-1$
+ public final String MAKEFILE_CVS = "Makefile.cvs"; //$NON-NLS-1$
+ public final String SETTINGS_FILE_NAME = ".cdtconfigure"; //$NON-NLS-1$
+ public final String SHELL_COMMAND = "sh"; //$NON-NLS-1$
+
+ public final String AUTOGEN_TOOL_ID = "org.eclipse.linuxtools.cdt.autotools.tool.autogen"; //$NON-NLS-1$
+ public final String CONFIGURE_TOOL_ID = "org.eclipse.linuxtools.cdt.autotools.tool.configure"; //$NON-NLS-1$
+
+ public final String GENERATED_TARGET = AutotoolsPlugin.PLUGIN_ID + ".generated.MakeTarget"; //$NON-NLS-1$
+
+ private static final String MAKE_TARGET_KEY = MakeCorePlugin.getUniqueIdentifier() + ".buildtargets"; //$NON-NLS-1$
+ 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"; //$NON-NLS-1$
+ private static final String TARGET_ATTR_NAME = "name"; //$NON-NLS-1$
+ private static final String TARGET_STOP_ON_ERROR = "stopOnError"; //$NON-NLS-1$
+ private static final String TARGET_USE_DEFAULT_CMD = "useDefaultCommand"; //$NON-NLS-1$
+ private static final String TARGET_ARGUMENTS = "buildArguments"; //$NON-NLS-1$
+ private static final String TARGET_COMMAND = "buildCommand"; //$NON-NLS-1$
+ private static final String TARGET_RUN_ALL_BUILDERS = "runAllBuilders";
+ private static final String TARGET = "buildTarget"; //$NON-NLS-1$
+
+ private IProject project;
+
+ private IProgressMonitor monitor;
+
+ private String buildDir;
+ private String srcDir;
+
+ private IConfiguration cfg;
+ private IBuilder builder;
+
+ public void generateDependencies() throws CoreException {
+ // TODO Auto-generated method stub
+
+ }
+
+ public MultiStatus generateMakefiles(IResourceDelta delta)
+ throws CoreException {
+ return regenerateMakefiles();
+ }
+
+ private void initializeBuildConfigDirs() {
+ ITool tool = cfg.getToolFromOutputExtension("status"); //$NON-NLS-1$
+ IOption[] options = tool.getOptions();
+ for (int i = 0; i < options.length; ++i) {
+ String id = options[i].getId();
+ if (id.indexOf("builddir") > 0) { //$NON-NLS-1$
+ buildDir = (String) options[i].getValue();
+ try {
+ String resolved = ManagedBuildManager.getBuildMacroProvider().resolveValue(buildDir, "build", null,
+ IBuildMacroProvider.CONTEXT_CONFIGURATION, cfg);
+ buildDir = resolved;
+ } catch (BuildMacroException e) {
+ // do nothing
+ }
+// try {
+// builder.setBuildAttribute(IMakeCommonBuildInfo.BUILD_LOCATION,
+// project.getLocation().append(buildDir).toOSString());
+// } catch (CoreException e) {
+// e.printStackTrace();
+// }
+ } else if (id.indexOf("configdir") > 0) { //$NON-NLS-1$
+ srcDir = (String) options[i].getValue();
+ try {
+ String resolved = ManagedBuildManager.getBuildMacroProvider().resolveValue(srcDir, "", null,
+ IBuildMacroProvider.CONTEXT_CONFIGURATION, cfg);
+ srcDir = resolved;
+ } catch (BuildMacroException e) {
+ // do nothing
+ }
+ }
+ }
+ }
+
+ public void initialize(IProject project, IManagedBuildInfo info,
+ IProgressMonitor monitor) {
+ this.project = project;
+ this.cfg = info.getDefaultConfiguration();
+ this.builder = cfg.getBuilder();
+ this.monitor = monitor;
+ initializeBuildConfigDirs();
+ }
+
+ public void initialize(int buildKind, IConfiguration cfg, IBuilder builder,
+ IProgressMonitor monitor) {
+ this.cfg = cfg;
+ this.builder = builder;
+ this.monitor = monitor;
+ this.project = (IProject)cfg.getManagedProject().getOwner();
+ initializeBuildConfigDirs();
+ }
+
+ public IProject getProject() {
+ return project;
+ }
+
+ public boolean isGeneratedResource(IResource resource) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public void regenerateDependencies(boolean force) throws CoreException {
+ // TODO Auto-generated method stub
+
+ }
+
+ /*
+ * (non-Javadoc) Check whether the build has been cancelled. Cancellation
+ * requests propagated to the caller by throwing <code>OperationCanceledException</code>.
+ *
+ * @see org.eclipse.core.runtime.OperationCanceledException#OperationCanceledException()
+ */
+ protected void checkCancel() {
+ if (monitor != null && monitor.isCanceled()) {
+ throw new OperationCanceledException();
+ }
+ }
+
+ /*
+ * (non-Javadoc) Return or create the makefile needed for the build. If we
+ * are creating the resource, set the derived bit to true so the CM system
+ * ignores the contents. If the resource exists, respect the existing
+ * derived setting.
+ *
+ * @param makefilePath @return IFile
+ */
+ protected 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, new SubProgressMonitor(monitor, 1));
+ // Make sure the new file is marked as derived
+ if (!newFile.isDerived()) {
+ newFile.setDerived(true);
+ }
+
+ } 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;
+ }
+
+ /*
+ * (non-Javadoc) Return or create the folder needed for the build output. If
+ * we are creating the folder, set the derived bit to true so the CM system
+ * ignores the contents. If the resource exists, respect the existing
+ * derived setting.
+ *
+ * @param string @return IPath
+ */
+ private boolean createDirectory(String dirName) throws CoreException {
+ // Create or get the handle for the build directory
+ boolean rc = true;
+ IPath path = new Path(dirName);
+ if (dirName.length() == 0 || dirName.startsWith(".") || !dirName.startsWith("/"))
+ path = project.getLocation().append(dirName);
+ File f = path.toFile();
+ if (!f.exists())
+ rc = f.mkdirs();
+
+ return rc;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.cdt.managedbuilder.makegen.IManagedBuilderMakefileGenerator#getBuildWorkingDir()
+ */
+ public IPath getBuildWorkingDir() {
+ return new Path(buildDir);
+ }
+
+ /*
+ * (non-Javadoc) Get the project's absolute path. @return IPath
+ */
+ private IPath getProjectLocation() {
+ return project.getLocation();
+ }
+
+ private String getAbsoluteDirectory(String dir) {
+ IPath path = new Path(dir);
+ if (!path.isAbsolute()) {
+ IPath absPath = getProjectLocation().addTrailingSeparator().append(
+ path);
+ return getPathString(absPath);
+ }
+ return dir;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.cdt.managedbuilder.makegen.IManagedBuilderMakefileGenerator#getMakefileName()
+ */
+ public String getMakefileName() {
+ return new String(MAKEFILE);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @return the path to the configuration settings file
+ */
+ protected IPath getConfigSettingsPath() {
+ IPath path = project.getWorkingLocation(AutotoolsPlugin.PLUGIN_ID).append(SETTINGS_FILE_NAME + "." + cfg.getName()); //$NON-NLS-1$
+ return path;
+ }
+
+ public void removeConfigSettings() {
+ File f = getConfigSettingsPath().toFile();
+ try {
+ f.delete();
+ } catch (Exception e) {
+ // do nothing
+ }
+ }
+
+ public MultiStatus regenerateMakefiles() throws CoreException {
+ MultiStatus status;
+ int rc = IStatus.OK;
+ String errMsg = new String();
+ boolean needFullConfigure = true;
+
+ // See if the user has cancelled the build
+ checkCancel();
+
+ // Create the top-level directory for the build output
+ if (!createDirectory(buildDir)) {
+ rc = IStatus.ERROR;
+ errMsg = AutotoolsPlugin.getFormattedString("MakeGenerator.createdir.error", //$NON-NLS-1$
+ new String[] {buildDir});
+ return new MultiStatus(AutotoolsPlugin.getUniqueIdentifier(),
+ rc, errMsg, null);
+ }
+
+ checkCancel();
+
+ // // How did we do
+ // if (!getInvalidDirList().isEmpty()) {
+ // status = new MultiStatus (
+ // ManagedBuilderCorePlugin.getUniqueIdentifier(),
+ // IStatus.WARNING,
+ // new String(),
+ // null);
+ // // Add a new status for each of the bad folders
+ // iter = getInvalidDirList().iterator();
+ // while (iter.hasNext()) {
+ // status.add(new Status (
+ // IStatus.WARNING,
+ // ManagedBuilderCorePlugin.getUniqueIdentifier(),
+ // SPACES_IN_PATH,
+ // ((IContainer)iter.next()).getFullPath().toString(),
+ // null));
+ // }
+ // } else {
+ // status = new MultiStatus(
+ // ManagedBuilderCorePlugin.getUniqueIdentifier(),
+ // IStatus.OK,
+ // new String(),
+ // null);
+ // }
+
+ // Get a build console for the project
+ IConsole console = CCorePlugin.getDefault().getConsole("org.eclipse.linuxtools.cdt.autotools.configureConsole"); //$NON-NLS-1$
+
+ // Get the project and make sure there's a monitor to cancel the build
+ if (monitor == null) {
+ monitor = new NullProgressMonitor();
+ }
+
+ try {
+ // If a config.status file exists in the build directory, we call it
+ // to
+ // regenerate the makefile
+ IPath configfile = getProjectLocation().append(buildDir).append(
+ CONFIG_STATUS);
+ IPath makefilePath = getProjectLocation().append(buildDir).append(MAKEFILE);
+ File configStatus = configfile.toFile();
+ File makefile = makefilePath.toFile();
+ IPath configSettingsPath = getConfigSettingsPath();
+ File configSettings = configSettingsPath.toFile();
+ String[] configArgs = getConfigArgs();
+
+ // We need to figure out if the end-user has changed the configuration
+ // settings. In such a case, we need to reconfigure from scratch
+ // regardless of whether config.status exists or not.
+ // We figure this out by saving the configuration settings to
+ // a special file and reading/comparing whenever we are asked to build.
+ if (configSettings.exists()) {
+ int i = 0;
+ boolean needSaveConfigArgs = false;
+ needFullConfigure = false;
+ try {
+ DataInputStream settings = new DataInputStream(
+ new BufferedInputStream(new FileInputStream(configSettings)));
+ // Get the first String in the configure settings file.
+ // Newer configure settings file start with the project name.
+ // If the project name is present and doesn't match the
+ // current project name, the project has been refactored and
+ // we need to do a full reconfigure.
+ settings.mark(100);
+ String s = settings.readUTF();
+ if (s.startsWith("project=")) { //$NON-NLS-1$
+ if (!s.substring(8).equals(project.getName())) {
+ needFullConfigure = true;
+ }
+ } else {
+ // An older configure arguments file. Reset
+ // to beginning and process as normal.
+ needSaveConfigArgs = true;
+ settings.reset();
+ }
+ while (i < configArgs.length) {
+ s = settings.readUTF();
+ if (!s.equals(configArgs[i])) {
+ i = configArgs.length;
+ needFullConfigure = true;
+ }
+ ++i;
+ }
+ if (settings.available() > 0)
+ needFullConfigure = true;
+ } catch (EOFException e) {
+ needFullConfigure = true;
+ } catch (IOException e) {
+ needFullConfigure = true;
+ }
+ if (needFullConfigure) {
+ // If we are going to do a full reconfigure, then if the current
+ // build directory exists, we should clean it out first. This is
+ // because the reconfiguration could change compile flags, etc..
+ // and the Makefile might not detect a rebuild is required. In
+ // addition, the build directory itself could have been changed and
+ // we should remove the previous build.
+ File r = project.getLocation().append(buildDir).toFile();
+ if (r != null && r.exists()) {
+ // See what type of cleaning the user has set up in the
+ // build properties dialog.
+ String cleanDelete = null;
+ try {
+ cleanDelete = getProject().getPersistentProperty(AutotoolsPropertyConstants.CLEAN_DELETE);
+ } catch (CoreException ce) {
+ // do nothing
+ }
+
+ if (cleanDelete != null && cleanDelete.equals(AutotoolsPropertyConstants.TRUE)) {
+ SubProgressMonitor sub = new SubProgressMonitor(monitor, IProgressMonitor.UNKNOWN);
+ sub.beginTask(AutotoolsPlugin.getResourceString("MakeGenerator.clean.builddir"), IProgressMonitor.UNKNOWN);
+ try {
+ r.delete();
+ } finally {
+ sub.done();
+ }
+ }
+ else {
+ // There is a make target for cleaning.
+ if (makefile != null && makefile.exists()) {
+ String[] makeargs = new String[1];
+ IPath makeCmd = new Path("make"); //$NON-NLS-1$
+ String target = null;
+ try {
+ target = getProject().getPersistentProperty(AutotoolsPropertyConstants.CLEAN_MAKE_TARGET);
+ } catch (CoreException ce) {
+ // do nothing
+ }
+ if (target == null)
+ target = AutotoolsPropertyConstants.CLEAN_MAKE_TARGET_DEFAULT;
+ String args = builder.getBuildArguments();
+ if (args != null && !(args = args.trim()).equals("")) { //$NON-NLS-1$
+ String[] newArgs = makeArray(args);
+ makeargs = new String[newArgs.length + 1];
+ System.arraycopy(newArgs, 0, makeargs, 0, newArgs.length);
+ }
+ makeargs[makeargs.length - 1] = target;
+ rc = runCommand(makeCmd,
+ project.getLocation().append(buildDir),
+ makeargs,
+ AutotoolsPlugin.getResourceString("MakeGenerator.clean.builddir"), //$NON-NLS-1$
+ errMsg, console, true);
+ }
+ }
+ }
+ initializeBuildConfigDirs();
+ createDirectory(buildDir);
+ // Mark the scanner info as dirty.
+ try {
+ project.setSessionProperty(AutotoolsPropertyConstants.SCANNER_INFO_DIRTY, Boolean.TRUE);
+ } catch (CoreException ce) {
+ // do nothing
+ }
+ } else if (needSaveConfigArgs) {
+ // No change in configuration args, but we have old
+ // style settings format which can't determine if project has
+ // been renamed. Refresh the settings file.
+ saveConfigArgs(configArgs);
+ }
+ }
+
+ ArrayList<String> configureEnvs = new ArrayList<String>();
+ IPath configurePath = getConfigurePath(configureEnvs);
+ ArrayList<String> autogenEnvs = new ArrayList<String>();
+ IPath autogenPath = getAutogenPath(autogenEnvs);
+
+ // Check if we have a config.status (meaning configure has already run).
+ if (!needFullConfigure && configStatus != null && configStatus.exists()) {
+ // If no corresponding Makefile in the same build location, then we
+ // can simply run config.status again to ensure the top level Makefile has been
+ // created.
+ if (makefile == null || !makefile.exists()) {
+ rc = runScript(configfile, project.getLocation().append(
+ buildDir), null,
+ AutotoolsPlugin.getResourceString("MakeGenerator.run.config.status"), //$NON-NLS-1$
+ errMsg, console, null, true);
+ }
+ }
+ // Look for configure and configure from scratch
+ else if (configurePath.toFile().exists()) {
+ rc = runScript(configurePath,
+ project.getLocation().append(buildDir),
+ configArgs,
+ AutotoolsPlugin.getResourceString("MakeGenerator.gen.makefile"), //$NON-NLS-1$
+ errMsg, console, configureEnvs, true);
+ if (rc != IStatus.ERROR) {
+ File makefileFile = project.getLocation().append(buildDir)
+ .append(MAKEFILE).toFile();
+ addMakeTargetsToManager(makefileFile);
+ // TODO: should we do something special if configure doesn't
+ // return ok?
+ saveConfigArgs(configArgs);
+ }
+ }
+ // If no configure, look for autogen.sh which may create configure and
+ // possibly even run it.
+ else if (autogenPath.toFile().exists()) {
+ // Remove the existing config.status file since we use it
+ // to figure out if configure was run.
+ if (configStatus.exists())
+ configStatus.delete();
+ // Get any user-specified arguments for autogen.
+ String[] autogenArgs = getAutogenArgs();
+ rc = runScript(autogenPath,
+ autogenPath.removeLastSegments(1), autogenArgs,
+ AutotoolsPlugin.getResourceString("MakeGenerator.autogen.sh"), //$NON-NLS-1$
+ errMsg, console, autogenEnvs, true);
+ if (rc != IStatus.ERROR) {
+ configStatus =configfile.toFile();
+ // Check for config.status. If it is created, then
+ // autogen.sh ran configure and we should not run it
+ // ourselves.
+ if (configStatus == null || !configStatus.exists()) {
+ rc = runScript(configurePath,
+ project.getLocation().append(buildDir),
+ configArgs,
+ AutotoolsPlugin.getResourceString("MakeGenerator.gen.makefile"), //$NON-NLS-1$
+ errMsg, console, configureEnvs, false);
+ if (rc != IStatus.ERROR) {
+ File makefileFile = project.getLocation().append(buildDir)
+ .append(MAKEFILE).toFile();
+ addMakeTargetsToManager(makefileFile);
+ }
+ } else {
+ File makefileFile = project.getLocation().append(buildDir)
+ .append(MAKEFILE).toFile();
+ addMakeTargetsToManager(makefileFile);
+ }
+ }
+ }
+ // If nothing this far, look for a Makefile.cvs file which needs to be run.
+ else if (makefileCvsExists()) {
+ String[] makeargs = new String[1];
+ IPath makeCmd = new Path("make"); //$NON-NLS-1$
+ makeargs[0] = "-f" + getMakefileCVSPath().toOSString(); //$NON-NLS-1$
+ rc = runCommand(makeCmd,
+ project.getLocation().append(buildDir),
+ makeargs,
+ AutotoolsPlugin.getResourceString("MakeGenerator.makefile.cvs"), //$NON-NLS-1$
+ errMsg, console, true);
+ if (rc != IStatus.ERROR) {
+ File makefileFile = project.getLocation().append(buildDir)
+ .append(MAKEFILE).toFile();
+ addMakeTargetsToManager(makefileFile);
+ saveConfigArgs(configArgs);
+ }
+ }
+ // If nothing this far, try running autoreconf -i
+ else {
+ String[] reconfArgs = new String[1];
+ String reconfCmd = project.getPersistentProperty(AutotoolsPropertyConstants.AUTORECONF_TOOL);
+ if (reconfCmd == null)
+ reconfCmd = "autoreconf"; // $NON-NLS-1$
+ IPath reconfCmdPath = new Path(reconfCmd);
+ reconfArgs[0] = "-i"; //$NON-NLS-1$
+ rc = runCommand(reconfCmdPath,
+ project.getLocation().append(srcDir),
+ reconfArgs,
+ AutotoolsPlugin.getResourceString("MakeGenerator.autoreconf"), //$NON-NLS-1$
+ errMsg, console, true);
+ // Check if configure generated and if yes, run it.
+ if (rc != IStatus.ERROR) {
+ if (configurePath.toFile().exists()) {
+
+ rc = runScript(configurePath,
+ project.getLocation().append(buildDir),
+ configArgs,
+ AutotoolsPlugin.getResourceString("MakeGenerator.gen.makefile"), //$NON-NLS-1$
+ errMsg, console, configureEnvs, false);
+ if (rc != IStatus.ERROR) {
+ File makefileFile = project.getLocation().append(buildDir)
+ .append(MAKEFILE).toFile();
+ addMakeTargetsToManager(makefileFile);
+ // TODO: should we do something special if configure doesn't
+ // return ok?
+ saveConfigArgs(configArgs);
+ }
+ }
+ }
+ }
+
+ // Treat no Makefile as generation error.
+ if (makefile == null || !makefile.exists()) {
+ rc = IStatus.ERROR;
+ errMsg = AutotoolsPlugin.getResourceString("MakeGenerator.didnt.generate"); //$NON-NLS-1$
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ // forgetLastBuiltState();
+ rc = IStatus.ERROR;
+ } finally {
+ // getGenerationProblems().clear();
+ status = new MultiStatus(AutotoolsPlugin
+ .getUniqueIdentifier(), rc, errMsg, null);
+ }
+ return status;
+ }
+
+ /**
+ * Strip a command of VAR=VALUE pairs that appear ahead of the command and add
+ * them to a list of environment variables.
+ *
+ * @param command - command to strip
+ * @param envVars - ArrayList to add environment variables to
+ * @return stripped command
+ */
+ public static String stripEnvVars(String command, ArrayList<String> envVars) {
+ Pattern p = Pattern.compile("(\\w+[=]([$]?\\w+[:;]?)+\\s+)\\w+.*");
+ Pattern p2 = Pattern.compile("(\\w+[=]\\\".*?\\\"\\s+)\\w+.*");
+ Pattern p3 = Pattern.compile("(\\w+[=]'.*?'\\s+)\\w+.*");
+ boolean finished = false;
+ while (!finished) {
+ Matcher m = p.matcher(command);
+ if (m.matches()) {
+ command = command.replaceFirst("\\w+[=]([$]?\\w+[:;]?)+", "").trim();
+ envVars.add(m.group(1).trim());
+ } else {
+ Matcher m2 = p2.matcher(command);
+ if (m2.matches()) {
+ command = command.replaceFirst("\\w+[=]\\\".*?\\\"","").trim();
+ String s = m2.group(1).trim();
+ envVars.add(s.replaceAll("\\\"", ""));
+ } else {
+ Matcher m3 = p3.matcher(command);
+ if (m3.matches()) {
+ command = command.replaceFirst("\\w+[=]'.*?'", "").trim();
+ String s = m3.group(1).trim();
+ envVars.add(s.replaceAll("'", ""));
+ } else {
+ finished = true;
+ }
+ }
+ }
+ }
+ return command;
+ }
+
+ protected IPath getConfigurePath(ArrayList<String> envVars) {
+ IPath configPath;
+ ITool[] tool = cfg.getToolsBySuperClassId(CONFIGURE_TOOL_ID);
+ String command = stripEnvVars(tool[0].getToolCommand().trim(), envVars);
+
+ if (srcDir.equals(""))
+ configPath = project.getLocation().append(command);
+ else
+ configPath = project.getLocation().append(srcDir).append(command);
+ return configPath;
+ }
+
+ protected IPath getMakefileCVSPath() {
+ IPath makefileCVSPath;
+ if (srcDir.equals(""))
+ makefileCVSPath = project.getLocation().append(MAKEFILE_CVS);
+ else
+ makefileCVSPath= project.getLocation().append(srcDir).append(
+ MAKEFILE_CVS);
+ return makefileCVSPath;
+ }
+
+ protected boolean makefileCvsExists() {
+ IPath makefileCVSPath = getMakefileCVSPath();
+ return makefileCVSPath.toFile().exists();
+ }
+
+ protected IPath getAutogenPath(ArrayList<String> envVars) {
+ IPath autogenPath;
+ ITool[] tool = cfg.getToolsBySuperClassId(AUTOGEN_TOOL_ID);
+ String command = stripEnvVars(tool[0].getToolCommand().trim(), envVars);
+
+ if (srcDir.equals(""))
+ autogenPath = project.getLocation().append(command);
+ else
+ autogenPath = project.getLocation().append(srcDir).append(command);
+ return autogenPath;
+ }
+
+ private void saveConfigArgs(String[] args) {
+ IPath settingsPath = getConfigSettingsPath();
+ try {
+ File f = settingsPath.toFile();
+ DataOutputStream settings = new DataOutputStream(
+ new BufferedOutputStream(new FileOutputStream(f)));
+ // Write the project name in the configure arguments
+ // so we know if the project gets refactored.
+ settings.writeUTF("project=" + project.getName()); //$NON-NLS-1$
+ for (int i = 0; i < args.length; ++i) {
+ settings.writeUTF(args[i]);
+ }
+ settings.close();
+ } catch (IOException e) {
+ /* What should we do? */
+ }
+ }
+
+ private String[] getAutogenArgs() throws BuildException {
+ // Get the arguments to be passed to config from build model
+ ITool[] tool = cfg.getToolsBySuperClassId(AUTOGEN_TOOL_ID);
+ IOption[] options = tool[0].getOptions();
+ ArrayList<String> autogenArgs = new ArrayList<String>();
+
+ for (int i = 0; i < options.length; ++i) {
+ if (options[i].getValueType() == IOption.STRING) {
+ String value = (String) options[i].getValue();
+ try {
+ String resolved = ManagedBuildManager.getBuildMacroProvider().resolveValue(value, "", null,
+ IBuildMacroProvider.CONTEXT_CONFIGURATION, cfg);
+ value = resolved;
+ } catch (BuildMacroException e) {
+ // do nothing
+ }
+ String id = options[i].getId();
+ if (id.indexOf("user") > 0) { //$NON-NLS-1$
+ // May be multiple user-specified options in which case we
+ // need to split them up into individual options
+ value = value.trim();
+ boolean finished = false;
+ int lastIndex = value.indexOf("--"); //$NON-NLS-1$
+ if (lastIndex != -1) {
+ while (!finished) {
+ int index = value.indexOf("--",lastIndex+2); //$NON-NLS-1$
+ if (index != -1) {
+ String previous = value.substring(lastIndex, index).trim();
+ autogenArgs.add(previous);
+ value = value.substring(index);
+ } else {
+ autogenArgs.add(value);
+ finished = true;
+ }
+ }
+ }
+ }
+ }
+ }
+ return (String[]) autogenArgs.toArray(new String[autogenArgs.size()]);
+ }
+
+ private String[] getConfigArgs() throws BuildException {
+ // Get the arguments to be passed to config from build model
+ ITool tool = cfg.getToolFromOutputExtension("status"); //$NON-NLS-1$
+ IOption[] options = tool.getOptions();
+ ArrayList<String> configArgs = new ArrayList<String>();
+ for (int i = 0; i < options.length; ++i) {
+ if (options[i].getValueType() == IOption.STRING) {
+ String value = (String) options[i].getValue();
+ try {
+ String resolved = ManagedBuildManager.getBuildMacroProvider().resolveValue(value, "", null,
+ IBuildMacroProvider.CONTEXT_CONFIGURATION, cfg);
+ value = resolved;
+ } catch (BuildMacroException e) {
+ // do nothing
+ }
+ String id = options[i].getId();
+ if (id.indexOf("configdir") > 0 || id.indexOf("builddir") > 0) //$NON-NLS-1$ $NON-NLS-2$
+ continue;
+ else if (id.indexOf("user") > 0) { //$NON-NLS-1$
+ // May be multiple user-specified options in which case we
+ // need to split them up into individual options
+ value = value.trim();
+ boolean finished = false;
+ int lastIndex = value.indexOf("--"); //$NON-NLS-1$
+ if (lastIndex != -1) {
+ while (!finished) {
+ int index = value.indexOf("--",lastIndex+2); //$NON-NLS-1$
+ if (index != -1) {
+ String previous = value.substring(lastIndex, index).trim();
+ configArgs.add(previous);
+ value = value.substring(index);
+ } else {
+ configArgs.add(value);
+ finished = true;
+ }
+ }
+ } else {
+ // No --xxx arguments, but there might still be some NAME=VALUE args
+ // and we should pass them on regardless
+ configArgs.add(value);
+ }
+ }
+ else if (value.trim().length() > 0) {
+ String categoryId = options[i].getCategory().getId();
+ if (categoryId.indexOf("directories") >= 0) //$NON-NLS-1$
+ value = getAbsoluteDirectory(value);
+ String cmd = options[i].getCommand().concat(value);
+ configArgs.add(cmd);
+ }
+ } else if (options[i].getValueType() == IOption.BOOLEAN) {
+ Boolean value = (Boolean) options[i].getValue();
+ if (value.booleanValue())
+ configArgs.add(options[i].getCommand());
+ else if (!options[i].getCommandFalse().equals(""))
+ configArgs.add(options[i].getCommandFalse());
+ }
+ }
+ return (String[]) configArgs.toArray(new String[configArgs.size()]);
+ }
+
+ // Run a command or executable (e.g. make).
+ private int runCommand(IPath commandPath, IPath runPath, String[] args,
+ String jobDescription, String errMsg, IConsole console,
+ boolean consoleStart) throws BuildException, CoreException,
+ NullPointerException, IOException {
+ // TODO: Figure out what this next stuff is used for
+ // //try to resolve the build macros in the builder command
+ // try{
+ // String resolved =
+ // ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(
+ // configCmd,
+ // "", //$NON-NLS-1$
+ // " ", //$NON-NLS-1$
+ // IBuildMacroProvider.CONTEXT_CONFIGURATION,
+ // info.getDefaultConfiguration());
+ // if((resolved = resolved.trim()).length() > 0)
+ // configCmd = resolved;
+ // } catch (BuildMacroException e){
+ // }
+
+ int rc = IStatus.OK;
+
+ removeAllMarkers(project);
+
+ String[] configTargets = args;
+ if (args == null)
+ configTargets = new String[0];
+
+ String[] msgs = new String[2];
+ msgs[0] = commandPath.toString();
+ msgs[1] = project.getName();
+ monitor.subTask(AutotoolsPlugin.getFormattedString(
+ "MakeGenerator.make.message", msgs)); //$NON-NLS-1$
+
+
+ ConsoleOutputStream consoleOutStream = null;
+ StringBuffer buf = new StringBuffer();
+
+ // Launch command - main invocation
+ if (consoleStart)
+ console.start(project);
+ consoleOutStream = console.getOutputStream();
+ String[] consoleHeader = new String[3];
+
+ consoleHeader[0] = jobDescription;
+ consoleHeader[1] = cfg.getName();
+ consoleHeader[2] = project.getName();
+ buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$ //$NON-NLS-2$
+ buf.append(jobDescription);
+ buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$ //$NON-NLS-2$
+ buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$ //$NON-NLS-2$
+
+ if (!cfg.isSupported()) {
+ String msgArgs[] = new String[1];
+ msgArgs[0] = cfg.getName();
+ buf.append(AutotoolsPlugin.getFormattedString("MakeGenerator.unsupportedConfig", msgArgs));
+ buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$ //$NON-NLS-2$
+ buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ consoleOutStream.write(buf.toString().getBytes());
+ consoleOutStream.flush();
+
+ // Get a launcher for the config command
+ CommandLauncher launcher = new CommandLauncher();
+ // Set the environment
+ IEnvironmentVariable variables[] = ManagedBuildManager
+ .getEnvironmentVariableProvider().getVariables(cfg, true);
+ String[] env = null;
+ ArrayList<String> envList = new ArrayList<String>();
+ if (variables != null) {
+ for (int i = 0; i < variables.length; i++) {
+ envList.add(variables[i].getName()
+ + "=" + variables[i].getValue()); //$NON-NLS-1$
+ }
+ env = (String[]) envList.toArray(new String[envList.size()]);
+ }
+
+ // // Hook up an error parser manager
+ // String[] errorParsers =
+ // info.getDefaultConfiguration().getErrorParserList();
+ // ErrorParserManager epm = new ErrorParserManager(project, topBuildDir,
+ // this, errorParsers);
+ // epm.setOutputStream(consoleOutStream);
+ OutputStream stdout = consoleOutStream;
+ OutputStream stderr = consoleOutStream;
+
+ launcher.showCommand(true);
+ Process proc = launcher.execute(commandPath, configTargets, env,
+ runPath, new NullProgressMonitor());
+ 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
+ // ensure
+ // the UI is up-to-date with the build results
+ // monitor.subTask(ManagedMakeMessages
+ // .getResourceString(REFRESH));
+ monitor.subTask(AutotoolsPlugin.getResourceString("MakeGenerator.refresh")); //$NON-NLS-1$
+ try {
+ project.refreshLocal(IResource.DEPTH_INFINITE, null);
+ } catch (CoreException e) {
+ monitor.subTask(AutotoolsPlugin
+ .getResourceString("MakeGenerator.refresh.error")); //$NON-NLS-1$
+ }
+ } else {
+ errMsg = launcher.getErrorMessage();
+ }
+
+ // Report either the success or failure of our mission
+ buf = new StringBuffer();
+ if (errMsg != null && errMsg.length() > 0) {
+ String errorDesc = AutotoolsPlugin
+ .getResourceString("MakeGenerator.generation.error"); //$NON-NLS-1$
+ buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$//$NON-NLS-2$
+ buf.append(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$
+ rc = IStatus.ERROR;
+ } else if (proc.exitValue() >= 1 || proc.exitValue() < 0) {
+ // We have an invalid return code from configuration.
+ String[] errArg = new String[2];
+ errArg[0] = Integer.toString(proc.exitValue());
+ errArg[1] = commandPath.toString();
+ errMsg = AutotoolsPlugin.getFormattedString(
+ "MakeGenerator.config.error", errArg); //$NON-NLS-1$
+ buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$//$NON-NLS-2$
+ buf.append(AutotoolsPlugin.getResourceString("MakeGenerator.generation.error")); //$NON-NLS-1$
+ buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$//$NON-NLS-2$
+ if (proc.exitValue() == 1)
+ rc = IStatus.WARNING;
+ else
+ rc = IStatus.ERROR;
+ } else {
+ // Report a successful build
+ String successMsg =
+ AutotoolsPlugin.getResourceString("MakeGenerator.success"); //$NON-NLS-1$
+ buf.append(successMsg);
+ buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$//$NON-NLS-2$
+ rc = IStatus.OK;
+ }
+
+ // Write message on the console
+ consoleOutStream.write(buf.toString().getBytes());
+ consoleOutStream.flush();
+
+ // // Generate any error markers that the build has discovered
+ // monitor.subTask(ManagedMakeMessages
+ // .getResourceString(MARKERS));
+ // epm.reportProblems();
+ consoleOutStream.close();
+
+ // TODO: For now, add a marker with our generated error message.
+ // In the future, we might add an error parser to do this properly
+ // and give the actual error line, etc..
+ if (rc == IStatus.ERROR) {
+ addMarker(project, -1, errMsg, SEVERITY_ERROR_BUILD, null);
+ // Mark the configuration as needing a full rebuild.
+ cfg.setRebuildState(true);
+ }
+
+ return rc;
+ }
+
+ // Get the path string. We add a Win check to handle MingW.
+ // For MingW, we would rather represent C:\a\b as /C/a/b which
+ // doesn't cause Makefile to choke.
+ // TODO: further logic would be needed to handle cygwin if desired
+ private String getPathString(IPath path) {
+ String s = path.toString();
+ if (Platform.getOS().equals(Platform.OS_WIN32))
+ s = s.replaceAll("^([A-Z])(:)", "/$1");
+ return s;
+ }
+
+ // Run an autotools script (e.g. configure, autogen.sh, config.status).
+ private int runScript(IPath commandPath, IPath runPath, String[] args,
+ String jobDescription, String errMsg, IConsole console,
+ ArrayList<String> additionalEnvs,
+ boolean consoleStart) throws BuildException, CoreException,
+ NullPointerException, IOException {
+ // TODO: Figure out what this next stuff is used for
+ // //try to resolve the build macros in the builder command
+ // try{
+ // String resolved =
+ // ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(
+ // configCmd,
+ // "", //$NON-NLS-1$
+ // " ", //$NON-NLS-1$
+ // IBuildMacroProvider.CONTEXT_CONFIGURATION,
+ // info.getDefaultConfiguration());
+ // if((resolved = resolved.trim()).length() > 0)
+ // configCmd = resolved;
+ // } catch (BuildMacroException e){
+ // }
+
+ int rc = IStatus.OK;
+
+ removeAllMarkers(project);
+
+ // We want to run the script via the shell command. So, we add the command
+ // script as the first argument and expect "sh" to be on the runtime path.
+ // Any other arguments are placed after the script name.
+ String[] configTargets = null;
+ if (args == null)
+ configTargets = new String[1];
+ else {
+ configTargets = new String[args.length+1];
+ System.arraycopy(args, 0, configTargets, 1, args.length);
+ }
+ configTargets[0] = getPathString(commandPath);
+
+ String[] msgs = new String[2];
+ msgs[0] = commandPath.toString();
+ msgs[1] = project.getName();
+ monitor.subTask(AutotoolsPlugin.getFormattedString(
+ "MakeGenerator.make.message", msgs)); //$NON-NLS-1$
+
+
+ ConsoleOutputStream consoleOutStream = null;
+ StringBuffer buf = new StringBuffer();
+
+ // Launch command - main invocation
+ if (consoleStart)
+ console.start(project);
+ consoleOutStream = console.getOutputStream();
+ String[] consoleHeader = new String[3];
+
+ consoleHeader[0] = jobDescription;
+ consoleHeader[1] = cfg.getName();
+ consoleHeader[2] = project.getName();
+ buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$ //$NON-NLS-2$
+ buf.append(jobDescription);
+ buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$ //$NON-NLS-2$
+ buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$ //$NON-NLS-2$
+
+ if (!cfg.isSupported()) {
+ String msgArgs[] = new String[1];
+ msgArgs[0] = cfg.getName();
+ buf.append(AutotoolsPlugin.getFormattedString("MakeGenerator.unsupportedConfig", msgArgs)); // $NON-NLS-1$
+ buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$ //$NON-NLS-2$
+ buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ consoleOutStream.write(buf.toString().getBytes());
+ consoleOutStream.flush();
+
+ // Get a launcher for the config command
+ CommandLauncher launcher = new CommandLauncher();
+ // Set the environment
+ IEnvironmentVariable variables[] = ManagedBuildManager
+ .getEnvironmentVariableProvider().getVariables(cfg, true);
+ String[] env = null;
+ ArrayList<String> envList = new ArrayList<String>();
+ if (variables != null) {
+ for (int i = 0; i < variables.length; i++) {
+ envList.add(variables[i].getName()
+ + "=" + variables[i].getValue()); //$NON-NLS-1$
+ }
+ if (additionalEnvs != null)
+ envList.addAll(additionalEnvs); // add any additional environment variables specified ahead of script
+ env = (String[]) envList.toArray(new String[envList.size()]);
+ }
+
+ // // Hook up an error parser manager
+ // String[] errorParsers =
+ // info.getDefaultConfiguration().getErrorParserList();
+ // ErrorParserManager epm = new ErrorParserManager(project, topBuildDir,
+ // this, errorParsers);
+ // epm.setOutputStream(consoleOutStream);
+ OutputStream stdout = consoleOutStream;
+ OutputStream stderr = consoleOutStream;
+
+ launcher.showCommand(true);
+ // Run the shell script via shell command.
+ Process proc = launcher.execute(new Path(SHELL_COMMAND), configTargets, env,
+ runPath, new NullProgressMonitor());
+ 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
+ // ensure
+ // the UI is up-to-date with the build results
+ // monitor.subTask(ManagedMakeMessages
+ // .getResourceString(REFRESH));
+ monitor.subTask(AutotoolsPlugin.getResourceString("MakeGenerator.refresh")); //$NON-NLS-1$
+ try {
+ project.refreshLocal(IResource.DEPTH_INFINITE, null);
+ } catch (CoreException e) {
+ monitor.subTask(AutotoolsPlugin
+ .getResourceString("MakeGenerator.refresh.error")); //$NON-NLS-1$
+ }
+ } else {
+ errMsg = launcher.getErrorMessage();
+ }
+
+ // Report either the success or failure of our mission
+ buf = new StringBuffer();
+ if (errMsg != null && errMsg.length() > 0) {
+ String errorDesc = AutotoolsPlugin
+ .getResourceString("MakeGenerator.generation.error"); //$NON-NLS-1$
+ buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$//$NON-NLS-2$
+ buf.append(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$
+ rc = IStatus.ERROR;
+ } else if (proc.exitValue() >= 1 || proc.exitValue() < 0) {
+ // We have an invalid return code from configuration.
+ String[] errArg = new String[2];
+ errArg[0] = Integer.toString(proc.exitValue());
+ errArg[1] = commandPath.toString();
+ errMsg = AutotoolsPlugin.getFormattedString(
+ "MakeGenerator.config.error", errArg); //$NON-NLS-1$
+ buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$//$NON-NLS-2$
+ buf.append(AutotoolsPlugin.getResourceString("MakeGenerator.generation.error")); //$NON-NLS-1$
+ buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$//$NON-NLS-2$
+ if (proc.exitValue() == 1)
+ rc = IStatus.WARNING;
+ else
+ rc = IStatus.ERROR;
+ } else {
+ // Report a successful build
+ String successMsg =
+ AutotoolsPlugin.getResourceString("MakeGenerator.success"); //$NON-NLS-1$
+ buf.append(successMsg);
+ buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$//$NON-NLS-2$
+ rc = IStatus.OK;
+ }
+
+ // Write message on the console
+ consoleOutStream.write(buf.toString().getBytes());
+ consoleOutStream.flush();
+
+ // // Generate any error markers that the build has discovered
+ // monitor.subTask(ManagedMakeMessages
+ // .getResourceString(MARKERS));
+ // epm.reportProblems();
+ consoleOutStream.close();
+
+ // TODO: For now, add a marker with our generated error message.
+ // In the future, we might add an error parser to do this properly
+ // and give the actual error line, etc..
+ if (rc == IStatus.ERROR) {
+ addMarker(project, -1, errMsg, SEVERITY_ERROR_BUILD, null);
+ // Mark the configuration as needing a full rebuild.
+ cfg.setRebuildState(true);
+ }
+
+ return rc;
+ }
+
+ private ICStorageElement createTargetElement(ICStorageElement parent, IMakeTarget target) {
+ ICStorageElement targetElem = parent.createChild(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());
+ ICStorageElement elem = targetElem.createChild(TARGET_COMMAND);
+ elem.setValue(target.getBuildAttribute(IMakeCommonBuildInfo.BUILD_COMMAND, "make")); //$NON-NLS-1$
+
+ String targetAttr = target.getBuildAttribute(IMakeCommonBuildInfo.BUILD_ARGUMENTS, null);
+ if ( targetAttr != null) {
+ elem = targetElem.createChild(TARGET_ARGUMENTS);
+ elem.setValue(targetAttr);
+ }
+
+ targetAttr = target.getBuildAttribute(IMakeTarget.BUILD_TARGET, null);
+ if (targetAttr != null) {
+ elem = targetElem.createChild(TARGET);
+ elem.setValue(targetAttr);
+ }
+
+ elem = targetElem.createChild(TARGET_STOP_ON_ERROR);
+ elem.setValue(new Boolean(target.isStopOnError()).toString());
+
+ elem = targetElem.createChild(TARGET_USE_DEFAULT_CMD);
+ elem.setValue(new Boolean(target.isDefaultBuildCmd()).toString());
+
+ elem = targetElem.createChild(TARGET_RUN_ALL_BUILDERS);
+ elem.setValue(new Boolean(target.runAllBuilders()).toString());
+
+ return targetElem;
+ }
+
+ /**
+ * This output method saves the information into the .cdtproject metadata file.
+ *
+ * @param doc
+ * @throws CoreException
+ */
+ private void saveTargets(IMakeTarget[] makeTargets) throws CoreException {
+ ICDescriptor descriptor = CCorePlugin.getDefault().getCProjectDescription(getProject(), true);
+ ICStorageElement rootElement = descriptor.getProjectStorageElement(MAKE_TARGET_KEY);
+
+ //Nuke the children since we are going to write out new ones
+ rootElement.clear();
+
+ // Fetch the ProjectTargets as ICStorageElements
+ rootElement = rootElement.createChild(BUILD_TARGET_ELEMENT);
+ for (int i = 0; i < makeTargets.length; ++i)
+ createTargetElement(rootElement, makeTargets[i]);
+
+ //Save the results
+ descriptor.saveProjectData();
+ }
+
+
+ protected class MakeTargetComparator implements Comparator<Object> {
+ public int compare(Object a, Object b) {
+ IMakeTarget make1 = (IMakeTarget)a;
+ IMakeTarget make2 = (IMakeTarget)b;
+ return make1.getName().compareToIgnoreCase(make2.getName());
+ }
+
+ }
+
+ /**
+ * This method parses the given Makefile and produces MakeTargets for all targets so the
+ * end-user can access them from the MakeTargets popup-menu.
+ *
+ * @param makefileFile the Makefile to parse
+ * @throws CoreException
+ */
+ private void addMakeTargetsToManager(File makefileFile) throws CoreException {
+ // Return immediately if no Makefile.
+ if (makefileFile == null || !makefileFile.exists())
+ return;
+
+ checkCancel();
+ if (monitor == null)
+ monitor = new NullProgressMonitor();
+ String statusMsg = AutotoolsPlugin.getResourceString("MakeGenerator.refresh.MakeTargets"); //$NON-NLS-1$
+ monitor.subTask(statusMsg);
+
+ IMakeTargetManager makeTargetManager =
+ MakeCorePlugin.getDefault().getTargetManager();
+
+ IMakefile makefile = MakeCorePlugin.createMakefile(makefileFile.toURI(), false, null);
+ ITargetRule[] targets = makefile.getTargetRules();
+ ITarget target = null;
+ Map<String, IMakeTarget> makeTargets = new HashMap<String, IMakeTarget>(); // use a HashMap so duplicate names are handled
+ for (int i = 0; i < targets.length; i++) {
+ target = targets[i].getTarget();
+ String targetName = target.toString();
+ if (!isValidTarget(targetName, makeTargetManager))
+ continue;
+ try {
+ IMakeTarget makeTarget = makeTargetManager.createTarget(
+ project, targetName, "org.eclipse.linuxtools.cdt.autotools.builder1"); //$NON-NLS-1$
+ makeTarget.setContainer(project);
+ makeTarget.setStopOnError(true);
+ makeTarget.setRunAllBuilders(false);
+ makeTarget.setUseDefaultBuildCmd(true);
+
+ makeTarget.setBuildAttribute(GENERATED_TARGET, "true");
+ makeTarget.setBuildAttribute(IMakeTarget.BUILD_TARGET,
+ targetName);
+
+ makeTarget.setBuildAttribute(IMakeTarget.BUILD_LOCATION,
+ buildDir);
+ makeTargets.put(makeTarget.getName(), makeTarget);
+ } catch (CoreException e) {
+ // Duplicate target. Ignore.
+ }
+ }
+
+ IMakeTarget[] makeTargetArray = new IMakeTarget[makeTargets.size()];
+ Collection<IMakeTarget> values = makeTargets.values();
+ ArrayList<IMakeTarget> valueList = new ArrayList<IMakeTarget>(values);
+ valueList.toArray(makeTargetArray);
+ MakeTargetComparator compareMakeTargets = new MakeTargetComparator();
+ Arrays.sort(makeTargetArray, compareMakeTargets);
+
+ saveTargets(makeTargetArray);
+ }
+
+ private boolean isValidTarget(String targetName, IMakeTargetManager makeTargetManager) {
+ return !(targetName.endsWith("-am") //$NON-NLS-1$
+ || targetName.endsWith("PROGRAMS") //$NON-NLS-1$
+ || targetName.endsWith("-generic") //$NON-NLS-1$
+ || (targetName.indexOf('$') >= 0)
+ || (targetName.charAt(0) == '.')
+ || targetName.equals(targetName.toUpperCase()));
+ }
+
+ // Turn the string into an array.
+ private String[] makeArray(String string) {
+ string = string.trim();
+ char[] array = string.toCharArray();
+ ArrayList<String> aList = new ArrayList<String>();
+ StringBuilder buffer = new StringBuilder();
+ boolean inComment = false;
+ for (int i = 0; i < array.length; i++) {
+ char c = array[i];
+ boolean needsToAdd = true;
+ if (array[i] == '"' || array[i] == '\'') {
+ if (i > 0 && array[i - 1] == '\\') {
+ inComment = false;
+ } else {
+ inComment = !inComment;
+ needsToAdd = false; // skip it
+ }
+ }
+ if (c == ' ' && !inComment) {
+ if (buffer.length() > 0){
+ String str = buffer.toString().trim();
+ if(str.length() > 0){
+ aList.add(str);
+ }
+ }
+ buffer = new StringBuilder();
+ } else {
+ if (needsToAdd)
+ buffer.append(c);
+ }
+ }
+ if (buffer.length() > 0){
+ String str = buffer.toString().trim();
+ if(str.length() > 0){
+ aList.add(str);
+ }
+ }
+ return (String[])aList.toArray(new String[aList.size()]);
+ }
+
+} \ No newline at end of file
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/Resources.properties b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/Resources.properties
new file mode 100644
index 0000000000..7b4c9179b2
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/Resources.properties
@@ -0,0 +1,95 @@
+#################################################################################
+# Copyright (c) 2006, 2007 Red Hat, Inc.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Red Hat Incorporated - initial API and implementation
+# IBM Rational Software - ManagedMakeMessages copied to AutotoolsMakefileBuilder
+#################################################################################
+MakeCWizard.title=C/Make Project
+MakeCWizard.description=Create a New C Project using 'make' to build it
+
+WARNING_UNSUPPORTED_CONFIGURATION=Warning: unsupported configuration
+
+AutotoolsMakefileBuilder.message.finished=Build complete for project {0}
+AutotoolsMakefileBuilder.type.clean=Clean-only build
+AutotoolsMakefileBuilder.message.clean.deleting.output=Removing build artifacts from {0}
+AutotoolsMakefileBuilder.message.console.header=**** {0} of configuration {1} for project {2} ****
+
+MakeGenerator.makefile.built=Makefile built
+MakeGenerator.refresh=Refresh
+MakeGenerator.refresh.error=Refresh error
+MakeGenerator.generation.error=Configuration failed with error
+MakeGenerator.configuring=Configuring
+MakeGenerator.createdir.error=Error creating build directory: {0}
+MakeGenerator.make.message=Invoking {0} for project {1}
+MakeGenerator.config.error=Error {0} occurred while running {1}
+MakeGenerator.run.config.status=Running config.status
+MakeGenerator.makefile.cvs=Invoking Makefile.cvs
+MakeGenerator.autogen.sh=Invoking autogen.sh
+MakeGenerator.autoreconf=Invoking autoreconf
+MakeGenerator.gen.makefile=Generating Makefile
+MakeGenerator.gen.configure=Generating configure
+MakeGenerator.unsupportedConfig=Warning: unsupported configuration {0}
+MakeGenerator.success=[Operation successful]
+MakeGenerator.didnt.generate=No Makefile generated
+MakeGenerator.refresh.MakeTargets=Refreshing Make Targets
+MakeGenerator.clean.builddir=Cleaning build directory before reconfiguring
+
+
+BuildDir.apply=Build directory already in use
+BuildDir.default=Default build directory to unused value?
+BuildDir.yes=Yes
+BuildDir.no=No
+
+WizardAutotoolsProjectConversion.title=Convert to a CVS C/C++ Autotools Project
+WizardAutotoolsProjectConversion.description=Convert a CVS source repository to C/C++ Autotools Project
+WizardAutotoolsProjectConversion.message.add_nature=Adding C/C++ Autotools Managed Project Nature
+WizardAutotoolsProjectConversion.message.add_builder=Adding C/C++ Autotools Managed Project Builder
+WizardMakeProjectConversion.monitor.convertingToMakeProject=Converting Project...
+WizardAutotoolsConversion=CVS C/C++ Autotools Conversion
+WizardAutotoolsConversion.windowTitle=Conversion to CVS C/C++ Autotools Project
+WizardAutotoolsConversion.config.title=Select a configuration
+WizardAutotoolsConversion.config.desc=Select the configuration you wish to deploy on
+WizardAutotoolsConversion.options.title=Additional Project Settings
+WizardAutotoolsConversion.options.desc=Define the inter-project dependencies, if any.
+WizardAutotoolsConversion.message.save=Saving new build options
+
+WizardAutotoolsNewCProject.title=Autotools C Project
+WizardAutotoolsNewCProject.description=Create a new C Autotools project
+WizardAutotoolsNewCProject.monitor.creatingProject=Creating Project...
+WizardAutotoolsNewCProject.windowTitle=GNU Autotools C Project
+WizardAutotoolsNewCProject.config.title=Select a configuration
+WizardAutotoolsNewCProject.config.desc=Select the configuration you wish to deploy on
+WizardAutotoolsNewCProject.options.title=Additional Project Settings
+WizardAutotoolsNewCProject.options.desc=Define the inter-project dependencies, if any.
+WizardAutotoolsNewCProject.message.save=Saving new build options
+
+WizardAutotoolsNewCCProject.title=Autotools C++ Project
+WizardAutotoolsNewCCProject.description=Create a new C++ Autotools project
+WizardAutotoolsNewCCProject.monitor.creatingProject=Creating Project...
+WizardAutotoolsNewCCProject.windowTitle=GNU Autotools C++ Project
+WizardAutotoolsNewCCProject.config.title=Select a configuration
+WizardAutotoolsNewCCProject.config.desc=Select the configuration you wish to deploy on
+WizardAutotoolsNewCCProject.options.title=Additional Project Settings
+WizardAutotoolsNewCCProject.options.desc=Define the inter-project dependencies, if any.
+WizardAutotoolsNewCCProject.message.save=Saving new build options
+
+
+BuildTargetDialog.title.buildTarget=Build Special Targets
+BuildTargetDialog.title.makeTargetsFor=Make targets for
+BuildTargetDialog.button.build=Build
+
+TargetListViewer.button.add=Add...
+TargetListViewer.button.remove=Remove
+TargetListViewer.button.edit=Edit...
+TargetListViewer.label.target=Target
+TargetListViewer.label.location=Location
+TargetListViewer.exception.error=Error
+TargetListViewer.exception.message=An error occurred performing the selected action
+
+AutotoolsPreferencePage.useAutotoolsFileScanner.label=Use make -w for includepath scanning
+MakeTargetPreferencePage.buildTargetInBackground.label=Build target in background
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/AbstractAutotoolsHandler.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/AbstractAutotoolsHandler.java
new file mode 100644
index 0000000000..be54ee8fb5
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/AbstractAutotoolsHandler.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.actions;
+
+import java.util.Collection;
+
+import org.eclipse.cdt.core.model.ICContainer;
+import org.eclipse.cdt.core.model.ICElement;
+import org.eclipse.cdt.core.model.ICProject;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.expressions.IEvaluationContext;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IResource;
+
+public abstract class AbstractAutotoolsHandler extends AbstractHandler {
+
+ @SuppressWarnings("unchecked")
+ protected IContainer getContainer(IEvaluationContext e) {
+ IContainer fContainer = null;
+
+ Object obj = e.getDefaultVariable();
+ if (obj instanceof Collection) {
+ Collection<Object> c = (Collection<Object>)obj;
+ Object[] objArray = c.toArray();
+ if (objArray.length > 0)
+ obj = objArray[0];
+ }
+ if (obj instanceof ICElement) {
+ if ( obj instanceof ICContainer || obj instanceof ICProject) {
+ fContainer = (IContainer) ((ICElement) 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;
+ }
+ return fContainer;
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/AbstractTargetAction.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/AbstractTargetAction.java
new file mode 100644
index 0000000000..367d63a7be
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/AbstractTargetAction.java
@@ -0,0 +1,93 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2004 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.actions;
+
+import org.eclipse.cdt.core.model.ICContainer;
+import org.eclipse.cdt.core.model.ICElement;
+import org.eclipse.cdt.core.model.ICProject;
+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.linuxtools.cdt.autotools.AutotoolsMakefileBuilder;
+import org.eclipse.linuxtools.cdt.autotools.AutotoolsPlugin;
+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 AutotoolsPlugin.getActiveWorkbenchShell();
+ }
+
+ protected IContainer getSelectedContainer() {
+ return fContainer;
+ }
+
+ public void setSelectedContainer(IContainer container) {
+ fContainer = container;
+ }
+
+ 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 || obj instanceof ICProject) {
+ fContainer = (IContainer) ((ICElement) 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 && AutotoolsMakefileBuilder.hasTargetBuilder(fContainer.getProject())) {
+ enabled = true;
+ }
+ }
+ action.setEnabled(enabled);
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/AclocalHandler.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/AclocalHandler.java
new file mode 100644
index 0000000000..b534cfe06a
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/AclocalHandler.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.actions;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.expressions.IEvaluationContext;
+import org.eclipse.core.resources.IContainer;
+
+/**
+ * @author Jeff Johnston
+ *
+ */
+public class AclocalHandler extends AbstractAutotoolsHandler {
+
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ InvokeAclocalAction a = new InvokeAclocalAction();
+ Object o = event.getApplicationContext();
+ if (o instanceof IEvaluationContext) {
+ IContainer container = getContainer((IEvaluationContext)o);
+ if (container != null) {
+ a.setSelectedContainer(container);
+ a.run(null);
+ }
+ }
+ return null;
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/AutoconfHandler.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/AutoconfHandler.java
new file mode 100644
index 0000000000..9dc28e2935
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/AutoconfHandler.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.actions;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.expressions.IEvaluationContext;
+import org.eclipse.core.resources.IContainer;
+
+public class AutoconfHandler extends AbstractAutotoolsHandler {
+
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ InvokeAutoconfAction a = new InvokeAutoconfAction();
+ Object o = event.getApplicationContext();
+ if (o instanceof IEvaluationContext) {
+ IContainer container = getContainer((IEvaluationContext)o);
+ if (container != null) {
+ a.setSelectedContainer(container);
+ a.run(null);
+ }
+ }
+ return null;
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/AutoheaderHandler.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/AutoheaderHandler.java
new file mode 100644
index 0000000000..e64ad41799
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/AutoheaderHandler.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.actions;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.expressions.IEvaluationContext;
+import org.eclipse.core.resources.IContainer;
+
+/**
+ * @author Jeff Johnston
+ *
+ */
+public class AutoheaderHandler extends AbstractAutotoolsHandler {
+
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ InvokeAutoheaderAction a = new InvokeAutoheaderAction();
+ Object o = event.getApplicationContext();
+ if (o instanceof IEvaluationContext) {
+ IContainer container = getContainer((IEvaluationContext)o);
+ if (container != null) {
+ a.setSelectedContainer(container);
+ a.run(null);
+ }
+ }
+ return null;
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/AutomakeHandler.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/AutomakeHandler.java
new file mode 100644
index 0000000000..c1bbcf4f47
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/AutomakeHandler.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.actions;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.expressions.IEvaluationContext;
+import org.eclipse.core.resources.IContainer;
+
+public class AutomakeHandler extends AbstractAutotoolsHandler {
+
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ InvokeAutomakeAction a = new InvokeAutomakeAction();
+ Object o = event.getApplicationContext();
+ if (o instanceof IEvaluationContext) {
+ IContainer container = getContainer((IEvaluationContext)o);
+ if (container != null) {
+ a.setSelectedContainer(container);
+ a.run(null);
+ }
+ }
+ return null;
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/AutoreconfHandler.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/AutoreconfHandler.java
new file mode 100644
index 0000000000..d9b0c8c72f
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/AutoreconfHandler.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.actions;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.expressions.IEvaluationContext;
+import org.eclipse.core.resources.IContainer;
+
+/**
+ * @author Jeff Johnston
+ *
+ */
+public class AutoreconfHandler extends AbstractAutotoolsHandler {
+
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ InvokeAutoreconfAction a = new InvokeAutoreconfAction();
+ Object o = event.getApplicationContext();
+ if (o instanceof IEvaluationContext) {
+ IContainer container = getContainer((IEvaluationContext)o);
+ if (container != null) {
+ a.setSelectedContainer(container);
+ a.run(null);
+ }
+ }
+ return null;
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAclocalAction.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAclocalAction.java
new file mode 100644
index 0000000000..0834ef434b
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAclocalAction.java
@@ -0,0 +1,104 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2007 2009 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.actions;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.linuxtools.cdt.autotools.ui.properties.AutotoolsPropertyConstants;
+import org.eclipse.swt.widgets.Shell;
+
+
+public class InvokeAclocalAction extends InvokeAction {
+
+ private static final String DEFAULT_OPTION = ""; //$NON-NLS-1$
+ private static final String DEFAULT_COMMAND = "aclocal"; //$NON-NLS-1$
+
+ public void run(IAction action) {
+
+ IContainer container = getSelectedContainer();
+ if (container == null)
+ return;
+
+ IPath execDir = getExecDir(container);
+ String cwd = InvokeMessages.getString("CWD") + getCWD(container); //$NON-NLS-1$
+
+ TwoInputDialog optionDialog = new TwoInputDialog(
+ new Shell(),
+ cwd,
+ InvokeMessages
+ .getString("InvokeAclocalAction.windowTitle.options"), //$NON-NLS-1$
+ InvokeMessages
+ .getString("InvokeAclocalAction.message.options.otherOptions"), //$NON-NLS-1$
+ InvokeMessages
+ .getString("InvokeAclocalAction.message.options.includeDir"), DEFAULT_OPTION, null); //$NON-NLS-1$
+
+ optionDialog.open();
+
+ // chop args into string array
+ String rawArgList = optionDialog.getValue();
+
+ String[] optionsList = separateOptions(rawArgList);
+
+ // chop args into string array
+ rawArgList = optionDialog.getSecondValue();
+
+ String[] targetList = separateTargets(rawArgList);
+
+ if (targetList == null) {
+
+ showError(InvokeMessages
+ .getString("InvokeAction.execute.windowTitle.error"), //$NON-NLS-1$
+ InvokeMessages
+ .getString("InvokeAction.windowTitle.quoteError")); //$NON-NLS-1$
+ return;
+ }
+
+ int iOption = 0;
+ if (targetList.length > 0)
+ iOption = 1;
+
+ String[] argumentList = new String[targetList.length
+ + optionsList.length + iOption];
+
+ System.arraycopy(optionsList, 0, argumentList, 0, optionsList.length);
+
+ if (iOption == 1)
+ argumentList[optionsList.length] = "-I"; //$NON-NLS-1$
+
+ System.arraycopy(targetList, 0, argumentList, optionsList.length
+ + iOption, targetList.length);
+
+ if (container != null) {
+ String aclocalCommand = null;
+ IProject project = getSelectedContainer().getProject();
+ try {
+ aclocalCommand = project.getPersistentProperty(AutotoolsPropertyConstants.ACLOCAL_TOOL);
+ } catch (CoreException e) {
+ // do nothing
+ }
+
+ // If unset, use default system path
+ if (aclocalCommand == null)
+ aclocalCommand = DEFAULT_COMMAND;
+
+ executeConsoleCommand(DEFAULT_COMMAND, aclocalCommand,
+ argumentList, execDir);
+ }
+ }
+
+ public void dispose() {
+
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAction.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAction.java
new file mode 100644
index 0000000000..01979735f6
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAction.java
@@ -0,0 +1,442 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2007, 2009 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.actions;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.StringTokenizer;
+
+import org.eclipse.cdt.core.CCorePlugin;
+import org.eclipse.cdt.core.CommandLauncher;
+import org.eclipse.cdt.core.ConsoleOutputStream;
+import org.eclipse.cdt.core.envvar.IEnvironmentVariable;
+import org.eclipse.cdt.core.resources.IConsole;
+import org.eclipse.cdt.managedbuilder.core.IConfiguration;
+import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
+import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
+import org.eclipse.core.resources.IContainer;
+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;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.core.runtime.jobs.ISchedulingRule;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.dialogs.InputDialog;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.linuxtools.cdt.autotools.AutotoolsPlugin;
+import org.eclipse.linuxtools.cdt.autotools.MakeGenerator;
+import org.eclipse.swt.widgets.Shell;
+
+public abstract class InvokeAction extends AbstractTargetAction {
+
+ protected void showInformation(String title, String content) {
+
+ MessageDialog.openInformation(new Shell(), title, content);
+ }
+
+ protected void showError(String title, String content) {
+
+ MessageDialog.openError(new Shell(), title, content);
+ }
+
+ protected void showSuccess(String title) {
+ MessageDialog.openInformation(new Shell(), title,
+ InvokeMessages.getString("InvokeAction.success")); //$NON-NLS-1$
+ }
+
+ protected String showInput(String title, String content, String defaultTxt) {
+ InputDialog getOptionDialog = new InputDialog(new Shell(), title,
+ content, defaultTxt, null);
+
+ getOptionDialog.open();
+
+ return getOptionDialog.getValue();
+ }
+
+ /**
+ * Separate targets to array from a string.
+ *
+ * @param rawArgList
+ * @return targets in string[] array. if targets are not formatted properly,
+ * returns null
+ */
+ protected String[] separateTargets(String rawArgList) {
+
+ StringTokenizer st = new StringTokenizer(rawArgList, " "); //$NON-NLS-1$
+ ArrayList<String> targetList = new ArrayList<String>();
+
+ while (st.hasMoreTokens()) {
+ String currentWord = st.nextToken().trim();
+
+ if (currentWord.startsWith("'")) { //$NON-NLS-1$
+ String tmpTarget = ""; //$NON-NLS-1$
+ while (!currentWord.endsWith("'")) { //$NON-NLS-1$
+ tmpTarget += currentWord + " "; //$NON-NLS-1$
+ if (!st.hasMoreTokens()) {
+ // quote not closed properly, so return null
+ return null;
+ }
+ currentWord = st.nextToken().trim();
+ }
+
+ tmpTarget += currentWord;
+ targetList.add(tmpTarget);
+ continue;
+ }
+
+ if (currentWord.startsWith("\"")) { //$NON-NLS-1$
+ String tmpTarget = ""; //$NON-NLS-1$
+ while (!currentWord.endsWith("\"")) { //$NON-NLS-1$
+ tmpTarget += currentWord + " "; //$NON-NLS-1$
+ if (!st.hasMoreTokens()) {
+ // double quote not closed properly, so return null
+ return null;
+ }
+ currentWord = st.nextToken().trim();
+ }
+
+ tmpTarget += currentWord;
+ targetList.add(tmpTarget);
+ continue;
+ }
+
+ // for targets without quote/double quotes.
+ targetList.add(currentWord);
+
+ }
+
+ return (String[])targetList.toArray(new String[targetList.size()]);
+ }
+
+ protected String[] separateOptions(String rawArgList) {
+ ArrayList<String> argList = new ArrayList<String>();
+ // May be multiple user-specified options in which case we
+ // need to split them up into individual options
+ rawArgList = rawArgList.trim();
+ boolean finished = false;
+ int lastIndex = rawArgList.indexOf("--"); //$NON-NLS-1$
+ if (lastIndex != -1) {
+ while (!finished) {
+ int index = rawArgList.indexOf("--", lastIndex + 2); //$NON-NLS-1$
+ if (index != -1) {
+ String previous = rawArgList.substring(lastIndex, index)
+ .trim();
+ argList.add(previous);
+ rawArgList = rawArgList.substring(index);
+ } else {
+ argList.add(rawArgList);
+ finished = true;
+ }
+ }
+ }
+
+ return (String[])argList.toArray(new String[argList.size()]);
+
+ }
+
+ protected String[] simpleParseOptions(String rawArgList) {
+ ArrayList<String> argList = new ArrayList<String>();
+ int lastArgIndex = -1;
+ int i = 0;
+ while (i < rawArgList.length()) {
+ char ch = rawArgList.charAt(i);
+ // Skip white-space
+ while (Character.isWhitespace(ch)) {
+ ++i;
+ if (i < rawArgList.length())
+ ch = rawArgList.charAt(i);
+ else // Otherwise we are done
+ return argList.toArray(new String[argList.size()]);
+ }
+
+ // Simplistic parser. We break up into strings delimited
+ // by blanks. If quotes are used, we ignore blanks within.
+ // If a backslash is used, we ignore the next character and
+ // pass it through.
+ lastArgIndex = i;
+ boolean inString = false;
+ while (i < rawArgList.length()) {
+ ch = rawArgList.charAt(i);
+ if (ch == '\\') // escape character
+ ++i; // skip over the next character
+ else if (ch == '\"') { // double quotes
+ inString = !inString;
+ } else if (Character.isWhitespace(ch)) {
+ if (!inString) {
+ argList.add(rawArgList.substring(lastArgIndex, i));
+ break;
+ }
+ }
+ ++i;
+ }
+ // Look for the case where we ran out of chars for the last
+ // token.
+ if (i >= rawArgList.length())
+ argList.add(rawArgList.substring(lastArgIndex));
+ ++i;
+ }
+ return argList.toArray(new String[argList.size()]);
+ }
+
+ protected IPath getExecDir(IContainer container) {
+ int type = container.getType();
+ IPath execDir = null;
+ if (type == IContainer.FILE) {
+ execDir = container.getLocation().removeLastSegments(1);
+ } else {
+ execDir = container.getLocation();
+ }
+ return execDir;
+ }
+
+ protected IPath getCWD(IContainer container) {
+ int type = container.getType();
+ IPath cwd = null;
+ if (type == IContainer.FILE) {
+ cwd = container.getFullPath().removeLastSegments(1);
+ } else {
+ cwd = container.getFullPath();
+ }
+ return cwd;
+ }
+
+ private class ExecuteProgressDialog implements IRunnableWithProgress {
+ private IPath command;
+ private String[] argumentList;
+ private String[] envList;
+ private IPath execDir;
+ private int status;
+ private HashMap<String, String> outputs = null;
+
+ public ExecuteProgressDialog(IPath command, String[] argumentList,
+ String[] envList, IPath execDir) {
+ this.command = command;
+ this.argumentList = argumentList;
+ this.envList = envList;
+ this.execDir = execDir;
+ }
+
+ public void run(IProgressMonitor monitor)
+ throws InvocationTargetException, InterruptedException {
+ ByteArrayOutputStream stdout = new ByteArrayOutputStream();
+ ByteArrayOutputStream stderr = new ByteArrayOutputStream();
+ CommandLauncher cmdL = new CommandLauncher();
+ outputs = null;
+
+ // invoke command
+ try {
+ monitor.beginTask(
+ InvokeMessages.getFormattedString("InvokeAction.progress.message", // $NON-NLS-1$
+ new String[]{command.toOSString()}), IProgressMonitor.UNKNOWN);
+ monitor.worked(1);
+ Process process = cmdL.execute(command, argumentList, envList,
+ execDir, new NullProgressMonitor());
+
+ if (cmdL.waitAndRead(stdout, stderr) == CommandLauncher.OK) {
+ try {
+ status = 0;
+ monitor.done();
+ process.getOutputStream().close();
+ } catch (IOException e) {
+ // ignore
+ }
+ } else {
+ // failed to execute command
+ status = -1;
+ monitor.done();
+ return;
+ }
+ } catch (CoreException e) {
+ monitor.done();
+ throw new InvocationTargetException(e);
+ }
+
+ outputs = new HashMap<String, String>();
+
+ outputs.put("stdout", stdout.toString()); //$NON-NLS-1$
+ outputs.put("stderr", stderr.toString()); //$NON-NLS-1$
+
+ try {
+ stdout.close();
+ stderr.close();
+ } catch (IOException e) {
+ // ignore
+ }
+ }
+
+ public HashMap<String, String> getOutputs() {
+ return outputs;
+ }
+
+ public int getStatus() {
+ return status;
+ }
+ }
+
+
+ protected HashMap<String, String> executeCommand(IPath command,
+ String[] argumentList, String[] envList, IPath execDir) {
+ try {
+ ExecuteProgressDialog d = new ExecuteProgressDialog(command,
+ argumentList, envList, execDir);
+ new ProgressMonitorDialog(new Shell()).run(false, false, d);
+ if (d.getStatus() == -1)
+ showError(InvokeMessages
+ .getString("InvokeAction.execute.windowTitle.error"), InvokeMessages //$NON-NLS-1$
+ .getString("InvokeAction.execute.message") //$NON-NLS-1$
+ + command.toOSString()); //$NON-NLS-1$
+ return d.getOutputs();
+ } catch (InvocationTargetException e) {
+ showError(InvokeMessages
+ .getString("InvokeAction.execute.windowTitle.error"), InvokeMessages //$NON-NLS-1$
+ .getString("InvokeAction.execute.message") //$NON-NLS-1$
+ + command.toOSString()); //$NON-NLS-1$
+ AutotoolsPlugin.logException(e);
+ return null;
+ } catch (InterruptedException e) {
+ return null;
+ }
+ }
+
+ protected void executeConsoleCommand(final String actionName, final String command,
+ final String[] argumentList, final IPath execDir) {
+ // We need to use a workspace root scheduling rule because adding MakeTargets
+ // may end up saving the project description which runs under a workspace root rule.
+ final ISchedulingRule rule = ResourcesPlugin.getWorkspace().getRoot();
+
+ Job backgroundJob = new Job(actionName) {
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
+
+ public void run(IProgressMonitor monitor) throws CoreException {
+ try {
+ String errMsg = null;
+ IProject project = getSelectedContainer().getProject();
+ // Get a build console for the project
+ IConsole console = CCorePlugin.getDefault().getConsole("org.eclipse.linuxtools.cdt.autotools.autotoolsConsole"); //$NON-NLS-1$
+ console.start(project);
+ ConsoleOutputStream consoleOutStream = console.getOutputStream();
+ // FIXME: we want to remove need for ManagedBuilderManager, but how do we
+ // get environment variables.
+ IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project);
+ IConfiguration cfg = info.getDefaultConfiguration();
+
+ StringBuffer buf = new StringBuffer();
+ String[] consoleHeader = new String[3];
+
+ consoleHeader[0] = actionName;
+ consoleHeader[1] = cfg.getName();
+ consoleHeader[2] = project.getName();
+ buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$ //$NON-NLS-2$
+ String invokeMsg = InvokeMessages.getFormattedString("InvokeAction.console.message", //$NON-NLS-1$
+ new String[]{actionName, execDir.toString()}); //$NON-NLS-1$
+ buf.append(invokeMsg);
+ buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$ //$NON-NLS-2$
+ buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$ //$NON-NLS-2$
+ consoleOutStream.write(buf.toString().getBytes());
+ consoleOutStream.flush();
+
+ ArrayList<String> additionalEnvs = new ArrayList<String>();
+ String strippedCommand = MakeGenerator.stripEnvVars(command, additionalEnvs);
+ // Get a launcher for the config command
+ CommandLauncher launcher = new CommandLauncher();
+ // Set the environment
+ IEnvironmentVariable variables[] = ManagedBuildManager
+ .getEnvironmentVariableProvider().getVariables(cfg, true);
+ String[] env = null;
+ ArrayList<String> envList = new ArrayList<String>();
+ if (variables != null) {
+ for (int i = 0; i < variables.length; i++) {
+ envList.add(variables[i].getName()
+ + "=" + variables[i].getValue()); //$NON-NLS-1$
+ }
+ if (additionalEnvs.size() > 0)
+ envList.addAll(additionalEnvs); // add any additional environment variables specified ahead of script
+ env = (String[]) envList.toArray(new String[envList.size()]);
+ }
+ OutputStream stdout = consoleOutStream;
+ OutputStream stderr = consoleOutStream;
+
+ launcher.showCommand(true);
+ // Run the shell script via shell command.
+ Process proc = launcher.execute(new Path(strippedCommand), argumentList, env,
+ execDir, new NullProgressMonitor());
+ 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
+ // ensure
+ // the UI is up-to-date with the build results
+ // monitor.subTask(ManagedMakeMessages
+ // .getResourceString(REFRESH));
+ monitor.subTask(AutotoolsPlugin.getResourceString("MakeGenerator.refresh")); //$NON-NLS-1$
+ try {
+ project.refreshLocal(IResource.DEPTH_INFINITE, null);
+ } catch (CoreException e) {
+ monitor.subTask(AutotoolsPlugin
+ .getResourceString("MakeGenerator.refresh.error")); //$NON-NLS-1$
+ }
+ } else {
+ errMsg = launcher.getErrorMessage();
+ }
+
+ if (errMsg != null)
+ AutotoolsPlugin.logErrorMessage(errMsg);
+
+ } catch (IOException e) {
+ AutotoolsPlugin.log(e);
+ }
+ }
+ }, rule, IWorkspace.AVOID_UPDATE, monitor);
+ } catch (CoreException e) {
+ return e.getStatus();
+ }
+ IStatus returnStatus = Status.OK_STATUS;
+ return returnStatus;
+ }
+ };
+
+ backgroundJob.setRule(rule);
+ backgroundJob.schedule();
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAutoconfAction.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAutoconfAction.java
new file mode 100644
index 0000000000..6440dfa025
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAutoconfAction.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2007 2009 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.actions;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.linuxtools.cdt.autotools.ui.properties.AutotoolsPropertyConstants;
+
+
+/**
+ * Class responsible for invoking autoconf.
+ *
+ * @author klee
+ *
+ */
+public class InvokeAutoconfAction extends InvokeAction {
+
+ private final static String DEFAULT_COMMAND = "autoconf"; //$NON-NLS-1$
+ public void run(IAction action) {
+ IContainer container = getSelectedContainer();
+ if (container == null)
+ return;
+
+ IPath execDir = getExecDir(container);
+
+ if (container != null) {
+ IProject project = container.getProject();
+ String autoconfCommand = null;
+ try {
+ autoconfCommand = project.getPersistentProperty(AutotoolsPropertyConstants.AUTOCONF_TOOL);
+ } catch (CoreException e) {
+ // do nothing
+ }
+
+ // If unset for the project, default to system path
+ if (autoconfCommand == null)
+ autoconfCommand = DEFAULT_COMMAND;
+
+ executeConsoleCommand(DEFAULT_COMMAND, autoconfCommand, new String[]{}, execDir);
+ }
+ }
+
+
+ public void dispose() {
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAutoheaderAction.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAutoheaderAction.java
new file mode 100644
index 0000000000..1057d45743
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAutoheaderAction.java
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.actions;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.InputDialog;
+import org.eclipse.linuxtools.cdt.autotools.ui.properties.AutotoolsPropertyConstants;
+import org.eclipse.swt.widgets.Shell;
+
+
+public class InvokeAutoheaderAction extends InvokeAction {
+
+ private static final String DEFAULT_OPTION = ""; //$NON-NLS-1$
+ private static final String DEFAULT_COMMAND = "autoheader"; //$NON-NLS-1$
+
+ public void run(IAction action) {
+
+ IContainer container = getSelectedContainer();
+ if (container == null)
+ return;
+
+ IPath execDir = getExecDir(container);
+ String cwd = InvokeMessages.getString("CWD") + getCWD(container); //$NON-NLS-1$
+
+ InputDialog optionDialog = new SingleInputDialog(
+ new Shell(),
+ cwd,
+ InvokeMessages
+ .getString("InvokeAutoheaderAction.windowTitle.options"), //$NON-NLS-1$
+ InvokeMessages
+ .getString("InvokeAutoheaderAction.message.options.otherOptions"), //$NON-NLS-1$
+ DEFAULT_OPTION, null);
+ optionDialog.open();
+
+ // chop args into string array
+ String rawArgList = optionDialog.getValue();
+
+ String[] optionsList = simpleParseOptions(rawArgList);
+
+ String[] argumentList = new String[optionsList.length];
+
+ System.arraycopy(optionsList, 0, argumentList, 0, optionsList.length);
+
+ if (container != null) {
+ String autoheaderCommand = null;
+ IProject project = getSelectedContainer().getProject();
+ try {
+ autoheaderCommand = project.getPersistentProperty(AutotoolsPropertyConstants.AUTOHEADER_TOOL);
+ } catch (CoreException e) {
+ // do nothing
+ }
+
+ // If unset, use default system path
+ if (autoheaderCommand == null)
+ autoheaderCommand = DEFAULT_COMMAND;
+
+ executeConsoleCommand(DEFAULT_COMMAND, autoheaderCommand,
+ argumentList, execDir);
+ }
+
+ }
+
+ public void dispose() {
+
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAutomakeAction.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAutomakeAction.java
new file mode 100644
index 0000000000..2e973849f9
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAutomakeAction.java
@@ -0,0 +1,98 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2007 2009 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.actions;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.linuxtools.cdt.autotools.ui.properties.AutotoolsPropertyConstants;
+import org.eclipse.swt.widgets.Shell;
+
+
+/**
+ * Class responsible for invoking automake.
+ *
+ * @author klee
+ *
+ */
+public class InvokeAutomakeAction extends InvokeAction {
+
+ private static final String DEFAULT_OPTION = ""; //$NON-NLS-1$
+ private static final String DEFAULT_COMMAND = "automake"; //$NON-NLS-1$
+
+ public void run(IAction action) {
+
+ IContainer container = getSelectedContainer();
+ if (container == null)
+ return;
+
+ IPath execDir = getExecDir(container);
+ String cwd = InvokeMessages.getString("CWD") + getCWD(container); //$NON-NLS-1$
+;
+ TwoInputDialog optionDialog = new TwoInputDialog(new Shell(), cwd,
+ InvokeMessages
+ .getString("InvokeAutomakeAction.windowTitle.options"), //$NON-NLS-1$
+InvokeMessages
+ .getString("InvokeAutomakeAction.message.options.otherOptions"),InvokeMessages //$NON-NLS-1$
+ .getString("InvokeAutomakeAction.message.options.makeTargets"), DEFAULT_OPTION, null); //$NON-NLS-1$
+
+ optionDialog.open();
+
+ // chop args into string array
+ String rawArgList = optionDialog.getValue();
+
+ String[] optionsList = separateOptions(rawArgList);
+
+
+ // chop args into string array
+ rawArgList = optionDialog.getSecondValue();
+
+ String[] targetList = separateTargets(rawArgList);
+
+ if (targetList == null) {
+
+ showError(InvokeMessages.getString("InvokeAction.execute.windowTitle.error"), //$NON-NLS-1$
+ InvokeMessages.getString("InvokeAction.windowTitle.quoteError")); //$NON-NLS-1$
+ return;
+ }
+
+ String[] argumentList = new String[targetList.length
+ + optionsList.length];
+
+ System.arraycopy(optionsList, 0, argumentList, 0, optionsList.length);
+ System.arraycopy(targetList, 0, argumentList, optionsList.length,
+ targetList.length);
+
+ if (container != null) {
+ IProject project = container.getProject();
+ String automakeCommand = null;
+ try {
+ automakeCommand = project.getPersistentProperty(AutotoolsPropertyConstants.AUTOMAKE_TOOL);
+ } catch (CoreException e) {
+ // do nothing
+ }
+
+ // If automake path not set for the project, default to system path
+ if (automakeCommand == null)
+ automakeCommand = DEFAULT_COMMAND;
+
+ executeConsoleCommand(DEFAULT_COMMAND, automakeCommand,
+ argumentList, execDir);
+ }
+ }
+
+ public void dispose() {
+
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAutoreconfAction.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAutoreconfAction.java
new file mode 100644
index 0000000000..b16de919d3
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeAutoreconfAction.java
@@ -0,0 +1,78 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.actions;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.InputDialog;
+import org.eclipse.linuxtools.cdt.autotools.ui.properties.AutotoolsPropertyConstants;
+import org.eclipse.swt.widgets.Shell;
+
+
+public class InvokeAutoreconfAction extends InvokeAction {
+
+ private static final String DEFAULT_OPTION = ""; //$NON-NLS-1$
+ private static final String DEFAULT_COMMAND = "autoreconf"; //$NON-NLS-1$
+
+ public void run(IAction action) {
+
+ IContainer container = getSelectedContainer();
+ if (container == null)
+ return;
+
+ IPath execDir = getExecDir(container);
+ String cwd = InvokeMessages.getString("CWD") + getCWD(container); //$NON-NLS-1$
+
+ InputDialog optionDialog = new SingleInputDialog(
+ new Shell(),
+ cwd,
+ InvokeMessages
+ .getString("InvokeAutoreconfAction.windowTitle.options"), //$NON-NLS-1$
+ InvokeMessages
+ .getString("InvokeAutoreconfAction.message.options.otherOptions"), //$NON-NLS-1$
+ DEFAULT_OPTION, null);
+ optionDialog.open();
+
+ // chop args into string array
+ String rawArgList = optionDialog.getValue();
+
+ String[] optionsList = simpleParseOptions(rawArgList);
+
+ String[] argumentList = new String[optionsList.length];
+
+ System.arraycopy(optionsList, 0, argumentList, 0, optionsList.length);
+
+ if (container != null) {
+ String autoreconfCommand = null;
+ IProject project = getSelectedContainer().getProject();
+ try {
+ autoreconfCommand = project.getPersistentProperty(AutotoolsPropertyConstants.AUTORECONF_TOOL);
+ } catch (CoreException e) {
+ // do nothing
+ }
+
+ // If unset, use default system path
+ if (autoreconfCommand == null)
+ autoreconfCommand = DEFAULT_COMMAND;
+
+ executeConsoleCommand(DEFAULT_COMMAND, autoreconfCommand,
+ argumentList, execDir);
+ }
+ }
+
+ public void dispose() {
+
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeLibtoolizeAction.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeLibtoolizeAction.java
new file mode 100644
index 0000000000..03e04273db
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeLibtoolizeAction.java
@@ -0,0 +1,78 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.actions;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.InputDialog;
+import org.eclipse.linuxtools.cdt.autotools.ui.properties.AutotoolsPropertyConstants;
+import org.eclipse.swt.widgets.Shell;
+
+
+public class InvokeLibtoolizeAction extends InvokeAction {
+
+ private static final String DEFAULT_OPTION = ""; //$NON-NLS-1$
+ private static final String DEFAULT_COMMAND = "libtoolize"; //$NON-NLS-1$
+
+ public void run(IAction action) {
+
+ IContainer container = getSelectedContainer();
+ if (container == null)
+ return;
+
+ IPath execDir = getExecDir(container);
+ String cwd = InvokeMessages.getString("CWD") + getCWD(container); //$NON-NLS-1$
+
+ InputDialog optionDialog = new SingleInputDialog(
+ new Shell(),
+ cwd,
+ InvokeMessages
+ .getString("InvokeLibtoolizeAction.windowTitle.options"), //$NON-NLS-1$
+ InvokeMessages
+ .getString("InvokeLibtoolizeAction.message.options.otherOptions"), //$NON-NLS-1$
+ DEFAULT_OPTION, null);
+ optionDialog.open();
+
+ // chop args into string array
+ String rawArgList = optionDialog.getValue();
+
+ String[] optionsList = simpleParseOptions(rawArgList);
+
+ String[] argumentList = new String[optionsList.length];
+
+ System.arraycopy(optionsList, 0, argumentList, 0, optionsList.length);
+
+ if (container != null) {
+ String libtoolizeCommand = null;
+ IProject project = getSelectedContainer().getProject();
+ try {
+ libtoolizeCommand = project.getPersistentProperty(AutotoolsPropertyConstants.AUTOHEADER_TOOL);
+ } catch (CoreException e) {
+ // do nothing
+ }
+
+ // If unset, use default system path
+ if (libtoolizeCommand == null)
+ libtoolizeCommand = DEFAULT_COMMAND;
+
+ executeConsoleCommand(DEFAULT_COMMAND, libtoolizeCommand,
+ argumentList, execDir);
+ }
+ }
+
+ public void dispose() {
+
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeMessages.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeMessages.java
new file mode 100644
index 0000000000..b62632a1c2
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeMessages.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2007, 2009 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.actions;
+
+import java.text.MessageFormat;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class InvokeMessages {
+ private static final String BUNDLE_NAME = InvokeMessages.class.getName();
+
+ private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
+ .getBundle(BUNDLE_NAME);
+
+ private InvokeMessages() {
+ }
+
+ /**
+ * Returns the string from the resource bundle,
+ * or 'key' if not found.
+ *
+ * @param key the message key
+ * @return the resource bundle message
+ */
+ public static String getString(String key) {
+ try {
+ return RESOURCE_BUNDLE.getString(key);
+ } catch (MissingResourceException e) {
+ return '!' + key + '!';
+ }
+ }
+
+ /**
+ * Returns the formatted string from the resource bundle,
+ * or 'key' if not found.
+ *
+ * @param key the message key
+ * @param args an array of substituition strings
+ * @return the resource bundle message
+ */
+ public static String getFormattedString(String key, String[] args) {
+ return MessageFormat.format(getString(key), (Object[])args);
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeMessages.properties b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeMessages.properties
new file mode 100644
index 0000000000..b2da117fef
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/InvokeMessages.properties
@@ -0,0 +1,56 @@
+#################################################################################
+# Copyright (c) 2006, 2007, 2009 Red Hat, Inc.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Red Hat Incorporated - initial API and implementation
+#################################################################################
+CWD=Working Directory:
+
+InvokeAction.windowTitle.quoteError=Quote/Double quote not correct
+InvokeAction.progress.message=Running {0}
+InvokeAction.execute.windowTitle.error=Invoke Action Error
+InvokeAction.execute.message=Couldn't execute command :
+InvokeAction.success=Command executed successfully
+InvokeAction.console.message=Invoking {0} in {1}
+
+
+InvokeAutoconfAction.command=Running autoconf in {0}
+InvokeAutoconfAction.windowTitle.stdout=Invoke Autoconf - Output
+InvokeAutoconfAction.windowTitle.stderr=Invoke Autoconf - Error
+
+
+InvokeAutomakeAction.command=Running automake
+InvokeAutomakeAction.windowTitle.options=Automake Options
+InvokeAutomakeAction.message.options.makeTargets=Enter targets separated by space :
+InvokeAutomakeAction.message.options.otherOptions=Enter options separated by space :
+InvokeAutomakeAction.windowTitle.stdout=Invoke Automake - Output
+InvokeAutomakeAction.windowTitle.stderr=Invoke Automake - Error
+
+InvokeAutoheaderAction.command=Running autoheader
+InvokeAutoheaderAction.windowTitle.options=Autoheader Options
+InvokeAutoheaderAction.message.options.otherOptions=Enter options separated by space :
+InvokeAutoheaderAction.windowTitle.stdout=Invoke Autoheader - Output
+InvokeAutoheaderAction.windowTitle.stderr=Invoke Autoheader - Error
+
+InvokeAutoreconfAction.command=Running autoreconf
+InvokeAutoreconfAction.windowTitle.options=Autoreconf Options
+InvokeAutoreconfAction.message.options.otherOptions=Enter options separated by space :
+InvokeAutoreconfAction.windowTitle.stdout=Invoke Autoreconf - Output
+InvokeAutoreconfAction.windowTitle.stderr=Invoke Autoreconf - Error
+
+InvokeAclocalAction.command=Running aclocal
+InvokeAclocalAction.windowTitle.options=Aclocal Options
+InvokeAclocalAction.message.options.includeDir=Add directory to search list for .m4 files :
+InvokeAclocalAction.message.options.otherOptions=Enter options separated by space :
+InvokeAclocalAction.windowTitle.stdout=Invoke Automake - Output
+InvokeAclocalAction.windowTitle.stderr=Invoke Automake - Error
+
+InvokeLibtoolizeAction.command=Running libtoolize
+InvokeLibtoolizeAction.windowTitle.options=Libtoolize Options
+InvokeLibtoolizeAction.message.options.otherOptions=Enter options separated by space :
+InvokeLibtoolizeAction.windowTitle.stdout=Invoke Libtoolize - Output
+InvokeLibtoolizeAction.windowTitle.stderr=Invoke Libtoolize - Error
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/LibtoolizeHandler.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/LibtoolizeHandler.java
new file mode 100644
index 0000000000..202f1b6476
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/LibtoolizeHandler.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.actions;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.expressions.IEvaluationContext;
+import org.eclipse.core.resources.IContainer;
+
+/**
+ * @author Jeff Johnston
+ *
+ */
+public class LibtoolizeHandler extends AbstractAutotoolsHandler {
+
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ InvokeLibtoolizeAction a = new InvokeLibtoolizeAction();
+ Object o = event.getApplicationContext();
+ if (o instanceof IEvaluationContext) {
+ IContainer container = getContainer((IEvaluationContext)o);
+ if (container != null) {
+ a.setSelectedContainer(container);
+ a.run(null);
+ }
+ }
+ return null;
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/ReconfigureAction.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/ReconfigureAction.java
new file mode 100644
index 0000000000..96ef9a6823
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/ReconfigureAction.java
@@ -0,0 +1,78 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.actions;
+
+import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
+import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.IWorkspaceRunnable;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.ISchedulingRule;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.linuxtools.cdt.autotools.MakeGenerator;
+
+
+public class ReconfigureAction extends InvokeAction {
+
+ public void run(IAction action) {
+ IContainer container = getSelectedContainer();
+ if (container == null)
+ return;
+
+ // We need to use a workspace root scheduling rule because adding MakeTargets
+ // may end up saving the project description which runs under a workspace root rule.
+ final ISchedulingRule rule = ResourcesPlugin.getWorkspace().getRoot();
+
+ Job backgroundJob = new Job("Reconfigure Action"){ //$NON-NLS-1$
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
+
+ public void run(IProgressMonitor monitor) throws CoreException {
+ IProject project = getSelectedContainer().getProject();
+ MakeGenerator m = new MakeGenerator();
+ IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project);
+ m.initialize(project, info, monitor);
+ m.removeConfigSettings();
+ try {
+ m.regenerateMakefiles();
+ } catch (CoreException e) {
+ // do nothing for now
+ }
+ }
+ }, rule, IWorkspace.AVOID_UPDATE, monitor);
+ } catch (CoreException e) {
+ return e.getStatus();
+ }
+ IStatus returnStatus = Status.OK_STATUS;
+ return returnStatus;
+ }
+ };
+
+ backgroundJob.setRule(rule);
+ backgroundJob.schedule();
+ }
+
+ public void dispose() {
+
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/ReconfigureHandler.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/ReconfigureHandler.java
new file mode 100644
index 0000000000..843d7bbabc
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/ReconfigureHandler.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.actions;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.expressions.IEvaluationContext;
+import org.eclipse.core.resources.IContainer;
+
+/**
+ * @author Jeff Johnston
+ *
+ */
+public class ReconfigureHandler extends AbstractAutotoolsHandler {
+
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ ReconfigureAction a = new ReconfigureAction();
+ Object o = event.getApplicationContext();
+ if (o instanceof IEvaluationContext) {
+ IContainer container = getContainer((IEvaluationContext)o);
+ if (container != null) {
+ a.setSelectedContainer(container);
+ a.run(null);
+ }
+ }
+ return null;
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/SingleInputDialog.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/SingleInputDialog.java
new file mode 100644
index 0000000000..8a5f8bc456
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/SingleInputDialog.java
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2007 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.actions;
+
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.IInputValidator;
+import org.eclipse.jface.dialogs.InputDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CLabel;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Shell;
+
+public class SingleInputDialog extends InputDialog {
+
+ private String firstMessage;
+
+ public SingleInputDialog(Shell parentShell, String firstMessage, String dialogTitle,
+ String dialogMessage, String initialValue,
+ IInputValidator validator) {
+ super(parentShell, dialogTitle, dialogMessage, initialValue, validator);
+
+ this.firstMessage = firstMessage;
+ }
+
+ /*
+ * (non-Javadoc) Method declared on Dialog.
+ */
+ protected void buttonPressed(int buttonId) {
+ super.buttonPressed(buttonId);
+ }
+
+ protected Control createDialogArea(Composite parent) {
+
+ // create composite
+ Composite composite = (Composite) super.createDialogArea(parent);
+
+ CLabel label0 = new CLabel(composite, SWT.WRAP);
+ label0.setText(firstMessage);
+ GridData data = new GridData(GridData.GRAB_HORIZONTAL
+ | GridData.GRAB_VERTICAL | GridData.HORIZONTAL_ALIGN_FILL
+ | GridData.VERTICAL_ALIGN_CENTER);
+ data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
+ label0.setLayoutData(data);
+ label0.setFont(parent.getFont());
+
+ // remove error message dialog from focusing.
+ composite.getTabList()[2].setVisible(false);
+ composite.getTabList()[2].setEnabled(false);
+
+ return composite;
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/TwoInputDialog.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/TwoInputDialog.java
new file mode 100644
index 0000000000..f786e449f2
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/actions/TwoInputDialog.java
@@ -0,0 +1,111 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2007 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.actions;
+
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.IInputValidator;
+import org.eclipse.jface.dialogs.InputDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CLabel;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+
+public class TwoInputDialog extends InputDialog {
+
+ private Text secondText;
+
+ private String secondValue;
+
+ private String secondMessage;
+
+ private String firstMessage;
+
+ public TwoInputDialog(Shell parentShell, String firstMessage, String dialogTitle,
+ String dialogMessage, String secondMessage, String initialValue,
+ IInputValidator validator) {
+ super(parentShell, dialogTitle, dialogMessage, initialValue, validator);
+
+ this.firstMessage = firstMessage;
+ this.secondMessage = secondMessage;
+ }
+
+ /*
+ * (non-Javadoc) Method declared on Dialog.
+ */
+ protected void buttonPressed(int buttonId) {
+ if (buttonId == IDialogConstants.OK_ID) {
+ secondValue = secondText.getText();
+ } else {
+ secondValue = null;
+ }
+ super.buttonPressed(buttonId);
+ }
+
+ protected Control createDialogArea(Composite parent) {
+
+ // create composite
+ Composite composite = (Composite) super.createDialogArea(parent);
+
+ CLabel label0 = new CLabel(composite, SWT.WRAP);
+ label0.setText(firstMessage);
+ Label label = new Label(composite, SWT.WRAP);
+ label.setText(secondMessage);
+ GridData data = new GridData(GridData.GRAB_HORIZONTAL
+ | GridData.GRAB_VERTICAL | GridData.HORIZONTAL_ALIGN_FILL
+ | GridData.VERTICAL_ALIGN_CENTER);
+ data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
+ label0.setLayoutData(data);
+ label0.setFont(parent.getFont());
+ label.setLayoutData(data);
+ label.setFont(parent.getFont());
+
+
+ secondText = new Text(composite, SWT.SINGLE | SWT.BORDER);
+ secondText.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL
+ | GridData.HORIZONTAL_ALIGN_FILL));
+ secondText.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ validateInput();
+ }
+ });
+
+ // remove error message dialog from focusing.
+ composite.getTabList()[2].setVisible(false);
+ composite.getTabList()[2].setEnabled(false);
+
+ return composite;
+ }
+
+ /**
+ * Returns the text area.
+ *
+ * @return the text area
+ */
+ protected Text getSecondText() {
+ return secondText;
+ }
+
+ /**
+ * Returns the string typed into this input dialog.
+ *
+ * @return the input string
+ */
+ public String getSecondValue() {
+ return secondValue;
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfCaseConditionElement.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfCaseConditionElement.java
new file mode 100644
index 0000000000..d06e73d091
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfCaseConditionElement.java
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors.parser;
+
+public class AutoconfCaseConditionElement extends AutoconfElement {
+
+ public AutoconfCaseConditionElement() {
+ super("");
+ }
+
+ public AutoconfCaseConditionElement(String name) {
+ super(name);
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfCaseElement.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfCaseElement.java
new file mode 100644
index 0000000000..c8ad284dd4
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfCaseElement.java
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors.parser;
+
+public class AutoconfCaseElement extends AutoconfElement {
+
+ public AutoconfCaseElement() {
+ super("case"); //$NON-NLS-1$
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfEditorMessages.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfEditorMessages.java
new file mode 100644
index 0000000000..53c7a7d857
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfEditorMessages.java
@@ -0,0 +1,117 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.cdt.autotools.ui.editors.parser;
+
+import java.text.MessageFormat;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+
+/**
+ * AutoconfEditorMessages
+ */
+public class AutoconfEditorMessages {
+
+ private static final String RESOURCE_BUNDLE= AutoconfEditorMessages.class.getName();
+
+ private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE);
+
+ private AutoconfEditorMessages() {
+ }
+
+ public static ResourceBundle getResourceBundle() {
+ return fgResourceBundle;
+ }
+
+ 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
+ * @since 3.0
+ */
+ 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 the arguments
+ *
+ * @param key the string used to get the bundle value, must not be null
+ * @since 3.0
+ */
+ public static String getFormattedString(String key, Object arg1, Object arg2) {
+ String format= null;
+ try {
+ format= fgResourceBundle.getString(key);
+ } catch (MissingResourceException e) {
+ return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$
+ }
+ if (arg1 == null)
+ arg1= ""; //$NON-NLS-1$
+ if (arg2 == null)
+ arg2= ""; //$NON-NLS-1$
+ return MessageFormat.format(format, new Object[] { arg1, arg2 });
+ }
+
+ /**
+ * Gets a string from the resource bundle and formats it with the arguments
+ *
+ * @param key the string used to get the bundle value, must not be null
+ * @since 3.0
+ */
+ public static String getFormattedString(String key, Object arg1, Object arg2, Object arg3) {
+ String format= null;
+ try {
+ format= fgResourceBundle.getString(key);
+ } catch (MissingResourceException e) {
+ return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$
+ }
+ if (arg1 == null)
+ arg1= ""; //$NON-NLS-1$
+ if (arg2 == null)
+ arg2= ""; //$NON-NLS-1$
+ if (arg3 == null)
+ arg3= ""; //$NON-NLS-1$
+ return MessageFormat.format(format, new Object[] { arg1, arg2, arg3 });
+ }
+
+ /**
+ * 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
+ * @since 3.0
+ */
+ public static String getFormattedString(String key, boolean arg) {
+ String format= null;
+ try {
+ format= fgResourceBundle.getString(key);
+ } catch (MissingResourceException e) {
+ return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$
+ }
+ return MessageFormat.format(format, new Object[] { new Boolean(arg) });
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfEditorMessages.properties b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfEditorMessages.properties
new file mode 100644
index 0000000000..692d0649fb
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfEditorMessages.properties
@@ -0,0 +1,47 @@
+#################################################################################
+# Copyright (c) 2007 Red Hat, Inc., (c) 2008 Nokia Inc
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Red Hat Incorporated - initial API and implementation
+# Nokia Inc - refactoring
+#################################################################################
+UnmatchedRightParenthesis=Unmatched right parenthesis
+UnmatchedLeftParenthesis=Unmatched left parenthesis
+UnmatchedRightQuote=Unmatched right quote, expected {0}
+UnmatchedLeftQuote=Unmatched left quote, expected {0}
+UnmatchedCloseComment=Unmatched end of comment, expected {0}
+UnterminatedString=Unterminated string, expected {0}
+
+AutoconfMacroArgsTooFew=The autoconf version {0} definition of macro "{1}" requires at least {2} arguments
+AutoconfMacroArgsTooMany=The autoconf version {0} definition of macro "{1}" may have a maximum of {2} arguments
+M4MacroArgsTooFew=The m4 macro "{0}" requires at least {1} arguments
+M4MacroArgsTooMany=The m4 macro "{0}" may have a maximum of {1} arguments
+MissingSpecifier=Missing "{0}" specifier
+InvalidSpecifier=The specifier "{0}" should be separated from condition by semicolon or newline
+InvalidTermination=The specifier "{0}" should appear after semicolon or newline
+UnterminatedConstruct=This "{0}" construct is unterminated
+MissingCondition=Missing condition for {0} specifier
+InvalidElif=The "elif" keyword should appear in an "if" or "elif" construct
+InvalidElse=The "else" keyword should appear in an "if" or "elif" construct
+InvalidFi=The "fi" keyword should terminate an "if", "elif", or "else" construct
+InvalidEsac=The "esac" keyword should terminate a "case" statement
+InvalidDone=The "done" keyword should terminate a "for", "while", "until", or "select" statement
+InvalidDo=The "do" keyword should appear in a "for", "while", "until", or "select" statement
+InvalidThen=The "then" keyword should appear in an "if" or "elif" statement
+InvalidIn=The "in" keyword should appear in a "case" statement
+UnterminatedCaseCondition=Case condition is not terminated before "esac" keyword
+ImproperCaseCondition=Case condition expected to end with ")"
+UnterminatedInlineDocument=Inline document started with "<<" is unterminated
+IncompleteInlineMarker=Inline document marker has incomplete quote
+MissingInlineMarker=Inline document specification is missing end marker
+AutoconfAnnotationHover.multipleMarkers=Multiple markers at this line
+
+ShowToolTip.label=Show T&ooltip Description
+ContentAssistProposal.label=Co&ntent Assist
+ContentAssistProposal.tooltip=Content Assist
+ContentAssistProposal.description=Content Assist
+
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfElement.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfElement.java
new file mode 100644
index 0000000000..2bf2a28c39
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfElement.java
@@ -0,0 +1,138 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors.parser;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+
+public class AutoconfElement {
+
+ protected String name;
+ protected String var;
+ protected int startOffset;
+ protected int endOffset;
+ protected ArrayList<AutoconfElement> children;
+ protected AutoconfElement parent;
+ private IDocument document;
+
+ public AutoconfElement(String name) {
+ this(name, null);
+ }
+
+ public AutoconfElement(String name, String var) {
+ this.name = name;
+ this.var = var;
+ this.startOffset = 0;
+ this.children = new ArrayList<AutoconfElement>();
+ }
+
+
+ public String toString() {
+ String source = getSource();
+ if (source == null) {
+ StringBuffer kids = new StringBuffer();
+ for (Iterator<AutoconfElement> iterator = children.iterator(); iterator.hasNext();) {
+ AutoconfElement kid = (AutoconfElement) iterator.next();
+ kids.append(kid.toString());
+ kids.append(",");
+ }
+ source = kids.toString();
+ }
+ return getClass().getSimpleName() + ": '" + source + "'";
+ }
+
+ public void addChild(AutoconfElement element) {
+ children.add(element);
+ if (element.getParent() == null)
+ element.setParent(this);
+ }
+
+ public void addSibling(AutoconfElement element) {
+ parent.addChild(element);
+ }
+
+ public AutoconfElement getLastChild() {
+ if (hasChildren())
+ return (AutoconfElement)children.get(children.size() - 1);
+ return null;
+ }
+
+ public AutoconfElement getParent() {
+ return parent;
+ }
+
+ public void setParent(AutoconfElement parent) {
+ this.parent = parent;
+ }
+
+ public AutoconfElement[] getChildren() {
+ return (AutoconfElement[]) children.toArray(new AutoconfElement[children.size()]);
+ }
+
+ public boolean hasChildren() {
+ return !children.isEmpty();
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String string) {
+ this.name = string;
+ }
+
+
+ public String getVar() {
+ return var;
+ }
+
+ public void setVar(String value) {
+ var = value;
+ }
+
+ public void setDocument(IDocument document) {
+ this.document = document;
+ }
+
+ public IDocument getDocument() {
+ return document;
+ }
+
+ public void setStartOffset(int offset) {
+ this.startOffset = offset;
+ }
+
+ public int getStartOffset() {
+ return startOffset;
+ }
+
+ public void setEndOffset(int offset) {
+ this.endOffset = offset;
+ }
+
+ public int getEndOffset() {
+ return endOffset;
+ }
+
+ public String getSource() {
+ if (document != null && startOffset >= 0 && endOffset >= startOffset) {
+ try {
+ return document.get(startOffset, endOffset - startOffset);
+ } catch (BadLocationException e) {
+ return null;
+ }
+ }
+ return null;
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfElifElement.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfElifElement.java
new file mode 100644
index 0000000000..a990ea82d5
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfElifElement.java
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors.parser;
+
+public class AutoconfElifElement extends AutoconfElement {
+
+ public AutoconfElifElement() {
+ super("elif"); //$NON-NLS-1$
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfElseElement.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfElseElement.java
new file mode 100644
index 0000000000..bbaa2c2c76
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfElseElement.java
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors.parser;
+
+public class AutoconfElseElement extends AutoconfElement {
+
+ public AutoconfElseElement() {
+ super("else"); //$NON-NLS-1$
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfForElement.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfForElement.java
new file mode 100644
index 0000000000..6b0ffcc9a4
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfForElement.java
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors.parser;
+
+public class AutoconfForElement extends AutoconfElement {
+
+ public AutoconfForElement() {
+ super("for"); //$NON-NLS-1$
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfIfElement.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfIfElement.java
new file mode 100644
index 0000000000..6ad658979c
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfIfElement.java
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors.parser;
+
+public class AutoconfIfElement extends AutoconfElement {
+
+ public AutoconfIfElement() {
+ super("if"); //$NON-NLS-1$
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfMacroArgumentElement.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfMacroArgumentElement.java
new file mode 100644
index 0000000000..24bf1d5f0b
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfMacroArgumentElement.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.cdt.autotools.ui.editors.parser;
+
+/**
+ * This is a macro argument node. It may also hold
+ * other AutoconfMacroElements. The source range includes any quotes around an argument
+ * but the #getName() has them stripped.
+ * @author eswartz
+ *
+ */
+public class AutoconfMacroArgumentElement extends AutoconfElement {
+
+ public AutoconfMacroArgumentElement() {
+ super(""); // //$NON-NLS-N$
+ }
+ public AutoconfMacroArgumentElement(String name) {
+ super(name); // //$NON-NLS-N$
+ }
+ public String getVar() {
+ return super.getVar();
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfMacroDetector.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfMacroDetector.java
new file mode 100644
index 0000000000..3635bcd5a9
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfMacroDetector.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc., (c) 2008 Nokia Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ * Ed Swartz (Nokia) - refactoring
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.cdt.autotools.ui.editors.parser;
+
+import java.util.regex.Pattern;
+
+/**
+ *
+ */
+public class AutoconfMacroDetector implements IAutoconfMacroDetector {
+
+ private static final Pattern AUTOCONF_MACRO_PATTERN = Pattern.compile("PKG_.*|AC_.*|AM_.*|m4.*"); //$NON-NLS-1$
+
+ /* (non-Javadoc)
+ * @see org.eclipse.linuxtools.cdt.autotools.ui.editors.parser.IAutoconfMacroDetector#isMacroIdentifier(java.lang.String)
+ */
+ public boolean isMacroIdentifier(String name) {
+ return AUTOCONF_MACRO_PATTERN.matcher(name).matches();
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfMacroElement.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfMacroElement.java
new file mode 100644
index 0000000000..1168f910cc
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfMacroElement.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ * Ed Swartz (NOKIA Inc) - support standalone parser
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors.parser;
+
+/**
+ * A call to a macro.
+ * <p>
+ * Macro element now stores arguments as AutoconfMacroElement or AutoconfMacroArgument children
+ *
+ */
+public class AutoconfMacroElement extends AutoconfElement {
+
+ public AutoconfMacroElement(String name) {
+ super(name);
+ }
+
+ public String getVar() {
+ if (children.size() > 0)
+ return getParameter(0);
+ else
+ return null;
+ }
+ public int getParameterCount() {
+ return children.size();
+ }
+
+ public String getParameter(int num) {
+ return ((AutoconfElement) children.get(num)).getName();
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfOutlineErrorHandler.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfOutlineErrorHandler.java
new file mode 100644
index 0000000000..9a5100eff7
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfOutlineErrorHandler.java
@@ -0,0 +1,136 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors.parser;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.cdt.core.CCorePlugin;
+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.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.linuxtools.cdt.autotools.AutotoolsPlugin;
+import org.eclipse.ui.IStorageEditorInput;
+import org.eclipse.ui.texteditor.MarkerUtilities;
+
+
+public class AutoconfOutlineErrorHandler {
+
+ public static final String PARSE_ERROR_MARKER_ID = AutotoolsPlugin.PLUGIN_ID
+ + ".outlineparsefileerror";
+
+ private IFile file;
+ private IDocument document;
+
+ public AutoconfOutlineErrorHandler(IStorageEditorInput input, IDocument document)
+ {
+ this.document = document;
+ IWorkspaceRoot root = CCorePlugin.getWorkspace().getRoot();
+ try {
+ IPath absPath = input.getStorage().getFullPath();
+ IPath rootPath = root.getLocation();
+ IPath relPath = new Path("");
+
+ for (int i = 0; i < rootPath.segmentCount(); ++i) {
+ relPath = relPath.append("../");
+ }
+ relPath = relPath.append(absPath);
+ this.file = root.getFileForLocation(relPath);
+ if (this.file == null) {
+ this.file = root.getFile(relPath);
+ }
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public IDocument getDocument() {
+ return document;
+ }
+
+ public void handleError(ParseException e) {
+ if (!file.exists())
+ return;
+
+ int lineNumber = e.getLineNumber();
+
+ Map<String, Object> map = new HashMap<String, Object>();
+ MarkerUtilities.setLineNumber(map, lineNumber);
+ MarkerUtilities.setMessage(map, e.getMessage());
+ map.put(IMarker.MESSAGE, e.getMessage());
+ map.put(IMarker.LOCATION, file.getFullPath().toString());
+
+ Integer charStart = getCharOffset(lineNumber, e.getStartColumn());
+ if (charStart != null) {
+ map.put(IMarker.CHAR_START, charStart);
+ }
+ Integer charEnd = getCharOffset(lineNumber, e.getEndColumn());
+ if (charEnd != null) {
+ map.put(IMarker.CHAR_END, charEnd);
+ }
+
+ // FIXME: add severity level
+ map.put(IMarker.SEVERITY, new Integer(e.getSeverity()));
+
+ try {
+ MarkerUtilities.createMarker(file, map, PARSE_ERROR_MARKER_ID);
+ } catch (CoreException ee) {
+ ee.printStackTrace();
+ }
+ return;
+ }
+
+ public void removeAllExistingMarkers() {
+ if (!file.exists())
+ return;
+
+ try {
+ file.deleteMarkers(PARSE_ERROR_MARKER_ID, true, IResource.DEPTH_ZERO);
+ } catch (CoreException e1) {
+ e1.printStackTrace();
+ }
+ }
+
+ public void removeExistingMarkers(int offset, int length) {
+ if (!file.exists())
+ return;
+
+ try {
+ IMarker[] markers = file.findMarkers(PARSE_ERROR_MARKER_ID, true, IResource.DEPTH_ZERO);
+ // Delete all markers that start in the given document range.
+ for (int i = 0; i < markers.length; ++i) {
+ IMarker marker = markers[i];
+ int charEnd = MarkerUtilities.getCharEnd(marker);
+ int charStart = MarkerUtilities.getCharStart(marker);
+ if (charStart >= offset && charEnd <= (offset + length))
+ marker.delete();
+ }
+ } catch (CoreException e1) {
+ e1.printStackTrace();
+ }
+ }
+
+ private Integer getCharOffset(int lineNumber, int columnNumber) {
+ try {
+ return new Integer(document.getLineOffset(lineNumber) + columnNumber);
+ } catch (BadLocationException e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfParser.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfParser.java
new file mode 100644
index 0000000000..e6996035c2
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfParser.java
@@ -0,0 +1,1041 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc., (c) 2008 Nokia
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ * Ed Swartz (Nokia) - refactoring
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors.parser;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+
+
+/**
+ * Tokenizing autoconf parser, based on original work by Jeff Johnston
+ * @author eswartz
+ */
+public class AutoconfParser {
+
+ public static final String MISSING_SPECIFIER = "MissingSpecifier"; //$NON-NLS-1$
+ public static final String INVALID_SPECIFIER = "InvalidSpecifier"; //$NON-NLS-1$
+ public static final String INVALID_TERMINATION = "InvalidTermination"; //$NON-NLS-1$
+ public static final String UNTERMINATED_CONSTRUCT = "UnterminatedConstruct"; //$NON-NLS-1$
+ public static final String MISSING_CONDITION = "MissingCondition"; //$NON-NLS-1$
+ public static final String INVALID_ELIF = "InvalidElif"; //$NON-NLS-1$
+ public static final String INVALID_ELSE = "InvalidElse"; //$NON-NLS-1$
+ public static final String INVALID_FI = "InvalidFi"; //$NON-NLS-1$
+ public static final String INVALID_DONE = "InvalidDone"; //$NON-NLS-1$
+ public static final String INVALID_ESAC = "InvalidEsac"; //$NON-NLS-1$
+ public static final String INVALID_DO = "InvalidDo"; //$NON-NLS-1$
+ public static final String INVALID_THEN = "InvalidThen"; //$NON-NLS-1$
+ public static final String INVALID_IN = "InvalidIn"; //$NON-NLS-1$
+ public static final String IMPROPER_CASE_CONDITION = "ImproperCaseCondition"; //$NON-NLS-1$
+ public static final String UNTERMINATED_CASE_CONDITION = "UnterminatedCaseCondition"; //$NON-NLS-1$
+ public static final String UNTERMINATED_INLINE_DOCUMENT = "UnterminatedInlineDocument"; //$NON-NLS-1$
+ public static final String INCOMPLETE_INLINE_MARKER="IncompleteInlineMarker"; //$NON-NLS-1$
+ public static final String MISSING_INLINE_MARKER="MissingInlineMarker"; //$NON-NLS-1$
+ public static final String UNMATCHED_RIGHT_PARENTHESIS = "UnmatchedRightParenthesis"; //$NON-NLS-1$
+ public static final String UNMATCHED_LEFT_PARENTHESIS = "UnmatchedLeftParenthesis"; //$NON-NLS-1$
+
+ private IAutoconfErrorHandler errorHandler;
+ private IAutoconfMacroValidator macroValidator;
+ private AutoconfTokenizer tokenizer;
+ private IAutoconfMacroDetector macroDetector;
+
+ private static final String M4_BUILTINS =
+ "define undefine defn pushdef popdef indir builtin ifdef ifelse shift reverse cond " +
+ "dumpdef traceon traceoff debugmode debugfile dnl changequote changecom changeword " +
+ "m4wrap " +
+ "include sinclude divert undivert divnum len index regexp substr translit patsubst " +
+ "format incr decr eval syscmd esyscmd sysval mkstemp maketemp errprint m4exit " +
+ "__file__ __line__ __program__ ";
+
+ private static List<String> m4builtins = new ArrayList<String>();
+ static {
+ m4builtins.addAll(Arrays.asList(M4_BUILTINS.split(" ")));
+ }
+
+ /**
+ * Create a parser for autoconf-style sources.
+ * @param errorHandler
+ * @param macroDetector
+ * @param macroValidator
+ */
+ public AutoconfParser(IAutoconfErrorHandler errorHandler,
+ IAutoconfMacroDetector macroDetector,
+ IAutoconfMacroValidator macroValidator) {
+ this.errorHandler = errorHandler;
+ this.macroDetector = macroDetector;
+ this.macroValidator = macroValidator;
+ }
+
+ /**
+ * Parse the given document and produce an AutoconfElement tree
+ * @param errorHandler
+ * @param macroValidator
+ * @param document
+ * @return element tree
+ */
+ public AutoconfElement parse(IDocument document) {
+ return parse(document, true);
+ }
+
+ /**
+ * Parse the given document and produce an AutoconfElement tree,
+ * and control whether the initial quoting style is m4 style (`...')
+ * or autoconf style ([ ... ]).
+ * @param errorHandler
+ * @param macroValidator
+ * @param document
+ * @param useAutoconfQuotes
+ * @return element tree
+ */
+ public AutoconfElement parse(IDocument document, boolean useAutoconfQuotes) {
+ this.tokenizer = new AutoconfTokenizer(document, errorHandler);
+ if (useAutoconfQuotes)
+ tokenizer.setM4Quote("[", "]");
+
+ AutoconfElement root = new AutoconfRootElement();
+ Token eof = parseTopLevel(root);
+
+ root.setStartOffset(0);
+ root.setDocument(document);
+
+ setSourceEnd(root, eof);
+
+ return root;
+ }
+
+
+ static class BlockEndCondition extends Exception {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+ private Token token;
+
+ public BlockEndCondition(Token token) {
+ this.token = token;
+ }
+
+ public Token getToken() {
+ return token;
+ }
+
+ }
+
+ static class ExprEndCondition extends Exception {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+ private Token token;
+
+ public ExprEndCondition(Token token) {
+ this.token = token;
+ }
+
+ public Token getToken() {
+ return token;
+ }
+
+ }
+
+ /**
+ * Parse individual top-level nodes: divide text into macro calls
+ * and recognized shell constructs. Anything else is not accounted for.
+ * @param parent
+ * @return
+ */
+ protected Token parseTopLevel(AutoconfElement parent) {
+ while (true) {
+ try {
+ parseStatement(parent);
+ } catch (BlockEndCondition e) {
+ // don't terminate here; we may have constructs closed too early
+ Token token = tokenizer.peekToken();
+ if (token.getType() == ITokenConstants.EOF)
+ return token;
+ }
+ }
+ }
+
+ /**
+ * Parse a block of nodes, which starts with an expression and contains
+ * subnodes. Divide text into macro calls and recognized shell constructs.
+ * Anything else is not accounted for.
+ * @param parent
+ */
+ protected void parseBlock(AutoconfElement parent, Token open, AutoconfElement block) throws BlockEndCondition {
+ parent.addChild(block);
+
+ setSourceStart(block, open);
+
+ // get the expression part
+ Token token;
+ try {
+ token = parseBlockExpression(open, block);
+ } catch (BlockEndCondition e) {
+ setSourceEndBefore(block, e.getToken());
+ throw e;
+ }
+
+ // parse the block proper
+ if (token.getType() != ITokenConstants.EOF) {
+ while (true) {
+ try {
+ parseStatement(block);
+ } catch (BlockEndCondition e) {
+ setSourceEnd(block, e.getToken());
+ return;
+ }
+ }
+ } else {
+ setSourceEnd(block, token);
+ }
+ }
+
+ private Token parseBlockExpression(Token open, AutoconfElement block) throws BlockEndCondition {
+ Token token;
+ try {
+ if (block instanceof AutoconfIfElement
+ || block instanceof AutoconfElifElement
+ || block instanceof AutoconfCaseElement
+ || block instanceof AutoconfWhileElement) {
+ token = parseExpression(block);
+ } else if (block instanceof AutoconfForElement) {
+ token = parseForExpression(block);
+ } else {
+ // no expression
+ return open;
+ }
+ block.setVar(getTokenSpanTextBetween(open, token));
+ } catch (BlockEndCondition e) {
+ // oops, premature end
+ setSourceEnd(block, e.getToken());
+ throw e;
+ }
+
+ // check for expected token
+ while (true) {
+ token = tokenizer.readToken();
+ if (token.getType() == ITokenConstants.EOF)
+ break;
+ if (token.getType() != ITokenConstants.EOL)
+ break;
+ }
+
+ if (token.getType() == ITokenConstants.SH_DO) {
+ checkBlockValidity(block, token,
+ new Class[] { AutoconfForElement.class, AutoconfWhileElement.class },
+ INVALID_DO);
+ }
+ else if (token.getType() == ITokenConstants.SH_THEN) {
+ checkBlockValidity(block, token,
+ new Class[] { AutoconfIfElement.class, AutoconfElifElement.class },
+ INVALID_THEN);
+ }
+ else {
+ String exp;
+ if (block instanceof AutoconfIfElement || block instanceof AutoconfElifElement)
+ exp = "then";
+ else
+ exp = "do";
+
+ handleError(block, token, AutoconfEditorMessages.getFormattedString(MISSING_SPECIFIER, exp));
+
+ // assume we're still in the block...
+ tokenizer.unreadToken(token);
+ }
+ return token;
+ }
+
+ /**
+ * Parse a case statement. Scoop up statements into case conditional blocks.
+ * <pre>
+ * 'case' EXPR 'in'
+ * { EXPR ')' { STMTS } ';;' }
+ * 'esac'
+ * </pre>
+ * @param parent
+ * @return
+ */
+ protected void parseCaseBlock(AutoconfElement parent, Token open, AutoconfElement block) throws BlockEndCondition {
+ parent.addChild(block);
+
+ setSourceStart(block, open);
+
+ // get the case expression, terminating at 'in'
+ Token token;
+ try {
+ token = parseCaseExpression(block);
+ } catch (BlockEndCondition e) {
+ // oops, premature end
+ setSourceEnd(block, e.getToken());
+ throw e;
+ }
+
+ block.setVar(getTokenSpanTextBetween(open, token));
+
+ // now get the statements, which are themselves blocks... just read statements
+ // that terminate with ';;' and stuff those into blocks.
+
+ while (true) {
+ AutoconfCaseConditionElement condition = new AutoconfCaseConditionElement();
+
+ // skip EOLs and get the first "real" token
+ while (true) {
+ token = tokenizer.readToken();
+ setSourceStart(condition, token);
+ if (token.getType() == ITokenConstants.EOF)
+ break;
+ if (token.getType() == ITokenConstants.EOL)
+ continue;
+ break;
+ }
+
+ if (token.getType() == ITokenConstants.SH_ESAC) {
+ break;
+ }
+
+ try {
+ Token start = token;
+ token = parseCaseExpression(condition);
+ condition.setName(getTokenSpanTextFromUpTo(start, token));
+
+ while (true) {
+ parseStatement(condition);
+ }
+ } catch (BlockEndCondition e) {
+ setSourceEnd(condition, e.getToken());
+
+ if (condition.getSource().length() > 0)
+ block.addChild(condition);
+
+ if (e.getToken().getType() != ITokenConstants.SH_CASE_CONDITION_END) {
+ token = e.getToken();
+ break;
+ }
+ }
+ }
+
+ setSourceEnd(block, token);
+
+ if (token.getType() != ITokenConstants.SH_ESAC) {
+ handleError(parent, token, AutoconfEditorMessages.getFormattedString(UNTERMINATED_CONSTRUCT, block.getName()));
+ }
+ }
+
+ private String getTokenSpanTextBetween(Token open, Token close) {
+ int startOffset = open.getOffset() + open.getLength();
+ int endOffset = close.getOffset();
+ if (open.getDocument() != close.getDocument())
+ return open.getText();
+
+ String text;
+ try {
+ text = open.getDocument().get(startOffset, endOffset - startOffset).trim();
+ } catch (BadLocationException e) {
+ text = open.getText();
+ // TODO: error
+ }
+
+ return text;
+ }
+
+ private String getTokenSpanTextFromUpTo(Token open, Token close) {
+ int startOffset = open.getOffset();
+ int endOffset = close.getOffset();
+ if (open.getDocument() != close.getDocument())
+ return open.getText();
+
+ String text;
+ try {
+ text = open.getDocument().get(startOffset, endOffset - startOffset).trim();
+ } catch (BadLocationException e) {
+ text = open.getText();
+ // TODO: error
+ }
+
+ return text;
+ }
+ private void setSourceStart(AutoconfElement block, Token open) {
+ int offset = open.getOffset();
+ block.setDocument(open.getDocument());
+ block.setStartOffset(offset);
+ }
+
+ private void setSourceEnd(AutoconfElement block, Token close) {
+ int offset = close.getOffset() + close.getLength();
+ if (block.getDocument() != null && block.getDocument() != close.getDocument())
+ throw new IllegalStateException();
+ block.setDocument(close.getDocument());
+ block.setEndOffset(offset);
+ }
+
+ private void setSourceEndBefore(AutoconfElement block, Token close) {
+ int offset = close.getOffset();
+ if (block.getDocument() != null && block.getDocument() != close.getDocument())
+ throw new IllegalStateException();
+ block.setDocument(close.getDocument());
+ block.setEndOffset(offset);
+ }
+
+ /**
+ * Parse a single statement (macro call or a shell construct).
+ * This can recursively invoke parseBlock() or parseStatement() to populate the tree.
+ * Whenever a token terminates a block, we check its validity and then throw BlockEndCondition.
+ * @param parent the parent into which to add statements. The type of this element is used
+ * to validate the legality of block closing tokens.
+ */
+ protected void parseStatement(AutoconfElement parent) throws BlockEndCondition {
+
+ boolean atStart = true;
+
+ while (true) {
+ Token token = tokenizer.readToken();
+
+ switch (token.getType()) {
+ // 0. Check EOF
+ case ITokenConstants.EOF:
+ AutoconfElement element = parent;
+ while (element != null && !(element instanceof AutoconfRootElement)) {
+ handleError(element, token, AutoconfEditorMessages.getFormattedString(UNTERMINATED_CONSTRUCT, element.getName()));
+ element = element.getParent();
+ }
+ throw new BlockEndCondition(token);
+
+
+ // 1. Check for end of statement
+ case ITokenConstants.EOL:
+ case ITokenConstants.SEMI:
+ return;
+
+
+ // 2. Check macro expansions
+ case ITokenConstants.WORD:
+ checkMacro(parent, token);
+ atStart = false;
+ break;
+
+ // Check for shell constructs. These should appear at the start of a line
+ // or after a semicolon. If they don't, just report an error and continue,
+ // to be tolerant of our own lax parsing.
+
+ // 3.a) Check dollar variables
+ case ITokenConstants.SH_DOLLAR:
+ // skip the next token
+ atStart = false;
+ token = tokenizer.readToken();
+ continue;
+
+ // 3.b) Look for if/else/elif/fi constructs,
+ // being tolerant of nesting problems by allowing
+ // stranded else/elif nodes but reporting errors.
+ case ITokenConstants.SH_IF:
+ checkLineStart(parent, token, atStart);
+ parseBlock(parent, token, new AutoconfIfElement());
+ break;
+
+ case ITokenConstants.SH_ELIF:
+ checkLineStart(parent, token, atStart);
+ checkBlockValidity(
+ parent, token,
+ new Class[] { AutoconfIfElement.class, AutoconfElifElement.class },
+ INVALID_ELIF);
+ parseBlock(parent, token, new AutoconfElifElement());
+ token = tokenizer.peekToken();
+ throw new BlockEndCondition(token);
+
+ case ITokenConstants.SH_ELSE:
+ checkLineStart(parent, token, atStart);
+ checkBlockValidity(
+ parent, token,
+ new Class[] { AutoconfIfElement.class, AutoconfElifElement.class },
+ INVALID_ELSE);
+ parseBlock(parent, token, new AutoconfElseElement());
+ token = tokenizer.peekToken();
+ throw new BlockEndCondition(token);
+
+ case ITokenConstants.SH_FI:
+ checkLineStart(parent, token, atStart);
+ checkBlockValidity(
+ parent, token,
+ new Class[] { AutoconfIfElement.class, AutoconfElifElement.class, AutoconfElseElement.class },
+ INVALID_FI);
+ throw new BlockEndCondition(token);
+
+
+ // 4. Look for for/while loops
+ case ITokenConstants.SH_FOR:
+ checkLineStart(parent, token, atStart);
+ parseBlock(parent, token, new AutoconfForElement());
+ break;
+
+ case ITokenConstants.SH_WHILE:
+ checkLineStart(parent, token, atStart);
+ parseBlock(parent, token, new AutoconfWhileElement());
+ break;
+
+ case ITokenConstants.SH_UNTIL:
+ checkLineStart(parent, token, atStart);
+ parseBlock(parent, token, new AutoconfUntilElement());
+ break;
+
+ case ITokenConstants.SH_SELECT:
+ checkLineStart(parent, token, atStart);
+ parseBlock(parent, token, new AutoconfSelectElement());
+ break;
+
+ case ITokenConstants.SH_DONE:
+ checkLineStart(parent, token, atStart);
+ checkBlockValidity(
+ parent, token,
+ new Class[] { AutoconfForElement.class, AutoconfWhileElement.class,
+ AutoconfUntilElement.class, AutoconfSelectElement.class },
+ INVALID_DONE);
+ throw new BlockEndCondition(token);
+
+ // 5. Look for case statements
+ case ITokenConstants.SH_CASE:
+ checkLineStart(parent, token, atStart);
+ parseCaseBlock(parent, token, new AutoconfCaseElement());
+ break;
+
+ case ITokenConstants.SH_CASE_CONDITION_END:
+ checkBlockValidity(
+ parent, token,
+ new Class[] { AutoconfCaseConditionElement.class },
+ IMPROPER_CASE_CONDITION);
+ throw new BlockEndCondition(token);
+
+ case ITokenConstants.SH_ESAC:
+ checkLineStart(parent, token, atStart);
+ checkBlockValidity(
+ parent, token,
+ // note: we don't strictly recurse here, so accept either parent
+ new Class[] { AutoconfCaseElement.class, AutoconfCaseConditionElement.class },
+ INVALID_ESAC);
+ throw new BlockEndCondition(token);
+
+
+ // 6. Check for HERE documents
+ case ITokenConstants.SH_HERE:
+ case ITokenConstants.SH_HERE_DASH:
+
+ parseHERE(parent, token);
+ break;
+ }
+ }
+ }
+
+ private void checkLineStart(AutoconfElement parent, Token token, boolean atStart) {
+ if (!atStart) {
+ handleError(parent, token, AutoconfEditorMessages.getFormattedString(INVALID_TERMINATION, token.getText()));
+ }
+ }
+
+ /**
+ * Parse the Here document, whose control token is provided (SH_HERE or SH_HERE_DASH).
+ * Contents are thrown away except for any macro calls.
+ * @param parent
+ * @param controlToken
+ */
+ private void parseHERE(AutoconfElement parent, Token controlToken) {
+ Token token = tokenizer.readToken();
+ if (token.getType() == ITokenConstants.EOL || token.getType() == ITokenConstants.EOF) {
+ handleError(parent, token,
+ AutoconfEditorMessages.getString(INCOMPLETE_INLINE_MARKER));
+
+ } else {
+ String hereTag = token.getText();
+
+ boolean atEOL = false;
+ while (true) {
+ token = tokenizer.readToken();
+ if (token.getType() == ITokenConstants.EOF) {
+ handleError(parent, token, AutoconfEditorMessages.getFormattedString(UNTERMINATED_CONSTRUCT, parent.getName()));
+ break;
+ } else if (token.getType() == ITokenConstants.EOL) {
+ atEOL = true;
+ } else {
+ if (atEOL && token.getText().equals(hereTag)) {
+ // only the end if it is also followed by EOL without any whitespace
+ Token eol = tokenizer.readToken();
+ if (eol.getType() == ITokenConstants.EOL && eol.getOffset() == token.getOffset() + token.getLength()) {
+ break;
+ }
+ }
+ if (token.getType() == ITokenConstants.WORD) {
+ checkMacro(parent, token);
+ }
+ atEOL = false;
+ }
+ }
+ }
+ }
+
+ /**
+ * Parse through a single expression up to a semicolon or newline.
+ * Add a macro call to the element or just return upon finding the desired token.
+ * Whenever a token terminates the expression, we check its validity and return the final token
+ * Throw {@link BlockEndCondition} if an unexpected token was found.
+ * @param parent the parent into which to add statements. The type of this element is used
+ * to validate the legality of block closing tokens.
+ */
+ protected Token parseExpression(AutoconfElement parent) throws BlockEndCondition {
+
+ while (true) {
+ Token token = tokenizer.readToken();
+
+ // 0. Ignore comments (tokenizer skipped them!)
+
+ switch (token.getType()) {
+ // 1. Check EOF
+ case ITokenConstants.EOF:
+ throw new BlockEndCondition(token);
+
+ // 2. Check macro expansions
+ case ITokenConstants.WORD:
+ token = checkMacro(parent, token);
+ break;
+
+ // 3. Check expression terminators
+ case ITokenConstants.SEMI:
+ case ITokenConstants.EOL:
+ return token;
+
+ // 4. Handle variables
+ case ITokenConstants.SH_DOLLAR:
+ token = tokenizer.readToken();
+ break;
+
+ case ITokenConstants.SH_IN:
+ // in 'for' or 'select, an 'in' may occur before 'do'
+ if (!(parent instanceof AutoconfForElement)
+ && !(parent instanceof AutoconfSelectElement))
+ return token;
+ // fall through
+
+ // 5. Abort on unexpected tokens
+ case ITokenConstants.SH_DO:
+ case ITokenConstants.SH_THEN:
+ handleError(parent, token, AutoconfEditorMessages.getFormattedString(INVALID_SPECIFIER, token.getText()));
+ tokenizer.unreadToken(token);
+ // close enough...
+ return token;
+
+ case ITokenConstants.SH_ESAC:
+ case ITokenConstants.SH_CASE:
+ case ITokenConstants.SH_CASE_CONDITION_END:
+ case ITokenConstants.SH_FOR:
+ case ITokenConstants.SH_IF:
+ case ITokenConstants.SH_ELIF:
+ case ITokenConstants.SH_ELSE:
+ case ITokenConstants.SH_FI:
+ case ITokenConstants.SH_DONE:
+ handleError(parent, token, AutoconfEditorMessages.getFormattedString(UNTERMINATED_CONSTRUCT, parent.getName()));
+ tokenizer.unreadToken(token);
+ throw new BlockEndCondition(token);
+ }
+ }
+ }
+
+ /**
+ * Parse through a single expression up to 'do'.
+ * Add a macro call to the element or just return upon finding the desired token.
+ * Whenever a token terminates the expression, we check its validity and then throw ExprEndCondition.
+ * Throw {@link BlockEndCondition} if an unexpected token was found.
+ * @param parent the parent into which to add statements. The type of this element is used
+ * to validate the legality of block closing tokens.
+ */
+ protected Token parseForExpression(AutoconfElement parent) throws BlockEndCondition {
+ while (true) {
+ Token token = tokenizer.readToken();
+
+ // 0. Ignore comments (tokenizer skipped them!)
+
+ // 1. Check EOF
+ if (token.getType() == ITokenConstants.EOF) {
+ throw new BlockEndCondition(token);
+ }
+
+ // 2. Check macro expansions
+ else if (token.getType() == ITokenConstants.WORD) {
+ token = checkMacro(parent, token);
+ }
+
+ // 3. Check expression terminators -- not ';' here, but 'do'
+ else if (token.getType() == ITokenConstants.SH_DO) {
+ tokenizer.unreadToken(token);
+ return tokenizer.peekToken();
+ }
+
+ // 4. Abort on unexpected tokens
+ else switch (token.getType()) {
+ case ITokenConstants.SH_THEN:
+ handleError(parent, token, AutoconfEditorMessages.getFormattedString(INVALID_SPECIFIER, token.getText()));
+ tokenizer.unreadToken(token);
+ // close enough...
+ //throw new ExprEndCondition(token);
+ return token;
+
+ case ITokenConstants.SH_ESAC:
+ case ITokenConstants.SH_CASE:
+ case ITokenConstants.SH_CASE_CONDITION_END:
+ case ITokenConstants.SH_FOR:
+ case ITokenConstants.SH_IF:
+ case ITokenConstants.SH_ELIF:
+ case ITokenConstants.SH_ELSE:
+ case ITokenConstants.SH_FI:
+ case ITokenConstants.SH_DONE:
+ handleError(parent, token, AutoconfEditorMessages.getFormattedString(UNTERMINATED_CONSTRUCT, parent.getName()));
+ tokenizer.unreadToken(token);
+ throw new BlockEndCondition(token);
+ }
+ }
+ }
+
+ /**
+ * Parse through a single expression up to 'in'.
+ * Add a macro call to the element or just return upon finding the desired token.
+ * Whenever a token terminates the expression, we check its validity and then throw ExprEndCondition.
+ * Throw {@link BlockEndCondition} if an unexpected token was found.
+ * @param parent the parent into which to add statements. The type of this element is used
+ * to validate the legality of block closing tokens.
+ */
+ protected Token parseCaseExpression(AutoconfElement parent) throws BlockEndCondition {
+ while (true) {
+ Token token = tokenizer.readToken();
+
+ // 0. Ignore comments (tokenizer skipped them!)
+
+ // 1. Check EOF
+ if (token.getType() == ITokenConstants.EOF) {
+ throw new BlockEndCondition(token);
+ }
+
+ // 2. Check macro expansions
+ else if (token.getType() == ITokenConstants.WORD) {
+ token = checkMacro(parent, token);
+ }
+
+ // 3. Check expression terminators
+ else if (parent instanceof AutoconfCaseElement && token.getType() == ITokenConstants.SH_IN) {
+ return token;
+ }
+ else if (parent instanceof AutoconfCaseConditionElement && token.getType() == ITokenConstants.RPAREN) {
+ return token;
+ }
+
+ // 4. Abort on unexpected tokens
+ else switch (token.getType()) {
+ case ITokenConstants.SEMI:
+ case ITokenConstants.SH_IN:
+ case ITokenConstants.RPAREN:
+ case ITokenConstants.SH_DO:
+ case ITokenConstants.SH_THEN:
+ if (parent instanceof AutoconfCaseElement)
+ handleError(parent, token, AutoconfEditorMessages.getString(INVALID_IN));
+ else
+ handleError(parent, token, AutoconfEditorMessages.getString(IMPROPER_CASE_CONDITION));
+ // close enough...
+ return token;
+
+ case ITokenConstants.SH_ESAC:
+ case ITokenConstants.SH_CASE:
+ case ITokenConstants.SH_CASE_CONDITION_END:
+ case ITokenConstants.SH_FOR:
+ case ITokenConstants.SH_IF:
+ case ITokenConstants.SH_ELIF:
+ case ITokenConstants.SH_ELSE:
+ case ITokenConstants.SH_FI:
+ case ITokenConstants.SH_DONE:
+ handleError(parent, token, AutoconfEditorMessages.getFormattedString(UNTERMINATED_CONSTRUCT, parent.getName()));
+ tokenizer.unreadToken(token);
+ throw new BlockEndCondition(token);
+ }
+ }
+ }
+
+ /**
+ * Check a given close block token against the current parent by checking that
+ * the parent's class is one of classes, If a match happens,
+ * optionally push back the token if it will be used to parse new statements in the parent.
+ * Report an error if the parent is not one of the expected kinds.
+ * @param parent
+ * @param token
+ * @param classes
+ */
+ private void checkBlockValidity(
+ AutoconfElement parent,
+ Token token,
+ Class<?>[] classes,
+ String errorMessage) {
+ for (int i = 0; i < classes.length; i++) {
+ if (classes[i].isInstance(parent)) {
+ return;
+ }
+ }
+
+ // not a match
+ handleError(parent, token,
+ AutoconfEditorMessages.getFormattedString(errorMessage, parent.getName(), token.getText()));
+ }
+
+ /**
+ * Check whether the given token is part of a macro, and parse it as such
+ * if necessary.
+ * @param parent
+ * @param token
+ * @return Token last read for the macro call
+ */
+ private Token checkMacro(AutoconfElement parent, Token token) {
+ String name = token.getText();
+
+ boolean hasArguments = tokenizer.peekToken().getType() == ITokenConstants.LPAREN;
+ if (macroDetector != null && macroDetector.isMacroIdentifier(name)) {
+ // ok
+ } else if (m4builtins.contains(name)) {
+ // all of these except dnl take arguments
+ if (!name.equals("dnl") && !hasArguments)
+ return token;
+ } else {
+ return token;
+ }
+
+ AutoconfMacroElement macro = new AutoconfMacroElement(name);
+ token = parseMacro(macro, token);
+
+ // handle special macros here
+ if ("dnl".equals(name)) {
+ // consume to EOL
+ while (true) {
+ token = tokenizer.readToken();
+ if (token.getType() == ITokenConstants.EOF || token.getType() == ITokenConstants.EOL)
+ break;
+ }
+
+ // ignore macro entirely
+ macro = null;
+ } else if ("changequote".equals(name)) {
+ // change quote delimiters
+ validateMacroParameterCount(macro, token, 2);
+
+ // GNU behavior for invalid argument count
+ String parm0 = "`";
+ String parm1 = "'";
+ if (macro.getParameterCount() >= 1)
+ parm0 = macro.getParameter(0);
+ if (macro.getParameterCount() >= 2)
+ parm1 = macro.getParameter(1);
+
+ tokenizer.setM4Quote(parm0, parm1);
+ } else if ("changecom".equals(name)) {
+ // change comment delimiters
+ validateMacroParameterCount(macro, token, 2);
+
+ // GNU behavior for invalid argument count
+ String parm0 = "#";
+ String parm1 = "\n";
+ if (macro.getParameterCount() >= 1)
+ parm0 = macro.getParameter(0);
+ if (macro.getParameterCount() >= 2)
+ parm1 = macro.getParameter(1);
+
+ tokenizer.setM4Comment(parm0, parm1);
+ }
+
+ if (macro != null) {
+ parent.addChild(macro);
+ }
+
+ // now validate that the macro is properly terminated
+ if (!(parent instanceof AutoconfMacroArgumentElement)
+ && !(parent instanceof AutoconfMacroElement)
+ && !(parent instanceof AutoconfForElement)) {
+ Token peek = tokenizer.peekToken();
+ if (peek.getType() == ITokenConstants.RPAREN) {
+ handleError(macro, peek, AutoconfEditorMessages.getString(UNMATCHED_RIGHT_PARENTHESIS));
+ }
+ }
+
+ return token;
+ }
+
+ private void validateMacroParameterCount(AutoconfMacroElement macro, Token token, int count) {
+ if (macro.getParameterCount() < count) {
+ handleError(macro, token, AutoconfEditorMessages.getFormattedString("M4MacroArgsTooFew", macro.getName(), new Integer(2)));
+ } else if (macro.getParameterCount() > count) {
+ handleError(macro, token, AutoconfEditorMessages.getFormattedString("M4MacroArgsTooMany", macro.getName(), new Integer(2)));
+ }
+ }
+
+ /**
+ * Start parsing a macro call at a suspected macro expansion location.
+ * @param macro
+ * @param line the line containing the start of the
+ * @param parent
+ * @return last token parsed
+ */
+ protected Token parseMacro(AutoconfMacroElement macro, Token macroName) {
+ setSourceStart(macro, macroName);
+
+ // parse any arguments
+ tokenizer.setM4Context(true);
+
+ Token token = tokenizer.readToken();
+ if (token.getType() == ITokenConstants.LPAREN) {
+ token = parseMacroArguments(macro, token);
+ setSourceEnd(macro, token);
+ } else {
+ tokenizer.unreadToken(token);
+ setSourceEnd(macro, macroName);
+ }
+
+ tokenizer.setM4Context(false);
+
+ // validate macro arguments?
+ if (macroValidator != null) {
+ try {
+ macroValidator.validateMacroCall(macro);
+ } catch (ParseException e) {
+ errorHandler.handleError(e);
+ }
+ }
+
+ return token;
+ }
+
+ /**
+ * Parse the arguments for the given macro. These are not interpreted as shell
+ * constructs but just as text with possibly more macro expansions inside.
+ * @param macro
+ * @return final token (')')
+ */
+ protected Token parseMacroArguments(AutoconfMacroElement macro, Token lparen) {
+ Token argStart = null;
+ Token argEnd = null;
+ Token token;
+
+ // When parsing, we want to ignore the whitespace around the arguments.
+ // So, instead of taking the source range "between" a parenthesis and a comma,
+ // track the exact tokens forming the start and end of an argument, defaulting
+ // to the borders of the parentheses and commas if no text is included.
+
+ StringBuffer argBuffer = new StringBuffer();
+ AutoconfMacroArgumentElement arg = new AutoconfMacroArgumentElement();
+
+ while (true) {
+ token = tokenizer.readToken();
+
+ if (token.getType() == ITokenConstants.EOL) {
+ if (argBuffer.length() > 0)
+ argBuffer.append(token.getText());
+ continue;
+ }
+
+ if (token.getType() == ITokenConstants.COMMA
+ || token.getType() == ITokenConstants.RPAREN
+ || token.getType() == ITokenConstants.EOF) {
+
+ arg.setName(argBuffer.toString());
+ argBuffer.setLength(0);
+
+ if (argStart != null && argEnd != null) {
+ setSourceStart(arg, argStart);
+ setSourceEnd(arg, argEnd);
+ } else if (argEnd != null) {
+ setSourceStart(arg, argStart);
+ setSourceEndBefore(arg, token);
+ } else {
+ // empty argument
+ setSourceStart(arg, token);
+ setSourceEndBefore(arg, token);
+ }
+
+ macro.addChild(arg);
+
+ if (token.getType() != ITokenConstants.COMMA)
+ break;
+
+ argStart = null;
+ argEnd = null;
+
+ arg = new AutoconfMacroArgumentElement();
+
+ } else {
+ if (argStart == null) {
+ argStart = token;
+ }
+ argEnd = token;
+
+ if (argBuffer.length() > 0 && token.followsSpace())
+ argBuffer.append(' ');
+ argBuffer.append(token.getText());
+
+ // handle nested macro calls in arguments
+ if (token.getType() == ITokenConstants.WORD) {
+ argEnd = checkMacro(arg, token);
+ }
+ }
+ }
+
+ if (token.getType() != ITokenConstants.RPAREN) {
+ handleError(macro, token, AutoconfEditorMessages.getString(UNMATCHED_LEFT_PARENTHESIS));
+ }
+
+ // note: moved 15-char truncation to AutoconfLabelProvider
+ AutoconfElement[] children = macro.getChildren();
+ if (children.length > 0)
+ macro.setVar(children[0].getVar());
+
+ return token;
+ }
+
+
+
+ protected void handleError(AutoconfElement element, Token token, String message) {
+ handleMessage(element, token, message, IMarker.SEVERITY_ERROR);
+ }
+ protected void handleWarning(AutoconfElement element, Token token, String message) {
+ handleMessage(element, token, message, IMarker.SEVERITY_WARNING);
+ }
+ protected void handleMessage(AutoconfElement element, Token token, String message, int severity) {
+ if (errorHandler != null) {
+ int lineNumber = 0;
+ int startColumn = 0;
+ int endColumn = 0;
+ try {
+ lineNumber = token.getDocument().getLineOfOffset(token.getOffset());
+ int lineOffs = token.getDocument().getLineOffset(lineNumber);
+ startColumn = token.getOffset() - lineOffs;
+ endColumn = startColumn + token.getLength();
+ } catch (BadLocationException e) {
+ // Don't care if we blow up trying to issue marker
+ }
+ errorHandler.handleError(new ParseException(
+ message,
+ token.getOffset(),
+ token.getOffset() + token.getLength(),
+ lineNumber,
+ startColumn, endColumn,
+ severity));
+ }
+ }
+
+ public IAutoconfErrorHandler getErrorHandler() {
+ return errorHandler;
+ }
+}
+
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfRootElement.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfRootElement.java
new file mode 100644
index 0000000000..105d00b88d
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfRootElement.java
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors.parser;
+
+public class AutoconfRootElement extends AutoconfElement {
+
+ public AutoconfRootElement() {
+ super(""); //$NON-NLS-1$
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfSelectElement.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfSelectElement.java
new file mode 100644
index 0000000000..aded97c871
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfSelectElement.java
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors.parser;
+
+public class AutoconfSelectElement extends AutoconfElement {
+
+ public AutoconfSelectElement() {
+ super("select");
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfTokenizer.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfTokenizer.java
new file mode 100644
index 0000000000..a34cbb2448
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfTokenizer.java
@@ -0,0 +1,434 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.cdt.autotools.ui.editors.parser;
+
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+
+
+/**
+ * This tokenizer traverses autotools-style text (m4 or configure.ac) to support the
+ * autoconf parser. It tracks the current context (m4 macro call or shell commands)
+ * to detect appropriate tokens, and tracks the m4 current quote style as well.
+ * <p>
+ * In m4 mode, its primary purpose is to find word boundaries, detect comments and quoted
+ * strings, and to find the macro punctuation tokens. It will not interpret anything
+ * (e.g. '$1' inside a macro) -- this is up to the parser.
+ * <p>
+ * In shell script mode, its primary purpose is to identify enough
+ * tokens to get a general picture of the structure of source for use by the autoconf
+ * parser. This isn't intended to be used for full shell script parsing. In fact,
+ * aside from the known tokens and identifiers, only individual characters will be returned.
+ * <p>
+ * Both modes know about "words" or identifiers and use the same syntax to detect these.
+ * It's expected that the parser will detect a word as a macro or possible macro and
+ * switch the mode of the tokenizer to fit. The parser should invoke "setM4Context(...)"
+ * (and "unreadToken" if necessary) to switch modes.
+ * @author eswartz
+ *
+ */
+public class AutoconfTokenizer {
+
+ private static final String UNTERMINATED_STRING = "UnterminatedString"; //$NON-NLS-1$
+ public static final String UNMATCHED_RIGHT_QUOTE = "UnmatchedRightQuote"; //$NON-NLS-1$
+ public static final String UNMATCHED_LEFT_QUOTE = "UnmatchedLeftQuote"; //$NON-NLS-1$
+ public static final String UNMATCHED_CLOSE_COMMENT = "UnmatchedCloseComment"; //$NON-NLS-1$
+
+ private IDocument document;
+ private int offset;
+ private String m4OpenQuote;
+ private String m4CloseQuote;
+ private String m4OpenComment;
+ private String m4CloseComment;
+ private char[] chars;
+ private int startOffset;
+ private boolean isM4Context;
+ private Token eofToken;
+ private IAutoconfErrorHandler errorHandler;
+
+ /** Create a tokenizer for a document. */
+ public AutoconfTokenizer(IDocument document, IAutoconfErrorHandler errorHandler) {
+ if (document == null /* || macroDetector == null*/)
+ throw new IllegalArgumentException();
+ this.document = document;
+ this.errorHandler = errorHandler;
+
+ this.chars = document.get().toCharArray();
+ this.offset = 0;
+
+ this.eofToken = new Token(ITokenConstants.EOF, "", document, chars.length, 0);
+
+ this.m4OpenQuote = "`";
+ this.m4CloseQuote = "'";
+ this.m4OpenComment = "#";
+ this.m4CloseComment = "\n";
+ }
+
+ /**
+ * Tell whether the tokenizer considers itself to be in an m4 context.
+ * This determines what kinds of tokens it returns.
+ * @return
+ */
+ public boolean isM4Context() {
+ return isM4Context;
+ }
+
+ /**
+ * Switch the tokenizer into or out of m4 context.
+ * @return
+ */
+ public void setM4Context(boolean flag) {
+ isM4Context = flag;
+ }
+
+ /**
+ * Set the m4 quote delimiters
+ */
+ public void setM4Quote(String open, String close) {
+ this.m4OpenQuote = open;
+ this.m4CloseQuote = close;
+ }
+
+ /**
+ * Set the m4 comment delimiters
+ */
+ public void setM4Comment(String open, String close) {
+ this.m4OpenComment = open;
+ this.m4CloseComment = close;
+ }
+
+ /** Push back the given token. This allows the tokenizer to restart from its start position,
+ * potentially in a different context. */
+ public void unreadToken(Token token) {
+ if (token.getLength() > 0 && offset == token.getOffset())
+ throw new IllegalStateException();
+ offset = token.getOffset();
+ }
+
+ /** Read the next token. Returns an EOF token at EOF. */
+ public Token readToken() {
+ if (offset >= chars.length)
+ return eofToken;
+
+ char ch = chars[offset];
+
+ // skip whitespace (but not EOL)
+ while (isWhitespace(ch)) {
+ offset++;
+ if (offset >= chars.length)
+ return eofToken;
+ ch = chars[offset];
+ }
+
+ // in shell mode, strip comments up to eol
+ if (!isM4Context && ch == '#') {
+ while (offset < chars.length) {
+ ch = chars[offset];
+ if (ch == '\n')
+ break;
+ offset++;
+ }
+
+ // keep inside doc if we didn't find that EOL
+ if (offset >= chars.length)
+ offset--;
+ }
+
+ startOffset = offset;
+ StringBuffer buffer = new StringBuffer();
+
+ // check EOL
+ if (ch == '\r' || ch == '\n') {
+ buffer.append(ch);
+ offset++;
+ if (ch == '\r' && offset < chars.length && chars[offset] == '\n') {
+ buffer.append(chars[offset++]);
+ }
+ return makeToken(ITokenConstants.EOL, buffer.toString());
+ }
+
+ // TODO: this parser always uses fixed logic for identifier reading, ignoring m4's "changeword"
+ if (isLeadIdentifierChar(ch)) {
+ return parseWord(ch);
+ }
+
+ // check comments and quotes
+ if (isM4Context) {
+ if (lookAhead(m4OpenComment)) {
+ boolean found = false;
+ // keep reading until the close comment (these are NOT nested)
+ while (offset < chars.length) {
+ if (lookAhead(m4CloseComment)) {
+ found = true;
+ break;
+ }
+ offset++;
+ }
+ if (!found) {
+ handleError(startOffset, offset, AutoconfEditorMessages.getFormattedString(UNMATCHED_CLOSE_COMMENT,
+ m4CloseComment.equals("\n") ? "newline" : m4CloseComment)); //$NON-NLS-1$
+ }
+ return makeToken(ITokenConstants.M4_COMMENT);
+ }
+
+ if (lookAhead(m4OpenQuote)) {
+ return parseQuote();
+ }
+ }
+
+ // check shell punctuation
+ if (!isM4Context) {
+ if (ch == ';' && offset + 1 < chars.length && chars[offset + 1] == ';') {
+ offset += 2;
+ return makeToken(ITokenConstants.SH_CASE_CONDITION_END);
+ }
+ if (ch == '<' && offset + 1 < chars.length && chars[offset + 1] == '<') {
+ offset += 2;
+ if (offset < chars.length && chars[offset] == '-') {
+ offset++;
+ return makeToken(ITokenConstants.SH_HERE_DASH);
+ } else {
+ return makeToken(ITokenConstants.SH_HERE);
+ }
+ }
+ switch (ch) {
+ case '$':
+ offset++;
+ return makeToken(ITokenConstants.SH_DOLLAR);
+ case '[':
+ offset++;
+ return makeToken(ITokenConstants.SH_LBRACKET);
+ case ']':
+ offset++;
+ return makeToken(ITokenConstants.SH_RBRACKET);
+ case '{':
+ offset++;
+ return makeToken(ITokenConstants.SH_LBRACE);
+ case '}':
+ offset++;
+ return makeToken(ITokenConstants.SH_RBRACE);
+ case '\'':
+ return parseString(ITokenConstants.SH_STRING_SINGLE, ch);
+ case '\"':
+ return parseString(ITokenConstants.SH_STRING_DOUBLE, ch);
+ case '`':
+ return parseString(ITokenConstants.SH_STRING_BACKTICK, ch);
+ }
+ }
+
+ // check common punctuation
+ if (ch == ';') {
+ offset++;
+ return makeToken(ITokenConstants.SEMI);
+ }
+ if (ch == ',') {
+ offset++;
+ return makeToken(ITokenConstants.COMMA);
+ }
+ if (ch == '(') {
+ offset++;
+ return makeToken(ITokenConstants.LPAREN);
+ }
+ if (ch == ')') {
+ offset++;
+ return makeToken(ITokenConstants.RPAREN);
+ }
+
+ // unknown text
+ offset++;
+ return makeToken(ITokenConstants.TEXT);
+ }
+
+ private Token parseWord(char ch) {
+ StringBuffer buffer = new StringBuffer();
+
+ buffer.append(ch);
+ offset++;
+ do {
+ if (offset >= chars.length)
+ break;
+ ch = chars[offset];
+ if (!isIdentifierChar(ch))
+ break;
+ buffer.append(ch);
+ offset++;
+ } while (true);
+
+ String text = buffer.toString();
+
+ if (!isM4Context) {
+ // detect sh tokens
+ if ("case".equals(text))
+ return makeToken(ITokenConstants.SH_CASE, text);
+ if ("in".equals(text))
+ return makeToken(ITokenConstants.SH_IN, text);
+ if ("esac".equals(text))
+ return makeToken(ITokenConstants.SH_ESAC, text);
+ if ("while".equals(text))
+ return makeToken(ITokenConstants.SH_WHILE, text);
+ if ("select".equals(text))
+ return makeToken(ITokenConstants.SH_SELECT, text);
+ if ("until".equals(text))
+ return makeToken(ITokenConstants.SH_UNTIL, text);
+ if ("for".equals(text))
+ return makeToken(ITokenConstants.SH_FOR, text);
+ if ("do".equals(text))
+ return makeToken(ITokenConstants.SH_DO, text);
+ if ("done".equals(text))
+ return makeToken(ITokenConstants.SH_DONE, text);
+ if ("if".equals(text))
+ return makeToken(ITokenConstants.SH_IF, text);
+ if ("then".equals(text))
+ return makeToken(ITokenConstants.SH_THEN, text);
+ if ("else".equals(text))
+ return makeToken(ITokenConstants.SH_ELSE, text);
+ if ("elif".equals(text))
+ return makeToken(ITokenConstants.SH_ELIF, text);
+ if ("fi".equals(text))
+ return makeToken(ITokenConstants.SH_FI, text);
+ }
+
+ // other identifier-looking word
+ return makeToken(ITokenConstants.WORD, text);
+ }
+
+ private Token parseQuote() {
+ // read text, honoring nested quotes, but don't put the outermost quotes in the token
+
+ StringBuffer buffer = new StringBuffer();
+
+ int quoteLevel = 1;
+ // keep reading until the close quote
+ while (offset < chars.length) {
+ if (lookAhead(m4CloseQuote)) {
+ quoteLevel--;
+ if (quoteLevel == 0)
+ break;
+ buffer.append(m4CloseQuote);
+ } else if (lookAhead(m4OpenQuote)) {
+ buffer.append(m4OpenQuote);
+ quoteLevel++;
+ } else {
+ buffer.append(chars[offset]);
+ offset++;
+ }
+ }
+
+ if (quoteLevel > 0) {
+ handleError(startOffset, offset, AutoconfEditorMessages.getFormattedString(UNMATCHED_LEFT_QUOTE, m4CloseQuote));
+ } else if (quoteLevel < 0) {
+ handleError(startOffset, offset, AutoconfEditorMessages.getFormattedString(UNMATCHED_RIGHT_QUOTE, m4OpenQuote));
+ }
+
+ return makeToken(ITokenConstants.M4_STRING, buffer.toString());
+ }
+
+ private Token parseString(int type, char terminal) {
+ startOffset = offset;
+ offset++;
+
+ StringBuffer buffer = new StringBuffer();
+
+ char ch = 0;
+ while (offset < chars.length) {
+ ch = chars[offset++];
+ if (ch == '\\') {
+ if (offset < chars.length)
+ buffer.append(chars[offset++]);
+ else
+ buffer.append(ch);
+ } else if (ch == terminal) {
+ break;
+ } else {
+ buffer.append(ch);
+ }
+ }
+
+ if (ch != terminal) {
+ handleError(startOffset, offset, AutoconfEditorMessages.getFormattedString(UNTERMINATED_STRING, "" + ch));
+ }
+
+ return makeToken(type, buffer.toString());
+ }
+
+ private void handleError(int start, int end,
+ String message) {
+ if (errorHandler != null) {
+ int lineNumber = 0;
+ int startColumn = 0;
+ int endColumn = 0;
+ try {
+ lineNumber = document.getLineOfOffset(start);
+ int lineOffs = document.getLineOffset(lineNumber);
+ startColumn = start - lineOffs;
+ endColumn = end - lineOffs;
+ } catch (BadLocationException e) {
+ // Don't care if we blow up trying to issue marker
+ }
+ errorHandler.handleError(new ParseException(
+ message,
+ start, end,
+ lineNumber,
+ startColumn, endColumn,
+ IMarker.SEVERITY_ERROR));
+ }
+ }
+
+ /**
+ * Look ahead for the given string. If found, return true, and have
+ * offset updated. Otherwise, return false with offset unchanged.
+ * @param keyword
+ * @param text
+ * @return
+ */
+ private boolean lookAhead(String keyword) {
+ int length = keyword.length();
+ if (offset + length > chars.length) {
+ return false;
+ }
+ for (int idx = 0; idx < length; idx++) {
+ if (chars[offset + idx] != keyword.charAt(idx))
+ return false;
+ }
+ offset += length;
+ return true;
+ }
+
+ private boolean isWhitespace(char ch) {
+ return ch == ' ' || ch == '\t' || ch == '\f';
+ }
+
+ private Token makeToken(int type) {
+ return new Token(type,
+ new String(chars, startOffset, offset - startOffset),
+ document, startOffset, offset - startOffset);
+ }
+
+ private Token makeToken(int type, String text) {
+ return new Token(type, text, document, startOffset, offset - startOffset);
+ }
+
+ private boolean isIdentifierChar(char ch) {
+ return isLeadIdentifierChar(ch) || (ch >= '0' && ch <= '9');
+ }
+
+ private boolean isLeadIdentifierChar(char ch) {
+ return (ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z') || ch == '_';
+ }
+
+ public Token peekToken() {
+ Token token = readToken();
+ unreadToken(token);
+ return token;
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfUntilElement.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfUntilElement.java
new file mode 100644
index 0000000000..bf6eb597eb
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfUntilElement.java
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors.parser;
+
+public class AutoconfUntilElement extends AutoconfElement {
+
+ public AutoconfUntilElement() {
+ super("until");
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfWhileElement.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfWhileElement.java
new file mode 100644
index 0000000000..8d247f73d3
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/AutoconfWhileElement.java
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors.parser;
+
+public class AutoconfWhileElement extends AutoconfElement {
+
+ public AutoconfWhileElement() {
+ super("while");
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/IAutoconfErrorHandler.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/IAutoconfErrorHandler.java
new file mode 100644
index 0000000000..1363240bbc
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/IAutoconfErrorHandler.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.cdt.autotools.ui.editors.parser;
+
+
+/**
+ * Clients implement this interface to handle errors encountered while parsing.
+ * @author eswartz
+ *
+ */
+public interface IAutoconfErrorHandler {
+
+ /**
+ * Handle an exception associated with the given element
+ * @param exception the exception to handle; has a line number
+ * at the time of call
+ */
+ void handleError(ParseException exception);
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/IAutoconfMacroDetector.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/IAutoconfMacroDetector.java
new file mode 100644
index 0000000000..e4387316e5
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/IAutoconfMacroDetector.java
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.cdt.autotools.ui.editors.parser;
+
+
+/**
+ * Clients implement this interface to identify what identifiers represent
+ * macros for the autoconf tree.
+ * @author eswartz
+ *
+ */
+public interface IAutoconfMacroDetector {
+
+ /**
+ * Tell if this identifier should be treated as an m4 macro call.
+ * The identifier has already been judged to be a valid candidate
+ * (i.e. it's not quoted).
+ * @param name the string to check
+ */
+ boolean isMacroIdentifier(String name);
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/IAutoconfMacroValidator.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/IAutoconfMacroValidator.java
new file mode 100644
index 0000000000..2a54ee4773
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/IAutoconfMacroValidator.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.cdt.autotools.ui.editors.parser;
+
+
+/**
+ * Clients implement this interface to validate macro calls.
+ * @author eswartz
+ *
+ */
+public interface IAutoconfMacroValidator {
+
+ /**
+ * Validate the given macro call.
+ * @param element macro call, never <code>null</code>
+ * @throws ParseException if the call doesn't match the expected number of elements
+ */
+ void validateMacroCall(AutoconfMacroElement element) throws ParseException;
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/IMacroDetector.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/IMacroDetector.java
new file mode 100644
index 0000000000..b225942cfe
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/IMacroDetector.java
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.cdt.autotools.ui.editors.parser;
+
+/**
+ * Clients implement this interface to detect whether a given identifier
+ * represents a known or potential macro in m4 or configure.ac text.
+ * @author eswartz
+ *
+ */
+public interface IMacroDetector {
+ boolean isMacro(String identifier);
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/ITokenConstants.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/ITokenConstants.java
new file mode 100644
index 0000000000..b665115f8d
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/ITokenConstants.java
@@ -0,0 +1,87 @@
+package org.eclipse.linuxtools.cdt.autotools.ui.editors.parser;
+
+public interface ITokenConstants {
+
+ /** end of file */
+ public static final int EOF = 0;
+ /** end of line */
+ public static final int EOL = 1;
+
+ /** an open parenthesis */
+ public static final int LPAREN = 2;
+ /** a close parenthesis */
+ public static final int RPAREN = 3;
+ /** a comma */
+ public static final int COMMA = 4;
+ /** a semicolon */
+ public static final int SEMI = 5;
+
+ /** a word (either m4 word or shell identifier-looking word) */
+ public static final int WORD = 6;
+
+ /** other text (usually punctuation or number, one char at a time) */
+ public static final int TEXT = 7;
+
+ /** an m4 string (the text does not contain the outermost quotes) */
+ public static final int M4_STRING = 21;
+ /** an m4 comment (as determined by changecomment, NOT dnl) */
+ public static final int M4_COMMENT = 22;
+
+ /** the sh 'if' token */
+ public static final int SH_IF = 40;
+ /** the sh 'then' token */
+ public static final int SH_THEN = 41;
+ /** the sh 'else' token */
+ public static final int SH_ELSE = 42;
+ /** the sh 'elif' token */
+ public static final int SH_ELIF = 43;
+ /** the sh 'fi' token */
+ public static final int SH_FI = 44;
+
+ /** the sh 'while' token */
+ public static final int SH_WHILE = 45;
+ /** the sh 'for' token */
+ public static final int SH_FOR = 46;
+ /** the sh 'select' token */
+ public static final int SH_SELECT = 47;
+ /** the sh 'until' token */
+ public static final int SH_UNTIL = 48;
+ /** the sh 'do' token */
+ public static final int SH_DO = 49;
+ /** the sh 'done' token */
+ public static final int SH_DONE = 50;
+ /** the sh 'case' token */
+
+ public static final int SH_CASE = 51;
+ /** the sh 'in' token */
+ public static final int SH_IN = 52;
+ /** the sh ';;' token */
+ public static final int SH_CASE_CONDITION_END = 53;
+ /** the sh 'esac' token */
+ public static final int SH_ESAC = 54;
+
+ /** the sh '$' token */
+ public static final int SH_DOLLAR = 60;
+
+ /** the sh '{' token */
+ public static final int SH_LBRACE = 61;
+ /** the sh '}' token */
+ public static final int SH_RBRACE = 62;
+ /** the sh '[' token */
+ public static final int SH_LBRACKET = 63;
+ /** the sh ']' token */
+ public static final int SH_RBRACKET = 64;
+
+ /** the sh '<<' token */
+ public static final int SH_HERE = 65;
+ /** the sh '<<-' token */
+ public static final int SH_HERE_DASH = 66;
+ /** an sh double-quoted string */
+ public static final int SH_STRING_DOUBLE = 67;
+ /** an sh single-quoted string */
+ public static final int SH_STRING_SINGLE = 68;
+ /** an sh backtick-quoted string */
+ public static final int SH_STRING_BACKTICK = 69;
+
+
+} \ No newline at end of file
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/ParseException.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/ParseException.java
new file mode 100644
index 0000000000..f0bc442469
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/ParseException.java
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.editors.parser;
+
+public class ParseException extends Exception {
+
+ static final long serialVersionUID = 1;
+ String message;
+ int severity;
+ int lineNumber;
+ int startColumn;
+ int endColumn;
+ private int startOffset;
+ private int endOffset;
+ public int getEndColumn() {
+ return endColumn;
+ }
+ public void setEndColumn(int endColumn) {
+ this.endColumn = endColumn;
+ }
+ public int getLineNumber() {
+ return lineNumber;
+ }
+ public void setLineNumber(int lineNumber) {
+ this.lineNumber = lineNumber;
+ }
+ public String getMessage() {
+ return message;
+ }
+ public void setMessage(String message) {
+ this.message = message;
+ }
+ public int getStartColumn() {
+ return startColumn;
+ }
+ public void setStartColumn(int startColumn) {
+ this.startColumn = startColumn;
+ }
+ public ParseException(String message,
+ int startOffset, int endOffset,
+ int lineNumber, int startColumn, int endColumn, int severity) {
+ super();
+ this.message = message;
+ this.startOffset = startOffset;
+ this.endOffset = endOffset;
+ this.lineNumber = lineNumber;
+ this.startColumn = startColumn;
+ this.endColumn = endColumn;
+ this.severity = severity;
+ }
+ public int getSeverity() {
+ return severity;
+ }
+ public void setSeverity(int severity) {
+ this.severity = severity;
+ }
+ public int getStartOffset() {
+ return startOffset;
+ }
+ public int getEndOffset() {
+ return endOffset;
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/Token.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/Token.java
new file mode 100644
index 0000000000..9690363b4b
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/parser/Token.java
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.cdt.autotools.ui.editors.parser;
+
+import org.eclipse.jface.text.IDocument;
+
+/**
+ * A single token parsed from an autotools-style file. This represents m4 and sh
+ * tokens. Punctuation characters shared by both are not in a namespace.
+ *
+ * @author eswartz
+ *
+ */
+public class Token implements ITokenConstants {
+ /** Type:
+ * @see ITokenConstants
+ */
+ final int type;
+ /**
+ * Text of token, possibly interpreted or reduced from original characters
+ */
+ final String text;
+ /**
+ * Offset of token before interpretation
+ */
+ final int offset;
+ /**
+ * Length of token before interpretation
+ */
+ final int length;
+ /**
+ * The document providing the text
+ */
+ final IDocument document;
+
+ public Token(int type, String text, IDocument document, int offset, int length) {
+ this.type = type;
+ this.text = text;
+ this.document = document;
+ this.offset = offset;
+ this.length = length;
+ }
+
+ public String toString() {
+ return text;
+ }
+
+ public int getType() {
+ return type;
+ }
+
+ public String getText() {
+ return text;
+ }
+
+ public IDocument getDocument() {
+ return document;
+ }
+
+ public int getOffset() {
+ return offset;
+ }
+
+ public int getLength() {
+ return length;
+ }
+
+ public boolean followsSpace() {
+ char[] text = document.get().toCharArray();
+ if (offset == 0)
+ return false;
+ return (" \t\r\n\f".indexOf(text[offset - 1]) >= 0);
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsBuildPropertyPage.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsBuildPropertyPage.java
new file mode 100644
index 0000000000..8bc173fe35
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsBuildPropertyPage.java
@@ -0,0 +1,243 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.properties;
+
+import org.eclipse.cdt.core.settings.model.ICResourceDescription;
+import org.eclipse.cdt.managedbuilder.ui.properties.AbstractCBuildPropertyTab;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.linuxtools.cdt.autotools.AutotoolsMakefileBuilder;
+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.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.Label;
+import org.eclipse.swt.widgets.Text;
+
+
+public class AutotoolsBuildPropertyPage extends AbstractCBuildPropertyTab {
+
+ private String TRUE = "true"; // $NON-NLS-1$
+ private String FALSE = "false"; // $NON-NLS-1$
+ private String SCANNERMAKEW_LABEL = "ScannerMakeW.label"; // $NON-NLS-1$
+ private String SCANNERMAKEW_TOOLTIP = "ScannerMakeW.tooltip"; // $NON-NLS-1$
+
+ protected Button fCleanDelete;
+ protected Button fCleanMake;
+ protected Text fCleanMakeTarget;
+ protected Button fScannerMakeW;
+
+ private IProject getProject() {
+ return (IProject)getCfg().getManagedProject().getOwner();
+ }
+
+ public boolean canBeVisible() {
+ return AutotoolsMakefileBuilder.hasTargetBuilder(getProject());
+ }
+
+ public void createControls(Composite parent) {
+ super.createControls(parent);
+ Composite composite= usercomp;
+ // assume parent page uses griddata
+ GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_CENTER | GridData.VERTICAL_ALIGN_FILL | GridData.FILL_HORIZONTAL);
+ composite.setLayoutData(gd);
+ GridLayout layout= new GridLayout();
+ layout.numColumns= 2;
+ //PixelConverter pc= new PixelConverter(composite);
+ //layout.verticalSpacing= pc.convertHeightInCharsToPixels(1) / 2;
+ composite.setLayout(layout);
+
+ Group g = new Group(composite, SWT.SHADOW_ETCHED_IN);
+ g.setText(AutotoolsPropertyMessages.getString("CleanBehavior.title"));
+ gd = new GridData(GridData.HORIZONTAL_ALIGN_CENTER | GridData.VERTICAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
+ g.setLayoutData(gd);
+ layout= new GridLayout();
+ layout.numColumns= 2;
+ g.setLayout(layout);
+
+ fCleanDelete = new Button(g, SWT.RADIO);
+ fCleanDelete.setText(AutotoolsPropertyMessages.getString("CleanDelete.label"));
+ gd= new GridData();
+ gd.horizontalAlignment= GridData.BEGINNING;
+ gd.horizontalSpan = 2;
+ fCleanDelete.setLayoutData(gd);
+ fCleanMake = new Button(g, SWT.RADIO);
+ fCleanMake.setText(AutotoolsPropertyMessages.getString("CleanMake.label"));
+ gd= new GridData();
+ gd.horizontalAlignment= GridData.BEGINNING;
+ gd.horizontalSpan = 2;
+ fCleanMake.setLayoutData(gd);
+
+ Label label = new Label(g, SWT.LEFT);
+ label.setText(AutotoolsPropertyMessages.getString("CleanMakeTarget.label"));
+ gd= new GridData();
+ gd.horizontalAlignment= GridData.BEGINNING;
+ label.setLayoutData(gd);
+
+ fCleanMakeTarget = new Text(g, SWT.SINGLE | SWT.BORDER);
+ fCleanMakeTarget.setText(AutotoolsPropertyConstants.CLEAN_MAKE_TARGET_DEFAULT);
+ gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL);
+ fCleanMakeTarget.setLayoutData(gd);
+
+ fCleanDelete.addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ fCleanMake.setSelection(false);
+ fCleanDelete.setSelection(true);
+ fCleanMakeTarget.setEnabled(false);
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ // do nothing
+ }
+ });
+
+ fCleanMake.addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ fCleanDelete.setSelection(false);
+ fCleanMake.setSelection(true);
+ fCleanMakeTarget.setEnabled(true);
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ // do nothing
+ }
+ });
+
+ fCleanMakeTarget.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ if (fCleanMakeTarget.getText().equals("")) { // $NON-NLS-1$
+ // FIXME: should probably issue warning here, but how?
+ }
+ }
+ });
+
+ fScannerMakeW = new Button(composite, SWT.LEFT | SWT.CHECK);
+ fScannerMakeW.setText(AutotoolsPropertyMessages.getString(SCANNERMAKEW_LABEL));
+ fScannerMakeW.setToolTipText(AutotoolsPropertyMessages.getString(SCANNERMAKEW_TOOLTIP));
+ gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_BEGINNING);
+ fScannerMakeW.setLayoutData(gd);
+
+ initialize();
+ }
+
+ protected void performOK() {
+ IProject project = getProject();
+ if (fCleanDelete.getSelection()) {
+ try {
+ project.setPersistentProperty(AutotoolsPropertyConstants.CLEAN_DELETE, TRUE);
+ } catch (CoreException ce) {
+ // FIXME: what can we do here?
+ }
+ } else {
+ try {
+ project.setPersistentProperty(AutotoolsPropertyConstants.CLEAN_DELETE, FALSE);
+ } catch (CoreException ce) {
+ // FIXME: what can we do here?
+ }
+ try {
+ project.setPersistentProperty(AutotoolsPropertyConstants.CLEAN_MAKE_TARGET, fCleanMakeTarget.getText());
+ } catch (CoreException ce) {
+ // FIXME: what can we do here?
+ }
+ }
+ boolean setScannerInfoDirty = false;
+ try {
+ // Get old scanner method setting to see if it has changed.
+ String oldScannerMakeW = project.getPersistentProperty(AutotoolsPropertyConstants.SCANNER_USE_MAKE_W);
+ if (fScannerMakeW.getSelection()) {
+ project.setPersistentProperty(AutotoolsPropertyConstants.SCANNER_USE_MAKE_W, TRUE);
+ if (oldScannerMakeW == null || !oldScannerMakeW.equals(TRUE))
+ setScannerInfoDirty = true;
+ } else {
+ project.setPersistentProperty(AutotoolsPropertyConstants.SCANNER_USE_MAKE_W, null);
+ if (oldScannerMakeW != null && oldScannerMakeW.equals(TRUE))
+ setScannerInfoDirty = true;
+ }
+ } catch (CoreException ce) {
+ ce.printStackTrace(); // FIXME: what can we do here?
+ }
+ // If the scanner info method changes, we must mark the current data as
+ // dirty so it will be recalculated.
+ if (setScannerInfoDirty) {
+ try {
+ project.setSessionProperty(AutotoolsPropertyConstants.SCANNER_INFO_DIRTY, Boolean.TRUE);
+ } catch (CoreException ce2) {
+ // FIXME: what can we do here?
+ }
+ }
+ }
+
+ protected void performApply(ICResourceDescription src, ICResourceDescription dst) {
+ performOK();
+ }
+
+ protected void performDefaults() {
+ fCleanDelete.setSelection(false);
+ fCleanMake.setSelection(true);
+ fCleanMakeTarget.setText(AutotoolsPropertyConstants.CLEAN_MAKE_TARGET_DEFAULT);
+ fCleanMakeTarget.setEnabled(true);
+ fScannerMakeW.setSelection(true);
+ }
+
+ public void updateData(ICResourceDescription cfgd) {
+ // what to do here?
+ }
+
+ public void updateButtons() {
+ // what to do here?
+ }
+
+ public void setVisible (boolean b) {
+ super.setVisible(b);
+ }
+
+ private void initialize() {
+ IProject project = getProject();
+ String cleanDelete = null;
+ String cleanMakeTarget = null;
+ String scannerMakeW = null;
+ try {
+ cleanDelete = project.getPersistentProperty(AutotoolsPropertyConstants.CLEAN_DELETE);
+ cleanMakeTarget = project.getPersistentProperty(AutotoolsPropertyConstants.CLEAN_MAKE_TARGET);
+ scannerMakeW = project.getPersistentProperty(AutotoolsPropertyConstants.SCANNER_USE_MAKE_W);
+ } catch (CoreException e) {
+ // do nothing
+ }
+
+ if (cleanMakeTarget == null) {
+ cleanMakeTarget = AutotoolsPropertyConstants.CLEAN_MAKE_TARGET_DEFAULT;
+ }
+ fCleanMakeTarget.setText(cleanMakeTarget);
+
+ if (cleanDelete == null || cleanDelete.equals(FALSE)) {
+ fCleanDelete.setSelection(false);
+ fCleanMake.setSelection(true);
+ fCleanMakeTarget.setEnabled(true);
+ } else {
+ fCleanDelete.setSelection(true);
+ fCleanMake.setSelection(false);
+ fCleanMakeTarget.setEnabled(false);
+ }
+
+ if (scannerMakeW == null || !scannerMakeW.equals(TRUE)) {
+ fScannerMakeW.setSelection(false);
+ } else
+ fScannerMakeW.setSelection(true);
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsEditorPropertyPage.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsEditorPropertyPage.java
new file mode 100644
index 0000000000..9ee6a4bf7a
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsEditorPropertyPage.java
@@ -0,0 +1,278 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.properties;
+
+import org.eclipse.cdt.core.settings.model.ICResourceDescription;
+import org.eclipse.cdt.managedbuilder.core.IConfiguration;
+import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
+import org.eclipse.cdt.ui.newui.AbstractCPropertyTab;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.linuxtools.cdt.autotools.AutotoolsPlugin;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.preferences.AutotoolsEditorPreferenceConstants;
+import org.eclipse.swt.SWT;
+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.Label;
+
+
+public class AutotoolsEditorPropertyPage extends AbstractCPropertyTab {
+
+ protected Combo fACVersionCombo;
+ protected Combo fAMVersionCombo;
+ IProject project;
+
+// private class ACVersionSelectionListener implements SelectionListener {
+// ICPropertyProvider p;
+// public ACVersionSelectionListener(ICPropertyProvider p) {
+// this.p = p;
+// }
+//
+// public void widgetSelected(SelectionEvent e) {
+// int index = fACVersionCombo.getSelectionIndex();
+// try {
+// AutotoolsEditorPropertyPage.getProject(p).setPersistentProperty(AutotoolsPropertyConstants.AUTOCONF_VERSION, fACVersionCombo.getItem(index));
+// } catch (CoreException ce) {
+// // FIXME: what can we do here?
+// }
+// }
+//
+// public void widgetDefaultSelected(SelectionEvent e) {
+// // do nothing
+// }
+// }
+//
+// private class AMVersionSelectionListener implements SelectionListener {
+// ICPropertyProvider p;
+// public AMVersionSelectionListener(ICPropertyProvider p) {
+// this.p = p;
+// }
+//
+// public void widgetSelected(SelectionEvent e) {
+// int index = fAMVersionCombo.getSelectionIndex();
+// try {
+// AutotoolsEditorPropertyPage.getProject(p).setPersistentProperty(AutotoolsPropertyConstants.AUTOMAKE_VERSION, fAMVersionCombo.getItem(index));
+// } catch (CoreException ce) {
+// // FIXME: what can we do here?
+// }
+// }
+//
+// public void widgetDefaultSelected(SelectionEvent e) {
+// // do nothing
+// }
+// }
+
+ private IProject getProject() {
+ IConfiguration c = ManagedBuildManager.getConfigurationForDescription(getResDesc().getConfiguration());
+ return (IProject)c.getManagedProject().getOwner();
+ }
+
+ public boolean canBeVisible() {
+ return true;
+ }
+
+ public void createControls(Composite parent) {
+ // TODO Auto-generated method stub
+ super.createControls(parent);
+ Composite composite= usercomp;
+
+ // assume parent page uses griddata
+ GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_CENTER | GridData.VERTICAL_ALIGN_FILL);
+ composite.setLayoutData(gd);
+ GridLayout layout= new GridLayout();
+ layout.numColumns= 2;
+ //PixelConverter pc= new PixelConverter(composite);
+ //layout.verticalSpacing= pc.convertHeightInCharsToPixels(1) / 2;
+ composite.setLayout(layout);
+
+ project = getProject();
+
+ /* check box for new editors */
+ fACVersionCombo= new Combo(composite, SWT.CHECK | SWT.DROP_DOWN | SWT.READ_ONLY);
+ fACVersionCombo.setItems(AutotoolsPropertyConstants.fACVersions);
+ fACVersionCombo.select(AutotoolsPropertyConstants.fACVersions.length - 1);
+ gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_BEGINNING);
+ fACVersionCombo.setLayoutData(gd);
+
+ Label label= new Label(composite, SWT.LEFT);
+ label.setText(AutotoolsPropertyMessages.getString("ACEditor.autoconfVersion")); //$NON-NLS-1$
+ gd= new GridData();
+ gd.horizontalAlignment= GridData.BEGINNING;
+ label.setLayoutData(gd);
+
+ /* check box for new editors */
+ fAMVersionCombo= new Combo(composite, SWT.CHECK | SWT.DROP_DOWN | SWT.READ_ONLY);
+ fAMVersionCombo.setItems(AutotoolsPropertyConstants.fAMVersions);
+ fAMVersionCombo.select(AutotoolsPropertyConstants.fAMVersions.length - 1);
+ gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_BEGINNING);
+ fAMVersionCombo.setLayoutData(gd);
+
+ Label label2= new Label(composite, SWT.LEFT);
+ label2.setText(AutotoolsPropertyMessages.getString("ACEditor.automakeVersion")); //$NON-NLS-1$
+ gd= new GridData();
+ gd.horizontalAlignment= GridData.BEGINNING;
+ label2.setLayoutData(gd);
+
+ initialize();
+ }
+
+ public void performOK() {
+ String acVer = null;
+ String amVer = null;
+ boolean changed = false;
+ try {
+ acVer = project.getPersistentProperty(AutotoolsPropertyConstants.AUTOCONF_VERSION);
+ amVer = project.getPersistentProperty(AutotoolsPropertyConstants.AUTOMAKE_VERSION);
+ } catch (CoreException e) {
+ acVer = "";
+ amVer = "";
+ }
+ int index = fACVersionCombo.getSelectionIndex();
+ String acVerSelected = fACVersionCombo.getItem(index);
+ if (!acVerSelected.equals(acVer)) {
+ changed = true;
+ try {
+ project.setPersistentProperty(AutotoolsPropertyConstants.AUTOCONF_VERSION, fACVersionCombo.getItem(index));
+ } catch (CoreException ce) {
+ // Not much we can do at this point
+ }
+ }
+
+ index = fAMVersionCombo.getSelectionIndex();
+ String amVerSelected = fAMVersionCombo.getItem(index);
+ if (!amVerSelected.equals(amVer)) {
+ changed = true;
+ try {
+ project.setPersistentProperty(AutotoolsPropertyConstants.AUTOMAKE_VERSION, fAMVersionCombo.getItem(index));
+ } catch (CoreException ce) {
+ // Not much we can do here either
+ }
+ }
+
+ // Notify any Autoconf editors that are open for this project that macro versioning
+ // has changed.
+ if (changed)
+ AutotoolsPropertyManager.getDefault().notifyPropertyListeners(project, AutotoolsPropertyConstants.AUTOCONF_MACRO_VERSIONING);
+ }
+
+ protected void performApply(ICResourceDescription src, ICResourceDescription dst) {
+ performOK();
+ }
+
+ public void performDefaults() {
+ // For default Autoconf and Automake versions, use the setting from the
+ // Autotools preference dialog.
+ String version = AutotoolsPlugin.getDefault().getPreferenceStore().getString(AutotoolsEditorPreferenceConstants.AUTOCONF_VERSION);
+ String[] items = fACVersionCombo.getItems();
+ // Try and find which list item matches the current preference stored and
+ // select it in the list.
+ int i;
+ for (i = 0; i < items.length; ++i) {
+ if (items[i].equals(version))
+ break;
+ }
+ if (i >= items.length)
+ i = items.length - 1;
+ fACVersionCombo.select(i);
+
+ version = AutotoolsPlugin.getDefault().getPreferenceStore().getString(AutotoolsEditorPreferenceConstants.AUTOMAKE_VERSION);
+ items = fAMVersionCombo.getItems();
+ // Try and find which list item matches the current preference stored and
+ // select it in the list
+ for (i = 0; i < items.length; ++i) {
+ if (items[i].equals(version))
+ break;
+ }
+ if (i >= items.length)
+ i = items.length - 1;
+ fAMVersionCombo.select(i);
+ }
+
+ public void updateData(ICResourceDescription cfgd) {
+ // what to do here?
+ }
+
+ public void updateButtons() {
+ // what to do here?
+ }
+
+ public void setVisible (boolean b) {
+ super.setVisible(b);
+ }
+
+// private IProject getProject(ICPropertyProvider provider) {
+// Object element = provider.getElement();
+// if (element != null) {
+// if (element instanceof IFile ||
+// element instanceof IProject ||
+// element instanceof IFolder)
+// {
+// IResource f = (IResource) element;
+// return f.getProject();
+// }
+// else if (element instanceof ICProject)
+// return ((ICProject)element).getProject();
+// }
+// return null;
+// }
+
+ private void initialize() {
+ initializeACVersion();
+ initializeAMVersion();
+ }
+
+ void initializeACVersion() {
+ String version = "";
+ try {
+ version = project.getPersistentProperty(AutotoolsPropertyConstants.AUTOCONF_VERSION);
+ if (version == null)
+ version = AutotoolsPlugin.getDefault().getPreferenceStore().getString(AutotoolsEditorPreferenceConstants.AUTOCONF_VERSION);
+ } catch (CoreException e) {
+ // do nothing
+ }
+ String[] items = fACVersionCombo.getItems();
+ // Try and find which list item matches the current preference stored and
+ // select it in the list.
+ int i;
+ for (i = 0; i < items.length; ++i) {
+ if (items[i].equals(version))
+ break;
+ }
+ if (i >= items.length)
+ i = items.length - 1;
+ fACVersionCombo.select(i);
+ }
+
+ void initializeAMVersion() {
+ String version = "";
+ try {
+ version = project.getPersistentProperty(AutotoolsPropertyConstants.AUTOMAKE_VERSION);
+ if (version == null)
+ version = AutotoolsPlugin.getDefault().getPreferenceStore().getString(AutotoolsEditorPreferenceConstants.AUTOMAKE_VERSION);
+ } catch (CoreException e) {
+ // do nothing
+ }
+ String[] items = fAMVersionCombo.getItems();
+ // Try and find which list item matches the current preference stored and
+ // select it in the list.
+ int i;
+ for (i = 0; i < items.length; ++i) {
+ if (items[i].equals(version))
+ break;
+ }
+ if (i >= items.length)
+ i = items.length - 1;
+ fAMVersionCombo.select(i);
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsPropertyConstants.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsPropertyConstants.java
new file mode 100644
index 0000000000..f020ce0252
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsPropertyConstants.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.properties;
+
+import org.eclipse.core.runtime.QualifiedName;
+import org.eclipse.linuxtools.cdt.autotools.AutotoolsPlugin;
+
+
+public class AutotoolsPropertyConstants {
+
+ static final String PREFIX = AutotoolsPlugin.getUniqueIdentifier() + "."; // $NON-NLS-1$
+ public static final String AUTOMAKE_VERSION_STRING = "AutoconfEditorAutomakeVersion"; // $NON-NLS-1$
+ public static final QualifiedName AUTOMAKE_VERSION = new QualifiedName(PREFIX, AUTOMAKE_VERSION_STRING);
+ public static final String AUTOCONF_VERSION_STRING = "AutoconfEditorAutoconfVersion"; // $NON-NLS-1$
+ public static final QualifiedName AUTOCONF_VERSION = new QualifiedName(PREFIX, AUTOCONF_VERSION_STRING);
+ public static final String AUTOCONF_MACRO_VERSIONING = "AutoconfEditorMacroVersioning"; // $NON-NLS-1$
+ public static final QualifiedName AUTOCONF_TOOL = new QualifiedName(PREFIX, "AutoconfToolPath"); // $NON-NLS-1$
+ public static final QualifiedName AUTOMAKE_TOOL = new QualifiedName(PREFIX, "AutomakeToolPath"); // $NON-NLS-1$
+ public static final QualifiedName ACLOCAL_TOOL = new QualifiedName(PREFIX, "AclocalToolPath"); // $NON-NLS-1$
+ public static final QualifiedName AUTOHEADER_TOOL = new QualifiedName(PREFIX, "AutoheaderToolPath"); // $NON-NLS-1$
+ public static final QualifiedName AUTORECONF_TOOL = new QualifiedName(PREFIX, "AutoreconfToolPath"); // $NON-NLS-1$
+ public static final QualifiedName LIBTOOLIZE_TOOL = new QualifiedName(PREFIX, "LibtoolizePath"); // $NON-NLS-1$
+ public static final QualifiedName CLEAN_DELETE = new QualifiedName(PREFIX, "CleanDelete"); // $NON-NLS-1$
+ public static final QualifiedName CLEAN_MAKE_TARGET = new QualifiedName(PREFIX, "CleanMakeTarget"); // $NON-NLS-1$
+ public static final QualifiedName SCANNER_USE_MAKE_W = new QualifiedName(PREFIX, "ScannerUseMakeW");
+ public static final QualifiedName OPEN_INCLUDE = new QualifiedName(PREFIX, "IncludeResourceMapping"); // $NON-NLS-1$
+ public static final QualifiedName OPEN_INCLUDE_P = new QualifiedName(PREFIX, "PersistentIncludeResourceMapping"); //$NON-NLS-1$
+ public static final QualifiedName SCANNER_INFO_DIRTY = new QualifiedName(PREFIX, "ScannerInfoDirty"); // $NON-NLSp-1$
+
+ static String[] fACVersions = {"2.13", "2.59", "2.61"}; // $NON-NLS-1$
+ static final String LATEST_AC_VERSION = fACVersions[fACVersions.length - 1];
+
+ static String[] fAMVersions = {"1.4-p6", "1.9.5", "1.9.6"}; // $NON-NLS-1$
+ static final String LATEST_AM_VERSION = fAMVersions[fAMVersions.length - 1];
+
+ public static final String CLEAN_MAKE_TARGET_DEFAULT = "distclean"; // $NON-NLS-1$
+ public static final String TRUE = "true"; // $NON-NLS-1$
+ public static final String FALSE = "false"; // $NON-NLS-1$
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsPropertyManager.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsPropertyManager.java
new file mode 100644
index 0000000000..1bdcca5ac1
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsPropertyManager.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.properties;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.ListenerList;
+
+public class AutotoolsPropertyManager implements IPropertyChangeManager {
+
+ private static AutotoolsPropertyManager fInstance;
+ private Map<IProject, ListenerList> projectList;
+
+ private AutotoolsPropertyManager() {
+ projectList = new HashMap<IProject, ListenerList>();
+ }
+
+ public static AutotoolsPropertyManager getDefault() {
+ if (fInstance == null)
+ fInstance = new AutotoolsPropertyManager();
+ return fInstance;
+ }
+
+ public synchronized void addProjectPropertyListener(IProject project,
+ IProjectPropertyListener listener) {
+ ListenerList list = (ListenerList)projectList.get(project);
+ if (list == null) {
+ list = new ListenerList();
+ projectList.put(project, list);
+ }
+ list.add(listener);
+ }
+
+ public synchronized void notifyPropertyListeners(IProject project, String property) {
+ ListenerList list = (ListenerList)projectList.get(project);
+ if (list != null) {
+ Object[] listeners = list.getListeners();
+ for (int i = 0; i < listeners.length; ++i) {
+ ((IProjectPropertyListener)listeners[i]).handleProjectPropertyChanged(project, property);
+ }
+ }
+ }
+
+ public synchronized void removeProjectPropertyListener(IProject project,
+ IProjectPropertyListener listener) {
+ ListenerList list = (ListenerList)projectList.get(project);
+ if (list != null)
+ list.remove(listener);
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsPropertyMessages.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsPropertyMessages.java
new file mode 100644
index 0000000000..8fb1becc62
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsPropertyMessages.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.cdt.autotools.ui.properties;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+/**
+ * MakefilePreferencesMessages
+ */
+public class AutotoolsPropertyMessages {
+
+ /**
+ *
+ */
+ private AutotoolsPropertyMessages() {
+ }
+
+ private static final String BUNDLE_NAME = AutotoolsPropertyMessages.class.getName();
+
+ public static String getString(String key) {
+ try {
+ return ResourceBundle.getBundle(BUNDLE_NAME).getString(key);
+ } catch (MissingResourceException e) {
+ return '!' + key + '!';
+ } catch (NullPointerException e) {
+ return '#' + key + '#';
+ }
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsPropertyMessages.properties b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsPropertyMessages.properties
new file mode 100644
index 0000000000..d729559cc6
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsPropertyMessages.properties
@@ -0,0 +1,41 @@
+###############################################################################
+# Copyright (c) 2007 Red Hat Inc. and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Red Hat Inc. - initial API and implementation
+###############################################################################
+
+Edit.name=Editors
+Build.name=Build
+
+Autotools.aclocalPath=aclocal
+Autotools.aclocalPath.tooltip=Specify desired aclocal to use for project
+Autotools.automakePath=automake
+Autotools.automakePath.tooltip=Specify desired automake to use for project
+Autotools.autoconfPath=autoconf
+Autotools.autoconfPath.tooltip=Specify desired autoconf to use for project
+Autotools.autoheaderPath=autoheader
+Autotools.autoheaderPath.tooltip=Specify desired autoheader to use for project
+Autotools.autoreconfPath=autoreconf
+Autotools.autoreconfPath.tooltip=Specify desired autoreconf to use for project
+Autotools.libtoolizePath=libtoolize
+Autotools.libtoolizePath.tooltip=Specify desired libtoolize to use for project
+
+ACEditor.version=&Version
+ACEditor.autoconfVersion=Version of Autoconf to use for syntax checking
+ACEditor.automakeVersion=Version of Automake to use for syntax checking
+
+ScannerMakeW.label=Use make -n -w per file to generate scanner info
+ScannerMakeW.tooltip=Use this option only if necessary to get correct include path
+
+CleanBehavior.title=Clean Build Behavior
+
+CleanDelete.label=Delete build directory on "clean" operation
+CleanMake.label=Use make target to clean
+CleanMakeTarget.label=Make target:
+CleanMakeTarget.default=distclean
+CleanMakeTarget.tooltip=Specify a top-level make target to clean build directory
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsPropertyPage.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsPropertyPage.java
new file mode 100644
index 0000000000..95fb589c95
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsPropertyPage.java
@@ -0,0 +1,376 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.properties;
+
+import org.eclipse.cdt.ui.newui.AbstractPage;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+
+public class AutotoolsPropertyPage extends AbstractPage {
+
+ public AutotoolsPropertyPage() {
+ super();
+ }
+
+ protected boolean isSingle() {
+ return false;
+ }
+
+ protected Control createContents(Composite parent) {
+ return super.createContents(parent);
+ }
+
+ protected boolean showsConfig() {
+ return false;
+ }
+
+// protected Combo fACVersionCombo;
+// protected Combo fAMVersionCombo;
+//
+// protected Button fCleanDelete;
+// protected Button fCleanMake;
+// protected Combo fCleanMakeTarget;
+// protected Button fScannerMakeW;
+//
+//
+// public boolean isApplicable() {
+// IProject project = getProject();
+// if (project != null && !AutotoolsMakefileBuilder.hasTargetBuilder(project))
+// return false;
+// else
+// return super.isApplicable();
+// }
+//
+// protected Control createContents(Composite parent) {
+//
+// TabFolder folder= new TabFolder(parent, SWT.NONE);
+// folder.setLayout(new TabFolderLayout());
+// folder.setLayoutData(new GridData(GridData.FILL_BOTH));
+//
+// // Allow end-user to select which version of autoconf to use for hover help
+// // and syntax checking of macros.
+// TabItem item= new TabItem(folder, SWT.NONE);
+// item.setText(AutotoolsPropertyMessages.getString("Edit.name")); //$NON-NLS-1$
+// item.setControl(createEditTabContent(folder));
+//
+// // Build options.
+// item= new TabItem(folder, SWT.NONE);
+// item.setText(AutotoolsPropertyMessages.getString("Build.name")); //$NON-NLS-1$
+// item.setControl(createBuildTabContent(folder));
+//
+// initialize();
+//
+// applyDialogFont(folder);
+// return folder;
+// }
+//
+// private Composite createEditTabContent(TabFolder folder) {
+// Composite composite= new Composite(folder, SWT.NULL);
+// // assume parent page uses griddata
+// GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_CENTER | GridData.VERTICAL_ALIGN_FILL);
+// composite.setLayoutData(gd);
+// GridLayout layout= new GridLayout();
+// layout.numColumns= 2;
+// //PixelConverter pc= new PixelConverter(composite);
+// //layout.verticalSpacing= pc.convertHeightInCharsToPixels(1) / 2;
+// composite.setLayout(layout);
+//
+//
+// /* check box for new editors */
+// fACVersionCombo= new Combo(composite, SWT.CHECK | SWT.DROP_DOWN | SWT.READ_ONLY);
+// fACVersionCombo.setItems(AutotoolsPropertyConstants.fACVersions);
+// fACVersionCombo.select(AutotoolsPropertyConstants.fACVersions.length - 1);
+// gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_BEGINNING);
+// fACVersionCombo.setLayoutData(gd);
+// fACVersionCombo.addSelectionListener(new SelectionListener() {
+// public void widgetSelected(SelectionEvent e) {
+// int index = fACVersionCombo.getSelectionIndex();
+// try {
+// getProject().setPersistentProperty(AutotoolsPropertyConstants.AUTOCONF_VERSION, fACVersionCombo.getItem(index));
+// } catch (CoreException ce) {
+// // FIXME: what can we do here?
+// }
+// }
+//
+// public void widgetDefaultSelected(SelectionEvent e) {
+// String version = AutotoolsPlugin.getDefault().getPreferenceStore().getString(AutotoolsEditorPreferenceConstants.AUTOCONF_VERSION);
+// String[] items = fACVersionCombo.getItems();
+// // Try and find which list item matches the current preference stored and
+// // select it in the list.
+// int i;
+// for (i = 0; i < items.length; ++i) {
+// if (items[i].equals(version))
+// break;
+// }
+// if (i >= items.length)
+// i = items.length - 1;
+// fACVersionCombo.select(i);
+// }
+// });
+//
+// Label label= new Label(composite, SWT.LEFT);
+// label.setText(AutotoolsPropertyMessages.getString("ACEditor.autoconfVersion")); //$NON-NLS-1$
+// gd= new GridData();
+// gd.horizontalAlignment= GridData.BEGINNING;
+// label.setLayoutData(gd);
+//
+// /* check box for new editors */
+// fAMVersionCombo= new Combo(composite, SWT.CHECK | SWT.DROP_DOWN | SWT.READ_ONLY);
+// fAMVersionCombo.setItems(AutotoolsPropertyConstants.fAMVersions);
+// fAMVersionCombo.select(AutotoolsPropertyConstants.fAMVersions.length - 1);
+// gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_BEGINNING);
+// fAMVersionCombo.setLayoutData(gd);
+// fAMVersionCombo.addSelectionListener(new SelectionListener() {
+// public void widgetSelected(SelectionEvent e) {
+// int index = fAMVersionCombo.getSelectionIndex();
+// try {
+// getProject().setPersistentProperty(AutotoolsPropertyConstants.AUTOMAKE_VERSION, fAMVersionCombo.getItem(index));
+// } catch (CoreException ce) {
+// // FIXME: what can we do here?
+// }
+// }
+//
+// public void widgetDefaultSelected(SelectionEvent e) {
+// String version = AutotoolsPlugin.getDefault().getPreferenceStore().getString(AutotoolsEditorPreferenceConstants.AUTOMAKE_VERSION);
+// String[] items = fAMVersionCombo.getItems();
+// // Try and find which list item matches the current preference stored and
+// // select it in the list.
+// int i;
+// for (i = 0; i < items.length; ++i) {
+// if (items[i].equals(version))
+// break;
+// }
+// if (i >= items.length)
+// i = items.length - 1;
+// fAMVersionCombo.select(i);
+// }
+// });
+//
+// Label label2= new Label(composite, SWT.LEFT);
+// label2.setText(AutotoolsPropertyMessages.getString("ACEditor.automakeVersion")); //$NON-NLS-1$
+// gd= new GridData();
+// gd.horizontalAlignment= GridData.BEGINNING;
+// label2.setLayoutData(gd);
+//
+// return composite;
+// }
+//
+// private Composite createBuildTabContent(TabFolder folder) {
+// Composite composite= new Composite(folder, SWT.NULL);
+// // assume parent page uses griddata
+// GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_CENTER | GridData.VERTICAL_ALIGN_FILL);
+// composite.setLayoutData(gd);
+// GridLayout layout= new GridLayout();
+// layout.numColumns= 2;
+// //PixelConverter pc= new PixelConverter(composite);
+// //layout.verticalSpacing= pc.convertHeightInCharsToPixels(1) / 2;
+// composite.setLayout(layout);
+//
+//
+// Group g = new Group(composite, SWT.SHADOW_ETCHED_IN);
+// g.setText(AutotoolsPropertyMessages.getString("CleanBehavior.title"));
+// gd = new GridData(GridData.HORIZONTAL_ALIGN_CENTER | GridData.VERTICAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL);
+// gd.horizontalSpan = 2;
+// g.setLayoutData(gd);
+// layout= new GridLayout();
+// layout.numColumns= 2;
+// g.setLayout(layout);
+//
+// fCleanDelete = new Button(g, SWT.RADIO);
+// fCleanDelete.setText(AutotoolsPropertyMessages.getString("CleanDelete.label"));
+// gd= new GridData();
+// gd.horizontalAlignment= GridData.BEGINNING;
+// gd.horizontalSpan = 2;
+// fCleanDelete.setLayoutData(gd);
+// fCleanMake = new Button(g, SWT.RADIO);
+// fCleanMake.setText(AutotoolsPropertyMessages.getString("CleanMake.label"));
+// gd= new GridData();
+// gd.horizontalAlignment= GridData.BEGINNING;
+// gd.horizontalSpan = 2;
+// fCleanMake.setLayoutData(gd);
+//
+// Label label = new Label(g, SWT.LEFT);
+// label.setText(AutotoolsPropertyMessages.getString("CleanMakeTarget.label"));
+// gd= new GridData();
+// gd.horizontalAlignment= GridData.BEGINNING;
+// label.setLayoutData(gd);
+//
+// fCleanMakeTarget = new Combo(g, SWT.SIMPLE);
+// fCleanMakeTarget.setText(AutotoolsPropertyMessages.getString("CleanMakeTarget.default"));
+// fCleanMakeTarget.setTextLimit(40);
+// fCleanMakeTarget.setVisibleItemCount(0);
+// gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_BEGINNING);
+// fCleanMakeTarget.setLayoutData(gd);
+//
+// fCleanDelete.addSelectionListener(new SelectionListener() {
+// public void widgetSelected(SelectionEvent e) {
+// fCleanMake.setSelection(false);
+// fCleanDelete.setSelection(true);
+// fCleanMakeTarget.setEnabled(false);
+// try {
+// getProject().setPersistentProperty(AutotoolsPropertyConstants.CLEAN_DELETE, "true");
+// } catch (CoreException ce) {
+// // FIXME: what can we do here?
+// }
+// }
+//
+// public void widgetDefaultSelected(SelectionEvent e) {
+// fCleanDelete.setSelection(false);
+// fCleanMake.setSelection(true);
+// fCleanMakeTarget.setEnabled(true);
+// try {
+// getProject().setPersistentProperty(AutotoolsPropertyConstants.CLEAN_DELETE, "false");
+// getProject().setPersistentProperty(AutotoolsPropertyConstants.CLEAN_MAKE_TARGET, "distclean");
+// } catch (CoreException ce) {
+// // FIXME: what can we do here?
+// }
+// }
+// });
+//
+// fCleanMake.addSelectionListener(new SelectionListener() {
+// public void widgetSelected(SelectionEvent e) {
+// fCleanDelete.setSelection(false);
+// fCleanMake.setSelection(true);
+// fCleanMakeTarget.setEnabled(true);
+// try {
+// getProject().setPersistentProperty(AutotoolsPropertyConstants.CLEAN_DELETE, "false");
+// } catch (CoreException ce) {
+// // FIXME: what can we do here?
+// }
+// }
+//
+// public void widgetDefaultSelected(SelectionEvent e) {
+//// fCleanDelete.setSelection(false);
+//// fCleanMake.setSelection(true);
+//// try {
+//// getProject().setPersistentProperty(AutotoolsPropertyConstants.CLEAN_DELETE, "false");
+//// getProject().setPersistentProperty(AutotoolsPropertyConstants.CLEAN_MAKE_TARGET, "distclean");
+//// } catch (CoreException ce) {
+//// // FIXME: what can we do here?
+//// }
+// }
+// });
+//
+// fCleanMakeTarget.addModifyListener(new ModifyListener() {
+// public void modifyText(ModifyEvent e) {
+// try {
+// getProject().setPersistentProperty(AutotoolsPropertyConstants.CLEAN_MAKE_TARGET, fCleanMakeTarget.getText());
+// } catch (CoreException ce) {
+// // FIXME: what can we do here?
+// }
+// }
+// });
+//
+// fScannerMakeW = new Button(composite, SWT.LEFT | SWT.CHECK);
+// fScannerMakeW.setText(AutotoolsPropertyMessages.getString("ScannerMakeW.label"));
+// fScannerMakeW.setToolTipText(AutotoolsPropertyMessages.getString("ScannerMakeW.tooltip"));
+// gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_BEGINNING);
+// fScannerMakeW.setLayoutData(gd);
+// fScannerMakeW.addSelectionListener(new SelectionListener() {
+// public void widgetSelected(SelectionEvent e) {
+// try {
+// getProject().setPersistentProperty(AutotoolsPropertyConstants.SCANNER_USE_MAKE_W, "true");
+// } catch (CoreException ce) {
+// // FIXME: what can we do here?
+// }
+// }
+//
+// public void widgetDefaultSelected(SelectionEvent e) {
+// fScannerMakeW.setSelection(false);
+// try {
+// // This is only a temporary work-around so we remove the property rather than set it false.
+// getProject().setPersistentProperty(AutotoolsPropertyConstants.SCANNER_USE_MAKE_W, null);
+// } catch (CoreException ce) {
+// // FIXME: what can we do here?
+// }
+// }
+// });
+//
+// return composite;
+// }
+//
+// void initializeACVersion() {
+// String version = "";
+// try {
+// version = getProject().getPersistentProperty(AutotoolsPropertyConstants.AUTOCONF_VERSION);
+// if (version == null)
+// version = AutotoolsPlugin.getDefault().getPreferenceStore().getString(AutotoolsEditorPreferenceConstants.AUTOCONF_VERSION);
+// } catch (CoreException e) {
+// // do nothing
+// }
+// String[] items = fACVersionCombo.getItems();
+// // Try and find which list item matches the current preference stored and
+// // select it in the list.
+// int i;
+// for (i = 0; i < items.length; ++i) {
+// if (items[i].equals(version))
+// break;
+// }
+// if (i >= items.length)
+// i = items.length - 1;
+// fACVersionCombo.select(i);
+// }
+//
+// void initializeAMVersion() {
+// String version = "";
+// try {
+// version = getProject().getPersistentProperty(AutotoolsPropertyConstants.AUTOMAKE_VERSION);
+// if (version == null)
+// version = AutotoolsPlugin.getDefault().getPreferenceStore().getString(AutotoolsEditorPreferenceConstants.AUTOMAKE_VERSION);
+// } catch (CoreException e) {
+// // do nothing
+// }
+// String[] items = fAMVersionCombo.getItems();
+// // Try and find which list item matches the current preference stored and
+// // select it in the list.
+// int i;
+// for (i = 0; i < items.length; ++i) {
+// if (items[i].equals(version))
+// break;
+// }
+// if (i >= items.length)
+// i = items.length - 1;
+// fAMVersionCombo.select(i);
+// }
+//
+// void initializeBuild() {
+// String cleanDelete = null;
+// String cleanMakeTarget = null;
+// try {
+// cleanDelete = getProject().getPersistentProperty(AutotoolsPropertyConstants.CLEAN_DELETE);
+// cleanMakeTarget = getProject().getPersistentProperty(AutotoolsPropertyConstants.CLEAN_MAKE_TARGET);
+// } catch (CoreException e) {
+// // do nothing
+// }
+//
+// if (cleanMakeTarget == null) {
+// cleanMakeTarget = AutotoolsPropertyMessages.getString("CleanMakeTarget.default"); // $NON-NLS-1$
+// fCleanMakeTarget.setText(cleanMakeTarget);
+// }
+//
+// if (cleanDelete == null || cleanDelete.equals("false")) {
+// fCleanDelete.setSelection(false);
+// fCleanMake.setSelection(true);
+// fCleanMakeTarget.setEnabled(true);
+// } else {
+// fCleanDelete.setSelection(true);
+// fCleanMake.setSelection(false);
+// fCleanMakeTarget.setEnabled(false);
+// }
+// }
+//
+// private void initialize() {
+// initializeACVersion();
+// initializeAMVersion();
+// initializeBuild();
+// }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsToolsPropertyPage.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsToolsPropertyPage.java
new file mode 100644
index 0000000000..7b56c2b213
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/properties/AutotoolsToolsPropertyPage.java
@@ -0,0 +1,343 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.properties;
+
+import org.eclipse.cdt.core.settings.model.ICResourceDescription;
+import org.eclipse.cdt.managedbuilder.core.IConfiguration;
+import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
+import org.eclipse.cdt.ui.newui.AbstractCPropertyTab;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+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;
+
+public class AutotoolsToolsPropertyPage extends AbstractCPropertyTab {
+
+ public static final String DEFAULT_ACLOCAL = "aclocal"; // $NON-NLS-1$
+ public static final String DEFAULT_AUTOMAKE = "automake"; // $NON-NLS-1$
+ public static final String DEFAULT_AUTOCONF = "autoconf"; // $NON-NLS-1$
+ public static final String DEFAULT_AUTOHEADER = "autoheader"; // $NON-NLS-1$
+ public static final String DEFAULT_AUTORECONF = "autoreconf"; // $NON-NLS-1$
+ public static final String DEFAULT_LIBTOOLIZE = "libtoolize"; // $NON-NLS-1$
+
+ protected Text fAclocalPath;
+ protected Text fAutoheaderPath;
+ protected Text fAutomakePath;
+ protected Text fAutoreconfPath;
+ protected Text fAutoconfPath;
+ protected Text fLibtoolizePath;
+ private IProject project;
+
+
+ private IProject getProject() {
+ IConfiguration c = ManagedBuildManager.getConfigurationForDescription(getResDesc().getConfiguration());
+ return (IProject)c.getManagedProject().getOwner();
+ }
+
+ public boolean canBeVisible() {
+ return true;
+ }
+
+ public void createControls(Composite parent) {
+ // TODO Auto-generated method stub
+ super.createControls(parent);
+ Composite composite= usercomp;
+
+ // assume parent page uses griddata
+ GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_CENTER | GridData.VERTICAL_ALIGN_FILL | GridData.FILL_HORIZONTAL);
+ composite.setLayoutData(gd);
+ GridLayout layout= new GridLayout();
+ layout.numColumns= 2;
+ //PixelConverter pc= new PixelConverter(composite);
+ //layout.verticalSpacing= pc.convertHeightInCharsToPixels(1) / 2;
+ composite.setLayout(layout);
+
+ project = getProject();
+
+ Label label= new Label(composite, SWT.LEFT);
+ label.setText(AutotoolsPropertyMessages.getString("Autotools.aclocalPath")); //$NON-NLS-1$
+ gd= new GridData();
+ gd.horizontalAlignment= GridData.BEGINNING;
+ label.setLayoutData(gd);
+
+ /* text window for aclocal path */
+ fAclocalPath = new Text(composite, SWT.BORDER | SWT.SINGLE);
+ fAclocalPath.setToolTipText(AutotoolsPropertyMessages.getString("Autotools.aclocalPath.tooltip")); // $NON-NLS-1$
+ gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL);
+ fAclocalPath.setLayoutData(gd);
+
+ Label label2= new Label(composite, SWT.LEFT);
+ label2.setText(AutotoolsPropertyMessages.getString("Autotools.automakePath")); //$NON-NLS-1$
+ gd= new GridData();
+ gd.horizontalAlignment= GridData.BEGINNING;
+ label2.setLayoutData(gd);
+
+ /* text window for automake path */
+ fAutomakePath = new Text(composite, SWT.BORDER | SWT.SINGLE);
+ fAutomakePath.setToolTipText(AutotoolsPropertyMessages.getString("Autotools.automakePath.tooltip")); // $NON-NLS-1#
+ gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL);
+ fAutomakePath.setLayoutData(gd);
+
+ Label label3 = new Label(composite, SWT.LEFT);
+ label3.setText(AutotoolsPropertyMessages.getString("Autotools.autoconfPath")); //$NON-NLS-1$
+ gd= new GridData();
+ gd.horizontalAlignment= GridData.BEGINNING;
+ label3.setLayoutData(gd);
+
+ /* text window for autoconf path */
+ fAutoconfPath = new Text(composite, SWT.BORDER | SWT.SINGLE);
+ fAutoconfPath.setToolTipText(AutotoolsPropertyMessages.getString("Autotools.autoconfPath.tooltip")); // $NON-NLS-1$
+ gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL);
+ fAutoconfPath.setLayoutData(gd);
+
+ Label label4= new Label(composite, SWT.LEFT);
+ label4.setText(AutotoolsPropertyMessages.getString("Autotools.autoheaderPath")); //$NON-NLS-1$
+ gd= new GridData();
+ gd.horizontalAlignment= GridData.BEGINNING;
+ label4.setLayoutData(gd);
+
+ /* text window for aclocal path */
+ fAutoheaderPath = new Text(composite, SWT.BORDER | SWT.SINGLE);
+ fAutoheaderPath.setToolTipText(AutotoolsPropertyMessages.getString("Autotools.autoheaderPath.tooltip")); // $NON-NLS-1$
+ gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL);
+ fAutoheaderPath.setLayoutData(gd);
+
+ Label label5= new Label(composite, SWT.LEFT);
+ label5.setText(AutotoolsPropertyMessages.getString("Autotools.autoreconfPath")); //$NON-NLS-1$
+ gd= new GridData();
+ gd.horizontalAlignment= GridData.BEGINNING;
+ label5.setLayoutData(gd);
+
+ /* text window for aclocal path */
+ fAutoreconfPath = new Text(composite, SWT.BORDER | SWT.SINGLE);
+ fAutoreconfPath.setToolTipText(AutotoolsPropertyMessages.getString("Autotools.autoreconfPath.tooltip")); // $NON-NLS-1$
+ gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL);
+ fAutoreconfPath.setLayoutData(gd);
+
+ Label label6= new Label(composite, SWT.LEFT);
+ label6.setText(AutotoolsPropertyMessages.getString("Autotools.libtoolizePath")); //$NON-NLS-1$
+ gd= new GridData();
+ gd.horizontalAlignment= GridData.BEGINNING;
+ label6.setLayoutData(gd);
+
+ /* text window for aclocal path */
+ fLibtoolizePath = new Text(composite, SWT.BORDER | SWT.SINGLE);
+ fLibtoolizePath.setToolTipText(AutotoolsPropertyMessages.getString("Autotools.libtoolizePath.tooltip")); // $NON-NLS-1$
+ gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL);
+ fLibtoolizePath.setLayoutData(gd);
+
+ initialize();
+ }
+
+ public void performOK() {
+ String aclocalPath = null;
+ String automakePath = null;
+ String autoconfPath = null;
+ String autoheaderPath = null;
+ String autoreconfPath = null;
+ String libtoolizePath = null;
+ try {
+ aclocalPath = project.getPersistentProperty(AutotoolsPropertyConstants.ACLOCAL_TOOL);
+ } catch (CoreException e1) {
+ aclocalPath = DEFAULT_ACLOCAL;
+ }
+
+ String newAclocalPath = fAclocalPath.getText().trim();
+ if (aclocalPath == null || !newAclocalPath.equals(aclocalPath)) {
+ try {
+ project.setPersistentProperty(AutotoolsPropertyConstants.ACLOCAL_TOOL, newAclocalPath);
+ } catch (CoreException e1) {
+ // Not much we can do at this point
+ }
+ }
+
+ try {
+ automakePath = project.getPersistentProperty(AutotoolsPropertyConstants.AUTOMAKE_TOOL);
+ } catch (CoreException e1) {
+ automakePath = DEFAULT_AUTOMAKE;
+ }
+
+ String newAutomakePath = fAutomakePath.getText().trim();
+ if (automakePath == null || !newAutomakePath.equals(automakePath)) {
+ try {
+ project.setPersistentProperty(AutotoolsPropertyConstants.AUTOMAKE_TOOL, newAutomakePath);
+ } catch (CoreException e2) {
+ // Not much we can do at this point
+ }
+ }
+
+ try {
+ autoconfPath = project.getPersistentProperty(AutotoolsPropertyConstants.AUTOCONF_TOOL);
+ } catch (CoreException e1) {
+ autoconfPath = DEFAULT_AUTOCONF;
+ }
+
+ String newAutoconfPath = fAutoconfPath.getText().trim();
+ if (autoconfPath == null || !newAutoconfPath.equals(autoconfPath)) {
+ try {
+ project.setPersistentProperty(AutotoolsPropertyConstants.AUTOCONF_TOOL, newAutoconfPath);
+ } catch (CoreException e2) {
+ // Not much we can do at this point
+ }
+ }
+
+ try {
+ autoheaderPath = project.getPersistentProperty(AutotoolsPropertyConstants.AUTOHEADER_TOOL);
+ } catch (CoreException e1) {
+ autoheaderPath = DEFAULT_AUTOHEADER;
+ }
+
+ String newAutoheaderPath = fAutoheaderPath.getText().trim();
+ if (autoheaderPath == null || !newAutoheaderPath.equals(autoheaderPath)) {
+ try {
+ project.setPersistentProperty(AutotoolsPropertyConstants.AUTOHEADER_TOOL, newAutoheaderPath);
+ } catch (CoreException e2) {
+ // Not much we can do at this point
+ }
+ }
+
+ try {
+ autoreconfPath = project.getPersistentProperty(AutotoolsPropertyConstants.AUTORECONF_TOOL);
+ } catch (CoreException e1) {
+ autoreconfPath = DEFAULT_AUTORECONF;
+ }
+
+ String newAutoreconfPath = fAutoreconfPath.getText().trim();
+ if (autoreconfPath == null || !newAutoreconfPath.equals(autoreconfPath)) {
+ try {
+ project.setPersistentProperty(AutotoolsPropertyConstants.AUTORECONF_TOOL, newAutoreconfPath);
+ } catch (CoreException e2) {
+ // Not much we can do at this point
+ }
+ }
+
+ try {
+ libtoolizePath = project.getPersistentProperty(AutotoolsPropertyConstants.LIBTOOLIZE_TOOL);
+ } catch (CoreException e1) {
+ libtoolizePath = DEFAULT_LIBTOOLIZE;
+ }
+
+ String newLibtoolizePath = fLibtoolizePath.getText().trim();
+ if (libtoolizePath == null || !newLibtoolizePath.equals(libtoolizePath)) {
+ try {
+ project.setPersistentProperty(AutotoolsPropertyConstants.LIBTOOLIZE_TOOL, newLibtoolizePath);
+ } catch (CoreException e2) {
+ // Not much we can do at this point
+ }
+ }
+ }
+
+ protected void performApply(ICResourceDescription src, ICResourceDescription dst) {
+ performOK();
+ }
+
+ public void performDefaults() {
+ // For default tool settings, simply default the base tool names
+ fAclocalPath.setText(DEFAULT_ACLOCAL);
+ fAutomakePath.setText(DEFAULT_AUTOMAKE);
+ fAutoconfPath.setText(DEFAULT_AUTOCONF);
+ fAutoheaderPath.setText(DEFAULT_AUTOHEADER);
+ fAutoreconfPath.setText(DEFAULT_AUTORECONF);
+ fLibtoolizePath.setText(DEFAULT_LIBTOOLIZE);
+ }
+
+ public void updateData(ICResourceDescription cfgd) {
+ // what to do here?
+ }
+
+ public void updateButtons() {
+ // what to do here?
+ }
+
+ public void setVisible (boolean b) {
+ super.setVisible(b);
+ }
+
+ private void initialize() {
+ String aclocalPath = null;
+ String automakePath = null;
+ String autoconfPath = null;
+ String autoheaderPath = null;
+ String autoreconfPath = null;
+ String libtoolizePath = null;
+
+ try {
+ aclocalPath = project.getPersistentProperty(AutotoolsPropertyConstants.ACLOCAL_TOOL);
+ } catch (CoreException e1) {
+ // do nothing
+ }
+
+ if (aclocalPath == null)
+ aclocalPath = DEFAULT_ACLOCAL;
+
+ fAclocalPath.setText(aclocalPath);
+
+ try {
+ automakePath = project.getPersistentProperty(AutotoolsPropertyConstants.AUTOMAKE_TOOL);
+ } catch (CoreException e1) {
+ // do nothing
+ }
+
+ if (automakePath == null)
+ automakePath = DEFAULT_AUTOMAKE;
+
+ fAutomakePath.setText(automakePath);
+
+ try {
+ autoconfPath = project.getPersistentProperty(AutotoolsPropertyConstants.AUTOCONF_TOOL);
+ } catch (CoreException e1) {
+ // do nothing
+ }
+
+ if (autoconfPath == null)
+ autoconfPath = DEFAULT_AUTOCONF;
+
+ fAutoconfPath.setText(autoconfPath);
+
+ try {
+ autoheaderPath = project.getPersistentProperty(AutotoolsPropertyConstants.AUTOHEADER_TOOL);
+ } catch (CoreException e1) {
+ // do nothing
+ }
+
+ if (autoheaderPath == null)
+ autoheaderPath = DEFAULT_AUTOHEADER;
+
+ fAutoheaderPath.setText(autoheaderPath);
+
+ try {
+ autoreconfPath = project.getPersistentProperty(AutotoolsPropertyConstants.AUTORECONF_TOOL);
+ } catch (CoreException e1) {
+ // do nothing
+ }
+
+ if (autoreconfPath == null)
+ autoreconfPath = DEFAULT_AUTORECONF;
+
+ fAutoreconfPath.setText(autoreconfPath);
+
+ try {
+ libtoolizePath = project.getPersistentProperty(AutotoolsPropertyConstants.LIBTOOLIZE_TOOL);
+ } catch (CoreException e1) {
+ // do nothing
+ }
+
+ if (libtoolizePath == null)
+ libtoolizePath = DEFAULT_LIBTOOLIZE;
+
+ fLibtoolizePath.setText(libtoolizePath);
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/properties/IProjectPropertyListener.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/properties/IProjectPropertyListener.java
new file mode 100644
index 0000000000..f9752307fb
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/properties/IProjectPropertyListener.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.properties;
+
+import org.eclipse.core.resources.IProject;
+
+public interface IProjectPropertyListener {
+
+ /**
+ * Handler for property changes
+ *
+ * @param project the project to which the property changed
+ * @param property the name of the property changed
+ */
+ void handleProjectPropertyChanged(IProject project, String property);
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/properties/IPropertyChangeManager.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/properties/IPropertyChangeManager.java
new file mode 100644
index 0000000000..65b4fada2d
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/cdt/autotools/ui/properties/IPropertyChangeManager.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.cdt.autotools.ui.properties;
+
+import org.eclipse.core.resources.IProject;
+
+public interface IPropertyChangeManager {
+
+ /**
+ * Add a project property listener for given project.
+ *
+ * @param project the project to which the listener is interested
+ * @param listener the listener to notify
+ */
+ void addProjectPropertyListener(IProject project, IProjectPropertyListener listener);
+
+ /**
+ * Remove a project property listener.
+ *
+ * @param listener the listener to remove
+ */
+ void removeProjectPropertyListener(IProject project, IProjectPropertyListener listener);
+
+ /**
+ * Notify all listeners of project that a property has changed.
+ *
+ * @param project the project for which the property has changed
+ * @param property the property that has changed
+ */
+ void notifyPropertyListeners(IProject project, String property);
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/MarkerGenerator.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/MarkerGenerator.java
new file mode 100644
index 0000000000..c43f040b21
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/MarkerGenerator.java
@@ -0,0 +1,155 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools;
+
+import org.eclipse.cdt.core.CCorePlugin;
+import org.eclipse.cdt.core.IMarkerGenerator;
+import org.eclipse.cdt.core.ProblemMarkerInfo;
+import org.eclipse.cdt.core.model.ICModelMarker;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.runtime.CoreException;
+
+public abstract class MarkerGenerator implements IMarkerGenerator {
+
+ /**
+ * Constructor for MarkerGenerator
+ */
+ public MarkerGenerator() {
+ 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++) {
+ int line = ((Integer) cur[i].getAttribute(IMarker.LOCATION)).intValue();
+ int sev = ((Integer) cur[i].getAttribute(IMarker.SEVERITY)).intValue();
+ String mesg = (String) cur[i].getAttribute(IMarker.MESSAGE);
+ if (line == lineNumber && sev == mapMarkerSeverity(severity) && mesg.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());
+ }
+
+ }
+
+ public abstract IProject getProject();
+
+ /*
+ * callback from Output Parser
+ */
+ public void addMarker(ProblemMarkerInfo problemMarkerInfo) {
+ try {
+ IResource markerResource = problemMarkerInfo.file ;
+ if (markerResource==null) {
+ markerResource = getProject();
+ }
+ IMarker[] cur = markerResource.findMarkers(ICModelMarker.C_MODEL_PROBLEM_MARKER, true, 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++) {
+ int line = ((Integer) cur[i].getAttribute(IMarker.LOCATION)).intValue();
+ int sev = ((Integer) cur[i].getAttribute(IMarker.SEVERITY)).intValue();
+ String mesg = (String) cur[i].getAttribute(IMarker.MESSAGE);
+ if (line == problemMarkerInfo.lineNumber && sev == mapMarkerSeverity(problemMarkerInfo.severity) && mesg.equals(problemMarkerInfo.description)) {
+ return;
+ }
+ }
+ }
+
+ IMarker marker = markerResource.createMarker(ICModelMarker.C_MODEL_PROBLEM_MARKER);
+ marker.setAttribute(IMarker.LOCATION, problemMarkerInfo.lineNumber);
+ marker.setAttribute(IMarker.MESSAGE, problemMarkerInfo.description);
+ marker.setAttribute(IMarker.SEVERITY, mapMarkerSeverity(problemMarkerInfo.severity));
+ marker.setAttribute(IMarker.LINE_NUMBER, problemMarkerInfo.lineNumber);
+ marker.setAttribute(IMarker.CHAR_START, -1);
+ marker.setAttribute(IMarker.CHAR_END, -1);
+ if (problemMarkerInfo.variableName != null) {
+ marker.setAttribute(ICModelMarker.C_MODEL_MARKER_VARIABLE, problemMarkerInfo.variableName);
+ }
+ if (problemMarkerInfo.externalPath != null) {
+ marker.setAttribute(ICModelMarker.C_MODEL_MARKER_EXTERNAL_LOCATION, problemMarkerInfo.externalPath.toOSString());
+ }
+ }
+ catch (CoreException e) {
+ CCorePlugin.log(e.getStatus());
+ }
+ }
+
+ private 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;
+ }
+
+ /* (non-Javadoc)
+ * Removes the IMarkers for the project specified in the argument if the
+ * project exists, and is open.
+ *
+ * @param project
+ */
+ public void removeAllMarkers(IProject project) {
+ if (project == null || !project.isAccessible()) return;
+
+ // Clear out the problem markers
+ IWorkspace workspace = project.getWorkspace();
+ IMarker[] markers;
+ try {
+ markers = project.findMarkers(ICModelMarker.C_MODEL_PROBLEM_MARKER, true, IResource.DEPTH_INFINITE);
+ } catch (CoreException e) {
+ // Handled just about every case in the sanity check
+ return;
+ }
+ if (markers != null) {
+ try {
+ workspace.deleteMarkers(markers);
+ } catch (CoreException e) {
+ // The only situation that might cause this is some sort of resource change event
+ return;
+ }
+ }
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/AutotoolsConsole.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/AutotoolsConsole.java
new file mode 100644
index 0000000000..982764a120
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/AutotoolsConsole.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 2004, 2009 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ * Red Hat Inc - Adapted for Autotools usage
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui;
+
+import org.eclipse.cdt.ui.IBuildConsoleManager;
+import org.eclipse.core.resources.IProject;
+
+public class AutotoolsConsole extends Console {
+ IProject project;
+ IBuildConsoleManager fConsoleManager;
+
+ private static final String CONTEXT_MENU_ID = "CAutotoolsConsole"; //$NON-NLS-1$
+ private static final String CONSOLE_NAME = ConsoleMessages.getString("AutotoolsConsole.name"); //$NON-NLS-1$
+
+ public AutotoolsConsole() {
+ super(CONSOLE_NAME, CONTEXT_MENU_ID);
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/CBuildStepsConsole.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/CBuildStepsConsole.java
new file mode 100644
index 0000000000..5ba325974f
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/CBuildStepsConsole.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 2004, 2009 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ * Red Hat Inc - Adapted for Autotools usage
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui;
+
+import org.eclipse.cdt.ui.IBuildConsoleManager;
+import org.eclipse.core.resources.IProject;
+
+public class CBuildStepsConsole extends Console {
+ IProject project;
+ IBuildConsoleManager fConsoleManager;
+
+ private static final String CONTEXT_MENU_ID = "CAutotoolsBuildStepsConsole"; //$NON-NLS-1$
+ private static final String CONSOLE_NAME = ConsoleMessages.getString("BuildStepsConsole.name"); //$NON-NLS-1$
+
+ public CBuildStepsConsole() {
+ super(CONSOLE_NAME, CONTEXT_MENU_ID);
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/CConfigureConsole.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/CConfigureConsole.java
new file mode 100644
index 0000000000..1925fcd7c2
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/CConfigureConsole.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 2004, 2009 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui;
+
+import org.eclipse.cdt.ui.IBuildConsoleManager;
+import org.eclipse.core.resources.IProject;
+
+public class CConfigureConsole extends Console {
+ IProject project;
+ IBuildConsoleManager fConsoleManager;
+
+ private static final String CONTEXT_MENU_ID = "CAutotoolsConfigureConsole"; //$NON-NLS-1$
+ private static final String CONSOLE_NAME = ConsoleMessages.getString("ConfigureConsole.name"); //$NON-NLS-1$
+
+ public CConfigureConsole() {
+ super(CONSOLE_NAME, CONTEXT_MENU_ID);
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/CWordFinder.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/CWordFinder.java
new file mode 100644
index 0000000000..cc28694b10
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/CWordFinder.java
@@ -0,0 +1,283 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.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;
+
+
+/**
+ * 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 {
+
+ private static final char CBRACE_L = '{';
+ private static final char CBRACE_R = '}';
+ private static final char BRACE_R = ')';
+
+ /**
+ * 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 + 1;
+
+ 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
+ return new Region(start, end - start);
+ }
+
+ 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;
+ }
+
+ /**
+ * This method will determine whether current offset is contained
+ * in any function's body or it's outside it.
+ *
+ * @param document
+ * The document to be examined
+ * @param offset
+ * The offset into the document
+ * @return
+ * <code>true</code> if there is no function body around offset
+ * <code>false</code> otherwise
+ */
+ public static boolean isGlobal(IDocument document, int offset) {
+ try {
+ int pos = offset;
+ int bracketcount = 0;
+ char c;
+
+ //Find left curled bracket from our position
+ while (pos > 0) {
+ c = document.getChar(pos--);
+
+ if (c == CBRACE_R) {
+ bracketcount++; // take into account nested blocks
+ } else if (c == CBRACE_L) {
+ if (bracketcount-- == 0) {
+ do {
+ c = document.getChar(pos--);
+ if (c == BRACE_R) return false;
+ } while (Character.isWhitespace(c));
+ // container block seems to be not a function or statement body
+ pos++; // step back one symbol
+ bracketcount = 0; // let's search for upper block
+ }
+ }
+ }
+
+ } catch (BadLocationException x) { /* Ignore */ }
+ // return true in case of unknown result or exception
+ return true;
+ }
+
+ /**
+ * Searches for line feed symbols in string.
+ * First met '\r' or '\n' is treated as LF symbol
+ *
+ * @param s
+ * string to search in.
+ * @return number of LFs met.
+ */
+ public static int countLFs (String s) {
+ int counter = 0;
+ char lf = 0;
+ char c;
+ for (int i=0; i<s.length(); i++) {
+ c = s.charAt(i);
+ if (lf == 0) {
+ if (c == '\n' || c == '\r') {
+ lf = c;
+ counter++;
+ }
+ } else if (lf == c) counter++;
+ }
+ return counter;
+ }
+
+ /**
+ * Checks whether the string contains any C-block delimiters ( { } )
+ *
+ * @param s
+ * text to check
+ * @return true if curled brace found.
+ */
+ public static boolean hasCBraces (String s) {
+ if (s.indexOf(CBRACE_L) > -1 || s.indexOf(CBRACE_R) > -1) return true;
+ else return false;
+ }
+}
+
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/Console.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/Console.java
new file mode 100644
index 0000000000..695e489a1b
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/Console.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 2004 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui;
+
+import org.eclipse.cdt.core.ConsoleOutputStream;
+import org.eclipse.cdt.core.resources.IConsole;
+import org.eclipse.cdt.ui.CUIPlugin;
+import org.eclipse.cdt.ui.IBuildConsoleManager;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+
+public class Console implements IConsole {
+ IProject project;
+ IBuildConsoleManager fConsoleManager;
+
+ public Console(String consoleName, String contextId) {
+ fConsoleManager = CUIPlugin.getDefault().getConsoleManager(consoleName,
+ contextId);
+ }
+
+// /**
+// * Constructor for ConfigureConsole.
+// */
+// public CConfigureConsole() {
+// fConsoleManager = AutotoolsPlugin.getDefault().getConsoleManager();
+// }
+//
+
+ public void start(IProject project ) {
+ this.project = project;
+ fConsoleManager.getConsole(project).start(project);
+ }
+
+ /**
+ * @throws CoreException
+ * @see org.eclipse.cdt.core.resources.IConsole#getOutputStream()
+ */
+ public ConsoleOutputStream getOutputStream() throws CoreException {
+ return fConsoleManager.getConsole(project).getOutputStream();
+ }
+
+ public ConsoleOutputStream getInfoStream() throws CoreException {
+ return fConsoleManager.getConsole(project).getInfoStream();
+ }
+
+ public ConsoleOutputStream getErrorStream() throws CoreException {
+ return fConsoleManager.getConsole(project).getErrorStream();
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/ConsoleMessages.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/ConsoleMessages.java
new file mode 100644
index 0000000000..a9b3d21ef0
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/ConsoleMessages.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 2004 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class ConsoleMessages {
+
+ public static final String BUNDLE_NAME = "org.eclipse.linuxtools.internal.cdt.autotools.ui.ConsoleMessages";//$NON-NLS-1$
+
+ private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
+
+ private ConsoleMessages() {
+
+ }
+ public static String getString(String key) {
+ try {
+ return RESOURCE_BUNDLE.getString(key);
+ } catch (MissingResourceException e) {
+ return '!' + key + '!';
+ }
+ }
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/ConsoleMessages.properties b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/ConsoleMessages.properties
new file mode 100644
index 0000000000..7c4510df87
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/ConsoleMessages.properties
@@ -0,0 +1,25 @@
+###############################################################################
+# Copyright (c) 2003, 2004 QNX Software Systems and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# QNX Software Systems - Initial API and implementation
+###############################################################################
+ConfigureConsole.name=Configure
+BuildStepsConsole.name=Build Steps
+AutotoolsConsole.name=Autotools
+
+find_replace_action.label=&Find/Replace...@Ctrl+F
+find_replace_action.tooltip=Find/Replace
+find_replace_action.image=
+find_replace_action.description=Find/Replace
+
+ConfigureConsolePage.&Copy@Ctrl+C_6=&Copy@Ctrl+C
+ConfigureConsolePage.Copy_7=Copy
+ConfigureConsolePage.Select_&All@Ctrl+A_12=Select &All@Ctrl+A
+ConfigureConsolePage.Select_All=Select All
+
+ScrollLockAction.Scroll_Lock_1=Scroll Lock
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/HTMLPrinter.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/HTMLPrinter.java
new file mode 100644
index 0000000000..a9de7d1159
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/HTMLPrinter.java
@@ -0,0 +1,116 @@
+/*******************************************************************************
+ * Copyright (c) 2000 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * QNX Software System
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui;
+
+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, '<', "&lt;"); //$NON-NLS-1$
+ return replace(content, '>', "&gt;"); //$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, "<html><body text=\"#000000\" bgcolor=\"#FFFF88\"><font size=-1>"); //$NON-NLS-1$
+ }
+
+ public static void addPageProlog(StringBuffer buffer) {
+ insertPageProlog(buffer, buffer.length());
+ }
+
+ public static void addPageEpilog(StringBuffer buffer) {
+ buffer.append("</font></body></html>"); //$NON-NLS-1$
+ }
+
+ public static void startBulletList(StringBuffer buffer) {
+ buffer.append("<ul>"); //$NON-NLS-1$
+ }
+
+ public static void endBulletList(StringBuffer buffer) {
+ buffer.append("</ul>"); //$NON-NLS-1$
+ }
+
+ public static void addBullet(StringBuffer buffer, String bullet) {
+ if (bullet != null) {
+ buffer.append("<li>"); //$NON-NLS-1$
+ buffer.append(bullet);
+ buffer.append("</li>"); //$NON-NLS-1$
+ }
+ }
+
+ public static void addSmallHeader(StringBuffer buffer, String header) {
+ if (header != null) {
+ buffer.append("<h5>"); //$NON-NLS-1$
+ buffer.append(header);
+ buffer.append("</h5>"); //$NON-NLS-1$
+ }
+ }
+
+ public static void addParagraph(StringBuffer buffer, String paragraph) {
+ if (paragraph != null) {
+ buffer.append("<p>"); //$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/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/LineBreakingReader.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/LineBreakingReader.java
new file mode 100644
index 0000000000..52fb3e31e5
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/LineBreakingReader.java
@@ -0,0 +1,111 @@
+/*******************************************************************************
+ * Copyright (c) 2000 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * QNX Software System
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui;
+
+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;
+ }
+ 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/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/SingleCharReader.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/SingleCharReader.java
new file mode 100644
index 0000000000..1d48fcc21b
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/SingleCharReader.java
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * Copyright (c) 2000 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * QNX Software System
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui;
+
+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;
+ }
+ 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/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/SubstitutionTextReader.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/SubstitutionTextReader.java
new file mode 100644
index 0000000000..16d8400b98
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/SubstitutionTextReader.java
@@ -0,0 +1,138 @@
+/*******************************************************************************
+ * Copyright (c) 2000 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * QNX Software System
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.cdt.autotools.ui;
+
+
+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 <code>nextChar</code>
+ * 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;
+ }
+ 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/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/AutotoolsEditorPreferenceConstants.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/AutotoolsEditorPreferenceConstants.java
new file mode 100644
index 0000000000..5fbd71076a
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/AutotoolsEditorPreferenceConstants.java
@@ -0,0 +1,80 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 2005, 2007, 2009 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ * Red Hat Inc. - rename to use with Autotools editors
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.preferences;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+
+/**
+ * MakefileEditorPreferenceConstants
+ */
+public class AutotoolsEditorPreferenceConstants {
+
+ /**
+ *
+ */
+ private AutotoolsEditorPreferenceConstants() {
+ }
+
+ /**
+ * The symbolic names for colors for displaying code assist proposals
+ * @see org.eclipse.jface.resource.ColorRegistry
+ */
+ public static final String CURRENT_LINE_COLOR = "org.eclipse.linuxtools.cdt.autotools.automake.ui.currentLineHightlightColor"; //$NON-NLS-1$
+ public static final String LINE_NUMBER_RULER_COLOR = "org.eclipse.linuxtools.cdt.autotools.automake.ui.lineNumberForegroundColor"; //$NON-NLS-1$
+ public static final String PRINT_MARGIN_COLOR = "org.eclipse.linuxtools.cdt.autotools.automake.ui.printMarginColor"; //$NON-NLS-1$
+
+ /**
+ * Preference key suffix for bold text style preference keys.
+ *
+ */
+ public static final String EDITOR_BOLD_SUFFIX= "_bold"; //$NON-NLS-1$
+
+ /**
+ * Preference key suffix for italic text style preference keys.
+ */
+ public static final String EDITOR_ITALIC_SUFFIX= "_italic"; //$NON-NLS-1$
+
+
+ public static final String EDITOR_FOLDING_MACRODEF = "editor_folding_default_macrodef"; //$NON-NLS-1$
+
+ public static final String EDITOR_FOLDING_RULE = "editor_folding_default_rule"; //$NON-NLS-1$
+
+ public static final String EDITOR_FOLDING_CASE = "editor_folding_default_case"; //$NON-NLS-1$
+
+ public static final String EDITOR_FOLDING_CONDITIONAL = "editor_folding_default_conditional"; //$NON-NLS-1$
+
+ public static final String EDITOR_FOLDING_LOOP = "editor_folding_default_loop"; //$NON-NLS-1$
+
+ public static final String EDITOR_FOLDING_ENABLED = "editor_folding_enabled"; //$NON-NLS-1$
+
+ public static final String AUTOCONF_VERSION = "autoconf_version"; //$NON-NLS-1$
+
+ public static final String AUTOMAKE_VERSION = "automake_version"; //$NON-NLS-1$
+
+ public static final String LATEST_AC_VERSION = "2.61"; //$NON-NLS-1$
+
+ public static final String LATEST_AM_VERSION = "1.9.6"; //$NON-NLS-1$
+
+ public static void initializeDefaultValues(IPreferenceStore store) {
+
+ store.setDefault(AutotoolsEditorPreferenceConstants.EDITOR_FOLDING_ENABLED, false);
+ store.setDefault(AutotoolsEditorPreferenceConstants.EDITOR_FOLDING_MACRODEF, false);
+ store.setDefault(AutotoolsEditorPreferenceConstants.EDITOR_FOLDING_RULE, true);
+ store.setDefault(AutotoolsEditorPreferenceConstants.EDITOR_FOLDING_CASE, true);
+ store.setDefault(AutotoolsEditorPreferenceConstants.EDITOR_FOLDING_CONDITIONAL, true);
+ store.setDefault(AutotoolsEditorPreferenceConstants.EDITOR_FOLDING_LOOP, true);
+ store.setDefault(AutotoolsEditorPreferenceConstants.AUTOCONF_VERSION, LATEST_AC_VERSION);
+ store.setDefault(AutotoolsEditorPreferenceConstants.AUTOMAKE_VERSION, LATEST_AM_VERSION);
+ }
+
+}
diff --git a/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/OverlayPreferenceStore.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/OverlayPreferenceStore.java
new file mode 100644
index 0000000000..3c6a672572
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/OverlayPreferenceStore.java
@@ -0,0 +1,455 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.preferences;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceStore;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
+
+/**
+ * OverlayPreferenceStore
+ */
+/**
+ * An overlaying preference store.
+ */
+class OverlayPreferenceStore implements IPreferenceStore {
+
+
+ public static final class TypeDescriptor {
+ 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);
+ }
+ }
+
+
+ IPreferenceStore fParent;
+ IPreferenceStore fStore;
+ private OverlayKey[] fOverlayKeys;
+
+ private PropertyListener fPropertyListener;
+
+
+ public OverlayPreferenceStore(IPreferenceStore parent, OverlayKey[] overlayKeys) {
+ fParent= parent;
+ fOverlayKeys= overlayKeys;
+ fStore= new PreferenceStore();
+ }
+
+ 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);
+ }
+
+ 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"); //$NON-NLS-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/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/StatusInfo.java b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/StatusInfo.java
new file mode 100644
index 0000000000..3ae395a617
--- /dev/null
+++ b/autotools/0.5.0/org.eclipse.linuxtools.cdt.autotools/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/StatusInfo.java
@@ -0,0 +1,173 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 2006 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * QNX Software Systems - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.internal.cdt.autotools.ui.preferences;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.linuxtools.cdt.autotools.AutotoolsPlugin;
+
+
+/**
+ * A settable IStatus.
+ * Can be an error, warning, info or ok. For error, info and warning states,
+ * a message describes the problem.
+ */
+public class StatusInfo implements IStatus {
+
+ private String fStatusMessage;
+ private int fSeverity;
+
+ /**
+ * Creates a status set to OK (no message)
+ */
+ public StatusInfo() {
+ this(OK, null);
+ }
+
+ /**
+ * Creates a status .
+ * @param severity The status severity: ERROR, WARNING, INFO and OK.
+ * @param message The message of the status. Applies only for ERROR,
+ * WARNING and INFO.
+ */
+ public StatusInfo(int severity, String message) {
+ fStatusMessage= message;
+ fSeverity= severity;
+ }
+
+ /**
+ * Returns if the status' severity is OK.
+ */
+ public boolean isOK() {
+ return fSeverity == IStatus.OK;
+ }
+
+ /**
+ * Returns if the status' severity is WARNING.
+ */
+ public boolean isWarning() {
+ return fSeverity == IStatus.WARNING;
+ }
+
+ /**
+ * Returns if the status' severity is INFO.
+ */
+ public boolean isInfo() {
+ return fSeverity == IStatus.INFO;
+ }
+
+ /**
+ * Returns if the status' severity is ERROR.
+ */
+ public boolean isError() {
+ return fSeverity == IStatus.ERROR;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.IStatus#getMessage()
+ */
+ public String getMessage() {
+ return fStatusMessage;
+ }
+
+ /**
+ * Sets the status to ERROR.
+ * @param errorMessage The error message (can be empty, but not null)
+ */
+ public void setError(String errorMessage) {
+ Assert.isNotNull(errorMessage);
+ fStatusMessage= errorMessage;
+ fSeverity= IStatus.ERROR;
+ }
+
+ /**
+ * Sets the status to WARNING.
+ * @param warningMessage The warning message (can be empty, but not null)
+ */
+ public void setWarning(String warningMessage) {
+ Assert.isNotNull(warningMessage);
+ fStatusMessage= warningMessage;
+ fSeverity= IStatus.WARNING;
+ }
+
+ /**
+ * Sets the status to INFO.
+ * @param infoMessage The info message (can be empty, but not null)
+ */
+ public void setInfo(String infoMessage) {
+ Assert.isNotNull(infoMessage);
+ fStatusMessage= infoMessage;
+ fSeverity= IStatus.INFO;
+ }
+
+ /**
+ * Sets the status to OK.
+ */
+ public void setOK() {
+ fStatusMessage= null;
+ fSeverity= IStatus.OK;
+ }
+
+ /*
+ * @see IStatus#matches(int)
+ */
+ public boolean matches(int severityMask) {
+ return (fSeverity & severityMask) != 0;
+ }
+
+ /**
+ * Returns always <code>false</code>.
+ * @see IStatus#isMultiStatus()
+ */
+ public boolean isMultiStatus() {
+ return false;
+ }
+
+ /*
+ * @see IStatus#getSeverity()
+ */
+ public int getSeverity() {
+ return fSeverity;
+ }
+
+ /*
+ * @see IStatus#getPlugin()
+ */
+ public String getPlugin() {
+ return AutotoolsPlugin.getPluginId();
+ }
+
+ /**
+ * Returns always <code>null</code>.
+ * @see IStatus#getException()
+ */
+ public Throwable getException() {
+ return null;
+ }
+
+ /**
+ * Returns always the error severity.
+ * @see IStatus#getCode()
+ */
+ public int getCode() {
+ return fSeverity;
+ }
+
+ /**
+ * Returns always <code>null</code>.
+ * @see IStatus#getChildren()
+ */
+ public IStatus[] getChildren() {
+ return new IStatus[0];
+ }
+
+}

Back to the top