Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Overholt2011-02-28 03:55:20 +0000
committerAndrew Overholt2011-02-28 03:55:26 +0000
commit8cecd62e38d81be692f4850153abae414d90bf7c (patch)
treecf3b78cc9c89f31fff5b8b4711bbf11d7c0b9a69
parentda6e2347941a139ff6d0933ad5dbf3e474f93886 (diff)
parent4ae78c6535aa67bb1260ab5619eca2ff9a64ca19 (diff)
downloadorg.eclipse.linuxtools-8cecd62e38d81be692f4850153abae414d90bf7c.tar.gz
org.eclipse.linuxtools-8cecd62e38d81be692f4850153abae414d90bf7c.tar.xz
org.eclipse.linuxtools-8cecd62e38d81be692f4850153abae414d90bf7c.zip
Merge autotools 0.6.1
-rw-r--r--autotools/org.eclipse.linuxtools.cdt.autotools.ui.tests/ChangeLog14
-rw-r--r--autotools/org.eclipse.linuxtools.cdt.autotools.ui.tests/src/org/eclipse/linuxtools/cdt/autotools/ui/tests/TestToolActions.java549
-rw-r--r--autotools/org.eclipse.linuxtools.cdt.autotools.ui/ChangeLog151
-rw-r--r--autotools/org.eclipse.linuxtools.cdt.autotools.ui/plugin.xml10
-rw-r--r--autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfAnnotationHover.java39
-rw-r--r--autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfDocumentProvider.java1
-rw-r--r--autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfEditor.java32
-rw-r--r--autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfErrorHandler.java173
-rw-r--r--autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/outline/AutoconfContentOutlinePage.java1
-rw-r--r--autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/HTMLTextPresenter.java2
-rw-r--r--autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/MessageLine.java22
-rw-r--r--autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeLibtoolizeAction.java2
-rw-r--r--autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/autoconf/ProjectionFileUpdater.java2
-rw-r--r--autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AddBuildTargetAction.java154
-rw-r--r--autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeDocumentProvider.java2
-rw-r--r--autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeEditor.java3
-rw-r--r--autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeErrorHandler.java181
-rw-r--r--autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ExternalEditorInput.java2
-rw-r--r--autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakeFileMessages.properties4
-rw-r--r--autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileAnnotationHover.java188
-rw-r--r--autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileContentOutlinePage.java6
-rw-r--r--autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileDocumentProvider.java7
-rw-r--r--autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileEditor.java33
-rw-r--r--autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileMessages.java4
-rw-r--r--autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MessageLine.java46
-rw-r--r--autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/OpenIncludeAction.java2
-rw-r--r--autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ProjectionMakefileUpdater.java4
-rw-r--r--autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/SelectionStatusDialog.java4
-rw-r--r--autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/AutotoolsBuildWizard.java5
-rw-r--r--autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/AutotoolsWizardMessages.properties2
30 files changed, 1040 insertions, 605 deletions
diff --git a/autotools/org.eclipse.linuxtools.cdt.autotools.ui.tests/ChangeLog b/autotools/org.eclipse.linuxtools.cdt.autotools.ui.tests/ChangeLog
index 37e7bca72a..2c98afc247 100644
--- a/autotools/org.eclipse.linuxtools.cdt.autotools.ui.tests/ChangeLog
+++ b/autotools/org.eclipse.linuxtools.cdt.autotools.ui.tests/ChangeLog
@@ -1,3 +1,17 @@
+2010-06-22 Jeff Johnston <jjohnstn@redhat.com>
+
+ Tests: #317345
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/tests/TestToolActions.java (canSeeTools): New test.
+ (canAccessAclocal2): Ditto.
+ (canAccessAutoconf2): Ditto.
+ (canAccessAutomake2): Ditto.
+ (canAccessLibtoolize2): Ditto.
+ (canAccessAutoheader2): Ditto.
+ (canAccessAutoreconf2): Ditto.
+ (canReconfigureProject2): Ditto.
+ (canSetTools): Ditto.
+ (canResetTools): Ditto.
+
2010-06-04 Jeff Johnston <jjohnstn@redhat.com>
* src/org/eclipse/linuxtools/cdt/autotools/ui/tests/SetConfigurationParameter.java (canBuildWithConfigParm): Add a check
diff --git a/autotools/org.eclipse.linuxtools.cdt.autotools.ui.tests/src/org/eclipse/linuxtools/cdt/autotools/ui/tests/TestToolActions.java b/autotools/org.eclipse.linuxtools.cdt.autotools.ui.tests/src/org/eclipse/linuxtools/cdt/autotools/ui/tests/TestToolActions.java
index 92d0ec4eb0..64aa946397 100644
--- a/autotools/org.eclipse.linuxtools.cdt.autotools.ui.tests/src/org/eclipse/linuxtools/cdt/autotools/ui/tests/TestToolActions.java
+++ b/autotools/org.eclipse.linuxtools.cdt.autotools.ui.tests/src/org/eclipse/linuxtools/cdt/autotools/ui/tests/TestToolActions.java
@@ -78,6 +78,31 @@ public class TestToolActions {
}
@Test
+ // Verify we can set the tools via the Autotools Tools page
+ public void canSeeTools() throws Exception {
+ SWTBotView view = bot.viewByTitle("Project Explorer");
+ view.bot().tree().select("GnuProject1");
+ bot.menu("Project", 1).menu("Properties").click();
+ SWTBotShell shell = bot.shell("Properties for GnuProject1");
+ shell.activate();
+ bot.tree().expandNode("Autotools").select("General");
+ bot.tabItem("Tools Settings").activate();
+ String aclocalName = bot.textWithLabel("aclocal").getText();
+ assertTrue(aclocalName.equals("aclocal"));
+ String autoconfName = bot.textWithLabel("autoconf").getText();
+ assertTrue(autoconfName.equals("autoconf"));
+ String automakeName = bot.textWithLabel("automake").getText();
+ assertTrue(automakeName.equals("automake"));
+ String autoheaderName = bot.textWithLabel("autoheader").getText();
+ assertTrue(autoheaderName.equals("autoheader"));
+ String autoreconfName = bot.textWithLabel("autoreconf").getText();
+ assertTrue(autoreconfName.equals("autoreconf"));
+ String libtoolizeName = bot.textWithLabel("libtoolize").getText();
+ assertTrue(libtoolizeName.equals("libtoolize"));
+ bot.button("Cancel").click();
+ }
+
+ @Test
// Verify we can access the aclocal tool
public void canAccessAclocal() throws Exception {
IWorkspace workspace = ResourcesPlugin.getWorkspace();
@@ -440,6 +465,530 @@ public class TestToolActions {
assertTrue(f.exists());
}
+ @Test
+ // Verify we can set and reset the tools via the Autotools Tools page
+ // Verifies bug #317345
+ public void canResetTools() throws Exception {
+ SWTBotView view = bot.viewByTitle("Project Explorer");
+ view.bot().tree().select("GnuProject1");
+ bot.menu("Project", 1).menu("Properties").click();
+ SWTBotShell shell = bot.shell("Properties for GnuProject1");
+ shell.activate();
+ bot.tree().expandNode("Autotools").select("General");
+ bot.tabItem("Tools Settings").activate();
+ bot.textWithLabel("aclocal").setText("");
+ bot.textWithLabel("aclocal").typeText("automake");
+ bot.textWithLabel("automake").setText("");
+ bot.textWithLabel("automake").typeText("autoconf");
+ bot.textWithLabel("autoconf").setText("");
+ bot.textWithLabel("autoconf").typeText("autoheader");
+ bot.textWithLabel("autoheader").setText("");
+ bot.textWithLabel("autoheader").typeText("autoreconf");
+ bot.textWithLabel("autoreconf").setText("");
+ bot.textWithLabel("autoreconf").typeText("libtoolize");
+ bot.textWithLabel("libtoolize").setText("");
+ bot.textWithLabel("libtoolize").typeText("aclocal");
+ bot.button("Apply").click();
+ String aclocalName = bot.textWithLabel("aclocal").getText();
+ assertTrue(aclocalName.equals("automake"));
+ String autoconfName = bot.textWithLabel("autoconf").getText();
+ assertTrue(autoconfName.equals("autoheader"));
+ String automakeName = bot.textWithLabel("automake").getText();
+ assertTrue(automakeName.equals("autoconf"));
+ String autoheaderName = bot.textWithLabel("autoheader").getText();
+ assertTrue(autoheaderName.equals("autoreconf"));
+ String autoreconfName = bot.textWithLabel("autoreconf").getText();
+ assertTrue(autoreconfName.equals("libtoolize"));
+ String libtoolizeName = bot.textWithLabel("libtoolize").getText();
+ assertTrue(libtoolizeName.equals("aclocal"));
+ bot.button("Restore Defaults").click();
+ aclocalName = bot.textWithLabel("aclocal").getText();
+ assertTrue(aclocalName.equals("aclocal"));
+ autoconfName = bot.textWithLabel("autoconf").getText();
+ assertTrue(autoconfName.equals("autoconf"));
+ automakeName = bot.textWithLabel("automake").getText();
+ assertTrue(automakeName.equals("automake"));
+ autoheaderName = bot.textWithLabel("autoheader").getText();
+ assertTrue(autoheaderName.equals("autoheader"));
+ autoreconfName = bot.textWithLabel("autoreconf").getText();
+ assertTrue(autoreconfName.equals("autoreconf"));
+ libtoolizeName = bot.textWithLabel("libtoolize").getText();
+ assertTrue(libtoolizeName.equals("libtoolize"));
+ bot.button("OK").click();
+ }
+
+ @Test
+ // Verify we can access the aclocal tool
+ public void canAccessAclocal2() 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());
+ f.delete();
+ 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 canAccessAutoconf2() 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());
+ f.delete();
+ 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 canAccessAutomake2() 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());
+ f.delete();
+ File f2 = new File(path2.toOSString());
+ f2.delete();
+ 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 canAccessLibtoolize2() 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 canAccessAutoheader2() 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 canAccessAutoreconf2() 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 canReconfigureProject2() 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());
+ }
+
+ @Test
+ // Verify we can set the tools via the Autotools Tools page
+ public void canSetTools() throws Exception {
+ SWTBotView view = bot.viewByTitle("Project Explorer");
+ view.bot().tree().select("GnuProject1");
+ bot.menu("Project", 1).menu("Properties").click();
+ SWTBotShell shell = bot.shell("Properties for GnuProject1");
+ shell.activate();
+ bot.tree().expandNode("Autotools").select("General");
+ bot.tabItem("Tools Settings").activate();
+ bot.textWithLabel("aclocal").setText("");
+ bot.textWithLabel("aclocal").typeText("automake");
+ bot.textWithLabel("automake").setText("");
+ bot.textWithLabel("automake").typeText("autoconf");
+ bot.textWithLabel("autoconf").setText("");
+ bot.textWithLabel("autoconf").typeText("autoheader");
+ bot.textWithLabel("autoheader").setText("");
+ bot.textWithLabel("autoheader").typeText("autoreconf");
+ bot.textWithLabel("autoreconf").setText("");
+ bot.textWithLabel("autoreconf").typeText("libtoolize");
+ bot.textWithLabel("libtoolize").setText("");
+ bot.textWithLabel("libtoolize").typeText("aclocal");
+ bot.button("OK").click();
+ 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.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.*automake --help.*Usage:.*automake.*", 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 Automake").click();
+ shell = bot.shell("Automake Options");
+ shell.activate();
+ bot.text(0).typeText("--help");
+ bot.button("OK").click();
+ bot.sleep(1000);
+ consoleView = bot.viewByTitle("Console");
+ consoleView.setFocus();
+ output = consoleView.bot().styledText().getText();
+ // Verify we got some help output to the console
+ p = Pattern.compile(".*Invoking automake in.*GnuProject1.*autoconf --help.*Usage:.*autoconf.*", Pattern.DOTALL);
+ 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 Autoheader").click();
+ shell = bot.shell("Autoheader Options");
+ shell.activate();
+ bot.text(0).typeText("--help");
+ bot.button("OK").click();
+ bot.sleep(1000);
+ consoleView = bot.viewByTitle("Console");
+ consoleView.setFocus();
+ output = consoleView.bot().styledText().getText();
+ // Verify we got some help output to the console
+ p = Pattern.compile(".*Invoking autoheader in.*GnuProject1.*autoreconf --help.*Usage:.*autoreconf.*", Pattern.DOTALL);
+ m = p.matcher(output);
+ assertTrue(m.matches());
+
+ view = bot.viewByTitle("Project Explorer");
+ view.bot().tree().select("GnuProject1");
+ 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("--help");
+ bot.button("OK").click();
+ bot.sleep(1000);
+ consoleView = bot.viewByTitle("Console");
+ consoleView.setFocus();
+ output = consoleView.bot().styledText().getText();
+ // Verify we got some help output to the console
+ p = Pattern.compile(".*Invoking autoreconf in.*GnuProject1.*libtoolize --help.*Usage:.*libtoolize.*", Pattern.DOTALL);
+ m = p.matcher(output);
+ assertTrue(m.matches());
+
+ view = bot.viewByTitle("Project Explorer");
+ view.bot().tree().select("GnuProject1");
+ view = bot.viewByTitle("Project Explorer");
+ view.bot().tree().select("GnuProject1");
+ bot.menu("Project", 1).menu("Invoke Autotools").menu("Invoke Libtoolize").click();
+ shell = bot.shell("Libtoolize Options");
+ shell.activate();
+ bot.text(0).typeText("--help");
+ bot.button("OK").click();
+ bot.sleep(1000);
+ consoleView = bot.viewByTitle("Console");
+ consoleView.setFocus();
+ output = consoleView.bot().styledText().getText();
+ // Verify we got some help output to the console
+ p = Pattern.compile(".*Invoking libtoolize in.*GnuProject1.*aclocal --help.*Usage:.*aclocal.*", Pattern.DOTALL);
+ m = p.matcher(output);
+ assertTrue(m.matches());
+ }
+
@AfterClass
public static void sleep() {
bot.sleep(2000);
diff --git a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/ChangeLog b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/ChangeLog
index 497d710b22..a23fb97bfc 100644
--- a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/ChangeLog
+++ b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/ChangeLog
@@ -1,3 +1,154 @@
+2010-08-25 Jeff Johnston <jjohnstn@redhat.com>
+
+ Patch from Marc-Andre Laperle <malaperle@omnialabs.net>
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/AutotoolsBuildWizard.java (EMPTY_PROJECT): Switch
+ to use local messages.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/AutotoolsWizardMessages.properties: Add some
+ messages that were formerly fetched from the CDT.
+
+2010-07-19 Jeff Johnston <jjohnstn@redhat.com>
+
+ Bug #314334
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AddBuildTargetAction.java: Removed.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileContentOutlinePage.java (MakefileContentOutlinePage): Remove
+ AddBuildTargetAction which wasn't being used and illegally instantiated MakeTargetDialog.
+ (contextMenuAboutToShow): Ditto.
+
+2010-07-12 Jeff Johnston <jjohnstn@redhat.com>
+
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeErrorHandler.java:
+ (AutomakeAnnotation.setQuickFixable): Remove unnecessary override statement.
+ (AutomakeAnnotation.isQuickFixableStateSet): Ditto.
+ (AutomakeAnnotation.isQuickFixable): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfErrorHandler.java:
+ (AutoconfAnnotation.setQuickFixable): Remove unnecessary override statement.
+ (AutoconfAnnotation.isQuickFixableStateSet): Ditto.
+ (AutoconfAnnotation.isQuickFixable): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfDocumentProvider.java (shutdown): Remove use of rawtypes
+ Java annotation which doesn't exist in J2SE-1.5.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/outline/AutoconfContentOutlinePage.java (updateSelection): Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/autoconf/ProjectionFileUpdater.java (createAnnotationMap): Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AddBuildTargetAction.java (getTargetRules): Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeDocumentProvider.java (shutdown): Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeEditor.java (getAdapter): Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ExternalEditorInput.java (getAdapter): Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileEditor.java (getAdapter): Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/OpenIncludeAction.java (getIncludeStatement): Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ProjectionMakefileUpdater.java (initialize): Ditto.
+ (createAnnotationMap): Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ResourceMarkerAnnotationModel.java (batchedUpdate): Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/SelectionStatusDialog.java (getPrimaryInitialSelection): Ditto.
+ (setInitialSelection): Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/HTMLTextPresenter.java (adaptTextPresentation): Ditto.
+
+2010-07-12 Jeff Johnston <jjohnstn@redhat.com>
+
+ Fix for bug #314348
+ * plugin.xml: Make AutomakeEditor default for .am and Makefile.in files.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfAnnotationHover.java (select): Use
+ Annotations rather than IMarkers.
+ (getAnnotationsForLine): New method.
+ (getHoverInfo): Change logic to get annotations and get messages as opposed to using
+ markers.
+ (getAnnotationsForLine):
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfEditor.java (getAdapter): Fix warning.
+ (getAdapter):
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfErrorHandler.java (AutoconfAnnotation): New class.
+ (AutoconfAnnotation.AutoconfAnnotation): New method.
+ (AutoconfAnnotation.setQuickFixable): Ditto.
+ (AutoconfAnnotation.isQuickFixableStateSet): Ditto.
+ (AutoconfAnnotation.isQuickFixable): Ditto.
+ (handleError): Instead of adding a hacked up IMarker and creating a MarkerAnnotation, create
+ a normal annotation and add it to the annotation model.
+ (removeExistingMarkers): Fix warning.
+ (removeExistingMarkers):
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeErrorHandler.java (AutomakeAnnotation):
+ New class.
+ (checkChildren): Add an AutomakeAnnotation to the annotation model rather than a MarkerAnnotation which requires us to
+ make up our own IMarker implementation.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileAnnotationHover.java: Add
+ implements IAnnotationHoverExtension.
+ (fEditor): Mark unused for now.
+ (compareRulerLine): New method.
+ (select): Ditto.
+ (getAnnotationsForLine): Ditto.
+ (getHoverInfo): Change to get annotations and fetch the annotation text.
+ (formatSingleMessage): New method.
+ (formatMultipleMessages): Ditto.
+ (getHoverControlCreator): Ditto.
+ (.createInformationControl): New internal class.
+ (canHandleMouseCursor): New method.
+ (getHoverLineRange): Ditto.
+ (getAnnotationsForLine):
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileDocumentProvider.java (MakefileAnnotationModel):
+ (MakefileAnnotationModel.MakefileAnnotationModel):
+ (shutdown):
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileMessages.java (getResourceBundle): New static
+ method.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakeFileMessages.properties: Add message for bad directive.
+ Currently unused because of problem loading resource bundle.
+
+2010-07-06 Andrew Overholt <overholt@redhat.com>
+
+ * about.html: Add missing file.
+ * build.properties: Likewise.
+
+2010-06-25 Jeff Johnston <jjohnstn@redhat.com>
+
+ Bug #314358
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfEditor.java: Remove AdaptedSourceViewer class.
+ (createSourceViewer): Return ProjectionViewer.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileEditor.java (createSourceViewer): Ditto.
+
+2010-06-25 Jeff Johnston <jjohnstn@redhat.com>
+
+ Bug #314359
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/MessageLine.java (MessageLine): Rewritten to not extend CLabel but
+ instead to have an internal CLabel field because CLabel is nonextend.
+ (setErrorMessage): New method.
+ (setMessage): Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MessageLine.java (MessageLine): Rewritten to
+ not extend CLabel which is nonextend.
+ (setErrorMessage): New method.
+ (setMessage): Ditto.
+ (isDisposed): Ditto.
+ (setAlignment): Ditto.
+ (setLayoutData): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfAnnotationHover.java (getMarkersForLine): Fix warnings.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfDocumentProvider.java (shutdown): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfEditor.java (getAdapter): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfErrorHandler.java (AutoconfMarker): Ditto.
+ (AutoconfMarker.getAdapter): Ditto.
+ (AutoconfMarker.setAttributes): Ditto.
+ (removeExistingMarkers): Ditto.
+ * src/org/eclipse/linuxtools/cdt/autotools/ui/editors/outline/AutoconfContentOutlinePage.java (updateSelection):
+ Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/autoconf/ProjectionFileUpdater.java (createAnnotationMap): Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AddBuildTargetAction.java (getTargetRules): Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeDocumentProvider.java (shutdown): Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeEditor.java (getAdapter): Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeErrorHandler.java (AutomakeMarker): Ditto.
+ (AutomakeMarker.getAdapter): Ditto.
+ (AutomakeMarker.getAttributes): Ditto.
+ (AutomakeMarker.setAttributes): Ditto.
+ (createMarker): Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ExternalEditorInput.java (getAdapter): Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileDocumentProvider.java (shutdown): Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileEditor.java (getAdapter): Ditto.
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/OpenIncludeAction.java (getIncludeStatement):
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ProjectionMakefileUpdater.java (initialize):
+ (createAnnotationMap):
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ResourceMarkerAnnotationModel.java (batchedUpdate):
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/SelectionStatusDialog.java (getPrimaryInitialSelection):
+ (setInitialSelection):
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/HTMLTextPresenter.java (adaptTextPresentation):
+
+2010-06-22 Jeff Johnston <jjohnstn@redhat.com>
+
+ Resolves: #317345
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeLibtoolizeAction.java (run): Fix typo for property
+ to load.
+
2010-05-25 Jeff Johnston <jjohnstn@redhat.com>
* src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakefileContentOutlinePage.java: Remove
diff --git a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/plugin.xml b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/plugin.xml
index 5dbeb1d06a..5e6c7c62d6 100644
--- a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/plugin.xml
+++ b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/plugin.xml
@@ -156,12 +156,14 @@
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"
+ contributorClass="org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake.MakefileEditorActionContributor"
+ default="true"
+ extensions="am"
+ filenames="Makefile.am,Makefile.in"
+ icon="icons/automake.gif"
id="org.eclipse.linuxtools.cdt.autotools.ui.editors.AutomakeEditor"
- filenames="Makefile.am,Makefile.in">
+ name="%AutomakeEditor.name">
<contentTypeBinding contentTypeId="org.eclipse.linuxtools.cdt.autotools.ui.automake"/>
</editor>
</extension>
diff --git a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfAnnotationHover.java b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfAnnotationHover.java
index 444cef3511..abc539d86f 100644
--- a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfAnnotationHover.java
+++ b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfAnnotationHover.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000 2005 IBM Corporation and others.
+ * Copyright (c) 2000 2005 2010 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -15,13 +15,13 @@ 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.Annotation;
import org.eclipse.jface.text.source.IAnnotationHover;
import org.eclipse.jface.text.source.IAnnotationHoverExtension;
import org.eclipse.jface.text.source.IAnnotationModel;
@@ -30,7 +30,6 @@ 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 {
@@ -58,15 +57,14 @@ public class AutoconfAnnotationHover implements IAnnotationHover, IAnnotationHov
* 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) {
+ protected List<Annotation> select(List<Annotation> exactMatch, List<Annotation> including) {
return exactMatch;
}
/**
* Returns one marker which includes the ruler's line of activity.
*/
- @SuppressWarnings("unchecked")
- protected List<IMarker> getMarkersForLine(ISourceViewer viewer, int line) {
+ protected List<Annotation> getAnnotationsForLine(ISourceViewer viewer, int line) {
IDocument document= viewer.getDocument();
IAnnotationModel model= viewer.getAnnotationModel();
@@ -74,20 +72,21 @@ public class AutoconfAnnotationHover implements IAnnotationHover, IAnnotationHov
if (model == null)
return null;
- List<IMarker> exact= new ArrayList<IMarker>();
- List<IMarker> including= new ArrayList<IMarker>();
+ List<Annotation> exact= new ArrayList<Annotation>();
+ List<Annotation> including= new ArrayList<Annotation>();
+ @SuppressWarnings("unchecked")
Iterator e= model.getAnnotationIterator();
while (e.hasNext()) {
Object o= e.next();
- if (o instanceof MarkerAnnotation) {
- MarkerAnnotation a= (MarkerAnnotation) o;
+ if (o instanceof Annotation) {
+ Annotation a= (Annotation) o;
switch (compareRulerLine(model.getPosition(a), document, line)) {
case 1:
- exact.add(a.getMarker());
+ exact.add(a);
break;
case 2:
- including.add(a.getMarker());
+ including.add(a);
break;
}
}
@@ -100,14 +99,14 @@ public class AutoconfAnnotationHover implements IAnnotationHover, IAnnotationHov
* @see IVerticalRulerHover#getHoverInfo(ISourceViewer, int)
*/
public String getHoverInfo(ISourceViewer sourceViewer, int lineNumber) {
- List<IMarker> markers= getMarkersForLine(sourceViewer, lineNumber);
- if (markers != null && markers.size() > 0) {
+ List<Annotation> annotations = getAnnotationsForLine(sourceViewer, lineNumber);
+ if (annotations != null && annotations.size() > 0) {
- if (markers.size() == 1) {
+ if (annotations.size() == 1) {
// optimization
- IMarker marker= (IMarker) markers.get(0);
- String message= marker.getAttribute(IMarker.MESSAGE, (String) null);
+ Annotation annotation = (Annotation) annotations.get(0);
+ String message= annotation.getText();
if (message != null && message.trim().length() > 0)
return formatSingleMessage(message);
@@ -115,10 +114,10 @@ public class AutoconfAnnotationHover implements IAnnotationHover, IAnnotationHov
List<String> messages= new ArrayList<String>();
- Iterator<IMarker> e= markers.iterator();
+ Iterator<Annotation> e= annotations.iterator();
while (e.hasNext()) {
- IMarker marker= (IMarker) e.next();
- String message= marker.getAttribute(IMarker.MESSAGE, (String) null);
+ Annotation annotation = (Annotation) e.next();
+ String message= annotation.getText();
if (message != null && message.trim().length() > 0)
messages.add(message.trim());
}
diff --git a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfDocumentProvider.java b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfDocumentProvider.java
index dd7c38c51d..6ffcca2c4a 100644
--- a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfDocumentProvider.java
+++ b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfDocumentProvider.java
@@ -18,7 +18,6 @@ import org.eclipse.ui.editors.text.TextFileDocumentProvider;
public class AutoconfDocumentProvider extends TextFileDocumentProvider {
- @SuppressWarnings("unchecked")
public void shutdown() {
Iterator e= getConnectedElementsIterator();
while (e.hasNext())
diff --git a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfEditor.java b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfEditor.java
index a65cb24ee1..4aec90a4e7 100644
--- a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfEditor.java
+++ b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfEditor.java
@@ -28,7 +28,6 @@ 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;
@@ -42,7 +41,6 @@ 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;
@@ -120,32 +118,6 @@ public class AutoconfEditor extends TextEditor implements IAutotoolsEditor, IPro
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());
@@ -213,7 +185,7 @@ public class AutoconfEditor extends TextEditor implements IAutotoolsEditor, IPro
}
}
- @SuppressWarnings("unchecked")
+ @SuppressWarnings({ "unchecked" })
public Object getAdapter(Class required) {
if (ProjectionAnnotationModel.class.equals(required)) {
if (fProjectionSupport != null) {
@@ -733,7 +705,7 @@ public class AutoconfEditor extends TextEditor implements IAutotoolsEditor, IPro
}
protected ISourceViewer createSourceViewer(Composite parent, IVerticalRuler ruler, int styles) {
- ISourceViewer viewer = new AdaptedSourceViewer(parent, ruler, getOverviewRuler(), isOverviewRulerVisible(), styles);
+ ISourceViewer viewer = new ProjectionViewer(parent, ruler, getOverviewRuler(), isOverviewRulerVisible(), styles);
// ensure decoration support has been created and configured.
getSourceViewerDecorationSupport(viewer);
diff --git a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfErrorHandler.java b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfErrorHandler.java
index 14ea7f8d97..f3cf1d4221 100644
--- a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfErrorHandler.java
+++ b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/AutoconfErrorHandler.java
@@ -10,183 +10,72 @@
*******************************************************************************/
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.core.runtime.AssertionFailedException;
import org.eclipse.jface.text.Position;
+import org.eclipse.jface.text.quickassist.IQuickFixableAnnotation;
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$
+ public static final String CDT_ANNOTATION_INFO = "org.eclipse.cdt.ui.info"; //$NON-NLS-1$
+ public static final String CDT_ANNOTATION_WARNING = "org.eclipse.cdt.ui.warning"; //$NON-NLS-1$
+ public static final String CDT_ANNOTATION_ERROR = "org.eclipse.cdt.ui.error"; //$NON-NLS-1$
- private Map<Position, MarkerAnnotation> annotations = new HashMap<Position, MarkerAnnotation>();
+ private int CDT_WARNING = 1;
+ private int CDT_ERROR = 2;
+
+ private Map<Position, Annotation> annotations = new HashMap<Position, Annotation>();
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
-
+ // TODO: no quickfixes yet implemented, but maybe in the future
+ private class AutoconfAnnotation extends Annotation implements IQuickFixableAnnotation {
+ public AutoconfAnnotation(String annotationType, boolean persist, String message) {
+ super(annotationType, persist, message);
}
- public boolean equals(Object obj) {
- // TODO Auto-generated method stub
- return super.equals(obj);
+
+ public void setQuickFixable(boolean state) {
+ // do nothing
}
- public boolean exists() {
- // TODO Auto-generated method stub
+
+ public boolean isQuickFixableStateSet() {
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;
+
+ public boolean isQuickFixable() throws AssertionFailedException {
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;
+ String annotationType = CDT_ANNOTATION_INFO;
+ if (e.getSeverity() == CDT_ERROR)
+ annotationType = CDT_ANNOTATION_ERROR;
+ else if (e.getSeverity() == CDT_WARNING)
+ annotationType = CDT_ANNOTATION_WARNING;
+ Annotation annotation = new AutoconfAnnotation(annotationType, true, e.getLocalizedMessage());
+ Position p = new Position(charStart.intValue(),charEnd.intValue() - charStart.intValue());
+ fAnnotationModel.addAnnotation(annotation, p);
+ annotations.put(p, annotation);
}
public void removeAllExistingMarkers()
@@ -195,9 +84,9 @@ public class AutoconfErrorHandler implements IAutoconfErrorHandler {
annotations.clear();
}
- @SuppressWarnings("unchecked")
public void removeExistingMarkers(int offset, int length)
{
+ @SuppressWarnings("unchecked")
Iterator i = fAnnotationModel.getAnnotationIterator();
while (i.hasNext()) {
Annotation annotation = (Annotation)i.next();
diff --git a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/outline/AutoconfContentOutlinePage.java b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/outline/AutoconfContentOutlinePage.java
index 1b1d79268b..a11fc8cd59 100644
--- a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/outline/AutoconfContentOutlinePage.java
+++ b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/cdt/autotools/ui/editors/outline/AutoconfContentOutlinePage.java
@@ -42,7 +42,6 @@ public class AutoconfContentOutlinePage extends ContentOutlinePage {
update();
}
- @SuppressWarnings("unchecked")
protected ISelection updateSelection(ISelection sel) {
ArrayList<AutoconfElement> newSelection= new ArrayList<AutoconfElement>();
if (sel instanceof IStructuredSelection) {
diff --git a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/HTMLTextPresenter.java b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/HTMLTextPresenter.java
index 233112ba1d..8c87ee1e6d 100644
--- a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/HTMLTextPresenter.java
+++ b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/HTMLTextPresenter.java
@@ -45,13 +45,13 @@ public class HTMLTextPresenter implements DefaultInformationControl.IInformation
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);
+ @SuppressWarnings("unchecked")
Iterator e= presentation.getAllStyleRangeIterator();
while (e.hasNext()) {
diff --git a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/MessageLine.java b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/MessageLine.java
index f909063de9..a5e27d0940 100644
--- a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/MessageLine.java
+++ b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/MessageLine.java
@@ -22,13 +22,15 @@ import org.eclipse.swt.widgets.Composite;
* Setting an error message hides a currently displayed message until
* <code>clearErrorMessage</code> is called.
*/
-public class MessageLine extends CLabel {
+public class MessageLine {
private String fMessage;
private Color fNormalMsgAreaBackground;
private boolean hasErrorMessage;
+
+ private CLabel clabel;
/**
* Creates a new message line as a child of the given parent.
@@ -41,8 +43,8 @@ public class MessageLine extends CLabel {
* 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();
+ clabel = new CLabel(parent, style);
+ fNormalMsgAreaBackground= clabel.getBackground();
}
@@ -53,20 +55,20 @@ public class MessageLine extends CLabel {
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()));
+ clabel.setText(message);
+ clabel.setImage(MakeUIImages.getImage(MakeUIImages.IMG_OBJS_ERROR));
+ clabel.setBackground(JFaceColors.getErrorBackground(clabel.getDisplay()));
return;
}
hasErrorMessage = false;
- setText(fMessage);
- setImage(null);
- setBackground(fNormalMsgAreaBackground);
+ clabel.setText(fMessage);
+ clabel.setImage(null);
+ clabel.setBackground(fNormalMsgAreaBackground);
}
public void setMessage(String message) {
fMessage = message;
- setText(message);
+ clabel.setText(message);
}
public boolean hasErrorMessage() {
diff --git a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeLibtoolizeAction.java b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeLibtoolizeAction.java
index 02ec65d21d..43435290a9 100644
--- a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeLibtoolizeAction.java
+++ b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeLibtoolizeAction.java
@@ -57,7 +57,7 @@ public class InvokeLibtoolizeAction extends InvokeAction {
String libtoolizeCommand = null;
IProject project = getSelectedContainer().getProject();
try {
- libtoolizeCommand = project.getPersistentProperty(AutotoolsPropertyConstants.AUTOHEADER_TOOL);
+ libtoolizeCommand = project.getPersistentProperty(AutotoolsPropertyConstants.LIBTOOLIZE_TOOL);
} catch (CoreException e) {
// do nothing
}
diff --git a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/autoconf/ProjectionFileUpdater.java b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/autoconf/ProjectionFileUpdater.java
index 0d5555299c..9e0ac80625 100644
--- a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/autoconf/ProjectionFileUpdater.java
+++ b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/autoconf/ProjectionFileUpdater.java
@@ -402,9 +402,9 @@ public class ProjectionFileUpdater implements IProjectionListener {
changes.addAll(newChanges);
}
- @SuppressWarnings("unchecked")
private Map<AutoconfElement, List<AutoconfProjectionAnnotation>> createAnnotationMap(IAnnotationModel model) {
Map<AutoconfElement, List<AutoconfProjectionAnnotation>> map= new HashMap<AutoconfElement, List<AutoconfProjectionAnnotation>>();
+ @SuppressWarnings("unchecked")
Iterator e= model.getAnnotationIterator();
while (e.hasNext()) {
Object annotation= e.next();
diff --git a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AddBuildTargetAction.java b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AddBuildTargetAction.java
deleted file mode 100644
index 1a738bf26e..0000000000
--- a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AddBuildTargetAction.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*******************************************************************************
- * 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.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/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeDocumentProvider.java b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeDocumentProvider.java
index 6bf93db123..2955315ee1 100644
--- a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeDocumentProvider.java
+++ b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeDocumentProvider.java
@@ -95,8 +95,8 @@ public class AutomakeDocumentProvider extends TextFileDocumentProvider implement
/*
* @see org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake.IMakefileDocumentProvider#shutdown()
*/
- @SuppressWarnings("unchecked")
public void shutdown() {
+ @SuppressWarnings("unchecked")
Iterator e= getConnectedElementsIterator();
while (e.hasNext())
disconnect(e.next());
diff --git a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeEditor.java b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeEditor.java
index a277744a16..45e587c7fb 100644
--- a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeEditor.java
+++ b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeEditor.java
@@ -101,8 +101,7 @@ public class AutomakeEditor extends MakefileEditor {
/* (non-Javadoc)
* Method declared on IAdaptable
*/
- @SuppressWarnings("unchecked")
- public Object getAdapter(Class key) {
+ public Object getAdapter(@SuppressWarnings("unchecked") Class key) {
if (key.equals(IContentOutlinePage.class)) {
return getAutomakeOutlinePage();
}
diff --git a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeErrorHandler.java b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeErrorHandler.java
index 7186033545..080781299e 100644
--- a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeErrorHandler.java
+++ b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/AutomakeErrorHandler.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009 Red Hat Inc..
+ * Copyright (c) 2009, 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
@@ -10,21 +10,15 @@
*******************************************************************************/
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.core.resources.IMarker;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.AssertionFailedException;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.Position;
+import org.eclipse.jface.text.quickassist.IQuickFixableAnnotation;
+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.ui.IEditorInput;
-import org.eclipse.ui.texteditor.MarkerAnnotation;
-import org.eclipse.ui.texteditor.MarkerUtilities;
public class AutomakeErrorHandler {
@@ -34,125 +28,37 @@ public class AutomakeErrorHandler {
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);
- }
+ public static final String CDT_ANNOTATION_INFO = "org.eclipse.cdt.ui.info";
+ public static final String CDT_ANNOTATION_WARNING = "org.eclipse.cdt.ui.warning";
+ public static final String CDT_ANNOTATION_ERROR = "org.eclipse.cdt.ui.error";
- 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
-
+ // TODO: no quickfixes yet implemented, but maybe in the future
+ private class AutomakeAnnotation extends Annotation implements IQuickFixableAnnotation {
+ public AutomakeAnnotation(String annotationType, boolean persist, String message) {
+ super(annotationType, persist, message);
}
- public boolean equals(Object obj) {
- // TODO Auto-generated method stub
- return super.equals(obj);
+
+ public void setQuickFixable(boolean state) {
+ // do nothing
}
- public boolean exists() {
- // TODO Auto-generated method stub
+
+ public boolean isQuickFixableStateSet() {
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;
+
+ public boolean isQuickFixable() throws AssertionFailedException {
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 AutomakeErrorHandler(IDocument document) {
+ this.document = document;
+ IEditorInput input = AutomakeEditor.getDefault().getEditorInput();
+ this.fAnnotationModel = (AnnotationModel)AutomakeEditorFactory.getDefault().getAutomakefileDocumentProvider().getAnnotationModel(input);
}
+
public void update(IMakefile makefile) {
removeExistingMarkers();
@@ -167,39 +73,14 @@ public class AutomakeErrorHandler {
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);
- }
+ Integer charEnd = new Integer(getCharOffset(directive.getEndLine() - 1, -1).intValue());
- // 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
- }
+ String annotationType = CDT_ANNOTATION_ERROR;
+ Annotation annotation = new AutomakeAnnotation(annotationType, true, "Bad directive"); //$NON-NLS-1$
+ Position p = new Position(charStart.intValue(),charEnd.intValue() - charStart.intValue());
+ fAnnotationModel.addAnnotation(annotation, p);
}
}
return;
@@ -215,7 +96,9 @@ public class AutomakeErrorHandler {
{
try
{
- return new Integer(document.getLineOffset(lineNumber) + columnNumber);
+ if (columnNumber >= 0)
+ return new Integer(document.getLineOffset(lineNumber) + columnNumber);
+ return new Integer(document.getLineOffset(lineNumber) + document.getLineLength(lineNumber));
}
catch (BadLocationException e)
{
diff --git a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ExternalEditorInput.java b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ExternalEditorInput.java
index a7087de46c..b92e3ff55f 100644
--- a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ExternalEditorInput.java
+++ b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ExternalEditorInput.java
@@ -63,7 +63,7 @@ public class ExternalEditorInput implements ITranslationUnitEditorInput, IPersis
/*
* @see IAdaptable#getAdapter(Class)
*/
- @SuppressWarnings("unchecked")
+ @SuppressWarnings({ "unchecked" })
public Object getAdapter(Class adapter) {
if (ILocationProvider.class.equals(adapter)) {
return this;
diff --git a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakeFileMessages.properties b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakeFileMessages.properties
index ae76283204..b61ee7c8e2 100644
--- a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakeFileMessages.properties
+++ b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakeFileMessages.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2003, 2006, 2007 QNX Software Systems and others.
+# Copyright (c) 2003, 2006, 2007, 2010 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
@@ -9,7 +9,6 @@
# 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
@@ -24,4 +23,5 @@ MakefileValidator.error.unknownDirective=unknow directive
MakefileValidator.error.noMatchingEndifForCondition=No matching endif for condition
MakefileValidator.error.noMatchingEndefForOverrideDefine=No matching endef for [override] define
+MakefileErrorMessage=Invalid directive
EditorUtility.concatModifierStrings= {0} + {1} \ No newline at end of file
diff --git a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileAnnotationHover.java b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileAnnotationHover.java
index 633fc85621..c2db3f3c12 100644
--- a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileAnnotationHover.java
+++ b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileAnnotationHover.java
@@ -12,11 +12,26 @@
package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.DefaultInformationControl;
import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.IInformationControl;
+import org.eclipse.jface.text.IInformationControlCreator;
+import org.eclipse.jface.text.Position;
+import org.eclipse.jface.text.source.Annotation;
import org.eclipse.jface.text.source.IAnnotationHover;
+import org.eclipse.jface.text.source.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.cdt.autotools.ui.editors.AutoconfEditorMessages;
+import org.eclipse.linuxtools.internal.cdt.autotools.ui.HTMLPrinter;
+import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IEditorPart;
@@ -24,8 +39,9 @@ import org.eclipse.ui.IEditorPart;
* MakefileAnnotationHover
*
*/
-public class MakefileAnnotationHover implements IAnnotationHover {
+public class MakefileAnnotationHover implements IAnnotationHover, IAnnotationHoverExtension {
+ @SuppressWarnings("unused")
private IEditorPart fEditor;
/**
@@ -35,37 +51,157 @@ public class MakefileAnnotationHover implements IAnnotationHover {
fEditor = editor;
}
+ /**
+ * 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<Annotation> select(List<Annotation> exactMatch, List<Annotation> including) {
+ return exactMatch;
+ }
+
+ /**
+ * Returns one marker which includes the ruler's line of activity.
+ */
+ protected List<Annotation> getAnnotationsForLine(ISourceViewer viewer, int line) {
+
+ IDocument document= viewer.getDocument();
+ IAnnotationModel model= viewer.getAnnotationModel();
+
+ if (model == null)
+ return null;
+
+ List<Annotation> exact= new ArrayList<Annotation>();
+ List<Annotation> including= new ArrayList<Annotation>();
+
+ @SuppressWarnings("unchecked")
+ Iterator e= model.getAnnotationIterator();
+ while (e.hasNext()) {
+ Object o= e.next();
+ if (o instanceof Annotation) {
+ Annotation a= (Annotation) o;
+ switch (compareRulerLine(model.getPosition(a), document, line)) {
+ case 1:
+ exact.add(a);
+ break;
+ case 2:
+ including.add(a);
+ break;
+ }
+ }
+ }
+
+ return select(exact, including);
+ }
+
/*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.source.IAnnotationHover#getHoverInfo(org.eclipse.jface.text.source.ISourceViewer,
- * int)
+ * @see IVerticalRulerHover#getHoverInfo(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$
+ List<Annotation> annotations = getAnnotationsForLine(sourceViewer, lineNumber);
+ if (annotations != null && annotations.size() > 0) {
+
+ if (annotations.size() == 1) {
+
+ // optimization
+ Annotation annotation = (Annotation) annotations.get(0);
+ String message= annotation.getText();
+ if (message != null && message.trim().length() > 0)
+ return formatSingleMessage(message);
+
+ } else {
+
+ List<String> messages= new ArrayList<String>();
+
+ Iterator<Annotation> e= annotations.iterator();
+ while (e.hasNext()) {
+ Annotation annotation = (Annotation) e.next();
+ String message= annotation.getText();
+ 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);
}
- 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;
}
+ /*
+ * 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/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileContentOutlinePage.java b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileContentOutlinePage.java
index a61a9ec292..ef6b1be816 100644
--- a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileContentOutlinePage.java
+++ b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileContentOutlinePage.java
@@ -14,7 +14,6 @@ package org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake;
import java.util.ArrayList;
import java.util.List;
-
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IToolBarManager;
@@ -208,13 +207,11 @@ public class MakefileContentOutlinePage extends ContentOutlinePage implements IC
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);
}
@@ -266,9 +263,6 @@ public class MakefileContentOutlinePage extends ContentOutlinePage implements IC
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$
}
diff --git a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileDocumentProvider.java b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileDocumentProvider.java
index 6a3aa98281..d319488bac 100644
--- a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileDocumentProvider.java
+++ b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileDocumentProvider.java
@@ -16,6 +16,7 @@ import java.util.Iterator;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.text.source.AnnotationModel;
import org.eclipse.jface.text.source.IAnnotationModel;
import org.eclipse.ui.IFileEditorInput;
import org.eclipse.ui.editors.text.ForwardingDocumentProvider;
@@ -26,12 +27,12 @@ public class MakefileDocumentProvider extends TextFileDocumentProvider implement
IMakefile fMakefile;
- protected class MakefileAnnotationModel extends ResourceMarkerAnnotationModel /*implements IProblemRequestor */{
+ protected class MakefileAnnotationModel extends AnnotationModel /*implements IProblemRequestor */{
/**
* @param resource
*/
public MakefileAnnotationModel(IResource resource) {
- super(resource);
+ super();
}
/**
@@ -135,8 +136,8 @@ public class MakefileDocumentProvider extends TextFileDocumentProvider implement
/*
* @see org.eclipse.linuxtools.internal.cdt.autotools.ui.editors.automake.MakefileDocumentProvider#shutdown()
*/
- @SuppressWarnings("unchecked")
public void shutdown() {
+ @SuppressWarnings("unchecked")
Iterator e= getConnectedElementsIterator();
while (e.hasNext())
disconnect(e.next());
diff --git a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileEditor.java b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileEditor.java
index 09bf10ec52..7082903759 100644
--- a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileEditor.java
+++ b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileEditor.java
@@ -24,9 +24,7 @@ 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;
@@ -70,32 +68,6 @@ public class MakefileEditor extends TextEditor implements ISelectionChangedListe
*/
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();
@@ -183,7 +155,7 @@ public class MakefileEditor extends TextEditor implements ISelectionChangedListe
}
protected ISourceViewer createSourceViewer(Composite parent, IVerticalRuler ruler, int styles) {
- ISourceViewer viewer = new AdaptedSourceViewer(parent, ruler, getOverviewRuler(), isOverviewRulerVisible(), styles);
+ ISourceViewer viewer = new ProjectionViewer(parent, ruler, getOverviewRuler(), isOverviewRulerVisible(), styles);
// ensure decoration support has been created and configured.
getSourceViewerDecorationSupport(viewer);
@@ -194,8 +166,7 @@ public class MakefileEditor extends TextEditor implements ISelectionChangedListe
/* (non-Javadoc)
* Method declared on IAdaptable
*/
- @SuppressWarnings("unchecked")
- public Object getAdapter(Class key) {
+ public Object getAdapter(@SuppressWarnings("unchecked") Class key) {
if (ProjectionAnnotationModel.class.equals(key)) {
if (projectionSupport != null) {
Object result = projectionSupport.getAdapter(getSourceViewer(), key);
diff --git a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileMessages.java b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileMessages.java
index c8decc48e4..c7581627a2 100644
--- a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileMessages.java
+++ b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MakefileMessages.java
@@ -24,6 +24,10 @@ public class MakefileMessages {
private MakefileMessages() {
}
+ public static ResourceBundle getResourceBundle() {
+ return RESOURCE_BUNDLE;
+ }
+
/**
* Returns the string from the plugin's resource bundle,
* or 'key' if not found.
diff --git a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MessageLine.java b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MessageLine.java
index 367c9ed9f5..91d75d3291 100644
--- a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MessageLine.java
+++ b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/MessageLine.java
@@ -17,6 +17,7 @@ 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.layout.GridData;
import org.eclipse.swt.widgets.Composite;
/**
@@ -24,10 +25,11 @@ import org.eclipse.swt.widgets.Composite;
* Setting an error message hides a currently displayed message until
* <code>clearErrorMessage</code> is called.
*/
-public class MessageLine extends CLabel {
+public class MessageLine {
private String fMessageText;
private String fErrorText;
+ private CLabel clabel;
private Color fDefaultColor;
private RGB fErrorRGB;
@@ -67,8 +69,8 @@ public class MessageLine extends CLabel {
* Error message will be shown with in the given rgb color.
*/
public MessageLine(Composite parent, int style, RGB errorRGB) {
- super(parent, style);
- fDefaultColor= getForeground();
+ clabel = new CLabel(parent, style);
+ fDefaultColor= clabel.getForeground();
fErrorRGB= errorRGB;
}
/**
@@ -76,8 +78,8 @@ public class MessageLine extends CLabel {
* Error message will be shown with in the rgb color 200,0,0.
*/
public MessageLine(Composite parent, int style) {
- super(parent, style);
- fDefaultColor= getForeground();
+ clabel = new CLabel(parent, style);
+ fDefaultColor= clabel.getForeground();
fErrorRGB= fgErrorRGB;
}
/**
@@ -105,15 +107,15 @@ public class MessageLine extends CLabel {
setMessage(fMessageText);
} else {
if (fErrorColor == null) {
- fErrorColor= new Color(getDisplay(), fErrorRGB);
- addDisposeListener(new DisposeListener() {
+ fErrorColor= new Color(clabel.getDisplay(), fErrorRGB);
+ clabel.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent e) {
fErrorColor.dispose();
}
});
}
- setForeground(fErrorColor);
- setText(message);
+ clabel.setForeground(fErrorColor);
+ clabel.setText(message);
}
}
/**
@@ -125,8 +127,30 @@ public class MessageLine extends CLabel {
if (message == null)
message= ""; //$NON-NLS-1$
if (fErrorText == null) {
- setForeground(fDefaultColor);
- setText(message);
+ clabel.setForeground(fDefaultColor);
+ clabel.setText(message);
}
}
+
+ /**
+ * @see org.eclipse.swt.custom.CLabel#isDisposed()
+ */
+ public boolean isDisposed() {
+ return clabel.isDisposed();
+ }
+
+ /**
+ * @see org.eclipse.swt.custom.CLabel#setAlignment(int)
+ */
+ public void setAlignment(int left) {
+ clabel.setAlignment(left);
+ }
+
+ /**
+ * @see org.eclipse.swt.widgets.Control#setLayoutData(Object)
+ */
+ public void setLayoutData(GridData gridData) {
+ clabel.setLayoutData(gridData);
+ }
+
}
diff --git a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/OpenIncludeAction.java b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/OpenIncludeAction.java
index eabaa06b9d..e1155b9bc3 100644
--- a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/OpenIncludeAction.java
+++ b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/OpenIncludeAction.java
@@ -275,9 +275,9 @@ public class OpenIncludeAction extends Action {
}
- @SuppressWarnings("unchecked")
private static IInclude getIncludeStatement(ISelection sel) {
if (!sel.isEmpty() && sel instanceof IStructuredSelection) {
+ @SuppressWarnings("unchecked")
List list= ((IStructuredSelection)sel).toList();
if (list.size() == 1) {
Object element= list.get(0);
diff --git a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ProjectionMakefileUpdater.java b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ProjectionMakefileUpdater.java
index 3cba77cdea..e9824106a9 100644
--- a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ProjectionMakefileUpdater.java
+++ b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/ProjectionMakefileUpdater.java
@@ -132,7 +132,6 @@ public class ProjectionMakefileUpdater implements IProjectionListener {
}
}
- @SuppressWarnings("unchecked")
public void initialize() {
if (!isInstalled())
@@ -152,6 +151,7 @@ public class ProjectionMakefileUpdater implements IProjectionListener {
if (fInput != null) {
ProjectionAnnotationModel model= (ProjectionAnnotationModel) fEditor.getAdapter(ProjectionAnnotationModel.class);
if (model != null) {
+ @SuppressWarnings("unchecked")
Map additions= computeAdditions((IParent) fInput);
model.removeAllAnnotations();
model.replaceAnnotations(null, additions);
@@ -369,9 +369,9 @@ public class ProjectionMakefileUpdater implements IProjectionListener {
changes.addAll(newChanges);
}
- @SuppressWarnings("unchecked")
private Map<IDirective, List<MakefileProjectionAnnotation>> createAnnotationMap(IAnnotationModel model) {
Map<IDirective, List<MakefileProjectionAnnotation>> map= new HashMap<IDirective, List<MakefileProjectionAnnotation>>();
+ @SuppressWarnings("unchecked")
Iterator e= model.getAnnotationIterator();
while (e.hasNext()) {
Object annotation= e.next();
diff --git a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/SelectionStatusDialog.java b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/SelectionStatusDialog.java
index f480531efa..c126786893 100644
--- a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/SelectionStatusDialog.java
+++ b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/editors/automake/SelectionStatusDialog.java
@@ -91,7 +91,7 @@ public abstract class SelectionStatusDialog extends SelectionDialog {
* if there isn't any initial selection.
* @return the first element of the initial selection.
*/
- @SuppressWarnings("unchecked")
+ @SuppressWarnings({ "unchecked" })
protected Object getPrimaryInitialSelection() {
List result= getInitialElementSelections();
if (result == null || result.size() == 0)
@@ -130,7 +130,7 @@ public abstract class SelectionStatusDialog extends SelectionDialog {
public void setImage(Image image) {
fImage= image;
}
- @SuppressWarnings("unchecked")
+ @SuppressWarnings({ "unchecked" })
protected void setInitialSelection(int position, Object element) {
List l= getInitialElementSelections();
l.set(position, element);
diff --git a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/AutotoolsBuildWizard.java b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/AutotoolsBuildWizard.java
index 920d80ba5b..4b8cd14e88 100644
--- a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/AutotoolsBuildWizard.java
+++ b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/AutotoolsBuildWizard.java
@@ -22,7 +22,6 @@ 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;
@@ -33,13 +32,13 @@ 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 OTHERS_LABEL = AutotoolsWizardMessages.getResourceString("AutotoolsBuildWizard.1"); //$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$
+ public static final String EMPTY_PROJECT = AutotoolsWizardMessages.getResourceString("AutotoolsBuildWizard.2"); //$NON-NLS-1$
/**
* Creates and returns an array of items to be displayed
*/
diff --git a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/AutotoolsWizardMessages.properties b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/AutotoolsWizardMessages.properties
index ca7ddaace6..00732afa9d 100644
--- a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/AutotoolsWizardMessages.properties
+++ b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/wizards/AutotoolsWizardMessages.properties
@@ -15,6 +15,8 @@ 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
+AutotoolsBuildWizard.1=Others
+AutotoolsBuildWizard.2=Empty Project
# ------- NewProjectCreationPluginPage-------
MngMakeProjectWizard.op_error=Managed Make Error

Back to the top