Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Evoy2004-06-25 18:20:46 +0000
committerSean Evoy2004-06-25 18:20:46 +0000
commitb2c2d72f23385909e7e6f7ff2d874dec6785cfcf (patch)
tree66ba79b57d8fb8840776d06d831cdeeb1086f59b /build/org.eclipse.cdt.managedbuilder.ui/src
parentb163fa15a6c8659b147831115d300dedadbf9611 (diff)
downloadorg.eclipse.cdt-b2c2d72f23385909e7e6f7ff2d874dec6785cfcf.tar.gz
org.eclipse.cdt-b2c2d72f23385909e7e6f7ff2d874dec6785cfcf.tar.xz
org.eclipse.cdt-b2c2d72f23385909e7e6f7ff2d874dec6785cfcf.zip
I am removing the logging feature from the plugin, and will replace it latter with proper console debugging messages. There wwere a raft of tester bugs that I caused by using the log to report non-critical exceptions I was handling.
Diffstat (limited to 'build/org.eclipse.cdt.managedbuilder.ui/src')
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderUIPlugin.java42
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/actions/UpdateManagedProjectAction.java38
2 files changed, 20 insertions, 60 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderUIPlugin.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderUIPlugin.java
index 9b32e9765d..6f6225272e 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderUIPlugin.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderUIPlugin.java
@@ -19,7 +19,6 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.plugin.AbstractUIPlugin;
@@ -115,47 +114,6 @@ public class ManagedBuilderUIPlugin extends AbstractUIPlugin {
}
/**
- * Convenience method to log an exception without displaying a
- * message dialog
- * @param e
- */
- public static void logException(Throwable e) {
- logException(e, null, null);
- }
-
- /**
- * @param exception
- * @param string
- * @param string2
- */
- public static void logException(Throwable exception, final String title, String message) {
- if (exception instanceof InvocationTargetException) {
- exception = ((InvocationTargetException) exception).getTargetException();
- }
- IStatus status = null;
- if (exception instanceof CoreException)
- status = ((CoreException) exception).getStatus();
- else {
- if (message == null)
- message = exception.getMessage();
- if (message == null)
- message = exception.toString();
- status = new Status(IStatus.ERROR, getUniqueIdentifier(), IStatus.OK, message, exception);
- }
- ResourcesPlugin.getPlugin().getLog().log(status);
- Display display;
- display = Display.getCurrent();
- if (display == null)
- display = Display.getDefault();
- final IStatus fstatus = status;
- display.asyncExec(new Runnable() {
- public void run() {
- ErrorDialog.openError(null, title, null, fstatus);
- }
- });
- }
-
- /**
* Answers the <code>Shell</code> associated with the active workbench, or
* one of the windows associated with the workbench.
* @return
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/actions/UpdateManagedProjectAction.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/actions/UpdateManagedProjectAction.java
index e9a0bdea0d..35b568bf14 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/actions/UpdateManagedProjectAction.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/ui/actions/UpdateManagedProjectAction.java
@@ -22,6 +22,7 @@ import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.FactoryConfigurationError;
import javax.xml.parsers.ParserConfigurationException;
+import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.managedbuilder.core.BuildException;
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
@@ -373,7 +374,7 @@ public class UpdateManagedProjectAction implements IWorkbenchWindowActionDelegat
convertConfiguration(newTarget, newParent, (Element) configNodes.item(configIndex), monitor);
}
} catch (BuildException e) {
- ManagedBuilderUIPlugin.logException(e);
+ // Probably just a mismatch between option value and option
}
monitor.worked(1);
@@ -500,20 +501,23 @@ public class UpdateManagedProjectAction implements IWorkbenchWindowActionDelegat
IProject[] projects = ManagedBuilderUIPlugin.getWorkspace().getRoot().getProjects();
Vector result = new Vector();
for (int index = projects.length - 1; index >=0 ; --index) {
- IProjectDescription description;
- try {
- description = projects[index].getDescription();
- } catch (CoreException e) {
- continue;
- }
- // Make sure it has a managed nature
- if (description == null || !description.hasNature(ManagedCProjectNature.MNG_NATURE_ID)) {
- continue;
- }
- IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(projects[index]);
- if (info != null && info.getVersion()== null) {
- // This is a pre-2.0 file (no version info)
- result.add(projects[index]);
+ if (projects[index].isAccessible()) {
+ IProjectDescription description;
+ try {
+ description = projects[index].getDescription();
+ } catch (CoreException e) {
+ // This can only mean that something really bad has happened
+ continue;
+ }
+ // Make sure it has a managed nature
+ if (description == null || !description.hasNature(ManagedCProjectNature.MNG_NATURE_ID)) {
+ continue;
+ }
+ IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(projects[index]);
+ if (info != null && info.getVersion()== null) {
+ // This is a pre-2.0 file (no version info)
+ result.add(projects[index]);
+ }
}
}
@@ -562,9 +566,7 @@ public class UpdateManagedProjectAction implements IWorkbenchWindowActionDelegat
} catch (InterruptedException e) {
return;
} catch (InvocationTargetException e) {
- ManagedBuilderUIPlugin.logException(e,
- ManagedBuilderUIMessages.getResourceString("ManagedBuilderStartup.update.exception.error"), //$NON-NLS-1$
- ManagedBuilderUIMessages.getFormattedString("ManagedBuilderStartup.update.exception.message", project.getName())); //$NON-NLS-1$
+ CCorePlugin.log(e); //$NON-NLS-1$
}
}

Back to the top