[ooo-build-commit] ooeclipse: Branch 'master'
Dan Corneanu
cdan at kemper.freedesktop.org
Sun Dec 5 12:05:10 PST 2010
core/source/org/openoffice/ide/eclipse/core/launch/office/OfficeLaunchDelegate.java | 2
core/source/org/openoffice/ide/eclipse/core/launch/office/PackageConfigTab.java | 32 +++++-----
core/source/org/openoffice/ide/eclipse/core/launch/office/messages.properties | 4 -
3 files changed, 23 insertions(+), 15 deletions(-)
New commits:
commit b115ae71140de67c63b6d2ad194118e7804c6070
Author: Dan Corneanu <cdan at savatech.ro>
Date: Sun Dec 5 21:58:07 2010 +0200
Proper error logging. Adde some checks for null values to avoid some NullPointerExceptions and StringIndexOutOfBoundsException.
diff --git a/core/source/org/openoffice/ide/eclipse/core/launch/office/OfficeLaunchDelegate.java b/core/source/org/openoffice/ide/eclipse/core/launch/office/OfficeLaunchDelegate.java
index bf48a92..45b3306 100644
--- a/core/source/org/openoffice/ide/eclipse/core/launch/office/OfficeLaunchDelegate.java
+++ b/core/source/org/openoffice/ide/eclipse/core/launch/office/OfficeLaunchDelegate.java
@@ -46,6 +46,7 @@ import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.debug.core.model.LaunchConfigurationDelegate;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.widgets.Display;
+import org.openoffice.ide.eclipse.core.PluginLogger;
import org.openoffice.ide.eclipse.core.gui.PackageContentSelector;
import org.openoffice.ide.eclipse.core.model.IUnoidlProject;
import org.openoffice.ide.eclipse.core.model.ProjectsManager;
@@ -114,6 +115,7 @@ public class OfficeLaunchDelegate extends LaunchConfigurationDelegate {
}
pMonitor.worked(1);
} catch (Exception e) {
+ PluginLogger.error(Messages.OfficeLaunchDelegate_LaunchError, e);
Display.getDefault().asyncExec(new Runnable() {
public void run() {
diff --git a/core/source/org/openoffice/ide/eclipse/core/launch/office/PackageConfigTab.java b/core/source/org/openoffice/ide/eclipse/core/launch/office/PackageConfigTab.java
index a27d535..affe3c8 100644
--- a/core/source/org/openoffice/ide/eclipse/core/launch/office/PackageConfigTab.java
+++ b/core/source/org/openoffice/ide/eclipse/core/launch/office/PackageConfigTab.java
@@ -49,6 +49,7 @@ import org.openoffice.ide.eclipse.core.OOEclipsePlugin;
import org.openoffice.ide.eclipse.core.PluginLogger;
import org.openoffice.ide.eclipse.core.gui.PackageContentSelector;
import org.openoffice.ide.eclipse.core.i18n.ImagesConstants;
+import org.openoffice.ide.eclipse.core.model.IUnoidlProject;
import org.openoffice.ide.eclipse.core.model.ProjectsManager;
/**
@@ -78,15 +79,16 @@ public class PackageConfigTab extends AbstractLaunchConfigurationTab {
IProject prj = ResourcesPlugin.getWorkspace().getRoot().getProject( prjName );
String paths = pConfiguration.getAttribute( IOfficeLaunchConstants.CONTENT_PATHS, new String() );
- String[] pathsItems = paths.split( IOfficeLaunchConstants.PATHS_SEPARATOR );
-
- for (String path : pathsItems) {
- IResource res = prj.findMember( path );
- if ( res != null ) {
- selected.add( res );
+ if(!paths.isEmpty()) {
+ String[] pathsItems = paths.split( IOfficeLaunchConstants.PATHS_SEPARATOR );
+
+ for (String path : pathsItems) {
+ IResource res = prj.findMember( path );
+ if ( res != null ) {
+ selected.add( res );
+ }
}
}
-
return selected;
}
@@ -125,13 +127,17 @@ public class PackageConfigTab extends AbstractLaunchConfigurationTab {
public void initializeFrom(ILaunchConfiguration pConfiguration) {
try {
String prjName = pConfiguration.getAttribute( IOfficeLaunchConstants.PROJECT_NAME, new String() );
- mContentSelector.setProject( ProjectsManager.getProject( prjName ) );
+ IUnoidlProject project = ProjectsManager.getProject( prjName );
- List<IResource> selected = getResources( pConfiguration );
- if ( selected.isEmpty() ) {
- mContentSelector.loadDefaults();
- } else {
- mContentSelector.setSelected( selected );
+ if(null != project) {
+ mContentSelector.setProject( project );
+
+ List<IResource> selected = getResources( pConfiguration );
+ if ( selected.isEmpty() ) {
+ mContentSelector.loadDefaults();
+ } else {
+ mContentSelector.setSelected( selected );
+ }
}
} catch (CoreException e) {
PluginLogger.error(Messages.OfficeTab_Configurationerror, e);
diff --git a/core/source/org/openoffice/ide/eclipse/core/launch/office/messages.properties b/core/source/org/openoffice/ide/eclipse/core/launch/office/messages.properties
index c455461..f7cf788 100644
--- a/core/source/org/openoffice/ide/eclipse/core/launch/office/messages.properties
+++ b/core/source/org/openoffice/ide/eclipse/core/launch/office/messages.properties
@@ -1,5 +1,5 @@
-OfficeLaunchDelegate_LaunchError=Error Message
-OfficeLaunchDelegate_LaunchErrorTitle=Error Title
+OfficeLaunchDelegate_LaunchError=Error launching configuration.
+OfficeLaunchDelegate_LaunchErrorTitle=Launch Error
OfficeTab_Configurationerror=Configuration Error
OfficeTab_ProjectNameLabel=Project
OfficeTab_Title=LibreOffice
More information about the ooo-build-commit
mailing list