本文整理汇总了Java中org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants类的典型用法代码示例。如果您正苦于以下问题:Java IJavaLaunchConfigurationConstants类的具体用法?Java IJavaLaunchConfigurationConstants怎么用?Java IJavaLaunchConfigurationConstants使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IJavaLaunchConfigurationConstants类属于org.eclipse.jdt.launching包,在下文中一共展示了IJavaLaunchConfigurationConstants类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addJvmOptions
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants; //导入依赖的package包/类
private void addJvmOptions ( final ILaunchConfigurationWorkingCopy cfg, final Profile profile, final IContainer container ) throws CoreException
{
final List<String> args = new LinkedList<> ();
args.addAll ( profile.getJvmArguments () );
for ( final SystemProperty p : profile.getProperty () )
{
addSystemProperty ( profile, args, p.getKey (), p.getValue (), p.isEval () );
}
for ( final Map.Entry<String, String> entry : getInitialProperties ().entrySet () )
{
addSystemProperty ( profile, args, entry.getKey (), entry.getValue (), false );
}
final IFile dataJson = container.getFile ( new Path ( "data.json" ) ); //$NON-NLS-1$
if ( dataJson.exists () )
{
addJvmArg ( args, "org.eclipse.scada.ca.file.provisionJsonUrl", escapeArgValue ( dataJson.getLocation ().toFile ().toURI ().toString () ) ); //$NON-NLS-1$
}
cfg.setAttribute ( IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, StringHelper.join ( args, "\n" ) );
cfg.setAttribute ( IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, StringHelper.join ( profile.getArguments (), "\n" ) );
}
示例2: testProjectWithSourceFolders
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants; //导入依赖的package包/类
@Test
public void testProjectWithSourceFolders() throws Exception {
IPackageFragmentRoot rootSrc1 = javaProject1.createSourceFolder("src");
IPackageFragmentRoot rootSrc2 = javaProject1.createSourceFolder("test");
JavaProjectKit.waitForBuild();
ILaunchConfigurationWorkingCopy configuration = getJavaApplicationType()
.newInstance(javaProject1.project, "test.launch");
configuration.setAttribute(
IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, "project1");
final Collection<IPackageFragmentRoot> scope = launcher
.getOverallScope(configuration);
assertEquals(set(rootSrc1, rootSrc2), set(scope));
}
示例3: testProjectWithLibrary
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants; //导入依赖的package包/类
@Test
public void testProjectWithLibrary() throws Exception {
IPackageFragmentRoot rootBin1 = javaProject1.createJAR(
"testdata/bin/signatureresolver.jar", "/sample.jar", new Path(
"/UnitTestProject/sample.jar"), null);
JavaProjectKit.waitForBuild();
ILaunchConfigurationWorkingCopy configuration = getJavaApplicationType()
.newInstance(javaProject1.project, "test.launch");
configuration.setAttribute(
IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, "project1");
final Collection<IPackageFragmentRoot> scope = launcher
.getOverallScope(configuration);
assertEquals(set(rootBin1), set(scope));
}
示例4: testProjectWithProjectReference
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants; //导入依赖的package包/类
@Test
public void testProjectWithProjectReference() throws Exception {
IPackageFragmentRoot rootSrc1 = javaProject1.createSourceFolder("src");
IPackageFragmentRoot rootSrc2 = javaProject2.createSourceFolder("src");
javaProject1.addProjectReference(javaProject2);
JavaProjectKit.waitForBuild();
ILaunchConfigurationWorkingCopy configuration = getJavaApplicationType()
.newInstance(javaProject1.project, "test.launch");
configuration.setAttribute(
IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, "project1");
final Collection<IPackageFragmentRoot> scope = launcher
.getOverallScope(configuration);
assertEquals(set(rootSrc1, rootSrc2), set(scope));
}
示例5: mockILaunchConfiguration
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants; //导入依赖的package包/类
private ILaunchConfiguration mockILaunchConfiguration() throws CoreException {
ILaunchConfiguration configuration = mock(ILaunchConfiguration.class);
String configurationName = "testConfiguration";
when(configuration.getName()).thenReturn(configurationName);
PipelineRunner runner = PipelineRunner.BLOCKING_DATAFLOW_PIPELINE_RUNNER;
when(configuration.getAttribute(eq(PipelineConfigurationAttr.RUNNER_ARGUMENT.toString()),
anyString())).thenReturn(runner.getRunnerName());
String projectName = "Test-project,Name";
when(configuration.getAttribute(eq(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME),
anyString())).thenReturn(projectName);
when(workspaceRoot.getProject(projectName)).thenReturn(project);
when(project.exists()).thenReturn(true);
return configuration;
}
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:18,代码来源:DataflowPipelineLaunchDelegateTest.java
示例6: testInitializeForm_noExceptionForNonAccessibleProject
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants; //导入依赖的package包/类
@Test
public void testInitializeForm_noExceptionForNonAccessibleProject()
throws CoreException, InvocationTargetException, InterruptedException {
IWorkspaceRoot workspaceRoot = mock(IWorkspaceRoot.class);
when(workspaceRoot.getProject(anyString())).thenReturn(mock(IProject.class));
ILaunchConfigurationDialog dialog = mock(ILaunchConfigurationDialog.class);
doAnswer(new SynchronousIRunnableContextExecutor())
.when(dialog).run(anyBoolean(), anyBoolean(), any(IRunnableWithProgress.class));
ILaunchConfiguration configuration = mock(ILaunchConfiguration.class);
when(configuration.getAttribute(
eq(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME), anyString()))
.thenReturn("my-project");
when(configuration.getAttribute(
eq(PipelineConfigurationAttr.RUNNER_ARGUMENT.toString()), anyString()))
.thenReturn("DirectPipelineRunner");
PipelineArgumentsTab tab = new PipelineArgumentsTab(workspaceRoot);
tab.setLaunchConfigurationDialog(dialog);
tab.createControl(shellResource.getShell());
tab.initializeFrom(configuration); // Should not throw NPE.
ProjectUtils.waitForProjects(); // Suppress some non-terminated-job error logs
}
示例7: createMavenPackagingLaunchConfiguration
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants; //导入依赖的package包/类
@VisibleForTesting
static ILaunchConfiguration createMavenPackagingLaunchConfiguration(IProject project)
throws CoreException {
ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
ILaunchConfigurationType launchConfigurationType = launchManager
.getLaunchConfigurationType(MavenLaunchConstants.LAUNCH_CONFIGURATION_TYPE_ID);
String launchConfigName = "CT4E App Engine flexible Maven deploy artifact packaging "
+ project.getLocation().toString().replaceAll("[^a-zA-Z0-9]", "_");
ILaunchConfigurationWorkingCopy workingCopy = launchConfigurationType.newInstance(
null /*container*/, launchConfigName);
workingCopy.setAttribute(ILaunchManager.ATTR_PRIVATE, true);
// IDebugUIConstants.ATTR_LAUNCH_IN_BACKGROUND;
workingCopy.setAttribute("org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND", true);
workingCopy.setAttribute(MavenLaunchConstants.ATTR_POM_DIR, project.getLocation().toString());
workingCopy.setAttribute(MavenLaunchConstants.ATTR_GOALS, "package");
workingCopy.setAttribute(RefreshUtil.ATTR_REFRESH_SCOPE, "${project}");
workingCopy.setAttribute(RefreshUtil.ATTR_REFRESH_RECURSIVE, true);
IPath jreContainerPath = getJreContainerPath(project);
workingCopy.setAttribute(
IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH, jreContainerPath.toString());
return workingCopy;
}
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:27,代码来源:FlexMavenPackagedProjectStagingDelegate.java
示例8: testCreateMavenPackagingLaunchConfiguration
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants; //导入依赖的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
示例9: computeUnresolvedClasspath
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants; //导入依赖的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);
}
示例10: getRemoteDebugConfig
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants; //导入依赖的package包/类
private ILaunchConfigurationWorkingCopy getRemoteDebugConfig(IProject activeProj) throws CoreException {
ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
ILaunchConfigurationType type = manager.getLaunchConfigurationType(IJavaLaunchConfigurationConstants.ID_REMOTE_JAVA_APPLICATION);
ILaunchConfigurationWorkingCopy config = type.newInstance(null, "Debug "+activeProj.getName());
config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, activeProj.getName());
config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_ALLOW_TERMINATE, true);
config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_CONNECTOR, IJavaLaunchConfigurationConstants.ID_SOCKET_ATTACH_VM_CONNECTOR);
IVMConnector connector = JavaRuntime.getVMConnector(IJavaLaunchConfigurationConstants.ID_SOCKET_ATTACH_VM_CONNECTOR);
Map<String, Argument> def = connector.getDefaultArguments();
Map<String, String> argMap = new HashMap<String, String>(def.size());
argMap.put("hostname", getHostname(activeProj));
argMap.put("port", "8348");
WPILibJavaPlugin.logInfo(argMap.toString());
config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CONNECT_MAP, argMap);
return config;
}
示例11: createConfiguration
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants; //导入依赖的package包/类
protected ILaunchConfiguration createConfiguration(IType type)
throws CoreException {
ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
ILaunchConfigurationType configType = manager
.getLaunchConfigurationType(IJavaLaunchConfigurationConstants.ID_JAVA_APPLICATION);
ILaunchConfigurationWorkingCopy workingCopy = configType.newInstance(
null, manager.generateLaunchConfigurationName(type
.getTypeQualifiedName('.')));
workingCopy.setAttribute(
IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME,
type.getFullyQualifiedName());
workingCopy.setAttribute(
IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, type
.getJavaProject().getElementName());
workingCopy.setMappedResources(new IResource[] { type
.getUnderlyingResource() });
return workingCopy.doSave();
}
示例12: computeSourceContainers
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants; //导入依赖的package包/类
public ISourceContainer[] computeSourceContainers(ILaunchConfiguration configuration, IProgressMonitor monitor)
throws CoreException {
List<IRuntimeClasspathEntry> entries = new ArrayList<IRuntimeClasspathEntry>();
IRuntimeClasspathEntry jreEntry = JavaRuntime.computeJREEntry(configuration);
if (jreEntry != null) {
entries.add(jreEntry);
}
String projectName = configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, ""); //$NON-NLS-1$
if (projectName == null) {
return null;
}
for (IProject project : ResourcesPlugin.getWorkspace().getRoot().getProjects()) {
IJavaProject javaProject = JavaCore.create(project);
if (javaProject != null && javaProject.isOpen() && ("".equals(projectName) || projectName.equals(javaProject.getElementName()))) { //$NON-NLS-1$
entries.add(JavaRuntime.newDefaultProjectClasspathEntry(javaProject));
}
}
IRuntimeClasspathEntry[] resolved = JavaRuntime.resolveSourceLookupPath( //
entries.toArray(new IRuntimeClasspathEntry[entries.size()]), configuration);
return JavaRuntime.getSourceContainers(resolved);
}
示例13: getMainClass
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants; //导入依赖的package包/类
/**
* get mainclass set in launch configuration
*
* @return "" if not set, never null
*/
public String getMainClass() {
String result = null;
if (launchConfig != null) {
try {
result = launchConfig.getAttribute(
IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME,
(String) null);
} catch (CoreException ignore) {
}
}
if (result == null) {
result = "";
}
return result;
}
示例14: getArguments
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants; //导入依赖的package包/类
/**
* get program arguments set in launch configuration
*
* @return "" if not set, never null
*/
public String getArguments() {
String result = null;
if (launchConfig != null) {
try {
result = launchConfig
.getAttribute(
IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS,
(String) null);
} catch (CoreException ignore) {
}
}
if (result == null) {
result = "";
}
return result;
}
示例15: getVMArguments
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants; //导入依赖的package包/类
/**
* get vm arguments set in launch configuration
*
* @return "" if not set, never null
*/
public String getVMArguments() {
String result = null;
if (launchConfig != null) {
try {
result = launchConfig.getAttribute(
IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS,
(String) null);
} catch (CoreException ignore) {
}
}
if (result == null) {
result = "";
}
return result;
}