[ooo-build-commit] ooeclipse: Branch 'master'
Cédric Bosdonnat
cbosdo at kemper.freedesktop.org
Sat Sep 5 10:33:09 PDT 2009
core/META-INF/MANIFEST.MF | 15
core/source/org/openoffice/ide/eclipse/core/builders/TypesBuilder.java | 2
core/source/org/openoffice/ide/eclipse/core/gui/OOoTable.java | 6
core/source/org/openoffice/ide/eclipse/core/gui/SDKTable.java | 4
core/source/org/openoffice/ide/eclipse/core/gui/rows/AbstractConfigRow.java | 2
core/source/org/openoffice/ide/eclipse/core/gui/rows/OOoRow.java | 4
core/source/org/openoffice/ide/eclipse/core/gui/rows/SdkRow.java | 4
core/source/org/openoffice/ide/eclipse/core/internal/helpers/PropertiesManager.java | 6
core/source/org/openoffice/ide/eclipse/core/internal/helpers/UnoidlProjectHelper.java | 10
core/source/org/openoffice/ide/eclipse/core/internal/model/AbstractOOo.java | 4
core/source/org/openoffice/ide/eclipse/core/internal/model/OOo.java | 2
core/source/org/openoffice/ide/eclipse/core/internal/model/SDK.java | 14
core/source/org/openoffice/ide/eclipse/core/internal/model/URE.java | 2
core/source/org/openoffice/ide/eclipse/core/internal/model/UnoFactory.java | 6
core/source/org/openoffice/ide/eclipse/core/internal/model/UnoidlProject.java | 12
core/source/org/openoffice/ide/eclipse/core/internal/office/OfficeConnection.java | 2
core/source/org/openoffice/ide/eclipse/core/model/IUnoFactoryConstants.java | 4
core/source/org/openoffice/ide/eclipse/core/model/IUnoidlProject.java | 4
core/source/org/openoffice/ide/eclipse/core/model/OOoContainer.java | 6
core/source/org/openoffice/ide/eclipse/core/model/SDKContainer.java | 6
core/source/org/openoffice/ide/eclipse/core/model/config/IConfigListener.java | 73 +++
core/source/org/openoffice/ide/eclipse/core/model/config/IOOo.java | 169 ++++++++
core/source/org/openoffice/ide/eclipse/core/model/config/ISdk.java | 139 +++++++
core/source/org/openoffice/ide/eclipse/core/model/config/InvalidConfigException.java | 108 +++++
core/source/org/openoffice/ide/eclipse/core/model/language/ILanguageBuilder.java | 4
core/source/org/openoffice/ide/eclipse/core/model/language/IProjectHandler.java | 2
core/source/org/openoffice/ide/eclipse/core/office/OfficeClassLoader.java | 2
core/source/org/openoffice/ide/eclipse/core/office/OfficeHelper.java | 2
core/source/org/openoffice/ide/eclipse/core/office/TypesGetter.java | 2
core/source/org/openoffice/ide/eclipse/core/preferences/IConfigListener.java | 73 ---
core/source/org/openoffice/ide/eclipse/core/preferences/IOOo.java | 169 --------
core/source/org/openoffice/ide/eclipse/core/preferences/ISdk.java | 134 ------
core/source/org/openoffice/ide/eclipse/core/preferences/InvalidConfigException.java | 107 -----
core/source/org/openoffice/ide/eclipse/core/preferences/ProjectPropertiesPage.java | 2
core/source/org/openoffice/ide/eclipse/core/unittests/OOoTest.java | 2
core/source/org/openoffice/ide/eclipse/core/unotypebrowser/UnoTypeProvider.java | 2
core/source/org/openoffice/ide/eclipse/core/wizards/PackageExportWizard.java | 2
core/source/org/openoffice/ide/eclipse/core/wizards/ServiceWizardSet.java | 2
core/source/org/openoffice/ide/eclipse/core/wizards/pages/NewScopedElementWizardPage.java | 2
core/source/org/openoffice/ide/eclipse/core/wizards/pages/NewUnoProjectPage.java | 6
cpp/source/org/openoffice/ide/eclipse/cpp/CppBuilder.java | 34 -
cpp/source/org/openoffice/ide/eclipse/cpp/CppProjectHandler.java | 197 ++++++++--
java/source/org/openoffice/ide/eclipse/java/JavaBuilder.java | 4
java/source/org/openoffice/ide/eclipse/java/JavaProjectHandler.java | 2
java/source/org/openoffice/ide/eclipse/java/build/OOoClasspathContainer.java | 2
java/source/org/openoffice/ide/eclipse/java/build/OOoContainerPage.java | 2
java/source/org/openoffice/ide/eclipse/java/build/OooClasspathContainerInitializer.java | 2
47 files changed, 765 insertions(+), 595 deletions(-)
New commits:
commit 1863fd7c53f1d5608f70fb316f57ed03c99bcfe8
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date: Sat Sep 5 19:31:54 2009 +0200
C++ support enhancements & Core cleanup
Switched the created C++ project to a managed build one. The libraries
and includes are now set.
Moved the ISdk, IOOo and al classes to a more obvious package.
Moved the call of configureProject() as the first method called in the
language configuration.
diff --git a/core/META-INF/MANIFEST.MF b/core/META-INF/MANIFEST.MF
index a81a7bb..d772558 100755
--- a/core/META-INF/MANIFEST.MF
+++ b/core/META-INF/MANIFEST.MF
@@ -22,13 +22,26 @@ Require-Bundle: org.eclipse.core.runtime,
javax.xml;bundle-version="1.3.4"
Bundle-ActivationPolicy: lazy
Export-Package: org.openoffice.ide.eclipse.core,
+ org.openoffice.ide.eclipse.core.actions,
+ org.openoffice.ide.eclipse.core.builders,
+ org.openoffice.ide.eclipse.core.editors,
+ org.openoffice.ide.eclipse.core.editors.main,
+ org.openoffice.ide.eclipse.core.editors.syntax,
+ org.openoffice.ide.eclipse.core.gui,
org.openoffice.ide.eclipse.core.gui.rows,
org.openoffice.ide.eclipse.core.i18n,
org.openoffice.ide.eclipse.core.launch,
org.openoffice.ide.eclipse.core.model,
+ org.openoffice.ide.eclipse.core.model.config,
+ org.openoffice.ide.eclipse.core.model.description,
org.openoffice.ide.eclipse.core.model.language,
+ org.openoffice.ide.eclipse.core.office,
org.openoffice.ide.eclipse.core.preferences,
+ org.openoffice.ide.eclipse.core.unittests,
+ org.openoffice.ide.eclipse.core.unotypebrowser,
org.openoffice.ide.eclipse.core.utils,
- org.openoffice.ide.eclipse.core.wizards
+ org.openoffice.ide.eclipse.core.wizards,
+ org.openoffice.ide.eclipse.core.wizards.pages,
+ org.openoffice.ide.eclipse.core.wizards.utils
Bundle-Vendor: OpenOffice.org
Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/core/source/org/openoffice/ide/eclipse/core/builders/TypesBuilder.java b/core/source/org/openoffice/ide/eclipse/core/builders/TypesBuilder.java
index 1a00829..f1c7c7f 100644
--- a/core/source/org/openoffice/ide/eclipse/core/builders/TypesBuilder.java
+++ b/core/source/org/openoffice/ide/eclipse/core/builders/TypesBuilder.java
@@ -63,8 +63,8 @@ import org.openoffice.ide.eclipse.core.OOEclipsePlugin;
import org.openoffice.ide.eclipse.core.PluginLogger;
import org.openoffice.ide.eclipse.core.model.IUnoidlProject;
import org.openoffice.ide.eclipse.core.model.ProjectsManager;
+import org.openoffice.ide.eclipse.core.model.config.ISdk;
import org.openoffice.ide.eclipse.core.model.language.ILanguageBuilder;
-import org.openoffice.ide.eclipse.core.preferences.ISdk;
/**
* <p>Main builder of the UNO-IDL projects, it computes the language specific
diff --git a/core/source/org/openoffice/ide/eclipse/core/gui/OOoTable.java b/core/source/org/openoffice/ide/eclipse/core/gui/OOoTable.java
index ac1cb69..ff2c593 100644
--- a/core/source/org/openoffice/ide/eclipse/core/gui/OOoTable.java
+++ b/core/source/org/openoffice/ide/eclipse/core/gui/OOoTable.java
@@ -72,9 +72,9 @@ import org.openoffice.ide.eclipse.core.internal.model.AbstractOOo;
import org.openoffice.ide.eclipse.core.internal.model.OOo;
import org.openoffice.ide.eclipse.core.internal.model.URE;
import org.openoffice.ide.eclipse.core.model.OOoContainer;
-import org.openoffice.ide.eclipse.core.preferences.IConfigListener;
-import org.openoffice.ide.eclipse.core.preferences.IOOo;
-import org.openoffice.ide.eclipse.core.preferences.InvalidConfigException;
+import org.openoffice.ide.eclipse.core.model.config.IConfigListener;
+import org.openoffice.ide.eclipse.core.model.config.IOOo;
+import org.openoffice.ide.eclipse.core.model.config.InvalidConfigException;
/**
* This class creates the whole OOo table with it's viewer and content provider.
diff --git a/core/source/org/openoffice/ide/eclipse/core/gui/SDKTable.java b/core/source/org/openoffice/ide/eclipse/core/gui/SDKTable.java
index 78d9652..f86697c 100755
--- a/core/source/org/openoffice/ide/eclipse/core/gui/SDKTable.java
+++ b/core/source/org/openoffice/ide/eclipse/core/gui/SDKTable.java
@@ -70,8 +70,8 @@ import org.openoffice.ide.eclipse.core.gui.rows.TextRow;
import org.openoffice.ide.eclipse.core.i18n.ImagesConstants;
import org.openoffice.ide.eclipse.core.internal.model.SDK;
import org.openoffice.ide.eclipse.core.model.SDKContainer;
-import org.openoffice.ide.eclipse.core.preferences.IConfigListener;
-import org.openoffice.ide.eclipse.core.preferences.InvalidConfigException;
+import org.openoffice.ide.eclipse.core.model.config.IConfigListener;
+import org.openoffice.ide.eclipse.core.model.config.InvalidConfigException;
/**
*This class creates the whole SDK table with it's viewer and content provider.
diff --git a/core/source/org/openoffice/ide/eclipse/core/gui/rows/AbstractConfigRow.java b/core/source/org/openoffice/ide/eclipse/core/gui/rows/AbstractConfigRow.java
index afe0cc8..5ea74dc 100644
--- a/core/source/org/openoffice/ide/eclipse/core/gui/rows/AbstractConfigRow.java
+++ b/core/source/org/openoffice/ide/eclipse/core/gui/rows/AbstractConfigRow.java
@@ -51,7 +51,7 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
import org.openoffice.ide.eclipse.core.gui.AbstractTable;
-import org.openoffice.ide.eclipse.core.preferences.IConfigListener;
+import org.openoffice.ide.eclipse.core.model.config.IConfigListener;
/**
* Row for the selection of a configuration element.
diff --git a/core/source/org/openoffice/ide/eclipse/core/gui/rows/OOoRow.java b/core/source/org/openoffice/ide/eclipse/core/gui/rows/OOoRow.java
index fb9c982..e78b021 100644
--- a/core/source/org/openoffice/ide/eclipse/core/gui/rows/OOoRow.java
+++ b/core/source/org/openoffice/ide/eclipse/core/gui/rows/OOoRow.java
@@ -49,8 +49,8 @@ import org.eclipse.swt.widgets.Composite;
import org.openoffice.ide.eclipse.core.gui.AbstractTable;
import org.openoffice.ide.eclipse.core.gui.OOoTable;
import org.openoffice.ide.eclipse.core.model.OOoContainer;
-import org.openoffice.ide.eclipse.core.preferences.IConfigListener;
-import org.openoffice.ide.eclipse.core.preferences.IOOo;
+import org.openoffice.ide.eclipse.core.model.config.IConfigListener;
+import org.openoffice.ide.eclipse.core.model.config.IOOo;
/**
* Row displaying the selection of an OOo instance.
diff --git a/core/source/org/openoffice/ide/eclipse/core/gui/rows/SdkRow.java b/core/source/org/openoffice/ide/eclipse/core/gui/rows/SdkRow.java
index 3bfb1e9..30c303d 100644
--- a/core/source/org/openoffice/ide/eclipse/core/gui/rows/SdkRow.java
+++ b/core/source/org/openoffice/ide/eclipse/core/gui/rows/SdkRow.java
@@ -49,8 +49,8 @@ import org.eclipse.swt.widgets.Composite;
import org.openoffice.ide.eclipse.core.gui.AbstractTable;
import org.openoffice.ide.eclipse.core.gui.SDKTable;
import org.openoffice.ide.eclipse.core.model.SDKContainer;
-import org.openoffice.ide.eclipse.core.preferences.IConfigListener;
-import org.openoffice.ide.eclipse.core.preferences.ISdk;
+import org.openoffice.ide.eclipse.core.model.config.IConfigListener;
+import org.openoffice.ide.eclipse.core.model.config.ISdk;
/**
* Row displaying the selection of an SDK instance.
diff --git a/core/source/org/openoffice/ide/eclipse/core/internal/helpers/PropertiesManager.java b/core/source/org/openoffice/ide/eclipse/core/internal/helpers/PropertiesManager.java
index e1a7adc..79170dd 100644
--- a/core/source/org/openoffice/ide/eclipse/core/internal/helpers/PropertiesManager.java
+++ b/core/source/org/openoffice/ide/eclipse/core/internal/helpers/PropertiesManager.java
@@ -57,9 +57,9 @@ import org.openoffice.ide.eclipse.core.PluginLogger;
import org.openoffice.ide.eclipse.core.internal.model.OOo;
import org.openoffice.ide.eclipse.core.internal.model.SDK;
import org.openoffice.ide.eclipse.core.internal.model.URE;
-import org.openoffice.ide.eclipse.core.preferences.IOOo;
-import org.openoffice.ide.eclipse.core.preferences.ISdk;
-import org.openoffice.ide.eclipse.core.preferences.InvalidConfigException;
+import org.openoffice.ide.eclipse.core.model.config.IOOo;
+import org.openoffice.ide.eclipse.core.model.config.ISdk;
+import org.openoffice.ide.eclipse.core.model.config.InvalidConfigException;
/**
* Helper class for OOo and SDK preferences handling. These aren't stored in
diff --git a/core/source/org/openoffice/ide/eclipse/core/internal/helpers/UnoidlProjectHelper.java b/core/source/org/openoffice/ide/eclipse/core/internal/helpers/UnoidlProjectHelper.java
index 8212db2..a33ba12 100644
--- a/core/source/org/openoffice/ide/eclipse/core/internal/helpers/UnoidlProjectHelper.java
+++ b/core/source/org/openoffice/ide/eclipse/core/internal/helpers/UnoidlProjectHelper.java
@@ -70,9 +70,9 @@ import org.openoffice.ide.eclipse.core.model.CompositeFactory;
import org.openoffice.ide.eclipse.core.model.SDKContainer;
import org.openoffice.ide.eclipse.core.model.UnoFactoryData;
import org.openoffice.ide.eclipse.core.model.UnoPackage;
+import org.openoffice.ide.eclipse.core.model.config.IOOo;
+import org.openoffice.ide.eclipse.core.model.config.ISdk;
import org.openoffice.ide.eclipse.core.model.language.ILanguage;
-import org.openoffice.ide.eclipse.core.preferences.IOOo;
-import org.openoffice.ide.eclipse.core.preferences.ISdk;
/**
* Helper class for UNO-IDL project handling.
@@ -161,6 +161,9 @@ public class UnoidlProjectHelper {
IUnoFactoryConstants.PROJECT_LANGUAGE);
unoProject.setLanguage(language);
+ // create the language-specific part
+ language.getProjectHandler().configureProject(pData);
+
// Set the SDK
String sdkname = (String)pData.getProperty(
IUnoFactoryConstants.PROJECT_SDK);
@@ -374,11 +377,10 @@ public class UnoidlProjectHelper {
pUnoproject.getLanguage().getProjectHandler().addLanguageDependencies(
pUnoproject, pMonitor);
PluginLogger.debug("Language dependencies added"); //$NON-NLS-1$
-
+
pUnoproject.getLanguage().getProjectHandler().addOOoDependencies(
pUnoproject.getOOo(), ((UnoidlProject)pUnoproject).getProject());
PluginLogger.debug("OOo dependencies added"); //$NON-NLS-1$
-
} catch (CoreException e) {
Display.getDefault().asyncExec(new Runnable() {
public void run() {
diff --git a/core/source/org/openoffice/ide/eclipse/core/internal/model/AbstractOOo.java b/core/source/org/openoffice/ide/eclipse/core/internal/model/AbstractOOo.java
index 026e0aa..218cf04 100644
--- a/core/source/org/openoffice/ide/eclipse/core/internal/model/AbstractOOo.java
+++ b/core/source/org/openoffice/ide/eclipse/core/internal/model/AbstractOOo.java
@@ -58,8 +58,8 @@ import org.openoffice.ide.eclipse.core.gui.ITableElement;
import org.openoffice.ide.eclipse.core.internal.helpers.SystemHelper;
import org.openoffice.ide.eclipse.core.model.IUnoidlProject;
import org.openoffice.ide.eclipse.core.model.OOoContainer;
-import org.openoffice.ide.eclipse.core.preferences.IOOo;
-import org.openoffice.ide.eclipse.core.preferences.InvalidConfigException;
+import org.openoffice.ide.eclipse.core.model.config.IOOo;
+import org.openoffice.ide.eclipse.core.model.config.InvalidConfigException;
/**
* Helper class to add the table element features to the OOo classes. All the
diff --git a/core/source/org/openoffice/ide/eclipse/core/internal/model/OOo.java b/core/source/org/openoffice/ide/eclipse/core/internal/model/OOo.java
index a8430c7..c379436 100644
--- a/core/source/org/openoffice/ide/eclipse/core/internal/model/OOo.java
+++ b/core/source/org/openoffice/ide/eclipse/core/internal/model/OOo.java
@@ -55,7 +55,7 @@ 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.internal.helpers.SystemHelper;
-import org.openoffice.ide.eclipse.core.preferences.InvalidConfigException;
+import org.openoffice.ide.eclipse.core.model.config.InvalidConfigException;
/**
* Representing an OpenOffice.org instance for use in the UNO-IDL projects.
diff --git a/core/source/org/openoffice/ide/eclipse/core/internal/model/SDK.java b/core/source/org/openoffice/ide/eclipse/core/internal/model/SDK.java
index 6ae9a86..6151b97 100755
--- a/core/source/org/openoffice/ide/eclipse/core/internal/model/SDK.java
+++ b/core/source/org/openoffice/ide/eclipse/core/internal/model/SDK.java
@@ -62,9 +62,9 @@ import org.openoffice.ide.eclipse.core.PluginLogger;
import org.openoffice.ide.eclipse.core.gui.ITableElement;
import org.openoffice.ide.eclipse.core.internal.helpers.SystemHelper;
import org.openoffice.ide.eclipse.core.model.IUnoidlProject;
-import org.openoffice.ide.eclipse.core.preferences.IOOo;
-import org.openoffice.ide.eclipse.core.preferences.ISdk;
-import org.openoffice.ide.eclipse.core.preferences.InvalidConfigException;
+import org.openoffice.ide.eclipse.core.model.config.IOOo;
+import org.openoffice.ide.eclipse.core.model.config.ISdk;
+import org.openoffice.ide.eclipse.core.model.config.InvalidConfigException;
/**
* Class representing a SDK instance used in the UNO-IDL projects.
@@ -92,6 +92,7 @@ public class SDK implements ISdk, ITableElement {
private static final String PATH_SEPARATOR = System.getProperty("path.separator"); //$NON-NLS-1$
private static final String INCLUDE = "include"; //$NON-NLS-1$
+ private static final String LIB = "lib"; //$NON-NLS-1$
@@ -252,6 +253,13 @@ public class SDK implements ISdk, ITableElement {
}
/**
+ * {@inheritDoc}
+ */
+ public IPath getLibPath() {
+ return new Path( getHome() ).append( LIB );
+ }
+
+ /**
* Get the path to the executable files of the SDK.
*
* @param pHome the SDK installation path
diff --git a/core/source/org/openoffice/ide/eclipse/core/internal/model/URE.java b/core/source/org/openoffice/ide/eclipse/core/internal/model/URE.java
index 08e7d2e..aada277 100644
--- a/core/source/org/openoffice/ide/eclipse/core/internal/model/URE.java
+++ b/core/source/org/openoffice/ide/eclipse/core/internal/model/URE.java
@@ -47,7 +47,7 @@ import java.io.File;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
-import org.openoffice.ide.eclipse.core.preferences.InvalidConfigException;
+import org.openoffice.ide.eclipse.core.model.config.InvalidConfigException;
/**
* Class representing a URE installation.
diff --git a/core/source/org/openoffice/ide/eclipse/core/internal/model/UnoFactory.java b/core/source/org/openoffice/ide/eclipse/core/internal/model/UnoFactory.java
index e2c5d2f..425beec 100644
--- a/core/source/org/openoffice/ide/eclipse/core/internal/model/UnoFactory.java
+++ b/core/source/org/openoffice/ide/eclipse/core/internal/model/UnoFactory.java
@@ -52,6 +52,7 @@ import java.util.Arrays;
import java.util.Locale;
import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.swt.widgets.Display;
@@ -118,11 +119,6 @@ public final class UnoFactory {
UnoidlProjectHelper.refreshProject(prj, null);
UnoidlProjectHelper.forceBuild(prj, pMonitor);
- // create the language-specific part
- ILanguage language = (ILanguage)pData.getProperty(
- IUnoFactoryConstants.PROJECT_LANGUAGE);
- language.getProjectHandler().configureProject(pData);
-
return prj;
}
diff --git a/core/source/org/openoffice/ide/eclipse/core/internal/model/UnoidlProject.java b/core/source/org/openoffice/ide/eclipse/core/internal/model/UnoidlProject.java
index 8ab1840..cae817d 100755
--- a/core/source/org/openoffice/ide/eclipse/core/internal/model/UnoidlProject.java
+++ b/core/source/org/openoffice/ide/eclipse/core/internal/model/UnoidlProject.java
@@ -68,11 +68,11 @@ import org.openoffice.ide.eclipse.core.internal.helpers.UnoidlProjectHelper;
import org.openoffice.ide.eclipse.core.model.IUnoidlProject;
import org.openoffice.ide.eclipse.core.model.OOoContainer;
import org.openoffice.ide.eclipse.core.model.SDKContainer;
+import org.openoffice.ide.eclipse.core.model.config.IConfigListener;
+import org.openoffice.ide.eclipse.core.model.config.IOOo;
+import org.openoffice.ide.eclipse.core.model.config.ISdk;
import org.openoffice.ide.eclipse.core.model.language.ILanguage;
import org.openoffice.ide.eclipse.core.model.language.IProjectHandler;
-import org.openoffice.ide.eclipse.core.preferences.IConfigListener;
-import org.openoffice.ide.eclipse.core.preferences.IOOo;
-import org.openoffice.ide.eclipse.core.preferences.ISdk;
/**
* This class implements the UNO-IDL and project nature interface.
@@ -458,8 +458,10 @@ public class UnoidlProject implements IUnoidlProject, IProjectNature {
* {@inheritDoc}
*/
public IPath getSourcePath() {
- String sourcesDir = getProperty(SRC_DIRECTORY);
- return getFolder(sourcesDir).getProjectRelativePath();
+ if ( mSourcesDir == null ) {
+ mSourcesDir = getProperty(SRC_DIRECTORY);
+ }
+ return getFolder(mSourcesDir).getProjectRelativePath();
}
/**
diff --git a/core/source/org/openoffice/ide/eclipse/core/internal/office/OfficeConnection.java b/core/source/org/openoffice/ide/eclipse/core/internal/office/OfficeConnection.java
index 91950f9..9dca04f 100644
--- a/core/source/org/openoffice/ide/eclipse/core/internal/office/OfficeConnection.java
+++ b/core/source/org/openoffice/ide/eclipse/core/internal/office/OfficeConnection.java
@@ -47,7 +47,7 @@ import java.io.File;
import java.net.URL;
import org.openoffice.ide.eclipse.core.PluginLogger;
-import org.openoffice.ide.eclipse.core.preferences.IOOo;
+import org.openoffice.ide.eclipse.core.model.config.IOOo;
import com.sun.star.comp.helper.Bootstrap;
import com.sun.star.comp.helper.BootstrapException;
diff --git a/core/source/org/openoffice/ide/eclipse/core/model/IUnoFactoryConstants.java b/core/source/org/openoffice/ide/eclipse/core/model/IUnoFactoryConstants.java
index dd1a618..b137a35 100644
--- a/core/source/org/openoffice/ide/eclipse/core/model/IUnoFactoryConstants.java
+++ b/core/source/org/openoffice/ide/eclipse/core/model/IUnoFactoryConstants.java
@@ -44,9 +44,9 @@
package org.openoffice.ide.eclipse.core.model;
// Imports used for the javadocs
+import org.openoffice.ide.eclipse.core.model.config.IOOo;
+import org.openoffice.ide.eclipse.core.model.config.ISdk;
import org.openoffice.ide.eclipse.core.model.language.ILanguage;
-import org.openoffice.ide.eclipse.core.preferences.IOOo;
-import org.openoffice.ide.eclipse.core.preferences.ISdk;
/**
* This interface contains the keys for the data to provide to the UNO
diff --git a/core/source/org/openoffice/ide/eclipse/core/model/IUnoidlProject.java b/core/source/org/openoffice/ide/eclipse/core/model/IUnoidlProject.java
index b6d1ec2..96deb0a 100644
--- a/core/source/org/openoffice/ide/eclipse/core/model/IUnoidlProject.java
+++ b/core/source/org/openoffice/ide/eclipse/core/model/IUnoidlProject.java
@@ -46,9 +46,9 @@ package org.openoffice.ide.eclipse.core.model;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.runtime.IPath;
+import org.openoffice.ide.eclipse.core.model.config.IOOo;
+import org.openoffice.ide.eclipse.core.model.config.ISdk;
import org.openoffice.ide.eclipse.core.model.language.ILanguage;
-import org.openoffice.ide.eclipse.core.preferences.IOOo;
-import org.openoffice.ide.eclipse.core.preferences.ISdk;
/**
* Interface for a UNO project.
diff --git a/core/source/org/openoffice/ide/eclipse/core/model/OOoContainer.java b/core/source/org/openoffice/ide/eclipse/core/model/OOoContainer.java
index 7771848..253b31b 100644
--- a/core/source/org/openoffice/ide/eclipse/core/model/OOoContainer.java
+++ b/core/source/org/openoffice/ide/eclipse/core/model/OOoContainer.java
@@ -55,9 +55,9 @@ import org.openoffice.ide.eclipse.core.PluginLogger;
import org.openoffice.ide.eclipse.core.internal.helpers.PropertiesManager;
import org.openoffice.ide.eclipse.core.internal.model.OOo;
import org.openoffice.ide.eclipse.core.internal.model.URE;
-import org.openoffice.ide.eclipse.core.preferences.IConfigListener;
-import org.openoffice.ide.eclipse.core.preferences.IOOo;
-import org.openoffice.ide.eclipse.core.preferences.InvalidConfigException;
+import org.openoffice.ide.eclipse.core.model.config.IConfigListener;
+import org.openoffice.ide.eclipse.core.model.config.IOOo;
+import org.openoffice.ide.eclipse.core.model.config.InvalidConfigException;
/**
* Singleton object containing the OOo configurations.
diff --git a/core/source/org/openoffice/ide/eclipse/core/model/SDKContainer.java b/core/source/org/openoffice/ide/eclipse/core/model/SDKContainer.java
index 5ff9382..6b3fd4d 100755
--- a/core/source/org/openoffice/ide/eclipse/core/model/SDKContainer.java
+++ b/core/source/org/openoffice/ide/eclipse/core/model/SDKContainer.java
@@ -51,9 +51,9 @@ import java.util.Map.Entry;
import org.openoffice.ide.eclipse.core.PluginLogger;
import org.openoffice.ide.eclipse.core.internal.helpers.PropertiesManager;
-import org.openoffice.ide.eclipse.core.preferences.IConfigListener;
-import org.openoffice.ide.eclipse.core.preferences.ISdk;
-import org.openoffice.ide.eclipse.core.preferences.InvalidConfigException;
+import org.openoffice.ide.eclipse.core.model.config.IConfigListener;
+import org.openoffice.ide.eclipse.core.model.config.ISdk;
+import org.openoffice.ide.eclipse.core.model.config.InvalidConfigException;
/**
* Singleton object containing the SDK instances.
diff --git a/core/source/org/openoffice/ide/eclipse/core/model/config/IConfigListener.java b/core/source/org/openoffice/ide/eclipse/core/model/config/IConfigListener.java
new file mode 100755
index 0000000..6bafb12
--- /dev/null
+++ b/core/source/org/openoffice/ide/eclipse/core/model/config/IConfigListener.java
@@ -0,0 +1,73 @@
+/*************************************************************************
+ *
+ * $RCSfile: IConfigListener.java,v $
+ *
+ * $Revision: 1.3 $
+ *
+ * last change: $Author: cedricbosdo $ $Date: 2007/11/25 20:32:27 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * the GNU Lesser General Public License Version 2.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc..
+ *
+ * Copyright: 2002 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): Cedric Bosdonnat
+ *
+ *
+ ************************************************************************/
+package org.openoffice.ide.eclipse.core.model.config;
+
+/**
+ * Interface describing a OOo or SDK configuration listener.
+ *
+ * @author cedricbosdo
+ */
+public interface IConfigListener {
+
+ /**
+ * Method fired when a config element has been added to the container.
+ *
+ * @param pElement added sdk or ooo
+ */
+ public void ConfigAdded(Object pElement);
+
+ /**
+ * Method fired when a config element has been removed from the container.
+ *
+ * @param pElement removed sdk or ooo. <code>null</code> if the container has been cleared
+ */
+ public void ConfigRemoved(Object pElement);
+
+ /**
+ * Method fired when a config element has been updated in the container.
+ *
+ * @param pElement new value of the sdk or ooo
+ */
+ public void ConfigUpdated(Object pElement);
+}
diff --git a/core/source/org/openoffice/ide/eclipse/core/model/config/IOOo.java b/core/source/org/openoffice/ide/eclipse/core/model/config/IOOo.java
new file mode 100644
index 0000000..87867f7
--- /dev/null
+++ b/core/source/org/openoffice/ide/eclipse/core/model/config/IOOo.java
@@ -0,0 +1,169 @@
+/*************************************************************************
+ *
+ * $RCSfile: IOOo.java,v $
+ *
+ * $Revision: 1.6 $
+ *
+ * last change: $Author: cedricbosdo $ $Date: 2008/12/13 13:42:50 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * the GNU Lesser General Public License Version 2.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc..
+ *
+ * Copyright: 2002 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): Cedric Bosdonnat
+ *
+ *
+ ************************************************************************/
+package org.openoffice.ide.eclipse.core.model.config;
+
+import java.io.File;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.debug.core.ILaunch;
+import org.openoffice.ide.eclipse.core.model.IUnoidlProject;
+
+/**
+ * Interface for an OpenOffice.org configuration instance. This can even
+ * be implemented as an URE instance.
+ *
+ * @author cedricbosdo
+ */
+public interface IOOo {
+
+ /**
+ * Set the home directory.
+ *
+ * @param pHome the absolute path to the home directory
+ * @throws InvalidConfigException is thrown if the path doesn't match the
+ * implementation requirement for an OOo instance. The error code will
+ * be {@link InvalidConfigException#INVALID_OOO_HOME}
+ */
+ public void setHome(String pHome) throws InvalidConfigException;
+
+ /**
+ * Returns the path to the OpenOffice.org home directory. This string could
+ * be passed to the Path constructor to get the folder object.
+ *
+ * @return path to the OpenOffice.org home directory.
+ */
+ public String getHome();
+
+ /**
+ * Returns the OOo name. It should be a unique identifier
+ *
+ * @return ooo name
+ */
+ public String getName();
+
+ /**
+ * <p>Returns the path to the OpenOffice.org classes directory.
+ * These strings could be passed to the Path constructor to get the
+ * folder object.</p>
+ *
+ * <p><em>This method should be used for future compatibility with
+ * URE applications</em></p>
+ *
+ * @return path to the OpenOffice.org classes directory
+ */
+ public String[] getClassesPath();
+
+ /**
+ * <p>Returns the path to the OpenOffice.org shared libraries. This string
+ * could be passed to the Path constructor to get the folder object.</p>
+ *
+ * @return path to the OpenOffice.org libraries directory
+ */
+ public String[] getLibsPath();
+
+ /**
+ * @return the path to the <code>types.rdb</code> file of the OOo or URE
+ * instance.
+ */
+ public String[] getTypesPath();
+
+ /**
+ * @return the path to the <code>services.rdb</code> file of the OOo or URE
+ * instance.
+ */
+ public String[] getServicesPath();
+
+ /**
+ * @return the path to the UNO bootstrap properties file.
+ */
+ public String getUnorcPath();
+
+ /**
+ * @return the path to the UNO executable file
+ */
+ public String getUnoPath();
+
+ /**
+ * @return the path to the <code>javaldx</code> executable
+ */
+ public String getJavaldxPath();
+
+ /**
+ * Returns a command to execute a <code>uno</code> component.
+ *
+ * @param pImplementationName the name of the component implementation to run
+ * @param pLibLocation the name of the library containing the implementation
+ * @param pRegistriesPaths the path to the additional registries
+ * @param pArgs the argument for the component launch
+ *
+ * @return the command to execute the <code>uno</code> binary
+ */
+ public String createUnoCommand(String pImplementationName,
+ String pLibLocation, String[] pRegistriesPaths, String[] pArgs);
+
+ /**
+ * Run the <code>uno</code> executable with the given Main implementation,
+ * the arguments and the launcher.
+ *
+ * @param pPrj the project to run
+ * @param pMain the main implementation
+ * @param pArgs the argument to pass to the main implementation
+ * @param pLaunch the launcher
+ * @param pMonitor a monitor to follow the progress
+ */
+ public void runUno(IUnoidlProject pPrj, String pMain, String pArgs,
+ ILaunch pLaunch, IProgressMonitor pMonitor);
+
+ /**
+ * @return <code>true</code> if the OOo instance has a package manager.
+ */
+ public boolean canManagePackages();
+
+ /**
+ * Update a package in the OOo instance if it can manages packages.
+ *
+ * @param pPackageFile the package to add or update
+ */
+ public void updatePackage(File pPackageFile);
+}
diff --git a/core/source/org/openoffice/ide/eclipse/core/model/config/ISdk.java b/core/source/org/openoffice/ide/eclipse/core/model/config/ISdk.java
new file mode 100644
index 0000000..577e520
--- /dev/null
+++ b/core/source/org/openoffice/ide/eclipse/core/model/config/ISdk.java
@@ -0,0 +1,139 @@
+/*************************************************************************
+ *
+ * $RCSfile: ISdk.java,v $
+ *
+ * $Revision: 1.5 $
+ *
+ * last change: $Author: cedricbosdo $ $Date: 2007/12/07 08:47:16 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * the GNU Lesser General Public License Version 2.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc..
+ *
+ * Copyright: 2002 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): Cedric Bosdonnat
+ *
+ *
+ ************************************************************************/
+package org.openoffice.ide.eclipse.core.model.config;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.openoffice.ide.eclipse.core.model.IUnoidlProject;
+
+/**
+ * Interface defining an OpenOffice.org SDK.
+ *
+ * @author cedricbosdo
+ *
+ */
+public interface ISdk {
+
+ /**
+ * Set the new SDK Home after having checked for the existence of the idl and settings directory.
+ * Fetches the sdk name and buildid from the dk.mk file
+ *
+ * @param pHome path to the new sdk home
+ *
+ * @exception InvalidConfigException <p>This exception is thrown when the
+ * following errors are encountered with the
+ * {@link InvalidConfigException#INVALID_SDK_HOME}error code: </p>
+ * <ul>
+ * <li>the sdk path does not point to a valid directory</li>
+ * <li>the $(SDK_HOME)/idl directory doesnt exist</li>
+ * <li>the $(SDK_HOME)/settings directory doesnt exist</li>
+ * <li>the sdk name and buildid cannot be fetched</li>
+ * <li>an unexpected exception has been raised</li>
+ * </ul>
+ */
+ public void setHome(String pHome) throws InvalidConfigException;
+
+ /**
+ * Returns the SDK home directory. This string could be passed to the
+ * Path constructor to get the folder object.
+ *
+ * @return SDK home directory
+ */
+ public String getHome();
+
+ /**
+ * Returns the SDK build id without the parenthesized string. For example, if the
+ * full build id is <code>680m92(Build:8896)</code>, the result will be: <code>680m92</code>.
+ *
+ * If the builid is <code>null</code>, the return will be
+ *
+ * @return the shortened build id
+ */
+ public String getId();
+
+ /**
+ * @return the path to the directory containing the binaries in the SDK.
+ */
+ public IPath getBinPath();
+
+ /**
+ * @return the path to the includes in the SDK.
+ */
+ public IPath getIncludePath();
+
+ /**
+ * @return the path to the libraries in the SDK.
+ */
+ public IPath getLibPath();
+
+ /**
+ * Create a process for the given shell command. This process will
+ * be created with the project parameters such as it's SDK and
+ * location path
+ *
+ * @param pProject the UNO-IDL project on which to run the tool
+ * @param pShellCommand the shell command to execute the tool
+ * @param pMonitor a process monitor to watch the tool launching
+ *
+ * @return the process executing the tool
+ */
+ public Process runTool(IUnoidlProject pProject,
+ String pShellCommand, IProgressMonitor pMonitor);
+
+ /**
+ * Create a process for the given shell command. This process will
+ * be created with the project parameters such as it's SDK and
+ * location path
+ *
+ * @param pProject the UNO-IDL project on which to run the tool
+ * @param pShellCommand the shell command to execute the tool
+ * @param pEnv tool environement variable
+ * @param pMonitor a process monitor to watch the tool launching
+ *
+ * @return the process executing the tool
+ */
+ public Process runToolWithEnv(IUnoidlProject pProject,
+ String pShellCommand, String[] pEnv, IProgressMonitor pMonitor);
+
+}
diff --git a/core/source/org/openoffice/ide/eclipse/core/model/config/InvalidConfigException.java b/core/source/org/openoffice/ide/eclipse/core/model/config/InvalidConfigException.java
new file mode 100755
index 0000000..4b91a81
--- /dev/null
+++ b/core/source/org/openoffice/ide/eclipse/core/model/config/InvalidConfigException.java
@@ -0,0 +1,108 @@
+/*************************************************************************
+ *
+ * $RCSfile: InvalidConfigException.java,v $
+ *
+ * $Revision: 1.3 $
+ *
+ * last change: $Author: cedricbosdo $ $Date: 2007/11/25 20:32:27 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * the GNU Lesser General Public License Version 2.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc..
+ *
+ * Copyright: 2002 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): Cedric Bosdonnat
+ *
+ *
+ ************************************************************************/
+package org.openoffice.ide.eclipse.core.model.config;
+
+
+/**
+ * This exception is thrown when an OOo or SDK isn't valid, ie that it's home
+ * doesn't fit to a correct home directory for an OOo or SDK.
+ *
+ * @see IOOo
+ * @see ISdk
+ *
+ * @author cedricbosdo
+ */
+public class InvalidConfigException extends Exception {
+
+ /**
+ * The error points to an invalid SDK home path.
+ */
+ public static final int INVALID_SDK_HOME = 0;
+
+ /**
+ * The error points to an invalid OOo home path.
+ */
+ public static final int INVALID_OOO_HOME = 1;
+
+ private static final long serialVersionUID = 2019018152788487567L;
+
+ private int mErrorCode;
+
+ /**
+ * Constructor of the invalid SDK exception. It needs a message and a error
+ * code among those defined as constants of this class.
+ *
+ * @param pMessage error message
+ * @param pCode error code
+ */
+ public InvalidConfigException(String pMessage, int pCode) {
+ super(pMessage);
+
+ mErrorCode = pCode;
+ }
+
+ /**
+ * Constructor of the invalid SDK exception. It needs a message and a error
+ * code among those defined as constants of this class.
+ *
+ * @param pMessage error message
+ * @param pCode error code
+ * @param pException exception in case there is one.
+ */
+ public InvalidConfigException(String pMessage, int pCode, Throwable pException) {
+ super(pMessage, pException);
+
+ mErrorCode = pCode;
+ }
+
+ /**
+ * Returns the error code of the exception among the constants of the
+ * <code>InvalidSDKException</code> class.
+ *
+ * @return error code.
+ */
+ public int getErrorCode() {
+ return mErrorCode;
+ }
+}
diff --git a/core/source/org/openoffice/ide/eclipse/core/model/language/ILanguageBuilder.java b/core/source/org/openoffice/ide/eclipse/core/model/language/ILanguageBuilder.java
index c861736..b1b8382 100644
--- a/core/source/org/openoffice/ide/eclipse/core/model/language/ILanguageBuilder.java
+++ b/core/source/org/openoffice/ide/eclipse/core/model/language/ILanguageBuilder.java
@@ -50,8 +50,8 @@ import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.openoffice.ide.eclipse.core.model.IUnoidlProject;
import org.openoffice.ide.eclipse.core.model.UnoPackage;
-import org.openoffice.ide.eclipse.core.preferences.IOOo;
-import org.openoffice.ide.eclipse.core.preferences.ISdk;
+import org.openoffice.ide.eclipse.core.model.config.IOOo;
+import org.openoffice.ide.eclipse.core.model.config.ISdk;
/**
* Interface defining a set of methods for to do the language specific
diff --git a/core/source/org/openoffice/ide/eclipse/core/model/language/IProjectHandler.java b/core/source/org/openoffice/ide/eclipse/core/model/language/IProjectHandler.java
index 48f193d..4e160d6 100644
--- a/core/source/org/openoffice/ide/eclipse/core/model/language/IProjectHandler.java
+++ b/core/source/org/openoffice/ide/eclipse/core/model/language/IProjectHandler.java
@@ -49,7 +49,7 @@ import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.openoffice.ide.eclipse.core.model.IUnoidlProject;
import org.openoffice.ide.eclipse.core.model.UnoFactoryData;
-import org.openoffice.ide.eclipse.core.preferences.IOOo;
+import org.openoffice.ide.eclipse.core.model.config.IOOo;
/**
* This interface provides a set of methods to perform language
diff --git a/core/source/org/openoffice/ide/eclipse/core/office/OfficeClassLoader.java b/core/source/org/openoffice/ide/eclipse/core/office/OfficeClassLoader.java
index 7101247..05cad65 100644
--- a/core/source/org/openoffice/ide/eclipse/core/office/OfficeClassLoader.java
+++ b/core/source/org/openoffice/ide/eclipse/core/office/OfficeClassLoader.java
@@ -53,7 +53,7 @@ import java.util.LinkedList;
import org.eclipse.core.runtime.FileLocator;
import org.openoffice.ide.eclipse.core.OOEclipsePlugin;
import org.openoffice.ide.eclipse.core.PluginLogger;
-import org.openoffice.ide.eclipse.core.preferences.IOOo;
+import org.openoffice.ide.eclipse.core.model.config.IOOo;
/**
* Special class loader to use to load OOo related classes.
diff --git a/core/source/org/openoffice/ide/eclipse/core/office/OfficeHelper.java b/core/source/org/openoffice/ide/eclipse/core/office/OfficeHelper.java
index 8ea16f4..36466d1 100644
--- a/core/source/org/openoffice/ide/eclipse/core/office/OfficeHelper.java
+++ b/core/source/org/openoffice/ide/eclipse/core/office/OfficeHelper.java
@@ -46,7 +46,7 @@ package org.openoffice.ide.eclipse.core.office;
import java.lang.reflect.Constructor;
import java.net.URLClassLoader;
-import org.openoffice.ide.eclipse.core.preferences.IOOo;
+import org.openoffice.ide.eclipse.core.model.config.IOOo;
/**
* Provides a set of utility methods to use to handle OOo. All the code handling
diff --git a/core/source/org/openoffice/ide/eclipse/core/office/TypesGetter.java b/core/source/org/openoffice/ide/eclipse/core/office/TypesGetter.java
index a807f79..cd2bd2a 100644
--- a/core/source/org/openoffice/ide/eclipse/core/office/TypesGetter.java
+++ b/core/source/org/openoffice/ide/eclipse/core/office/TypesGetter.java
@@ -51,7 +51,7 @@ import java.util.Map;
import org.openoffice.ide.eclipse.core.PluginLogger;
import org.openoffice.ide.eclipse.core.model.IUnoFactoryConstants;
-import org.openoffice.ide.eclipse.core.preferences.IOOo;
+import org.openoffice.ide.eclipse.core.model.config.IOOo;
import org.openoffice.ide.eclipse.core.unotypebrowser.InternalUnoType;
/**
diff --git a/core/source/org/openoffice/ide/eclipse/core/preferences/IConfigListener.java b/core/source/org/openoffice/ide/eclipse/core/preferences/IConfigListener.java
deleted file mode 100755
index 1f5ff81..0000000
--- a/core/source/org/openoffice/ide/eclipse/core/preferences/IConfigListener.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*************************************************************************
- *
- * $RCSfile: IConfigListener.java,v $
- *
- * $Revision: 1.3 $
- *
- * last change: $Author: cedricbosdo $ $Date: 2007/11/25 20:32:27 $
- *
- * The Contents of this file are made available subject to the terms of
- * the GNU Lesser General Public License Version 2.1
- *
- * Sun Microsystems Inc., October, 2000
- *
- *
- * GNU Lesser General Public License Version 2.1
- * =============================================
- * Copyright 2000 by Sun Microsystems, Inc.
- * 901 San Antonio Road, Palo Alto, CA 94303, USA
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * The Initial Developer of the Original Code is: Sun Microsystems, Inc..
- *
- * Copyright: 2002 by Sun Microsystems, Inc.
- *
- * All Rights Reserved.
- *
- * Contributor(s): Cedric Bosdonnat
- *
- *
- ************************************************************************/
-package org.openoffice.ide.eclipse.core.preferences;
-
-/**
- * Interface describing a OOo or SDK configuration listener.
- *
- * @author cedricbosdo
- */
-public interface IConfigListener {
-
- /**
- * Method fired when a config element has been added to the container.
- *
- * @param pElement added sdk or ooo
- */
- public void ConfigAdded(Object pElement);
-
- /**
- * Method fired when a config element has been removed from the container.
- *
- * @param pElement removed sdk or ooo. <code>null</code> if the container has been cleared
- */
- public void ConfigRemoved(Object pElement);
-
- /**
- * Method fired when a config element has been updated in the container.
- *
- * @param pElement new value of the sdk or ooo
- */
- public void ConfigUpdated(Object pElement);
-}
diff --git a/core/source/org/openoffice/ide/eclipse/core/preferences/IOOo.java b/core/source/org/openoffice/ide/eclipse/core/preferences/IOOo.java
deleted file mode 100644
index 010abea..0000000
--- a/core/source/org/openoffice/ide/eclipse/core/preferences/IOOo.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*************************************************************************
- *
- * $RCSfile: IOOo.java,v $
- *
- * $Revision: 1.6 $
- *
- * last change: $Author: cedricbosdo $ $Date: 2008/12/13 13:42:50 $
- *
- * The Contents of this file are made available subject to the terms of
- * the GNU Lesser General Public License Version 2.1
- *
- * Sun Microsystems Inc., October, 2000
- *
- *
- * GNU Lesser General Public License Version 2.1
- * =============================================
- * Copyright 2000 by Sun Microsystems, Inc.
- * 901 San Antonio Road, Palo Alto, CA 94303, USA
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * The Initial Developer of the Original Code is: Sun Microsystems, Inc..
- *
- * Copyright: 2002 by Sun Microsystems, Inc.
- *
- * All Rights Reserved.
- *
- * Contributor(s): Cedric Bosdonnat
- *
- *
- ************************************************************************/
-package org.openoffice.ide.eclipse.core.preferences;
-
-import java.io.File;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.debug.core.ILaunch;
-import org.openoffice.ide.eclipse.core.model.IUnoidlProject;
-
-/**
- * Interface for an OpenOffice.org configuration instance. This can even
- * be implemented as an URE instance.
- *
- * @author cedricbosdo
- */
-public interface IOOo {
-
- /**
- * Set the home directory.
- *
- * @param pHome the absolute path to the home directory
- * @throws InvalidConfigException is thrown if the path doesn't match the
- * implementation requirement for an OOo instance. The error code will
- * be {@link InvalidConfigException#INVALID_OOO_HOME}
- */
- public void setHome(String pHome) throws InvalidConfigException;
-
- /**
- * Returns the path to the OpenOffice.org home directory. This string could
- * be passed to the Path constructor to get the folder object.
- *
- * @return path to the OpenOffice.org home directory.
- */
- public String getHome();
-
- /**
- * Returns the OOo name. It should be a unique identifier
- *
- * @return ooo name
- */
- public String getName();
-
- /**
- * <p>Returns the path to the OpenOffice.org classes directory.
- * These strings could be passed to the Path constructor to get the
- * folder object.</p>
- *
- * <p><em>This method should be used for future compatibility with
- * URE applications</em></p>
- *
- * @return path to the OpenOffice.org classes directory
- */
- public String[] getClassesPath();
-
- /**
- * <p>Returns the path to the OpenOffice.org shared libraries. This string
- * could be passed to the Path constructor to get the folder object.</p>
- *
- * @return path to the OpenOffice.org libraries directory
- */
- public String[] getLibsPath();
-
- /**
- * @return the path to the <code>types.rdb</code> file of the OOo or URE
- * instance.
- */
- public String[] getTypesPath();
-
- /**
- * @return the path to the <code>services.rdb</code> file of the OOo or URE
- * instance.
- */
- public String[] getServicesPath();
-
- /**
- * @return the path to the UNO bootstrap properties file.
- */
- public String getUnorcPath();
-
- /**
- * @return the path to the UNO executable file
- */
- public String getUnoPath();
-
- /**
- * @return the path to the <code>javaldx</code> executable
- */
- public String getJavaldxPath();
-
- /**
- * Returns a command to execute a <code>uno</code> component.
- *
- * @param pImplementationName the name of the component implementation to run
- * @param pLibLocation the name of the library containing the implementation
- * @param pRegistriesPaths the path to the additional registries
- * @param pArgs the argument for the component launch
- *
- * @return the command to execute the <code>uno</code> binary
- */
- public String createUnoCommand(String pImplementationName,
- String pLibLocation, String[] pRegistriesPaths, String[] pArgs);
-
- /**
- * Run the <code>uno</code> executable with the given Main implementation,
- * the arguments and the launcher.
- *
- * @param pPrj the project to run
- * @param pMain the main implementation
- * @param pArgs the argument to pass to the main implementation
- * @param pLaunch the launcher
- * @param pMonitor a monitor to follow the progress
- */
- public void runUno(IUnoidlProject pPrj, String pMain, String pArgs,
- ILaunch pLaunch, IProgressMonitor pMonitor);
-
- /**
- * @return <code>true</code> if the OOo instance has a package manager.
- */
- public boolean canManagePackages();
-
- /**
- * Update a package in the OOo instance if it can manages packages.
- *
- * @param pPackageFile the package to add or update
- */
- public void updatePackage(File pPackageFile);
-}
diff --git a/core/source/org/openoffice/ide/eclipse/core/preferences/ISdk.java b/core/source/org/openoffice/ide/eclipse/core/preferences/ISdk.java
deleted file mode 100644
index c6a7f8c..0000000
--- a/core/source/org/openoffice/ide/eclipse/core/preferences/ISdk.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*************************************************************************
- *
- * $RCSfile: ISdk.java,v $
- *
- * $Revision: 1.5 $
- *
- * last change: $Author: cedricbosdo $ $Date: 2007/12/07 08:47:16 $
- *
- * The Contents of this file are made available subject to the terms of
- * the GNU Lesser General Public License Version 2.1
- *
- * Sun Microsystems Inc., October, 2000
- *
- *
- * GNU Lesser General Public License Version 2.1
- * =============================================
- * Copyright 2000 by Sun Microsystems, Inc.
- * 901 San Antonio Road, Palo Alto, CA 94303, USA
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * The Initial Developer of the Original Code is: Sun Microsystems, Inc..
- *
- * Copyright: 2002 by Sun Microsystems, Inc.
- *
- * All Rights Reserved.
- *
- * Contributor(s): Cedric Bosdonnat
- *
- *
- ************************************************************************/
-package org.openoffice.ide.eclipse.core.preferences;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.openoffice.ide.eclipse.core.model.IUnoidlProject;
-
-/**
- * Interface defining an OpenOffice.org SDK.
- *
- * @author cedricbosdo
- *
- */
-public interface ISdk {
-
- /**
- * Set the new SDK Home after having checked for the existence of the idl and settings directory.
- * Fetches the sdk name and buildid from the dk.mk file
- *
- * @param pHome path to the new sdk home
- *
- * @exception InvalidConfigException <p>This exception is thrown when the
- * following errors are encountered with the
- * {@link InvalidConfigException#INVALID_SDK_HOME}error code: </p>
- * <ul>
- * <li>the sdk path does not point to a valid directory</li>
- * <li>the $(SDK_HOME)/idl directory doesnt exist</li>
- * <li>the $(SDK_HOME)/settings directory doesnt exist</li>
- * <li>the sdk name and buildid cannot be fetched</li>
- * <li>an unexpected exception has been raised</li>
- * </ul>
- */
- public void setHome(String pHome) throws InvalidConfigException;
-
- /**
- * Returns the SDK home directory. This string could be passed to the
- * Path constructor to get the folder object.
- *
- * @return SDK home directory
- */
- public String getHome();
-
- /**
- * Returns the SDK build id without the parenthesized string. For example, if the
- * full build id is <code>680m92(Build:8896)</code>, the result will be: <code>680m92</code>.
- *
- * If the builid is <code>null</code>, the return will be
- *
- * @return the shortened build id
- */
- public String getId();
-
- /**
- * @return the path to the directory containing the binaries in the SDK.
- */
- public IPath getBinPath();
-
- /**
- * @return the path to the includes in the SDK.
- */
- public IPath getIncludePath();
-
- /**
- * Create a process for the given shell command. This process will
- * be created with the project parameters such as it's SDK and
- * location path
- *
- * @param pProject the UNO-IDL project on which to run the tool
- * @param pShellCommand the shell command to execute the tool
- * @param pMonitor a process monitor to watch the tool launching
- *
- * @return the process executing the tool
- */
- public Process runTool(IUnoidlProject pProject,
- String pShellCommand, IProgressMonitor pMonitor);
-
- /**
- * Create a process for the given shell command. This process will
- * be created with the project parameters such as it's SDK and
- * location path
- *
- * @param pProject the UNO-IDL project on which to run the tool
- * @param pShellCommand the shell command to execute the tool
- * @param pEnv tool environement variable
- * @param pMonitor a process monitor to watch the tool launching
- *
- * @return the process executing the tool
- */
- public Process runToolWithEnv(IUnoidlProject pProject,
- String pShellCommand, String[] pEnv, IProgressMonitor pMonitor);
-
-}
diff --git a/core/source/org/openoffice/ide/eclipse/core/preferences/InvalidConfigException.java b/core/source/org/openoffice/ide/eclipse/core/preferences/InvalidConfigException.java
deleted file mode 100755
index 33a82ef..0000000
--- a/core/source/org/openoffice/ide/eclipse/core/preferences/InvalidConfigException.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*************************************************************************
- *
- * $RCSfile: InvalidConfigException.java,v $
- *
- * $Revision: 1.3 $
- *
- * last change: $Author: cedricbosdo $ $Date: 2007/11/25 20:32:27 $
- *
- * The Contents of this file are made available subject to the terms of
- * the GNU Lesser General Public License Version 2.1
- *
- * Sun Microsystems Inc., October, 2000
- *
- *
- * GNU Lesser General Public License Version 2.1
- * =============================================
- * Copyright 2000 by Sun Microsystems, Inc.
- * 901 San Antonio Road, Palo Alto, CA 94303, USA
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * The Initial Developer of the Original Code is: Sun Microsystems, Inc..
- *
- * Copyright: 2002 by Sun Microsystems, Inc.
- *
- * All Rights Reserved.
- *
- * Contributor(s): Cedric Bosdonnat
- *
- *
- ************************************************************************/
-package org.openoffice.ide.eclipse.core.preferences;
-
-/**
- * This exception is thrown when an OOo or SDK isn't valid, ie that it's home
- * doesn't fit to a correct home directory for an OOo or SDK.
- *
- * @see IOOo
- * @see ISdk
- *
- * @author cedricbosdo
- */
-public class InvalidConfigException extends Exception {
-
- /**
- * The error points to an invalid SDK home path.
- */
- public static final int INVALID_SDK_HOME = 0;
-
- /**
- * The error points to an invalid OOo home path.
- */
- public static final int INVALID_OOO_HOME = 1;
-
- private static final long serialVersionUID = 2019018152788487567L;
-
- private int mErrorCode;
-
- /**
- * Constructor of the invalid SDK exception. It needs a message and a error
- * code among those defined as constants of this class.
- *
- * @param pMessage error message
- * @param pCode error code
- */
- public InvalidConfigException(String pMessage, int pCode) {
- super(pMessage);
-
- mErrorCode = pCode;
- }
-
- /**
- * Constructor of the invalid SDK exception. It needs a message and a error
- * code among those defined as constants of this class.
- *
- * @param pMessage error message
- * @param pCode error code
- * @param pException exception in case there is one.
- */
- public InvalidConfigException(String pMessage, int pCode, Throwable pException) {
- super(pMessage, pException);
-
- mErrorCode = pCode;
- }
-
- /**
- * Returns the error code of the exception among the constants of the
- * <code>InvalidSDKException</code> class.
- *
- * @return error code.
- */
- public int getErrorCode() {
- return mErrorCode;
- }
-}
diff --git a/core/source/org/openoffice/ide/eclipse/core/preferences/ProjectPropertiesPage.java b/core/source/org/openoffice/ide/eclipse/core/preferences/ProjectPropertiesPage.java
index 25ebcd0..db8cf70 100644
--- a/core/source/org/openoffice/ide/eclipse/core/preferences/ProjectPropertiesPage.java
+++ b/core/source/org/openoffice/ide/eclipse/core/preferences/ProjectPropertiesPage.java
@@ -61,6 +61,8 @@ import org.openoffice.ide.eclipse.core.gui.rows.SdkRow;
import org.openoffice.ide.eclipse.core.internal.model.UnoidlProject;
import org.openoffice.ide.eclipse.core.model.OOoContainer;
import org.openoffice.ide.eclipse.core.model.SDKContainer;
+import org.openoffice.ide.eclipse.core.model.config.IOOo;
+import org.openoffice.ide.eclipse.core.model.config.ISdk;
/**
* The project preference page. This page can be used to reconfigure the
diff --git a/core/source/org/openoffice/ide/eclipse/core/unittests/OOoTest.java b/core/source/org/openoffice/ide/eclipse/core/unittests/OOoTest.java
index 2ec57ed..dbd04bc 100644
--- a/core/source/org/openoffice/ide/eclipse/core/unittests/OOoTest.java
+++ b/core/source/org/openoffice/ide/eclipse/core/unittests/OOoTest.java
@@ -36,7 +36,7 @@ import java.text.MessageFormat;
import org.eclipse.core.runtime.Platform;
import org.openoffice.ide.eclipse.core.internal.model.OOo;
-import org.openoffice.ide.eclipse.core.preferences.InvalidConfigException;
+import org.openoffice.ide.eclipse.core.model.config.InvalidConfigException;
import junit.framework.TestCase;
diff --git a/core/source/org/openoffice/ide/eclipse/core/unotypebrowser/UnoTypeProvider.java b/core/source/org/openoffice/ide/eclipse/core/unotypebrowser/UnoTypeProvider.java
index dbc14cf..ecc976c 100755
--- a/core/source/org/openoffice/ide/eclipse/core/unotypebrowser/UnoTypeProvider.java
+++ b/core/source/org/openoffice/ide/eclipse/core/unotypebrowser/UnoTypeProvider.java
@@ -53,8 +53,8 @@ import java.util.Map;
import org.openoffice.ide.eclipse.core.PluginLogger;
import org.openoffice.ide.eclipse.core.model.IUnoidlProject;
+import org.openoffice.ide.eclipse.core.model.config.IOOo;
import org.openoffice.ide.eclipse.core.office.TypesGetter;
-import org.openoffice.ide.eclipse.core.preferences.IOOo;
/**
* Class providing UNO types from an OpenOffice.org instance and optionally
diff --git a/core/source/org/openoffice/ide/eclipse/core/wizards/PackageExportWizard.java b/core/source/org/openoffice/ide/eclipse/core/wizards/PackageExportWizard.java
index 3072a60..ac36679 100644
--- a/core/source/org/openoffice/ide/eclipse/core/wizards/PackageExportWizard.java
+++ b/core/source/org/openoffice/ide/eclipse/core/wizards/PackageExportWizard.java
@@ -72,8 +72,8 @@ import org.openoffice.ide.eclipse.core.model.IUnoidlProject;
import org.openoffice.ide.eclipse.core.model.PackagePropertiesModel;
import org.openoffice.ide.eclipse.core.model.ProjectsManager;
import org.openoffice.ide.eclipse.core.model.UnoPackage;
+import org.openoffice.ide.eclipse.core.model.config.IOOo;
import org.openoffice.ide.eclipse.core.model.language.ILanguageBuilder;
-import org.openoffice.ide.eclipse.core.preferences.IOOo;
import org.openoffice.ide.eclipse.core.utils.FileHelper;
import org.openoffice.ide.eclipse.core.wizards.pages.PackageExportWizardPage;
diff --git a/core/source/org/openoffice/ide/eclipse/core/wizards/ServiceWizardSet.java b/core/source/org/openoffice/ide/eclipse/core/wizards/ServiceWizardSet.java
index da605e1..ab568e7 100644
--- a/core/source/org/openoffice/ide/eclipse/core/wizards/ServiceWizardSet.java
+++ b/core/source/org/openoffice/ide/eclipse/core/wizards/ServiceWizardSet.java
@@ -55,7 +55,7 @@ import org.openoffice.ide.eclipse.core.model.IUnoFactoryConstants;
import org.openoffice.ide.eclipse.core.model.IUnoidlProject;
import org.openoffice.ide.eclipse.core.model.ProjectsManager;
import org.openoffice.ide.eclipse.core.model.UnoFactoryData;
-import org.openoffice.ide.eclipse.core.preferences.IOOo;
+import org.openoffice.ide.eclipse.core.model.config.IOOo;
import org.openoffice.ide.eclipse.core.wizards.pages.NewInterfaceWizardPage;
import org.openoffice.ide.eclipse.core.wizards.pages.NewScopedElementWizardPage;
import org.openoffice.ide.eclipse.core.wizards.pages.NewServiceWizardPage;
diff --git a/core/source/org/openoffice/ide/eclipse/core/wizards/pages/NewScopedElementWizardPage.java b/core/source/org/openoffice/ide/eclipse/core/wizards/pages/NewScopedElementWizardPage.java
index bbcadb2..834c872 100644
--- a/core/source/org/openoffice/ide/eclipse/core/wizards/pages/NewScopedElementWizardPage.java
+++ b/core/source/org/openoffice/ide/eclipse/core/wizards/pages/NewScopedElementWizardPage.java
@@ -62,7 +62,7 @@ import org.openoffice.ide.eclipse.core.gui.rows.TextRow;
import org.openoffice.ide.eclipse.core.model.IUnoFactoryConstants;
import org.openoffice.ide.eclipse.core.model.IUnoidlProject;
import org.openoffice.ide.eclipse.core.model.UnoFactoryData;
-import org.openoffice.ide.eclipse.core.preferences.IOOo;
+import org.openoffice.ide.eclipse.core.model.config.IOOo;
import org.openoffice.ide.eclipse.core.unotypebrowser.UnoTypeProvider;
import org.openoffice.ide.eclipse.core.wizards.Messages;
import org.openoffice.ide.eclipse.core.wizards.utils.IListenablePage;
diff --git a/core/source/org/openoffice/ide/eclipse/core/wizards/pages/NewUnoProjectPage.java b/core/source/org/openoffice/ide/eclipse/core/wizards/pages/NewUnoProjectPage.java
index 22124c1..c6f71ed 100755
--- a/core/source/org/openoffice/ide/eclipse/core/wizards/pages/NewUnoProjectPage.java
+++ b/core/source/org/openoffice/ide/eclipse/core/wizards/pages/NewUnoProjectPage.java
@@ -90,10 +90,10 @@ import org.openoffice.ide.eclipse.core.model.IUnoidlProject;
import org.openoffice.ide.eclipse.core.model.OOoContainer;
import org.openoffice.ide.eclipse.core.model.SDKContainer;
import org.openoffice.ide.eclipse.core.model.UnoFactoryData;
+import org.openoffice.ide.eclipse.core.model.config.IConfigListener;
+import org.openoffice.ide.eclipse.core.model.config.IOOo;
+import org.openoffice.ide.eclipse.core.model.config.ISdk;
import org.openoffice.ide.eclipse.core.model.language.ILanguage;
-import org.openoffice.ide.eclipse.core.preferences.IConfigListener;
-import org.openoffice.ide.eclipse.core.preferences.IOOo;
-import org.openoffice.ide.eclipse.core.preferences.ISdk;
import org.openoffice.ide.eclipse.core.wizards.Messages;
import org.openoffice.ide.eclipse.core.wizards.NewUnoProjectWizard;
diff --git a/cpp/source/org/openoffice/ide/eclipse/cpp/CppBuilder.java b/cpp/source/org/openoffice/ide/eclipse/cpp/CppBuilder.java
index 7d37407..70aeac4 100644
--- a/cpp/source/org/openoffice/ide/eclipse/cpp/CppBuilder.java
+++ b/cpp/source/org/openoffice/ide/eclipse/cpp/CppBuilder.java
@@ -35,10 +35,9 @@ import java.io.IOException;
import java.io.InputStreamReader;
import java.io.LineNumberReader;
-import org.eclipse.cdt.core.model.CoreModel;
-import org.eclipse.cdt.core.model.ICProject;
-import org.eclipse.cdt.core.model.IIncludeEntry;
-import org.eclipse.cdt.core.model.IPathEntry;
+import org.eclipse.cdt.core.settings.model.CIncludePathEntry;
+import org.eclipse.cdt.core.settings.model.CLibraryPathEntry;
+import org.eclipse.cdt.core.settings.model.ICSettingEntry;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -48,13 +47,13 @@ import org.openoffice.ide.eclipse.core.PluginLogger;
import org.openoffice.ide.eclipse.core.model.IUnoidlProject;
import org.openoffice.ide.eclipse.core.model.ProjectsManager;
import org.openoffice.ide.eclipse.core.model.UnoPackage;
+import org.openoffice.ide.eclipse.core.model.config.IOOo;
+import org.openoffice.ide.eclipse.core.model.config.ISdk;
import org.openoffice.ide.eclipse.core.model.language.ILanguageBuilder;
-import org.openoffice.ide.eclipse.core.preferences.IOOo;
-import org.openoffice.ide.eclipse.core.preferences.ISdk;
public class CppBuilder implements ILanguageBuilder {
- private static final String INCLUDE = "include"; //$NON-NLS-1$
+ public static final String INCLUDE = "include"; //$NON-NLS-1$
@Override
public IPath createLibrary(IUnoidlProject unoProject) throws Exception {
@@ -117,21 +116,12 @@ public class CppBuilder implements ILanguageBuilder {
process.waitFor();
// Check if the build/include dir is in the includes
- ICProject cprj = CoreModel.getDefault().create( pPrj );
- IPath incPath = unoprj.getBuildPath().append( INCLUDE );
- if ( !cprj.isOnSourceRoot( pPrj.getFolder( incPath ) ) ) {
- try {
- IIncludeEntry entry = CoreModel.newIncludeEntry( null, null, incPath );
- IPathEntry[] entries = cprj.getRawPathEntries();
- IPathEntry[] newEntries = new IPathEntry[ entries.length + 1 ];
- System.arraycopy( entries, 0, newEntries, 0, entries.length );
- newEntries[entries.length] = entry;
- cprj.setRawPathEntries( newEntries, pMonitor );
- } catch ( Exception e ) {
- PluginLogger.warning( "Unable to add the local includes directory to the C++ project",e );
- }
-
- }
+ IPath includePath = pPrj.getFolder(
+ unoprj.getBuildPath().append( CppBuilder.INCLUDE ) ).getProjectRelativePath();
+
+ CppProjectHandler.addIncludesAndLibs( pPrj,
+ new CIncludePathEntry[]{ new CIncludePathEntry( includePath, ICSettingEntry.VALUE_WORKSPACE_PATH ) },
+ new CLibraryPathEntry[0] );
}
} catch (InterruptedException e) {
PluginLogger.error(
diff --git a/cpp/source/org/openoffice/ide/eclipse/cpp/CppProjectHandler.java b/cpp/source/org/openoffice/ide/eclipse/cpp/CppProjectHandler.java
index 1255164..4484f58 100644
--- a/cpp/source/org/openoffice/ide/eclipse/cpp/CppProjectHandler.java
+++ b/cpp/source/org/openoffice/ide/eclipse/cpp/CppProjectHandler.java
@@ -30,48 +30,63 @@
************************************************************************/
package org.openoffice.ide.eclipse.cpp;
+import java.util.ArrayList;
+import java.util.List;
+
import org.eclipse.cdt.core.CCProjectNature;
import org.eclipse.cdt.core.CProjectNature;
import org.eclipse.cdt.core.model.CoreModel;
import org.eclipse.cdt.core.model.ICProject;
-import org.eclipse.cdt.core.model.IIncludeEntry;
import org.eclipse.cdt.core.model.IPathEntry;
import org.eclipse.cdt.core.model.ISourceEntry;
-import org.eclipse.cdt.make.core.MakeProjectNature;
+import org.eclipse.cdt.core.settings.model.CIncludePathEntry;
+import org.eclipse.cdt.core.settings.model.CLibraryPathEntry;
+import org.eclipse.cdt.core.settings.model.CSourceEntry;
+import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
+import org.eclipse.cdt.core.settings.model.ICFolderDescription;
+import org.eclipse.cdt.core.settings.model.ICLanguageSetting;
+import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
+import org.eclipse.cdt.core.settings.model.ICProjectDescription;
+import org.eclipse.cdt.core.settings.model.ICSettingEntry;
+import org.eclipse.cdt.core.settings.model.ICSourceEntry;
+import org.eclipse.cdt.managedbuilder.core.IConfiguration;
+import org.eclipse.cdt.managedbuilder.core.IManagedProject;
+import org.eclipse.cdt.managedbuilder.core.IProjectType;
+import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
+import org.eclipse.cdt.managedbuilder.core.ManagedCProjectNature;
import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.openoffice.ide.eclipse.core.PluginLogger;
+import org.openoffice.ide.eclipse.core.model.IUnoFactoryConstants;
import org.openoffice.ide.eclipse.core.model.IUnoidlProject;
+import org.openoffice.ide.eclipse.core.model.ProjectsManager;
import org.openoffice.ide.eclipse.core.model.UnoFactoryData;
+import org.openoffice.ide.eclipse.core.model.config.IOOo;
import org.openoffice.ide.eclipse.core.model.language.IProjectHandler;
-import org.openoffice.ide.eclipse.core.preferences.IOOo;
-import org.openoffice.ide.eclipse.core.preferences.ISdk;
public class CppProjectHandler implements IProjectHandler {
@Override
public void addLanguageDependencies(IUnoidlProject unoproject,
IProgressMonitor monitor) throws CoreException {
-
- ISdk sdk = unoproject.getSdk();
- ISourceEntry sourceEntry = CoreModel.newSourceEntry( unoproject.getSourcePath() );
- IIncludeEntry includesEntry = CoreModel.newIncludeEntry( null, null,
- sdk.getIncludePath(), true );
- IProject prj = ResourcesPlugin.getWorkspace().getRoot().getProject( unoproject.getName() );
- ICProject cprj = CoreModel.getDefault().create( prj );
-
- cprj.setRawPathEntries(new IPathEntry[]{
- sourceEntry, includesEntry }, monitor);
+ // Everything is done in the configureProject method
}
@Override
public void addOOoDependencies(IOOo ooo, IProject project) {
- // TODO Auto-generated method stub
-
+ IUnoidlProject unoprj = ProjectsManager.getProject( project.getName() );
+
+ CIncludePathEntry sdkIncludes = new CIncludePathEntry( unoprj.getSdk().getIncludePath(), 0 );
+ ArrayList< CLibraryPathEntry > libs = new ArrayList<CLibraryPathEntry>();
+ String[] oooLibs = ooo.getLibsPath();
+ for (String libPath : oooLibs) {
+ libs.add( new CLibraryPathEntry( new Path( libPath ), 0 ) );
+ }
+ addIncludesAndLibs( project, new CIncludePathEntry[] { sdkIncludes },
+ libs.toArray( new CLibraryPathEntry[libs.size()]) );
}
@Override
@@ -90,7 +105,7 @@ public class CppProjectHandler implements IProjectHandler {
CProjectNature.addCNature(pProject, null);
CCProjectNature.addCCNature( pProject, null );
- MakeProjectNature.addNature( pProject, null ) ;
+ ManagedCProjectNature.addManagedNature( pProject, null );
PluginLogger.debug( "C++ project nature set" );
@@ -99,10 +114,58 @@ public class CppProjectHandler implements IProjectHandler {
}
}
+ /**
+ * {@inheritDoc}
+ */
@Override
- public void configureProject(UnoFactoryData data) throws Exception {
- // TODO Auto-generated method stub
-
+ public void configureProject(UnoFactoryData pData) throws Exception {
+ IProject prj = (IProject)pData.getProperty(
+ IUnoFactoryConstants.PROJECT_HANDLE);
+
+ // I don't know why, but this is needed to avoid problems when saving the buildInfos
+ String srcDir = (String)pData.getProperty( IUnoFactoryConstants.PROJECT_SRC_DIR );
+ IPath srcPath = prj.getFolder( srcDir ).getProjectRelativePath();
+ ISourceEntry srcEntry = CoreModel.newSourceEntry( srcPath );
+ ICProject cPrj = CoreModel.getDefault().getCModel().getCProject( prj.getName() );
+ CoreModel.setRawPathEntries( cPrj, new IPathEntry[] { srcEntry }, null );
+
+ // Create the managed build configurations
+ IProjectType prjType = null;
+ ArrayList< IConfiguration > validConfigs = new ArrayList<IConfiguration>();
+
+ IProjectType[] types = ManagedBuildManager.getDefinedProjectTypes();
+ for (IProjectType type : types) {
+ boolean isSharedLib = type.getBuildArtefactType().getId().equals(
+ ManagedBuildManager.BUILD_ARTEFACT_TYPE_PROPERTY_SHAREDLIB );
+ boolean isTest = type.isTestProjectType();
+ boolean isSupported = type.isSupported();
+ boolean isAbstract = type.isAbstract();
+
+ if ( isSharedLib && !isTest && isSupported && !isAbstract ) {
+ IConfiguration[] configs = type.getConfigurations();
+ for (IConfiguration config : configs) {
+ if ( ManagedBuildManager.isPlatformOk( config.getToolChain() ) ) {
+ prjType = type;
+ validConfigs.add( config );
+ }
+ }
+ }
+ }
+
+ // Initialize the project
+ ManagedBuildManager.createBuildInfo( prj );
+ IManagedProject managedPrj = ManagedBuildManager.createManagedProject( prj, prjType );
+ ICSourceEntry sourceEntry = new CSourceEntry( prj.getFolder(srcPath).getProjectRelativePath(), null, 0 );
+
+ for ( IConfiguration config : validConfigs ) {
+ String newId = ManagedBuildManager.calculateChildId( config.getId(), null);
+ IConfiguration newConf = managedPrj.createConfiguration( config, newId );
+ newConf.setArtifactName( prj.getName().replaceAll( " ", new String( ) ) ); //$NON-NLS-1$
+ newConf.setName( config.getName() );
+ newConf.setSourceEntries( new ICSourceEntry[] { sourceEntry } );
+ newConf.setArtifactExtension( "uno." + newConf.getArtifactExtension() ); //$NON-NLS-1$
+ }
+ ManagedBuildManager.saveBuildInfo( prj, true );
}
/**
@@ -122,6 +185,9 @@ public class CppProjectHandler implements IProjectHandler {
return service.substring( service.lastIndexOf( '.' ) + 1 ) + "Impl"; //$NON-NLS-1$
}
+ /**
+ * {@inheritDoc}
+ */
@Override
public String getLibraryPath(IUnoidlProject prj) {
// TODO Auto-generated method stub
@@ -137,9 +203,94 @@ public class CppProjectHandler implements IProjectHandler {
return "--cpp"; //$NON-NLS-1$
}
+ /**
+ * {@inheritDoc}
+ */
@Override
public void removeOOoDependencies(IOOo ooo, IProject project) {
- // TODO Auto-generated method stub
-
+ IUnoidlProject unoprj = ProjectsManager.getProject( project.getName() );
+
+ CIncludePathEntry sdkIncludes = new CIncludePathEntry( unoprj.getSdk().getIncludePath(), 0 );
+ ArrayList< CLibraryPathEntry > libs = new ArrayList<CLibraryPathEntry>();
+ String[] oooLibs = ooo.getLibsPath();
+ for (String libPath : oooLibs) {
+ libs.add( new CLibraryPathEntry( new Path( libPath ), 0 ) );
+ }
+ removeIncludesAndLibs( project, new CIncludePathEntry[] { sdkIncludes },
+ libs.toArray( new CLibraryPathEntry[libs.size()]) );
+ }
+
+ static public void addIncludesAndLibs( IProject pProject, CIncludePathEntry[] pNewIncludes,
+ CLibraryPathEntry[] pNewLibs ) {
+ ICProjectDescription prjDesc = CoreModel.getDefault().getProjectDescription( pProject );
+ ICConfigurationDescription[] configs = prjDesc.getConfigurations();
+
+ // Set them on all the languages of all the configurations
+ for (ICConfigurationDescription config : configs) {
+ ICFolderDescription folder = config.getRootFolderDescription();
+ ICLanguageSetting[] languages = folder.getLanguageSettings();
+ for (ICLanguageSetting lang : languages) {
+ // The includes
+ List<ICLanguageSettingEntry> includes = lang.getSettingEntriesList( ICSettingEntry.INCLUDE_PATH );
+ for ( CIncludePathEntry newEntry : pNewIncludes ) {
+ if ( !includes.contains( newEntry ) ) {
+ includes.add( newEntry );
+ }
+ }
+ lang.setSettingEntries( ICSettingEntry.INCLUDE_PATH, includes );
+
+ // The libs
+ List<ICLanguageSettingEntry> libs = lang.getSettingEntriesList( ICSettingEntry.LIBRARY_PATH );
+ for ( CLibraryPathEntry newLib : pNewLibs ) {
+ if ( !includes.contains( newLib ) ) {
+ libs.add( newLib );
+ }
+ }
+ lang.setSettingEntries( ICSettingEntry.LIBRARY_PATH, libs );
+ }
+ }
+
+ try {
+ CoreModel.getDefault().setProjectDescription( pProject, prjDesc );
+ } catch ( CoreException e ) {
+ PluginLogger.error( "Error setting the includes and libraries", e );
+ }
+ }
+
+ static public void removeIncludesAndLibs( IProject pProject, CIncludePathEntry[] pOldIncludes,
+ CLibraryPathEntry[] pOldLibs ) {
+ ICProjectDescription prjDesc = CoreModel.getDefault().getProjectDescription( pProject );
+ ICConfigurationDescription[] configs = prjDesc.getConfigurations();
+
+ // Set them on all the languages of all the configurations
+ for (ICConfigurationDescription config : configs) {
+ ICFolderDescription folder = config.getRootFolderDescription();
+ ICLanguageSetting[] languages = folder.getLanguageSettings();
+ for (ICLanguageSetting lang : languages) {
+ // The includes
+ List<ICLanguageSettingEntry> includes = lang.getSettingEntriesList( ICSettingEntry.INCLUDE_PATH );
+ for ( CIncludePathEntry oldEntry : pOldIncludes ) {
+ if ( includes.contains( oldEntry ) ) {
+ includes.remove( oldEntry );
+ }
+ }
+ lang.setSettingEntries( ICSettingEntry.INCLUDE_PATH, includes );
+
+ // The libs
+ List<ICLanguageSettingEntry> libs = lang.getSettingEntriesList( ICSettingEntry.LIBRARY_PATH );
+ for ( CLibraryPathEntry oldLib : pOldLibs ) {
+ if ( includes.contains( oldLib ) ) {
+ libs.remove( oldLib );
+ }
+ }
+ lang.setSettingEntries( ICSettingEntry.LIBRARY_PATH, libs );
+ }
+ }
+
+ try {
+ CoreModel.getDefault().setProjectDescription( pProject, prjDesc );
+ } catch ( CoreException e ) {
+ PluginLogger.error( "Error setting the includes and libaries", e );
+ }
}
}
diff --git a/java/source/org/openoffice/ide/eclipse/java/JavaBuilder.java b/java/source/org/openoffice/ide/eclipse/java/JavaBuilder.java
index 6227d47..e6692d2 100644
--- a/java/source/org/openoffice/ide/eclipse/java/JavaBuilder.java
+++ b/java/source/org/openoffice/ide/eclipse/java/JavaBuilder.java
@@ -70,9 +70,9 @@ import org.openoffice.ide.eclipse.core.PluginLogger;
import org.openoffice.ide.eclipse.core.model.IUnoidlProject;
import org.openoffice.ide.eclipse.core.model.ProjectsManager;
import org.openoffice.ide.eclipse.core.model.UnoPackage;
+import org.openoffice.ide.eclipse.core.model.config.IOOo;
+import org.openoffice.ide.eclipse.core.model.config.ISdk;
import org.openoffice.ide.eclipse.core.model.language.ILanguageBuilder;
-import org.openoffice.ide.eclipse.core.preferences.IOOo;
-import org.openoffice.ide.eclipse.core.preferences.ISdk;
import org.openoffice.ide.eclipse.core.utils.ZipContent;
import org.openoffice.ide.eclipse.java.utils.ZipContentHelper;
diff --git a/java/source/org/openoffice/ide/eclipse/java/JavaProjectHandler.java b/java/source/org/openoffice/ide/eclipse/java/JavaProjectHandler.java
index a464439..8b34526 100644
--- a/java/source/org/openoffice/ide/eclipse/java/JavaProjectHandler.java
+++ b/java/source/org/openoffice/ide/eclipse/java/JavaProjectHandler.java
@@ -62,8 +62,8 @@ import org.openoffice.ide.eclipse.core.model.IUnoFactoryConstants;
import org.openoffice.ide.eclipse.core.model.IUnoidlProject;
import org.openoffice.ide.eclipse.core.model.ProjectsManager;
import org.openoffice.ide.eclipse.core.model.UnoFactoryData;
+import org.openoffice.ide.eclipse.core.model.config.IOOo;
import org.openoffice.ide.eclipse.core.model.language.IProjectHandler;
-import org.openoffice.ide.eclipse.core.preferences.IOOo;
import org.openoffice.ide.eclipse.java.build.OOoContainerPage;
import org.openoffice.ide.eclipse.java.registration.RegistrationHelper;
import org.openoffice.ide.eclipse.java.tests.TestsHelper;
diff --git a/java/source/org/openoffice/ide/eclipse/java/build/OOoClasspathContainer.java b/java/source/org/openoffice/ide/eclipse/java/build/OOoClasspathContainer.java
index 09e629a..03a7454 100644
--- a/java/source/org/openoffice/ide/eclipse/java/build/OOoClasspathContainer.java
+++ b/java/source/org/openoffice/ide/eclipse/java/build/OOoClasspathContainer.java
@@ -51,7 +51,7 @@ import org.eclipse.core.runtime.Path;
import org.eclipse.jdt.core.IClasspathContainer;
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.JavaCore;
-import org.openoffice.ide.eclipse.core.preferences.IOOo;
+import org.openoffice.ide.eclipse.core.model.config.IOOo;
import org.openoffice.ide.eclipse.java.JavaProjectHandler;
/**
diff --git a/java/source/org/openoffice/ide/eclipse/java/build/OOoContainerPage.java b/java/source/org/openoffice/ide/eclipse/java/build/OOoContainerPage.java
index c3924cb..1278107 100644
--- a/java/source/org/openoffice/ide/eclipse/java/build/OOoContainerPage.java
+++ b/java/source/org/openoffice/ide/eclipse/java/build/OOoContainerPage.java
@@ -63,7 +63,7 @@ import org.openoffice.ide.eclipse.core.gui.rows.OOoRow;
import org.openoffice.ide.eclipse.core.model.IUnoidlProject;
import org.openoffice.ide.eclipse.core.model.OOoContainer;
import org.openoffice.ide.eclipse.core.model.ProjectsManager;
-import org.openoffice.ide.eclipse.core.preferences.IOOo;
+import org.openoffice.ide.eclipse.core.model.config.IOOo;
import org.openoffice.ide.eclipse.java.Messages;
import org.openoffice.ide.eclipse.java.OOoJavaPlugin;
diff --git a/java/source/org/openoffice/ide/eclipse/java/build/OooClasspathContainerInitializer.java b/java/source/org/openoffice/ide/eclipse/java/build/OooClasspathContainerInitializer.java
index c852cf6..2d388cc 100644
--- a/java/source/org/openoffice/ide/eclipse/java/build/OooClasspathContainerInitializer.java
+++ b/java/source/org/openoffice/ide/eclipse/java/build/OooClasspathContainerInitializer.java
@@ -50,7 +50,7 @@ import org.eclipse.jdt.core.IClasspathContainer;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;
import org.openoffice.ide.eclipse.core.model.OOoContainer;
-import org.openoffice.ide.eclipse.core.preferences.IOOo;
+import org.openoffice.ide.eclipse.core.model.config.IOOo;
/**
* Initializes a classpath container for OOo instances.
More information about the ooo-build-commit
mailing list