當前位置: 首頁>>代碼示例>>Java>>正文


Java IJavaLaunchConfigurationConstants類代碼示例

本文整理匯總了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" ) );
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:26,代碼來源:LaunchShortcut.java

示例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));
}
 
開發者ID:eclipse,項目名稱:eclemma,代碼行數:17,代碼來源:JavaApplicationLauncherTest.java

示例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));
}
 
開發者ID:eclipse,項目名稱:eclemma,代碼行數:18,代碼來源:JavaApplicationLauncherTest.java

示例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));
}
 
開發者ID:eclipse,項目名稱:eclemma,代碼行數:18,代碼來源:JavaApplicationLauncherTest.java

示例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
}
 
開發者ID:GoogleCloudPlatform,項目名稱:google-cloud-eclipse,代碼行數:26,代碼來源:PipelineArgumentsTabTest.java

示例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);
  }
 
開發者ID:fbricon,項目名稱:wildfly-hive,代碼行數:21,代碼來源:MavenRuntimeClasspathProvider.java

示例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;
}
 
開發者ID:wpilibsuite,項目名稱:EclipsePlugins,代碼行數:17,代碼來源:JavaLaunchShortcut.java

示例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();
}
 
開發者ID:eclipse,項目名稱:cft,代碼行數:22,代碼來源:JavaPackageFragmentRootHandler.java

示例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);
}
 
開發者ID:eclipse,項目名稱:cft,代碼行數:27,代碼來源:CloudFoundryDebugSourceLocator.java

示例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;
}
 
開發者ID:thahn0720,項目名稱:agui_eclipse_plugin,代碼行數:21,代碼來源:JProjectConfiguration.java

示例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;
}
 
開發者ID:thahn0720,項目名稱:agui_eclipse_plugin,代碼行數:22,代碼來源:JProjectConfiguration.java

示例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;
}
 
開發者ID:thahn0720,項目名稱:agui_eclipse_plugin,代碼行數:21,代碼來源:JProjectConfiguration.java


注:本文中的org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。