static ILaunchConfiguration de.alysis.r.submit.ui.LaunchShortcut.createDefaultLaunchConfiguration  )  [static]
 

Creates and returns a default launch configuration.

Returns:
default launch configuration or null if one could not be created
00277                                                                               {
00278                 ILaunchManager manager = SubmitPlugin.getDefault().getLaunchManager();
00279                 ILaunchConfigurationType type = manager
00280                                 .getLaunchConfigurationType(ConfigurationConstants.LAUNCH_CONFIG_TYPE_ID);
00281                 try {
00282                         String launchConfigName = "Generated default launch config";
00283                         ILaunchConfigurationWorkingCopy workingCopy = type.newInstance(
00284                                         null, launchConfigName);
00285 
00286                         /*
00287                          * TODO: ugly marks the launch configuration as editor submit
00288                          * configuration, otherwise one additioal configuration would be
00289                          * displaye when selecting between configurations.
00290                          */
00291                         workingCopy.setAttribute(
00292                                         ConfigurationConstants.ATTR_IS_EDITOR_SUBMIT, true);
00293 
00294                         workingCopy.setAttribute(
00295                                         ConfigurationConstants.ATTR_IS_REMOTE_CONNECTION,
00296                                         ConfigurationConstants.DEFAULT_IS_REMOTE);
00297                         workingCopy.setAttribute(ConfigurationConstants.ATTR_SERVER_NAME,
00298                                         ConfigurationConstants.DEFAULT_SERVER_NAME);
00299                         workingCopy.setAttribute(ConfigurationConstants.ATTR_SERVER_PORT,
00300                                         ConfigurationConstants.DEFAULT_SERVER_PORT);
00301                         workingCopy.setAttribute(ConfigurationConstants.ATTR_CONSOLEOUT_HOST,
00302                                         ConsoleConstants.DEFAULT_CONSOLEOUT_HOST);
00303                         workingCopy.setAttribute(ConfigurationConstants.ATTR_CONSOLEOUT_PORT,
00304                                         ConsoleConstants.DEFAULT_CONSOLEOUT_PORT);
00305                         workingCopy.setAttribute(
00306                                         ConfigurationConstants.ATTR_STORE_LOGIN_INFO,
00307                                         ConfigurationConstants.DEFAULT_STORE_LOGIN_INFO);
00308                         ConnectionTab2 conTab = new ConnectionTab2();
00309                         conTab.setDefaults(workingCopy);
00310                         conTab.dispose();
00311 
00312                         // set default for common settings
00313                         CommonTab tab = new CommonTab();
00314                         tab.setDefaults(workingCopy);
00315                         tab.dispose();
00316 
00317                         /* ConsoleoutConfiguration erzeugen */
00318                         ConsoleConfiguration ccf = new ConsoleConfiguration();
00319                         String host = ConsoleConstants.DEFAULT_CONSOLEOUT_HOST;
00320                         ccf.setHostName(host);
00321                         int port = new Integer(ConfigurationConstants.DEFAULT_SERVER_PORT).intValue();
00322                         ccf.setPort(port);
00323                         ConsoleManager cm = SubmitPlugin.getDefault().getConsoleManager();
00324                         cm.setConfig(launchConfigName, ccf);
00325 
00326                         ILaunchConfiguration launchConfig = workingCopy.doSave();
00327                         return launchConfig;
00328 
00329                 } catch (CoreException e) {
00330                         String msg = "Unable to create default launch configuration for shortcut.";
00331                         Utilities.reportError(msg, e);
00332                 }
00333                 return null;
00334         }


Generated on Mon Jun 26 18:45:59 2006 for RSubmit by  doxygen 1.4.6