Logo Search packages:      
Sourcecode: ooeclipseintegration version File versions  Download package

void org::openoffice::ide::eclipse::java::Language::generateFromTypes ( ISdk  sdk,
IOOo  ooo,
IFile  typesFile,
IFolder  buildFolder,
String  rootModule,
IProgressMonitor  monitor 
) [inline]

Generates the language specific interfaces corresponding to the project unoidl specifications. This method needs an OpenOffice.org instance, the project types.rdb path, the build path where to put the generated files and the root module to avoid massive idl types creation

sdk the sdk containing the tools for generation
ooo the working OpenOffice.org instance
typesFile the project types.rdb path
buildFolder the path to the folder where to the files will be generated
rootModule the project root module (eg: foo::bar)
monitor the progress monitor

Implements org::openoffice::ide::eclipse::core::model::ILanguage.

Definition at line 124 of file Language.java.

References org::openoffice::ide::eclipse::core::preferences::IOOo::getTypesPath().

            if (typesFile.exists()){
                  try {
                        if (null != sdk && null != ooo){
                              IPath ooTypesPath = new Path (ooo.getTypesPath());
                              // TODO What if the user creates other root modules ?
                              String firstModule = rootModule.split("::")[0]; //$NON-NLS-1$
                              // HELP quotes are placed here to prevent Windows path 
                              // names with spaces
                              String command = "javamaker -T" + firstModule +  //$NON-NLS-1$
                                    ".* -nD -Gc -BUCR " +  //$NON-NLS-1$
                                    "-O ." + System.getProperty("file.separator") +  //$NON-NLS-1$ //$NON-NLS-2$
                                    buildFolder.getProjectRelativePath().toOSString() + " " + //$NON-NLS-1$
                                    typesFile.getProjectRelativePath().toOSString() + " " + //$NON-NLS-1$
                                    "-X\"" + ooTypesPath.toOSString() + "\""; //$NON-NLS-1$ //$NON-NLS-2$
                              Process process = OOEclipsePlugin.runTool(
                                          command, monitor);
                              LineNumberReader lineReader = new LineNumberReader(
                                          new InputStreamReader(process.getErrorStream()));
                              // Only for debugging purpose
                              if (PluginLogger.isLevel(PluginLogger.DEBUG)){ //$NON-NLS-1$
                                    String line = lineReader.readLine();
                                    while (null != line){
                                          line = lineReader.readLine();
                  } catch (InterruptedException e) {
                                    Messages.getString("Language.CreateCodeError"), e); //$NON-NLS-1$
                  } catch (IOException e) {
                                    Messages.getString("Language.UnreadableOutputError")); //$NON-NLS-1$

Generated by  Doxygen 1.6.0   Back to index