[ooo-build-commit] ooeclipse: Branch 'master'
Cédric Bosdonnat
cbosdo at kemper.freedesktop.org
Mon Sep 28 02:11:22 PDT 2009
core/build/build.properties | 4
cpp/.checkstyle | 10 +
cpp/.project | 6
cpp/source/org/openoffice/ide/eclipse/cpp/Activator.java | 68 +++---
cpp/source/org/openoffice/ide/eclipse/cpp/CDTHelper.java | 97 ++++++++-
cpp/source/org/openoffice/ide/eclipse/cpp/CppBuilder.java | 24 +-
cpp/source/org/openoffice/ide/eclipse/cpp/CppProjectHandler.java | 99 ++++++----
cpp/source/org/openoffice/ide/eclipse/cpp/CppUI.java | 11 +
cpp/source/org/openoffice/ide/eclipse/cpp/Language.java | 6
cpp/source/org/openoffice/ide/eclipse/cpp/Messages.java | 53 +++++
cpp/source/org/openoffice/ide/eclipse/cpp/OOoSdkProjectJob.java | 79 ++++++-
cpp/source/org/openoffice/ide/eclipse/cpp/client/ClientWizard.java | 17 +
cpp/source/org/openoffice/ide/eclipse/cpp/client/Messages.java | 53 +++++
cpp/source/org/openoffice/ide/eclipse/cpp/client/UnoClientWizardPage.java | 26 ++
cpp/source/org/openoffice/ide/eclipse/cpp/client/UnoConnectionPage.java | 6
java/build/build.properties | 4
16 files changed, 442 insertions(+), 121 deletions(-)
New commits:
commit ea6c38d589666d3cc336d144b1f7f67657efc96e
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date: Mon Sep 28 11:12:07 2009 +0200
Code cleanup
* Added the missing Javadocs
* Applied the checkstyle rules to the project
diff --git a/core/build/build.properties b/core/build/build.properties
index e567571..003b9ca 100644
--- a/core/build/build.properties
+++ b/core/build/build.properties
@@ -1,3 +1,3 @@
#Wed Apr 26 20:26:45 CEST 2006
-core.plugin.version=1.1.2
-debug=true
\ No newline at end of file
+core.plugin.version=1.2.0
+debug=true
diff --git a/cpp/.checkstyle b/cpp/.checkstyle
new file mode 100644
index 0000000..866dd7c
--- /dev/null
+++ b/cpp/.checkstyle
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<fileset-config file-format-version="1.2.0" simple-config="true">
+ <local-check-config name="OOEclipse checks" location="/org.openoffice.ide.eclipse.build/checkstyle.xml" type="project" description="">
+ <additional-data name="protect-config-file" value="false"/>
+ </local-check-config>
+ <fileset name="all" enabled="true" check-config-name="OOEclipse checks" local="true">
+ <file-match-pattern match-pattern="." include-pattern="true"/>
+ </fileset>
+</fileset-config>
diff --git a/cpp/.project b/cpp/.project
index cb637c5..9acd25e 100644
--- a/cpp/.project
+++ b/cpp/.project
@@ -20,9 +20,15 @@
<arguments>
</arguments>
</buildCommand>
+ <buildCommand>
+ <name>net.sf.eclipsecs.core.CheckstyleBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>net.sf.eclipsecs.core.CheckstyleNature</nature>
</natures>
</projectDescription>
diff --git a/cpp/source/org/openoffice/ide/eclipse/cpp/Activator.java b/cpp/source/org/openoffice/ide/eclipse/cpp/Activator.java
index 38d1bab..0033025 100644
--- a/cpp/source/org/openoffice/ide/eclipse/cpp/Activator.java
+++ b/cpp/source/org/openoffice/ide/eclipse/cpp/Activator.java
@@ -34,47 +34,45 @@ import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
/**
- * The activator class controls the plug-in life cycle
+ * The activator class controls the plug-in life cycle.
*/
public class Activator extends AbstractUIPlugin {
- // The plug-in ID
- public static final String PLUGIN_ID = "org.openoffice.ide.eclipse.cpp"; //$NON-NLS-1$
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.openoffice.ide.eclipse.cpp"; //$NON-NLS-1$
- // The shared instance
- private static Activator plugin;
-
- /**
- * The constructor
- */
- public Activator() {
- }
+ // The shared instance
+ private static Activator sPlugin;
+
+ /**
+ * The constructor.
+ */
+ public Activator() {
+ }
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- }
+ /**
+ * {@inheritDoc}
+ */
+ public void start(BundleContext pContext) throws Exception {
+ super.start(pContext);
+ sPlugin = this;
+ }
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
+ /**
+ * {@inheritDoc}
+ */
+ public void stop(BundleContext pContext) throws Exception {
+ sPlugin = null;
+ super.stop(pContext);
+ }
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static Activator getDefault() {
- return plugin;
- }
+ /**
+ * Returns the shared instance.
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return sPlugin;
+ }
}
diff --git a/cpp/source/org/openoffice/ide/eclipse/cpp/CDTHelper.java b/cpp/source/org/openoffice/ide/eclipse/cpp/CDTHelper.java
index 4f2933d..a7ff37e 100644
--- a/cpp/source/org/openoffice/ide/eclipse/cpp/CDTHelper.java
+++ b/cpp/source/org/openoffice/ide/eclipse/cpp/CDTHelper.java
@@ -42,6 +42,7 @@ 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.managedbuilder.core.IConfiguration;
import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
import org.eclipse.cdt.managedbuilder.core.IOption;
@@ -53,33 +54,74 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.openoffice.ide.eclipse.core.PluginLogger;
+/**
+ * Utility class providing shortcuts for CDT operations on projects.
+ *
+ * @author cbosdonnat
+ *
+ */
public class CDTHelper {
+ /**
+ * Add the C++ project nature and all the other needed natures.
+ *
+ * @param pProject the project on which to set the natures
+ * @param pMonitor a progress monitor
+ *
+ * @throws CoreException if anything wrong happens
+ */
public static void addCDTNature( IProject pProject, IProgressMonitor pMonitor ) throws CoreException {
- if (!pProject.exists()) {
- pProject.create( pMonitor );
- PluginLogger.debug(
- "Project created during language specific operation"); //$NON-NLS-1$
- }
-
- if (!pProject.isOpen()) {
- pProject.open( pMonitor );
- PluginLogger.debug("Project opened"); //$NON-NLS-1$
- }
-
- CProjectNature.addCNature(pProject, pMonitor );
- CCProjectNature.addCCNature( pProject, pMonitor );
- ManagedCProjectNature.addManagedNature( pProject, pMonitor );
+ if (!pProject.exists()) {
+ pProject.create( pMonitor );
+ PluginLogger.debug(
+ "Project created during language specific operation"); //$NON-NLS-1$
+ }
+
+ if (!pProject.isOpen()) {
+ pProject.open( pMonitor );
+ PluginLogger.debug("Project opened"); //$NON-NLS-1$
+ }
+
+ CProjectNature.addCNature(pProject, pMonitor );
+ CCProjectNature.addCCNature( pProject, pMonitor );
+ ManagedCProjectNature.addManagedNature( pProject, pMonitor );
}
+ /**
+ * Add some configuration entries like includes, macros, libraries paths.
+ *
+ * @param pProject the project on which to add the entries
+ * @param pNewEntries the new entries to add
+ * @param pEntriesType the entries type in {@link ICSettingEntry}
+ *
+ * @see #changeEntries(IProject, ICLanguageSettingEntry[], int, boolean)
+ */
public static void addEntries( IProject pProject, ICLanguageSettingEntry[] pNewEntries, int pEntriesType ) {
changeEntries( pProject, pNewEntries, pEntriesType, false );
}
+ /**
+ * Remove some configuration entries like includes, macros, libraries paths.
+ *
+ * @param pProject the project on which to remove the entries
+ * @param pOldEntries the new entries to remove
+ * @param pEntriesType the entries type in {@link ICSettingEntry}
+ *
+ * @see #changeEntries(IProject, ICLanguageSettingEntry[], int, boolean)
+ */
public static void removeEntries( IProject pProject, ICLanguageSettingEntry[] pOldEntries, int pEntriesType ) {
changeEntries( pProject, pOldEntries, pEntriesType, true );
}
+ /**
+ * Add/Remove some configuration entries like includes, macros, libraries paths.
+ *
+ * @param pProject the project to handle
+ * @param pEntries the entries to add/remove
+ * @param pEntriesType the entries type in {@link ICSettingEntry}
+ * @param pRemove <code>true</code> if the entries have to be removed, <code>false</code>
+ * if they have to be added
+ */
private static void changeEntries( IProject pProject, ICLanguageSettingEntry[] pEntries,
int pEntriesType, boolean pRemove ) {
ICProjectDescription prjDesc = CoreModel.getDefault().getProjectDescription( pProject );
@@ -110,14 +152,38 @@ public class CDTHelper {
}
}
+ /**
+ * Add some libraries (-l gcc option) to the project.
+ *
+ * @param pProject the project to handle
+ * @param pLibNames the libraries to add
+ *
+ * @see #changeLibs(IProject, String[], boolean)
+ */
public static void addLibs( IProject pProject, String[] pLibNames ) {
changeLibs( pProject, pLibNames, false );
}
+ /**
+ * Remove some libraries (-l gcc option) to the project.
+ *
+ * @param pProject the project to handle
+ * @param pLibNames the libraries to remove
+ *
+ * @see #changeLibs(IProject, String[], boolean)
+ */
public static void removeLibs( IProject pProject, String[] pLibNames ) {
changeLibs( pProject, pLibNames, true );
}
+ /**
+ * Add/remove some libraries (-l gcc option) to the project.
+ *
+ * @param pProject the project to handle
+ * @param pLibNames the libraries to add/remove
+ * @param pRemove <code>true</code> if the libs have to be removed,
+ * <code>false</code> if they have to be added
+ */
private static void changeLibs( IProject pProject, String[] pLibNames, boolean pRemove ) {
IManagedBuildInfo infos = ManagedBuildManager.getBuildInfo( pProject );
IConfiguration[] configs = infos.getManagedProject().getConfigurations();
@@ -139,7 +205,8 @@ public class CDTHelper {
newLibs.remove( lib );
}
}
- ManagedBuildManager.setOption(config, tool, option, newLibs.toArray( new String[ newLibs.size() ] ) );
+ ManagedBuildManager.setOption(config, tool, option,
+ newLibs.toArray( new String[ newLibs.size() ] ) );
}
} catch ( Exception e ) {
PluginLogger.error( Messages.getString("CDTHelper.LinkerOptionsError"), e ); //$NON-NLS-1$
diff --git a/cpp/source/org/openoffice/ide/eclipse/cpp/CppBuilder.java b/cpp/source/org/openoffice/ide/eclipse/cpp/CppBuilder.java
index 2cda4b4..30cb453 100644
--- a/cpp/source/org/openoffice/ide/eclipse/cpp/CppBuilder.java
+++ b/cpp/source/org/openoffice/ide/eclipse/cpp/CppBuilder.java
@@ -50,24 +50,30 @@ 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;
+/**
+ * Helper class for the C++ UNO internal build tools.
+ *
+ * @author cbosdonnat
+ *
+ */
public class CppBuilder implements ILanguageBuilder {
public static final String INCLUDE = "include"; //$NON-NLS-1$
@Override
- public IPath createLibrary(IUnoidlProject unoProject) throws Exception {
+ public IPath createLibrary(IUnoidlProject pUnoProject) throws Exception {
// TODO Auto-generated method stub
return null;
}
@Override
- public void fillUnoPackage(UnoPackage unoPackage, IUnoidlProject prj) {
+ public void fillUnoPackage(UnoPackage pUnoPackage, IUnoidlProject pPrj) {
// TODO Auto-generated method stub
}
@Override
- public String[] getBuildEnv(IUnoidlProject unoProject) {
+ public String[] getBuildEnv(IUnoidlProject pUnoProject) {
// TODO Auto-generated method stub
return null;
}
@@ -91,10 +97,11 @@ public class CppBuilder implements ILanguageBuilder {
}
String command = "cppumaker -T\"*\"" + //$NON-NLS-1$
- " -Gc -BUCR " + //$NON-NLS-1$
- "-O \"" + new File( pBuildFolder, INCLUDE ).getAbsolutePath() + "\" \"" + //$NON-NLS-1$ //$NON-NLS-2$
- pTypesFile.getAbsolutePath() + "\" " + //$NON-NLS-1$
- oooTypesArgs;
+ " -Gc -BUCR " + //$NON-NLS-1$
+ "-O \"" + new File( pBuildFolder, INCLUDE ).getAbsolutePath() + //$NON-NLS-1$
+ "\" \"" + //$NON-NLS-1$
+ pTypesFile.getAbsolutePath() + "\" " + //$NON-NLS-1$
+ oooTypesArgs;
IUnoidlProject unoprj = ProjectsManager.getProject(pPrj.getName());
Process process = pSdk.runTool(unoprj,command, pMonitor);
@@ -119,7 +126,8 @@ public class CppBuilder implements ILanguageBuilder {
unoprj.getBuildPath().append( CppBuilder.INCLUDE ) ).getProjectRelativePath();
CDTHelper.addEntries( pPrj,
- new CIncludePathEntry[]{ new CIncludePathEntry( includePath, ICSettingEntry.VALUE_WORKSPACE_PATH ) },
+ new CIncludePathEntry[]{
+ new CIncludePathEntry( includePath, ICSettingEntry.VALUE_WORKSPACE_PATH ) },
ICSettingEntry.INCLUDE_PATH );
}
diff --git a/cpp/source/org/openoffice/ide/eclipse/cpp/CppProjectHandler.java b/cpp/source/org/openoffice/ide/eclipse/cpp/CppProjectHandler.java
index ae6c52f..07cc886 100644
--- a/cpp/source/org/openoffice/ide/eclipse/cpp/CppProjectHandler.java
+++ b/cpp/source/org/openoffice/ide/eclipse/cpp/CppProjectHandler.java
@@ -65,6 +65,12 @@ 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.IProjectHandler;
+/**
+ * Helper class handling the C++ parts of UNO projects.
+ *
+ * @author cbosdonnat
+ *
+ */
public class CppProjectHandler implements IProjectHandler {
public static final String[] LIBS = {
@@ -75,15 +81,15 @@ public class CppProjectHandler implements IProjectHandler {
};
@Override
- public void addLanguageDependencies(IUnoidlProject unoproject,
- IProgressMonitor monitor) throws CoreException {
+ public void addLanguageDependencies(IUnoidlProject pUnoproject,
+ IProgressMonitor pMonitor) throws CoreException {
// Everything is done in the configureProject method
}
@Override
- public void addOOoDependencies(IOOo ooo, IProject project) {
- IUnoidlProject unoprj = ProjectsManager.getProject( project.getName() );
- addOOoDependencies( ooo, unoprj.getSdk(), project );
+ public void addOOoDependencies(IOOo pOoo, IProject pProject) {
+ IUnoidlProject unoprj = ProjectsManager.getProject( pProject.getName() );
+ addOOoDependencies( pOoo, unoprj.getSdk(), pProject );
}
@Override
@@ -155,17 +161,16 @@ public class CppProjectHandler implements IProjectHandler {
* {@inheritDoc}
*/
@Override
- public IPath getImplementationFile(String implementationName) {
- return new Path( implementationName + ".cxx" ); //$NON-NLS-1$
+ public IPath getImplementationFile(String pImplementationName) {
+ return new Path( pImplementationName + ".cxx" ); //$NON-NLS-1$
}
/**
* {@inheritDoc}
*/
@Override
- public String getImplementationName(IUnoidlProject prj, String service)
- throws Exception {
- return service.substring( service.lastIndexOf( '.' ) + 1 ) + "Impl"; //$NON-NLS-1$
+ public String getImplementationName(IUnoidlProject pPrj, String pService) throws Exception {
+ return pService.substring( pService.lastIndexOf( '.' ) + 1 ) + "Impl"; //$NON-NLS-1$
}
/**
@@ -184,8 +189,7 @@ public class CppProjectHandler implements IProjectHandler {
* {@inheritDoc}
*/
@Override
- public String getSkeletonMakerLanguage(UnoFactoryData data)
- throws Exception {
+ public String getSkeletonMakerLanguage(UnoFactoryData pData) throws Exception {
return "--cpp"; //$NON-NLS-1$
}
@@ -193,11 +197,18 @@ public class CppProjectHandler implements IProjectHandler {
* {@inheritDoc}
*/
@Override
- public void removeOOoDependencies(IOOo ooo, IProject project) {
- IUnoidlProject unoprj = ProjectsManager.getProject( project.getName() );
- removeOOoDependencies( ooo, unoprj.getSdk(), project );
+ public void removeOOoDependencies(IOOo pOoo, IProject pProject) {
+ IUnoidlProject unoprj = ProjectsManager.getProject( pProject.getName() );
+ removeOOoDependencies( pOoo, unoprj.getSdk(), pProject );
}
+ /**
+ * Utility method providing the necessary macros to add depending on the OS.
+ *
+ * @param pOs the OS for which to get the macros
+ *
+ * @return the list of macros to set
+ */
private static ICLanguageSettingEntry[] getMacrosForPlatform( String pOs ) {
HashMap<String, String> macrosList = new HashMap<String, String>();
@@ -222,46 +233,64 @@ public class CppProjectHandler implements IProjectHandler {
return results.toArray( new ICLanguageSettingEntry[ results.size() ]);
}
- static public void addOOoDependencies(IOOo ooo, ISdk sdk, IProject project) {
- CIncludePathEntry sdkIncludes = new CIncludePathEntry( sdk.getIncludePath(), 0 );
- CIncludePathEntry includes = new CIncludePathEntry( OOoSdkProjectJob.getIncludes( ooo ), 0 );
+ /**
+ * Add the OOo C++ dependencies to a project.
+ *
+ * @param pOoo the OOo to configure with
+ * @param pSdk the OOo Sdk to configure with
+ * @param pProject the project to configure
+ */
+ public static void addOOoDependencies(IOOo pOoo, ISdk pSdk, IProject pProject) {
+ CIncludePathEntry sdkIncludes = new CIncludePathEntry( pSdk.getIncludePath(), 0 );
+ CIncludePathEntry includes = new CIncludePathEntry( OOoSdkProjectJob.getIncludes( pOoo ), 0 );
ArrayList< CLibraryPathEntry > libs = new ArrayList<CLibraryPathEntry>();
- String[] oooLibs = ooo.getLibsPath();
+ String[] oooLibs = pOoo.getLibsPath();
for (String libPath : oooLibs) {
libs.add( new CLibraryPathEntry( new Path( libPath ), 0 ) );
}
- IFolder oooSdkLibs = OOoSdkProjectJob.getLibraries( ooo );
+ IFolder oooSdkLibs = OOoSdkProjectJob.getLibraries( pOoo );
libs.add( new CLibraryPathEntry( oooSdkLibs, ICSettingEntry.VALUE_WORKSPACE_PATH ) );
- CDTHelper.addEntries( project, new CIncludePathEntry[] { sdkIncludes, includes }, ICSettingEntry.INCLUDE_PATH );
- CDTHelper.addEntries( project, libs.toArray( new CLibraryPathEntry[libs.size()]), ICSettingEntry.LIBRARY_PATH );
- CDTHelper.addEntries( project, getMacrosForPlatform( Platform.getOS() ), ICSettingEntry.MACRO );
- CDTHelper.addLibs( project, LIBS );
+ CDTHelper.addEntries( pProject,
+ new CIncludePathEntry[] { sdkIncludes, includes }, ICSettingEntry.INCLUDE_PATH );
+ CDTHelper.addEntries( pProject,
+ libs.toArray( new CLibraryPathEntry[libs.size()]), ICSettingEntry.LIBRARY_PATH );
+ CDTHelper.addEntries( pProject, getMacrosForPlatform( Platform.getOS() ), ICSettingEntry.MACRO );
+ CDTHelper.addLibs( pProject, LIBS );
// Run the cppumaker on the ooo types ( asynchronous )
- OOoSdkProjectJob job = new OOoSdkProjectJob(ooo, sdk );
+ OOoSdkProjectJob job = new OOoSdkProjectJob(pOoo, pSdk );
job.schedule();
- CDTHelper.addEntries( project, new ICLanguageSettingEntry[]{ includes }, ICSettingEntry.INCLUDE_PATH );
+ CDTHelper.addEntries( pProject, new ICLanguageSettingEntry[]{ includes }, ICSettingEntry.INCLUDE_PATH );
}
- static public void removeOOoDependencies(IOOo ooo, ISdk sdk, IProject project) {
- CIncludePathEntry sdkIncludes = new CIncludePathEntry( sdk.getIncludePath(), 0 );
- CIncludePathEntry includes = new CIncludePathEntry( OOoSdkProjectJob.getIncludes( ooo ), 0 );
+ /**
+ * Remove the OOo C++ dependencies to a project.
+ *
+ * @param pOoo the OOo to configure with
+ * @param pSdk the OOo Sdk to configure with
+ * @param pProject the project to configure
+ */
+ public static void removeOOoDependencies(IOOo pOoo, ISdk pSdk, IProject pProject) {
+ CIncludePathEntry sdkIncludes = new CIncludePathEntry( pSdk.getIncludePath(), 0 );
+ CIncludePathEntry includes = new CIncludePathEntry( OOoSdkProjectJob.getIncludes( pOoo ), 0 );
ArrayList< CLibraryPathEntry > libs = new ArrayList<CLibraryPathEntry>();
- String[] oooLibs = ooo.getLibsPath();
+ String[] oooLibs = pOoo.getLibsPath();
for (String libPath : oooLibs) {
libs.add( new CLibraryPathEntry( new Path( libPath ), 0 ) );
}
- IFolder oooSdkLibs = OOoSdkProjectJob.getLibraries( ooo );
+ IFolder oooSdkLibs = OOoSdkProjectJob.getLibraries( pOoo );
libs.add( new CLibraryPathEntry( oooSdkLibs, ICSettingEntry.VALUE_WORKSPACE_PATH ) );
- CDTHelper.removeEntries( project, new CIncludePathEntry[] { sdkIncludes, includes }, ICSettingEntry.INCLUDE_PATH );
- CDTHelper.removeEntries( project, libs.toArray( new CLibraryPathEntry[libs.size()]), ICSettingEntry.LIBRARY_PATH );
- CDTHelper.removeEntries( project, getMacrosForPlatform( Platform.getOS() ), ICSettingEntry.MACRO );
- CDTHelper.removeLibs( project, LIBS );
+ CDTHelper.removeEntries( pProject,
+ new CIncludePathEntry[] { sdkIncludes, includes }, ICSettingEntry.INCLUDE_PATH );
+ CDTHelper.removeEntries( pProject,
+ libs.toArray( new CLibraryPathEntry[libs.size()]), ICSettingEntry.LIBRARY_PATH );
+ CDTHelper.removeEntries( pProject, getMacrosForPlatform( Platform.getOS() ), ICSettingEntry.MACRO );
+ CDTHelper.removeLibs( pProject, LIBS );
}
}
diff --git a/cpp/source/org/openoffice/ide/eclipse/cpp/CppUI.java b/cpp/source/org/openoffice/ide/eclipse/cpp/CppUI.java
index 0cdb423..540b155 100644
--- a/cpp/source/org/openoffice/ide/eclipse/cpp/CppUI.java
+++ b/cpp/source/org/openoffice/ide/eclipse/cpp/CppUI.java
@@ -34,13 +34,22 @@ import org.openoffice.ide.eclipse.core.model.UnoFactoryData;
import org.openoffice.ide.eclipse.core.model.language.ILanguageUI;
import org.openoffice.ide.eclipse.core.model.language.LanguageWizardPage;
+/**
+ * Class for the C++ UI extensions to the core: nothing done here.
+ * @author cbosdonnat
+ *
+ */
public class CppUI implements ILanguageUI {
/**
* There is no need for C++ only options: then no page.
+ *
+ * @param pData not used
+ *
+ * @return <code>null</code>
*/
@Override
- public LanguageWizardPage getWizardPage(UnoFactoryData data) {
+ public LanguageWizardPage getWizardPage(UnoFactoryData pData) {
return null;
}
}
diff --git a/cpp/source/org/openoffice/ide/eclipse/cpp/Language.java b/cpp/source/org/openoffice/ide/eclipse/cpp/Language.java
index acea7b5..8cf917c 100644
--- a/cpp/source/org/openoffice/ide/eclipse/cpp/Language.java
+++ b/cpp/source/org/openoffice/ide/eclipse/cpp/Language.java
@@ -35,6 +35,12 @@ import org.openoffice.ide.eclipse.core.model.language.ILanguageBuilder;
import org.openoffice.ide.eclipse.core.model.language.ILanguageUI;
import org.openoffice.ide.eclipse.core.model.language.IProjectHandler;
+/**
+ * Class for the extension point.
+ *
+ * @author cbosdonnat
+ *
+ */
public class Language implements ILanguage {
@Override
diff --git a/cpp/source/org/openoffice/ide/eclipse/cpp/Messages.java b/cpp/source/org/openoffice/ide/eclipse/cpp/Messages.java
index 0c6ae86..56a4284 100644
--- a/cpp/source/org/openoffice/ide/eclipse/cpp/Messages.java
+++ b/cpp/source/org/openoffice/ide/eclipse/cpp/Messages.java
@@ -1,22 +1,69 @@
+/*************************************************************************
+ *
+ * The Contents of this file are made available subject to the terms of
+ * the GNU Lesser General Public License Version 2.1
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2009 by Novell, Inc.
+ *
+ * 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: Cédric Bosdonnat.
+ *
+ * Copyright: 2009 by Novell, Inc.
+ *
+ * All Rights Reserved.
+ *
+ ************************************************************************/
package org.openoffice.ide.eclipse.cpp;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
+/**
+ * Messages for the package.
+ *
+ * @author cbosdonnat
+ *
+ */
public class Messages {
private static final String BUNDLE_NAME = "org.openoffice.ide.eclipse.cpp.messages"; //$NON-NLS-1$
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
.getBundle(BUNDLE_NAME);
+ /**
+ * Default constructor.
+ */
private Messages() {
}
- public static String getString(String key) {
+ /**
+ * Get the string from it's key.
+ *
+ * @param pKey the key of the string
+ *
+ * @return the internationalized string
+ */
+ public static String getString(String pKey) {
+ String string = '!' + pKey + '!';
try {
- return RESOURCE_BUNDLE.getString(key);
+ string = RESOURCE_BUNDLE.getString(pKey);
} catch (MissingResourceException e) {
- return '!' + key + '!';
}
+ return string;
}
}
diff --git a/cpp/source/org/openoffice/ide/eclipse/cpp/OOoSdkProjectJob.java b/cpp/source/org/openoffice/ide/eclipse/cpp/OOoSdkProjectJob.java
index 95b1a7c..cd5b5bd 100644
--- a/cpp/source/org/openoffice/ide/eclipse/cpp/OOoSdkProjectJob.java
+++ b/cpp/source/org/openoffice/ide/eclipse/cpp/OOoSdkProjectJob.java
@@ -22,6 +22,16 @@ import org.openoffice.ide.eclipse.core.PluginLogger;
import org.openoffice.ide.eclipse.core.model.config.IOOo;
import org.openoffice.ide.eclipse.core.model.config.ISdk;
+/**
+ * Eclipse Job generating an OOo SDK project to use for the C++ UNO
+ * projects dependencies.
+ *
+ * This job also generates the headers from the UNO types defined in
+ * the OpenOffice.org instance.
+ *
+ * @author cbosdonnat
+ *
+ */
public class OOoSdkProjectJob extends Job {
private static final String INCLUDES_DIR = "includes"; //$NON-NLS-1$
@@ -31,12 +41,26 @@ public class OOoSdkProjectJob extends Job {
private IOOo mOOo;
private ISdk mSdk;
+ /**
+ * Constructor.
+ *
+ * @param pOOo the OOo for which to create the SDK project
+ * @param pSdk the OOo SDK for which to create the SDK project
+ */
public OOoSdkProjectJob( IOOo pOOo, ISdk pSdk ) {
super( Messages.getString("OOoSdkProjectJob.Title") + pOOo.getName() ); //$NON-NLS-1$
mOOo = pOOo;
mSdk = pSdk;
}
+ /**
+ * Get the includes folder in the SDK project corresponding to the
+ * given OOo instance.
+ *
+ * @param pOOo the OOo instance for which to get the includes folder
+ *
+ * @return the include folder in the workspace.
+ */
public static IFolder getIncludes( IOOo pOOo ) {
String prjName = MessageFormat.format( PRJ_NAME_PATTERN, pOOo.getName() );
@@ -45,6 +69,14 @@ public class OOoSdkProjectJob extends Job {
return prj.getFolder( INCLUDES_DIR );
}
+ /**
+ * Get the libraries folder in the SDK project corresponding to the
+ * given OOo instance.
+ *
+ * @param pOOo the OOo instance for which to get the libraries folder
+ *
+ * @return the libraries folder in the workspace.
+ */
public static IFolder getLibraries( IOOo pOOo ) {
String prjName = MessageFormat.format( PRJ_NAME_PATTERN, pOOo.getName() );
@@ -56,7 +88,8 @@ public class OOoSdkProjectJob extends Job {
@Override
protected IStatus run( IProgressMonitor pMonitor ) {
- IStatus status = new Status( IStatus.OK, Activator.PLUGIN_ID, Messages.getString("OOoSdkProjectJob.OkStatus") ); //$NON-NLS-1$
+ IStatus status = new Status( IStatus.OK, Activator.PLUGIN_ID,
+ Messages.getString("OOoSdkProjectJob.OkStatus") ); //$NON-NLS-1$
try {
// Create the OOo SDK project
@@ -79,19 +112,28 @@ public class OOoSdkProjectJob extends Job {
createIncludes( prj, pMonitor );
} catch ( Exception e ) {
- status = new Status( IStatus.ERROR, Activator.PLUGIN_ID, Messages.getString("OOoSdkProjectJob.FailedStatus"), e ); //$NON-NLS-1$
+ status = new Status( IStatus.ERROR, Activator.PLUGIN_ID,
+ Messages.getString("OOoSdkProjectJob.FailedStatus"), e ); //$NON-NLS-1$
}
return status;
}
- private void createLibLinks(IProject prj, IProgressMonitor pMonitor) throws CoreException {
+ /**
+ * Utility method creating the links to the libraries in the SDK project.
+ *
+ * @param pPrj the project in which to create the links
+ * @param pMonitor a progress monitor
+ *
+ * @throws CoreException if anything wrong happens
+ */
+ private void createLibLinks(IProject pPrj, IProgressMonitor pMonitor) throws CoreException {
String os = Platform.getOS();
if ( os.equals( Platform.OS_LINUX ) || os.equals( Platform.OS_SOLARIS )
|| os.equals( Platform.OS_MACOSX ) ) {
// Create the link folder
- IFolder folder = prj.getFolder( LIBS_DIR );
+ IFolder folder = pPrj.getFolder( LIBS_DIR );
if ( !folder.exists() ) {
folder.create( true, true, pMonitor );
@@ -118,15 +160,16 @@ public class OOoSdkProjectJob extends Job {
// Run ln to link the files: present on all *NIX platforms
String[] command = {
- "ln", "-s", //$NON-NLS-1$ //$NON-NLS-2$
- orig, dest
+ "ln", "-s", //$NON-NLS-1$ //$NON-NLS-2$
+ orig, dest
};
try {
Process proc = Runtime.getRuntime().exec( command );
StringBuffer buf = getErrorString( proc );
if ( !buf.toString().trim().equals( new String( ) ) ) {
- String msg = Messages.getString("OOoSdkProjectJob.LinkError") + libname + "\n"; //$NON-NLS-1$ //$NON-NLS-2$
+ String msg = Messages.getString("OOoSdkProjectJob.LinkError") + //$NON-NLS-1$
+ libname + "\n"; //$NON-NLS-1$
msg += buf.toString();
PluginLogger. error( msg );
}
@@ -134,7 +177,8 @@ public class OOoSdkProjectJob extends Job {
proc.waitFor();
} catch ( Exception e ) {
- PluginLogger.error( Messages.getString("OOoSdkProjectJob.LinkError") + libname, e ); //$NON-NLS-1$
+ PluginLogger.error( Messages.getString("OOoSdkProjectJob.LinkError") + //$NON-NLS-1$
+ libname, e );
}
}
}
@@ -143,6 +187,14 @@ public class OOoSdkProjectJob extends Job {
}
}
+ /**
+ * Utility method creating the headers in the SDK project.
+ *
+ * @param pProject the project in which to create the headers
+ * @param pMonitor a progress monitor
+ *
+ * @throws Exception if anything wrong happens
+ */
private void createIncludes( IProject pProject, IProgressMonitor pMonitor) throws Exception {
// Create the destination folder if needed
IFolder folder = pProject.getFolder( INCLUDES_DIR );
@@ -176,11 +228,18 @@ public class OOoSdkProjectJob extends Job {
folder.refreshLocal( IResource.DEPTH_INFINITE, pMonitor );
}
- private StringBuffer getErrorString(Process process) {
+ /**
+ * Get the error string from the <code>cppumaker</code> process.
+ *
+ * @param pProcess the running process
+ *
+ * @return the error string buffer
+ */
+ private StringBuffer getErrorString(Process pProcess) {
StringBuffer buf = new StringBuffer();
LineNumberReader lineReader = new LineNumberReader(
- new InputStreamReader(process.getErrorStream()));
+ new InputStreamReader(pProcess.getErrorStream()));
try {
// Only for debugging purpose
diff --git a/cpp/source/org/openoffice/ide/eclipse/cpp/client/ClientWizard.java b/cpp/source/org/openoffice/ide/eclipse/cpp/client/ClientWizard.java
index 8de2d6a..4f0843d 100644
--- a/cpp/source/org/openoffice/ide/eclipse/cpp/client/ClientWizard.java
+++ b/cpp/source/org/openoffice/ide/eclipse/cpp/client/ClientWizard.java
@@ -51,7 +51,12 @@ import org.openoffice.ide.eclipse.core.utils.WorkbenchHelper;
import org.openoffice.ide.eclipse.cpp.Activator;
import org.openoffice.ide.eclipse.cpp.CppProjectHandler;
-
+/**
+ * Class for the C++ UNO Client wizard.
+ *
+ * @author cbosdonnat
+ *
+ */
public class ClientWizard extends CCProjectWizard {
private static final String SRC_DIR_NAME = "src"; //$NON-NLS-1$
@@ -60,6 +65,9 @@ public class ClientWizard extends CCProjectWizard {
private UnoConnectionPage mCnxPage;
private IWorkbenchPage mActivePage;
+ /**
+ * Default constructor.
+ */
public ClientWizard() {
super( );
setWindowTitle( Messages.getString("ClientWizard.Title") ); //$NON-NLS-1$
@@ -125,6 +133,13 @@ public class ClientWizard extends CCProjectWizard {
return finished;
}
+ /**
+ * Copy a template resource into the generated project.
+ *
+ * @param pResName the name of the file to copy
+ * @param pSrcDir the folder where to put it
+ * @param pReplacement the replacement value for the connection string
+ */
private void copyResource(String pResName, IContainer pSrcDir, String pReplacement ) {
InputStream in = this.getClass().getResourceAsStream( pResName );
File destFile = new File( pSrcDir.getLocation().toFile(), pResName );
diff --git a/cpp/source/org/openoffice/ide/eclipse/cpp/client/Messages.java b/cpp/source/org/openoffice/ide/eclipse/cpp/client/Messages.java
index df0a7ca..d8b9933 100644
--- a/cpp/source/org/openoffice/ide/eclipse/cpp/client/Messages.java
+++ b/cpp/source/org/openoffice/ide/eclipse/cpp/client/Messages.java
@@ -1,22 +1,69 @@
+/*************************************************************************
+ *
+ * The Contents of this file are made available subject to the terms of
+ * the GNU Lesser General Public License Version 2.1
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2009 by Novell, Inc.
+ *
+ * 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: Cédric Bosdonnat.
+ *
+ * Copyright: 2009 by Novell, Inc.
+ *
+ * All Rights Reserved.
+ *
+ ************************************************************************/
package org.openoffice.ide.eclipse.cpp.client;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
+/**
+ * Messages for the package.
+ *
+ * @author cbosdonnat
+ *
+ */
public class Messages {
private static final String BUNDLE_NAME = "org.openoffice.ide.eclipse.cpp.client.messages"; //$NON-NLS-1$
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
.getBundle(BUNDLE_NAME);
+ /**
+ * Default constructor.
+ */
private Messages() {
}
- public static String getString(String key) {
+ /**
+ * Get the string from it's key.
+ *
+ * @param pKey the key of the string
+ *
+ * @return the internationalized string
+ */
+ public static String getString(String pKey) {
+ String string = '!' + pKey + '!';
try {
- return RESOURCE_BUNDLE.getString(key);
+ string = RESOURCE_BUNDLE.getString(pKey);
} catch (MissingResourceException e) {
- return '!' + key + '!';
}
+ return string;
}
}
diff --git a/cpp/source/org/openoffice/ide/eclipse/cpp/client/UnoClientWizardPage.java b/cpp/source/org/openoffice/ide/eclipse/cpp/client/UnoClientWizardPage.java
index 8875ff0..8171f1b 100644
--- a/cpp/source/org/openoffice/ide/eclipse/cpp/client/UnoClientWizardPage.java
+++ b/cpp/source/org/openoffice/ide/eclipse/cpp/client/UnoClientWizardPage.java
@@ -38,6 +38,15 @@ import org.eclipse.cdt.ui.wizards.CDTMainWizardPage;
import org.eclipse.cdt.ui.wizards.EntryDescriptor;
import org.eclipse.jface.wizard.IWizardPage;
+/**
+ * Class for the main UNO client wizard page.
+ *
+ * This page is derived from the CDT class, but some restrictions are
+ * applied to the selectable projects to fit the UNO Client case.
+ *
+ * @author cbosdonnat
+ *
+ */
public class UnoClientWizardPage extends CDTMainWizardPage {
private UnoConnectionPage mUnoCnxPage;
@@ -45,26 +54,31 @@ public class UnoClientWizardPage extends CDTMainWizardPage {
/**
* Creates a new project creation wizard page.
*
- * @param pageName the name of this page
+ * @param pPageName the name of this page
+ * @param pUnoPage the page for the UNO connection config
*/
public UnoClientWizardPage(String pPageName, UnoConnectionPage pUnoPage ) {
super(pPageName);
- mUnoCnxPage= pUnoPage;
+ mUnoCnxPage = pUnoPage;
setPageComplete(false);
}
/**
- * Only show the executable project types here
+ * Only show the executable project types here.
+ *
+ * @param pItems the items to filter.
+ * @return the items to show
*/
@SuppressWarnings("unchecked")
@Override
- public List filterItems(List items) {
+ public List filterItems(List pItems) {
ArrayList filtered = new ArrayList();
- for (Object item : items) {
+ for (Object item : pItems) {
EntryDescriptor desc = (EntryDescriptor)item;
String parentId = desc.getParentId();
- boolean exeParent = parentId != null && parentId.equals( ManagedBuildManager.BUILD_ARTEFACT_TYPE_PROPERTY_EXE );
+ boolean exeParent = parentId != null &&
+ parentId.equals( ManagedBuildManager.BUILD_ARTEFACT_TYPE_PROPERTY_EXE );
boolean exe = desc.getId().equals( ManagedBuildManager.BUILD_ARTEFACT_TYPE_PROPERTY_EXE );
boolean kept = exeParent || exe;
diff --git a/cpp/source/org/openoffice/ide/eclipse/cpp/client/UnoConnectionPage.java b/cpp/source/org/openoffice/ide/eclipse/cpp/client/UnoConnectionPage.java
index 7a9d1b9..6811142 100644
--- a/cpp/source/org/openoffice/ide/eclipse/cpp/client/UnoConnectionPage.java
+++ b/cpp/source/org/openoffice/ide/eclipse/cpp/client/UnoConnectionPage.java
@@ -62,6 +62,9 @@ public class UnoConnectionPage extends WizardPage {
private OOoConfigPanel mOOoConfigPanel;
private ConnectionConfigPanel mCnxConfigPanel;
+ /**
+ * Default constructor.
+ */
public UnoConnectionPage( ) {
super( "unocnxpage" ); //$NON-NLS-1$
setTitle( Messages.getString("UnoConnectionPage.Title") ); //$NON-NLS-1$
@@ -124,6 +127,9 @@ public class UnoConnectionPage extends WizardPage {
return mMainPage.getNextCdtPage();
}
+ /**
+ * @param pMainPage the main configuration page of the UNO Client Wizard
+ */
public void setMainPage(UnoClientWizardPage pMainPage) {
mMainPage = pMainPage;
}
diff --git a/java/build/build.properties b/java/build/build.properties
index c539fd2..cbfdacb 100644
--- a/java/build/build.properties
+++ b/java/build/build.properties
@@ -1,3 +1,3 @@
#Wed Apr 26 20:26:48 CEST 2006
-java.plugin.version=1.0.2
-debug=true
\ No newline at end of file
+java.plugin.version=1.0.3
+debug=true
More information about the ooo-build-commit
mailing list