public void setDefaults(ILaunchConfigurationWorkingCopy configuration) { String projectName = getProjectName(configuration); // get the name for this launch configuration String launchConfigName = ""; // try to base the launch config name on the current project launchConfigName = projectName == null ? "" :projectName; if (launchConfigName == null || launchConfigName.length() == 0) { // if no project name was found, base on a default name launchConfigName = "Jetty Webapp"; } // generate an unique name (e.g. myproject(2)) launchConfigName = getLaunchConfigurationDialog(). generateName(launchConfigName); initDefaultConfiguration(configuration,projectName,launchConfigName); return; }
/** * Reset the given configuration with the agent name attributes associated * to the given element. * * @param javaElement the element from which information may be retrieved. * @param config the config to set with the agent name. */ protected void initializeAgentName(IJavaElement javaElement, ILaunchConfigurationWorkingCopy config) { String name = extractNameFromJavaElement(javaElement); // Set the attribute this.configurator.setAgent(config, name); // Rename the launch configuration if (name.length() > 0) { final int index = name.lastIndexOf('.'); if (index > 0) { name = name.substring(index + 1); } name = getLaunchConfigurationDialog().generateName(name); config.rename(name); } }
/** * Find the first instance of a type, compilation unit, class file or project in the * specified element's parental hierarchy, and use this as the default name. */ private void initializeName(IJavaElement javaElement, ILaunchConfigurationWorkingCopy config) { String name = EMPTY_STRING; try { IResource resource = javaElement.getUnderlyingResource(); if (resource != null) { name = resource.getName(); int index = name.lastIndexOf('.'); if (index > 0) { name = name.substring(0, index); } } else { name= javaElement.getElementName(); } name = getLaunchConfigurationDialog().generateName(name); } catch (JavaModelException jme) {JDIDebugUIPlugin.log(jme);} config.rename(name); }
name = name.substring(index + 1); name = getLaunchConfigurationDialog().generateName(name); config.rename(name);
name, buildConfigName); name = getLaunchConfigurationDialog().generateName(name); config.rename(name); renamed = true; name = name.substring(0, index); name = getLaunchConfigurationDialog().generateName(name); config.rename(name); renamed = true; String name = getLaunchConfigurationDialog().generateName( cElement.getCProject().getElementName()); config.rename(name);
Matcher match = configNamePattern.matcher(curConfigName); if (!match.find()) { wc.rename(dialog.generateName(curConfigName));