当前位置: 首页>>代码示例>>Java>>正文


Java ILaunchConfiguration.getAttribute方法代码示例

本文整理汇总了Java中org.eclipse.debug.core.ILaunchConfiguration.getAttribute方法的典型用法代码示例。如果您正苦于以下问题:Java ILaunchConfiguration.getAttribute方法的具体用法?Java ILaunchConfiguration.getAttribute怎么用?Java ILaunchConfiguration.getAttribute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.debug.core.ILaunchConfiguration的用法示例。


在下文中一共展示了ILaunchConfiguration.getAttribute方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getRunnerId

import org.eclipse.debug.core.ILaunchConfiguration; //导入方法依赖的package包/类
/**
 * Read the N4JS runner ID from the given Eclipse launch configuration. Will throw exceptions if 'failFast' is
 * <code>true</code>, otherwise will return <code>null</code> in case of error.
 */
public static String getRunnerId(ILaunchConfiguration launchConfig, boolean failFast) {
	try {
		// 1) simple case: runnerId already defined in launchConfig
		final String id = launchConfig.getAttribute(RunConfiguration.RUNNER_ID, (String) null);
		if (id != null)
			return id;
		// 2) tricky case: not set yet, so have to go via the ILaunchConfigurationType or the launchConfig
		final ILaunchConfigurationType launchConfigType = launchConfig.getType();
		return getRunnerId(launchConfigType, failFast);
	} catch (CoreException e) {
		if (failFast)
			throw new WrappedException(e);
		return null;
	}
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:20,代码来源:RunnerUiUtils.java

示例2: getModels

import org.eclipse.debug.core.ILaunchConfiguration; //导入方法依赖的package包/类
private ModelData[] getModels(ILaunchConfiguration config) throws CoreException {
	List<ModelData> temp = new ArrayList<ModelData>();
	String paths = config.getAttribute(CONFIG_GRAPH_MODEL_PATHS, "");
	 
	if (paths == null || paths.trim().length() == 0)
		return new ModelData[0];
	StringTokenizer st = new StringTokenizer(paths, ";");
	st.nextToken(); // the main model path
	st.nextToken(); // main model : Always "1"
	st.nextToken(); // the main path generator
	while (st.hasMoreTokens()) {
		String path = st.nextToken();
		IFile file = (IFile) ResourceManager
				.getResource(new Path(path).toString());
		if (file==null) continue;
		ModelData data = new ModelData(file);
		boolean selected = st.nextToken().equalsIgnoreCase("1");
		String pathGenerator = st.nextToken();
		data.setSelected(selected);
		data.setSelectedPolicy(pathGenerator);
		temp.add(data);
	}
	ModelData[] ret = new ModelData[temp.size()];
	temp.toArray(ret);
	return ret;
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:27,代码来源:GW4ELaunchConfigurationTab.java

示例3: getModels

import org.eclipse.debug.core.ILaunchConfiguration; //导入方法依赖的package包/类
private ModelData[] getModels(ILaunchConfiguration config) throws CoreException {
	List<ModelData> temp = new ArrayList<ModelData>();
	String paths = config.getAttribute(CONFIG_GRAPH_MODEL_PATHS, "");
	 
	if (paths == null || paths.trim().length() == 0)
		return new ModelData[0];
	StringTokenizer st = new StringTokenizer(paths, ";");
	st.nextToken(); // the main model path
	st.nextToken(); // main model : Always "1"
	st.nextToken(); // the main path generator
	while (st.hasMoreTokens()) {
		String path = st.nextToken();
		IFile file = (IFile) ResourceManager
				.getResource(new Path(path).toString());
		if (file==null) continue;
		ModelData data = new ModelData(file);
		boolean selected = st.nextToken().equalsIgnoreCase("1");
		String pathGenerator = st.nextToken();
		data.setSelected(selected);
		data.setSelectedPolicy(pathGenerator);
		if (selected) temp.add(data);
	}
	ModelData[] ret = new ModelData[temp.size()];
	temp.toArray(ret);
	return ret;
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:27,代码来源:GW4ELaunchConfigurationDelegate.java

示例4: appendAdditionalLaunchParameters

import org.eclipse.debug.core.ILaunchConfiguration; //导入方法依赖的package包/类
@Override
protected void appendAdditionalLaunchParameters(LaunchParameterValues launchParameterValues) {
	ILaunch launch = launchParameterValues.getLaunch();
	if (launch==null){
		throw new IllegalStateException("launch missing");
	}
	String projectName;
	try {
		ILaunchConfiguration configuration = launch.getLaunchConfiguration();
		
		projectName = configuration.getAttribute(PROPERTY_PROJECTNAME, (String)null);
		
		String configuredTasksValue= configuration.getAttribute(PROPERTY_TASKS, "");
		String tasksToExecute = variableReplacement.replace(configuredTasksValue, JUNIT_PREFERENCES.getDefaultTestTaskType().getTestTasks());
		
		launchParameterValues.setPostJob(new ImportGradleJunitResultsJob("Import gradle junit results",projectName,true));
		launchParameterValues.setOverriddenTasks(tasksToExecute);
	} catch (CoreException e) {
		JunitUtil.logError("Was not able to add additional launch parameters", e);
	}
}
 
开发者ID:de-jcup,项目名称:egradle,代码行数:22,代码来源:EGradleJunitLaunchDelegate.java

示例5: getElements

import org.eclipse.debug.core.ILaunchConfiguration; //导入方法依赖的package包/类
public Object[] getElements(Object inputElement) {
	PropertyVariable[] elements = new PropertyVariable[0];
	ILaunchConfiguration config = (ILaunchConfiguration) inputElement;
	Map<String, String> m;
	try {
		m = config.getAttribute(launchConfigurationPropertyMapAttributeName, (Map<String, String>) null);
	} catch (CoreException e) {
		IDEUtil.logError("Error reading configuration", e); 
		return elements;
	}
	if (m != null && !m.isEmpty()) {
		elements = new PropertyVariable[m.size()];
		String[] varNames = new String[m.size()];
		m.keySet().toArray(varNames);
		for (int i = 0; i < m.size(); i++) {
			elements[i] = new PropertyVariable(varNames[i], (String) m.get(varNames[i]));
		}
	}
	return elements;
}
 
开发者ID:de-jcup,项目名称:egradle,代码行数:21,代码来源:EGradleLaunchConfigurationPropertiesTab.java

示例6: initializeFrom

import org.eclipse.debug.core.ILaunchConfiguration; //导入方法依赖的package包/类
@Override
public void initializeFrom(ILaunchConfiguration configuration) {
	try {
		String program = null;
		program = configuration.getAttribute(Constants.ATTR_LE_PROGRAM, (String) null);
		if (program != null)
			eiffelProgramText.setText(program);
		
		String seFullPath = null;
		seFullPath = configuration.getAttribute(Constants.ATTR_LEC_FULL_PATH, (String) null);
		if (seFullPath != null)
			this.seFullPathText.setText(seFullPath);
		
	} catch (CoreException e) {
		setErrorMessage(e.getMessage());
	}
}
 
开发者ID:Imhotup,项目名称:LibertyEiffel-Eclipse-Plugin,代码行数:18,代码来源:LibertyEiffelMainTab.java

示例7: getConfiguredScope

import org.eclipse.debug.core.ILaunchConfiguration; //导入方法依赖的package包/类
/**
 * Returns the scope configured with the given configuration. If no scope has
 * been explicitly defined, the default filter settings are applied to the
 * overall scope.
 *
 * @param configuration
 *          launch configuration to read scope from
 *
 * @return configured scope
 */
public static Set<IPackageFragmentRoot> getConfiguredScope(
    final ILaunchConfiguration configuration) throws CoreException {
  final Set<IPackageFragmentRoot> all = getOverallScope(configuration);
  @SuppressWarnings("rawtypes")
  final List<?> selection = configuration.getAttribute(
      ICoverageLaunchConfigurationConstants.ATTR_SCOPE_IDS, (List) null);
  if (selection == null) {
    final DefaultScopeFilter filter = new DefaultScopeFilter(
        EclEmmaCorePlugin.getInstance().getPreferences());
    return filter.filter(all, configuration);
  } else {
    all.retainAll(readScope(selection));
    return all;
  }
}
 
开发者ID:eclipse,项目名称:eclemma,代码行数:26,代码来源:ScopeUtils.java

示例8: getAdditionalVMArgs

import org.eclipse.debug.core.ILaunchConfiguration; //导入方法依赖的package包/类
protected List<String> getAdditionalVMArgs() throws CoreException {
	final List<String> additionalVMArgs = super.getAdditionalVMArgs();
	
	// distributed FPSet count
	final ILaunchConfiguration launchConfig = launch.getLaunchConfiguration();
	final int distributedFPSetCount = launchConfig.getAttribute(LAUNCH_DISTRIBUTED_FPSET_COUNT, 0);
	if (distributedFPSetCount > 0) {
		additionalVMArgs.add("-Dtlc2.tool.distributed.TLCServer.expectedFPSetCount=" + distributedFPSetCount);
	}
	
	// Inet Address to listen on
	final String iface = launchConfig.getAttribute(LAUNCH_DISTRIBUTED_INTERFACE, "");
	if (!"".equals(iface)) {
		additionalVMArgs.add("-Djava.rmi.server.hostname=" + iface);
	}
	
	return additionalVMArgs;
}
 
开发者ID:tlaplus,项目名称:tlaplus,代码行数:19,代码来源:DistributedTLCJob.java

示例9: testCreateMavenPackagingLaunchConfiguration

import org.eclipse.debug.core.ILaunchConfiguration; //导入方法依赖的package包/类
@Test
public void testCreateMavenPackagingLaunchConfiguration() throws CoreException {
  IProject project = projectCreator.getProject();

  ILaunchConfiguration launchConfig =
      FlexMavenPackagedProjectStagingDelegate.createMavenPackagingLaunchConfiguration(project);

  boolean privateConfig = launchConfig.getAttribute(ILaunchManager.ATTR_PRIVATE, false);
  assertTrue(privateConfig);

  boolean launchInBackground = launchConfig.getAttribute(
      "org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND", false);
  assertTrue(launchInBackground);

  String jreContainerPath = launchConfig.getAttribute(
      IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH, "");
  assertEquals("org.eclipse.jdt.launching.JRE_CONTAINER/"
      + "org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7", jreContainerPath);

  String pomDirectory = launchConfig.getAttribute(MavenLaunchConstants.ATTR_POM_DIR, "");
  assertEquals(project.getLocation().toString(), pomDirectory);

  String mavenGoals = launchConfig.getAttribute(MavenLaunchConstants.ATTR_GOALS, "");
  assertEquals("package", mavenGoals);
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:26,代码来源:FlexMavenPackagedProjectStagingDelegateTest.java

示例10: computeUnresolvedClasspath

import org.eclipse.debug.core.ILaunchConfiguration; //导入方法依赖的package包/类
@Override
public IRuntimeClasspathEntry[] computeUnresolvedClasspath(final ILaunchConfiguration configuration)
      throws CoreException {
    boolean useDefault = configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH, true);
    if(useDefault) {
      IJavaProject javaProject = JavaRuntime.getJavaProject(configuration);
      IRuntimeClasspathEntry jreEntry = JavaRuntime.computeJREEntry(configuration);
      IRuntimeClasspathEntry projectEntry = JavaRuntime.newProjectRuntimeClasspathEntry(javaProject);
      IRuntimeClasspathEntry mavenEntry = JavaRuntime.newRuntimeContainerClasspathEntry(new Path(
          IClasspathManager.CONTAINER_ID), IRuntimeClasspathEntry.USER_CLASSES);

      if(jreEntry == null) {
        return new IRuntimeClasspathEntry[] {projectEntry, mavenEntry};
      }

      return new IRuntimeClasspathEntry[] {jreEntry, projectEntry, mavenEntry};
    }

    return recoverRuntimePath(configuration, IJavaLaunchConfigurationConstants.ATTR_CLASSPATH);
  }
 
开发者ID:fbricon,项目名称:wildfly-hive,代码行数:21,代码来源:MavenRuntimeClasspathProvider.java

示例11: getConfigurations

import org.eclipse.debug.core.ILaunchConfiguration; //导入方法依赖的package包/类
private ILaunchConfiguration[] getConfigurations(IFile file) {
	ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
	ILaunchConfigurationType type = manager.getLaunchConfigurationType(LAUNCH_CONFIG_TYPE_CODE_ANALYSIS);
	try {
		// configurations that match the given resource
		List<ILaunchConfiguration> configs = new ArrayList<ILaunchConfiguration>();

		// candidates
		ILaunchConfiguration[] candidates = manager.getLaunchConfigurations(type);
		String name = FileUtils.getRelativePath(file);
		for (ILaunchConfiguration config : candidates) {
			String fileName = config.getAttribute(CAL_XDF.longName(), "");
			if (fileName.equals(name)) {
				configs.add(config);
			}
		}

		return configs.toArray(new ILaunchConfiguration[] {});
	} catch (Exception e) {
		e.printStackTrace();
		return null;
	}
}
 
开发者ID:turnus,项目名称:turnus.orcc,代码行数:24,代码来源:OrccCodeAnalysisLaunchShortcut.java

示例12: getConfigurations

import org.eclipse.debug.core.ILaunchConfiguration; //导入方法依赖的package包/类
private ILaunchConfiguration[] getConfigurations(IFile file) {
	ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
	ILaunchConfigurationType type = manager.getLaunchConfigurationType(LAUNCH_CONFIG_TYPE_NUMA_EXECUTION_ANALYSIS);
	try {
		// configurations that match the given resource
		List<ILaunchConfiguration> configs = new ArrayList<ILaunchConfiguration>();

		// candidates
		ILaunchConfiguration[] candidates = manager.getLaunchConfigurations(type);
		String name = FileUtils.getRelativePath(file);
		for (ILaunchConfiguration config : candidates) {
			String fileName = config.getAttribute(CAL_XDF.longName(), "");
			if (fileName.equals(name)) {
				configs.add(config);
			}
		}

		return configs.toArray(new ILaunchConfiguration[] {});
	} catch (Exception e) {
		e.printStackTrace();
		return null;
	}
}
 
开发者ID:turnus,项目名称:turnus.orcc,代码行数:24,代码来源:OrccNumaExecutionLaunchShortcut.java

示例13: getConfigurations

import org.eclipse.debug.core.ILaunchConfiguration; //导入方法依赖的package包/类
private ILaunchConfiguration[] getConfigurations(IFile file) {
	ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
	ILaunchConfigurationType type = manager.getLaunchConfigurationType(LAUNCH_CONFIG_TYPE_DYNAMIC_INTERPRETER_ANALYSIS);
	try {
		// configurations that match the given resource
		List<ILaunchConfiguration> configs = new ArrayList<ILaunchConfiguration>();

		// candidates
		ILaunchConfiguration[] candidates = manager.getLaunchConfigurations(type);
		String name = FileUtils.getRelativePath(file);
		for (ILaunchConfiguration config : candidates) {
			String fileName = config.getAttribute(CAL_XDF.longName(), "");
			if (fileName.equals(name)) {
				configs.add(config);
			}
		}

		return configs.toArray(new ILaunchConfiguration[] {});
	} catch (Exception e) {
		e.printStackTrace();
		return null;
	}
}
 
开发者ID:turnus,项目名称:turnus.orcc,代码行数:24,代码来源:OrccDynamicInterpreterLaunchShortcut.java

示例14: createSourceContent

import org.eclipse.debug.core.ILaunchConfiguration; //导入方法依赖的package包/类
/**
 * Create the content for a single source element
 * @return a list with at most one String[] element
 * @throws CoreException 
 */
public static List<String[]> createSourceContent(String propertyName, String labelingScheme, ILaunchConfiguration config)
        throws CoreException
{
    Vector<String[]> result = new Vector<String[]>();
    String value = config.getAttribute(propertyName, EMPTY_STRING);
    if (value.trim().length() == 0)
    {
        return result;
    }
    String identifier = getValidIdentifier(labelingScheme);
    StringBuffer buffer = new StringBuffer();

    // the identifier
    buffer.append(identifier).append(DEFINES_CR);
    buffer.append(value);

    result.add(new String[] { identifier, buffer.toString() });
    return result;
}
 
开发者ID:tlaplus,项目名称:tlaplus,代码行数:25,代码来源:ModelWriter.java

示例15: getConfigurations

import org.eclipse.debug.core.ILaunchConfiguration; //导入方法依赖的package包/类
private ILaunchConfiguration[] getConfigurations(IFile file) {
	ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
	ILaunchConfigurationType type = manager
			.getLaunchConfigurationType(LAUNCH_CONFIG_TYPE_DYNAMIC_EXECUTION_ANALYSIS);
	try {
		// configurations that match the given resource
		List<ILaunchConfiguration> configs = new ArrayList<ILaunchConfiguration>();

		// candidates
		ILaunchConfiguration[] candidates = manager.getLaunchConfigurations(type);
		String name = FileUtils.getRelativePath(file);
		for (ILaunchConfiguration config : candidates) {
			String fileName = config.getAttribute(CAL_XDF.longName(), "");
			if (fileName.equals(name)) {
				configs.add(config);
			}
		}

		return configs.toArray(new ILaunchConfiguration[] {});
	} catch (Exception e) {
		e.printStackTrace();
		return null;
	}
}
 
开发者ID:turnus,项目名称:turnus.orcc,代码行数:25,代码来源:OrccDynamicExecutionLaunchShortcut.java


注:本文中的org.eclipse.debug.core.ILaunchConfiguration.getAttribute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。