@Override public boolean getShowLogInfoFlag(ILaunchConfiguration configuration) { try { return configuration.getAttribute(ATTR_SHOW_LOG_INFO, DEFAULT_SHOW_LOG_INFO); } catch (CoreException e) { return DEFAULT_SHOW_LOG_INFO; } }
@Override public boolean isEmbeddedSRE(ILaunchConfiguration configuration) { try { return configuration.getAttribute(ATTR_EMBEDDED_SRE, DEFAULT_EMBEDDED_SRE); } catch (CoreException e) { return DEFAULT_EMBEDDED_SRE; } }
@Override public boolean isAssertionEnabledInRunMode(ILaunchConfiguration configuration) { try { return configuration.getAttribute(ATTR_ENABLE_ASSERTIONS_IN_RUN_MODE, DEFAULT_ENABLE_ASSERTIONS_IN_RUN_MODE); } catch (CoreException e) { return DEFAULT_ENABLE_ASSERTIONS_IN_RUN_MODE; } }
@Override public String getAgent(ILaunchConfiguration configuration) { try { return Strings.emptyToNull(configuration.getAttribute(ATTR_AGENT_NAME, (String) null)); } catch (CoreException e) { return null; } }
@Override public String getAgentLaunchingArguments(ILaunchConfiguration configuration) { try { return Strings.nullToEmpty(configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, (String) null)); } catch (CoreException e) { return null; } }
@Override public String getSRELaunchingArguments(ILaunchConfiguration configuration) { try { return Strings.nullToEmpty(configuration.getAttribute(ATTR_SARL_RUNTIME_ENVIRONMENT_ARGUMENTS, (String) null)); } catch (CoreException e) { return null; } }
@Override public String getJRELaunchingArguments(ILaunchConfiguration configuration) { try { return Strings.nullToEmpty(configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, (String) null)); } catch (CoreException e) { return null; } }
/** * @param configuration * @return @throws CoreException */ public static Map readEventParameter(ILaunchConfiguration configuration) throws CoreException { return configuration.getAttribute(ROUTINE_LAUNCH_EVENTPARAMS, new HashMap()); }
public void initializeFrom(ILaunchConfiguration configuration) { try { boolean keep = configuration.getAttribute(ATTR_KEEP, false); wKeep.setSelection(keep); boolean report = configuration.getAttribute(ATTR_REPORT, false); wReport.setSelection(report); } catch (Exception ce) { ce.printStackTrace(); } }
public boolean hasSameUniqueAttributes(ILaunchConfiguration launchConfiguration) { // reuse an existing run configuration if the working directory and the tasks are the same, // regardless of the other settings of the launch configuration try { return this.tasks.equals(launchConfiguration.getAttribute(TASKS, ImmutableList.<String> of())) && this.workingDirExpression.equals(launchConfiguration.getAttribute(WORKING_DIR, "")); } catch (CoreException e) { throw new GradlePluginsRuntimeException(String.format("Cannot read Gradle launch configuration %s.", launchConfiguration), e); } }
private static String getStringAttribute(String name, String defaultValue, ILaunchConfiguration configuration) { try { return configuration.getAttribute(name, defaultValue); } catch (CoreException e) { throw new GradlePluginsRuntimeException(String.format("Cannot read launch configuration attribute '%s'.", name)); } }
private void removeGradleClasspathProvider(ILaunchConfiguration configuration) throws CoreException { String originalClasspathProvider = configuration.getAttribute(ORIGINAL_CLASSPATH_PROVIDER_ATTRIBUTE, (String) null); Map<String, String> plusEntries = Maps.newHashMap(); Set<String> minusEntries = Sets.newHashSet(); if (originalClasspathProvider != null) { plusEntries.put(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH_PROVIDER, originalClasspathProvider); minusEntries.add(ORIGINAL_CLASSPATH_PROVIDER_ATTRIBUTE); } else { minusEntries.add(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH_PROVIDER); } updateLaunchConfiguration(configuration, plusEntries, minusEntries); }
private static boolean getBooleanAttribute(String name, boolean defaultValue, ILaunchConfiguration configuration) { try { return configuration.getAttribute(name, defaultValue); } catch (CoreException e) { throw new GradlePluginsRuntimeException(String.format("Cannot read launch configuration attribute '%s'.", name)); } }
@Override public boolean hasProgramArguments() { try { return fLaunchConfiguration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, (String) null) != null; } catch (CoreException e) { JavaPlugin.log(e); return false; } }
private static List<String> getListAttribute(String name, ILaunchConfiguration configuration) { try { return configuration.getAttribute(name, ImmutableList.<String>of()); } catch (CoreException e) { throw new GradlePluginsRuntimeException(String.format("Cannot read launch configuration attribute '%s'.", name)); } }
private void addGradleClasspathProvider(ILaunchConfiguration configuration) throws CoreException { String originalClasspathProvider = configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH_PROVIDER, (String) null); Map<String, String> plusEntries = Maps.newHashMap(); plusEntries.put(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH_PROVIDER, GradleClasspathProvider.ID); if (originalClasspathProvider != null) { plusEntries.put(ORIGINAL_CLASSPATH_PROVIDER_ATTRIBUTE, originalClasspathProvider); } updateLaunchConfiguration(configuration, plusEntries, Collections.<String> emptySet()); }
/** * update the inherited mains attribute from the specified launch config * @param config the config to load from */ private void updateInheritedMainsFromConfig(ILaunchConfiguration config) { boolean inherit = false; try { inherit = config.getAttribute(ATTR_CONSIDER_INHERITED_MAIN, false); } catch (CoreException e) {JDIDebugUIPlugin.log(e);} fConsiderInheritedMainButton.setSelection(inherit); }
@Override public boolean hasProgramArguments() { try { return fLaunchConfiguration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, (String) null) != null; } catch (CoreException e) { JavaPlugin.log(e); return false; } }
/** * updates the stop in main attribute from the specified launch config * @param config the config to load the stop in main attribute from */ private void updateStopInMainFromConfig(ILaunchConfiguration config) { boolean stop = false; try { stop = config.getAttribute(IJavaLaunchConfigurationConstants.ATTR_STOP_IN_MAIN, false); }//end try catch (CoreException e) {JDIDebugUIPlugin.log(e);} fStopInMainCheckButton.setSelection(stop); }
@Override public String getProgramArguments(ILaunchConfiguration configuration) throws CoreException { try { return super.getProgramArguments(configuration); } catch (CoreException ce) { // do nothing } return configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, IAntCoreConstants.EMPTY_STRING); } }