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


Java DebugUITools.launch方法代码示例

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


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

示例1: launchFile

import org.eclipse.debug.ui.DebugUITools; //导入方法依赖的package包/类
/**
 * Launch a file, using the file information, which means using default launch configurations.
 */
protected void launchFile(IFile originalFileToRun, String mode) {
	final String runnerId = getRunnerId();
	final String path = originalFileToRun.getFullPath().toOSString();
	final URI moduleToRun = URI.createPlatformResourceURI(path, true);

	final String implementationId = chooseImplHelper.chooseImplementationIfRequired(runnerId, moduleToRun);
	if (implementationId == ChooseImplementationHelper.CANCEL)
		return;

	RunConfiguration runConfig = runnerFrontEnd.createConfiguration(runnerId, implementationId, moduleToRun);

	ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
	ILaunchConfigurationType type = launchManager.getLaunchConfigurationType(getLaunchConfigTypeID());
	DebugUITools.launch(runConfigConverter.toLaunchConfiguration(type, runConfig), mode);
	// execution dispatched to proper delegate LaunchConfigurationDelegate
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:20,代码来源:AbstractRunnerLaunchShortcut.java

示例2: launch

import org.eclipse.debug.ui.DebugUITools; //导入方法依赖的package包/类
protected void launch(IResource type, Object additionalScope, String mode) {
	List<ILaunchConfiguration> configs = getCandidates(type, additionalScope, getConfigurationType());
	if (configs != null) {
		ILaunchConfiguration config = null;
		int count = configs.size();
		if (count == 1) {
			config = configs.get(0);
		} else if (count > 1) {
			config = chooseConfiguration(configs);
			if (config == null) {
				return;
			}
		}
		if (config == null) {
			config = createConfiguration(type, additionalScope);
		}
		if (config != null) {
			DebugUITools.launch(config, mode);
		}
	}
}
 
开发者ID:de-jcup,项目名称:egradle,代码行数:22,代码来源:EGradleLaunchShortCut.java

示例3: launch

import org.eclipse.debug.ui.DebugUITools; //导入方法依赖的package包/类
/**
 * Delegate method to launch the specified <code>ILaunchConfiguration</code>
 * in the specified mode
 * 
 * @param mode
 *            the mode to launch in
 * @param configuration
 *            the <code>ILaunchConfiguration</code> to launch
 */
private void launch(String mode, ILaunchConfiguration configuration) {
	if (fShowDialog) {
		/*
		 * // Offer to save dirty editors before opening the dialog as the
		 * contents // of an Ant editor often affect the contents of the
		 * dialog. if (!DebugUITools.saveBeforeLaunch()) { return; }
		 */
		IStatus status = new Status(IStatus.INFO,
				JSBuildFileUIPlugin.PLUGIN_ID, STATUS_INIT_RUN_ANT, "",
				null);
		String groupId;
		if (mode.equals(ILaunchManager.DEBUG_MODE)) {
			groupId = IDebugUIConstants.ID_DEBUG_LAUNCH_GROUP;
		} else {
			groupId = org.eclipse.ui.externaltools.internal.model.IExternalToolConstants.ID_EXTERNAL_TOOLS_LAUNCH_GROUP;
		}
		DebugUITools.openLaunchConfigurationDialog(JSBuildFileUIPlugin
				.getActiveWorkbenchWindow().getShell(), configuration,
				groupId, status);
	} else {
		DebugUITools.launch(configuration, mode);
	}
}
 
开发者ID:angelozerr,项目名称:jsbuild-eclipse,代码行数:33,代码来源:JSBuildFileLaunchShortcut.java

示例4: launch

import org.eclipse.debug.ui.DebugUITools; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
  public void launch(ISelection selection, String mode) {
      if (selection instanceof IStructuredSelection) {
          IStructuredSelection ss = (IStructuredSelection) selection;
          if (ss.size() == 1) {
          	Object element = ss.getFirstElement();
              if (element instanceof IFile || element instanceof IFolder
                  					|| element instanceof IProject) {
                  IResource res=(IResource)element;
                  ILaunchConfiguration configuration = getConfiguration(res);
                  if (configuration != null) {
                  	DebugUITools.launch(configuration, mode);
                  }
              }
          }
      }
  }
 
开发者ID:scribble,项目名称:scribble-eclipse,代码行数:20,代码来源:SimulationLauncherShortcut.java

示例5: launch

import org.eclipse.debug.ui.DebugUITools; //导入方法依赖的package包/类
private void launch(IProject project) {
	try {
		HybridProject hp = HybridProject.getHybridProject(project);
		if(!validateBuildToolsReady() 
				|| !shouldProceedWithLaunch(hp)
				|| !RequirementsUtility.checkCordovaRequirements() ){
			return;
		}
		ILaunchConfiguration launchConfig = findOrCreateLaunchConfiguration(project);
		ILaunchConfigurationWorkingCopy wc = launchConfig.getWorkingCopy();
		updateLaunchConfiguration(wc);
		launchConfig = wc.doSave();
		DebugUITools.launch(launchConfig, "run");
		
	} catch (CoreException e) {
		if (e.getCause() instanceof IOException) {
			Status status = new Status(IStatus.ERROR, HybridUI.PLUGIN_ID,
					"Unable to complete the build for target plarform",
					e.getCause());
			StatusManager.handle(status);
		}else{
			StatusManager.handle(e);
		}
	}
}
 
开发者ID:eclipse,项目名称:thym,代码行数:26,代码来源:HybridProjectLaunchShortcut.java

示例6: launchProject

import org.eclipse.debug.ui.DebugUITools; //导入方法依赖的package包/类
private void launchProject(IProject project) {
	Preconditions.checkNotNull(project);
	try {
           String launchName = getLaunchManager().generateLaunchConfigurationName(project.getName());
           
           ILaunchConfigurationWorkingCopy launchConfig =
                   getLaunchConfigType().newInstance(null, launchName);

           launchConfig.setAttribute(LaunchConstants.PROJECT_NAME, project.getName());

           boolean exists = false;
           for (ILaunchConfiguration cfg : getLaunchManager().getLaunchConfigurations(getLaunchConfigType())) {
			if (cfg.getAttribute(LaunchConstants.PROJECT_NAME, "").equals(project.getName())) {
				exists = true;
			}
		}
           if (!exists) {
           	launchConfig.doSave();
           }
           DebugUITools.launch(launchConfig, "run");
       } catch (Exception e) {
       	throw new Error(e);
       }
}
 
开发者ID:peq,项目名称:rustyeclipse,代码行数:25,代码来源:Shortcut.java

示例7: runProjectOnCodenvy

import org.eclipse.debug.ui.DebugUITools; //导入方法依赖的package包/类
private void runProjectOnCodenvy(IProject project, final String mode) {
    final ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
    final ILaunchConfigurationType launchConfigurationType = launchManager.getLaunchConfigurationType(LAUNCH_CONFIGURATION_TYPE_ID);
    if (launchConfigurationType != null) {
        try {

            final ILaunchConfiguration launchConfiguration =
                                                             getLaunchConfiguration(launchManager, launchConfigurationType, project,
                                                                                    mode);
            PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(IConsoleConstants.ID_CONSOLE_VIEW);
            DebugUITools.launch(launchConfiguration, mode);

        } catch (PartInitException e) {
            throw new RuntimeException(e);
        }
    }
}
 
开发者ID:codenvy-legacy,项目名称:eclipse-plugin,代码行数:18,代码来源:RunOnCodenvyShortcut.java

示例8: buildProjectOnCodenvy

import org.eclipse.debug.ui.DebugUITools; //导入方法依赖的package包/类
private void buildProjectOnCodenvy(IProject project, final String mode) {
    final ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
    final ILaunchConfigurationType launchConfigurationType = launchManager.getLaunchConfigurationType(LAUNCH_CONFIGURATION_TYPE_ID);
    if (launchConfigurationType != null) {
        try {

            final ILaunchConfiguration launchConfiguration =
                                                             getLaunchConfiguration(launchManager, launchConfigurationType, project,
                                                                                    mode);
            PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(IConsoleConstants.ID_CONSOLE_VIEW);
            DebugUITools.launch(launchConfiguration, mode);

        } catch (PartInitException e) {
            throw new RuntimeException(e);
        }
    }
}
 
开发者ID:codenvy-legacy,项目名称:eclipse-plugin,代码行数:18,代码来源:BuildOnCodenvyShortcut.java

示例9: launch

import org.eclipse.debug.ui.DebugUITools; //导入方法依赖的package包/类
public void launch( IEditorPart editor, String mode )
{
	Object obj = editor.getEditorInput( );
	if ( !( obj instanceof FileEditorInput ) )
	{
		return;
	}

	FileEditorInput input = (FileEditorInput) obj;
	String fileName = input.getPath( ).toOSString( );
	ILaunchConfiguration config = findLaunchConfiguration( fileName,
			getConfigurationType( ) );
	if ( config != null )
	{
		DebugUITools.launch( config, mode );
	}

}
 
开发者ID:eclipse,项目名称:birt,代码行数:19,代码来源:ScriptLaunchShortcut.java

示例10: run

import org.eclipse.debug.ui.DebugUITools; //导入方法依赖的package包/类
public void run( IAction action )
{
	ModuleHandle handle = null;

	if (handle == null )
	{
		FormEditor editor = UIUtil.getActiveReportEditor( false );
		if (editor instanceof MultiPageReportEditor)
		{
			handle = ((MultiPageReportEditor)editor).getModel( );
		}
	}
	if (handle != null)
	{
		String fileName = handle.getFileName( );
		
		ILaunchConfiguration config = ScriptLaunchShortcut.findLaunchConfiguration( fileName, ScriptLaunchShortcut.getConfigurationType( ) );
		if (config != null) {
			DebugUITools.launch(config, "debug");//$NON-NLS-1$
		}	
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:23,代码来源:DebugScriptAction.java

示例11: launch

import org.eclipse.debug.ui.DebugUITools; //导入方法依赖的package包/类
private void launch(IProject project, String mode) {
    ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
    ILaunchConfigurationType configType = manager.getLaunchConfigurationType(getConfigurationTypeId());
    ILaunchConfiguration config = findConfig(manager, configType, project);
    
    if (config == null) {
        ILaunchConfigurationWorkingCopy wc = null;
        try {
            wc = configType.newInstance(null, manager.generateLaunchConfigurationName(project.getName()));
            wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, project.getName());
            customizeConfiguration(wc);
            config = wc.doSave();
        } catch (CoreException e) {
            RoboVMPlugin.log(e);
        }
    }

    if (config != null) {
        DebugUITools.launch(config, mode);
    }
}
 
开发者ID:robovm,项目名称:robovm-eclipse,代码行数:22,代码来源:AbstractProjectLaunchShortcut.java

示例12: launch

import org.eclipse.debug.ui.DebugUITools; //导入方法依赖的package包/类
/**
 * Launch the given targets in the given build file. The targets are
 * launched in the given mode.
 * 
 * @param resources the resources to launch
 * @param mode the mode in which the file should be executed
 */
protected void launch(FileOrResource[] resources, String mode) {
    ILaunchConfiguration conf = null;
    List<ILaunchConfiguration> configurations = findExistingLaunchConfigurations(resources);
    if (configurations.isEmpty()) {
        conf = createDefaultLaunchConfiguration(resources);
    } else {
        if (configurations.size() == 1) {
            conf = configurations.get(0);
        } else {
            conf = chooseConfig(configurations);
            if (conf == null) {
                // User canceled selection
                return;
            }
        }
    }

    if (conf != null) {
        DebugUITools.launch(conf, mode);
        return;
    }
    fileNotFound();
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:31,代码来源:AbstractLaunchShortcut.java

示例13: launchTest

import org.eclipse.debug.ui.DebugUITools; //导入方法依赖的package包/类
/**
 * Launch a test of the given URI (may point to project, folder, file).
 */
protected void launchTest(URI resourceToTest, String mode) {
	TestConfiguration testConfig = testerFrontEnd.createConfiguration(getTesterId(), null, resourceToTest);

	ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
	ILaunchConfigurationType type = launchManager.getLaunchConfigurationType(getLaunchConfigTypeID());
	DebugUITools.launch(testConfigConverter.toLaunchConfiguration(type, testConfig), mode);
	// execution dispatched to proper ILaunchConfigurationDelegate
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:12,代码来源:AbstractTesterLaunchShortcut.java

示例14: launch

import org.eclipse.debug.ui.DebugUITools; //导入方法依赖的package包/类
private void launch(Object[] elements, String mode) {
	try {
		IJavaElement[] ijes = null;
		List<IJavaElement> jes =  new ArrayList<IJavaElement>();
		for (int i = 0; i < elements.length; i++) {
			Object selected= elements[i];
			if (selected instanceof IJavaElement) {
				IJavaElement element= (IJavaElement) selected;
				switch (element.getElementType()) {
					case IJavaElement.COMPILATION_UNIT:
						jes.add(element);
						break;
				}
			}
		
		}
		ijes = new IJavaElement[jes.size()];
		jes.toArray(ijes);
		ILaunchConfigurationWorkingCopy wc = buildLaunchConfiguration(ijes);
		if (wc==null) return;
		ILaunchConfiguration config= findExistingORCreateLaunchConfiguration(wc, mode);
		DebugUITools.launch(config, mode);
	} catch (Exception e) {
		ResourceManager.logException(e);
		MessageDialog dialog = new MessageDialog(Display.getCurrent().getActiveShell(), "GW4E Launcher", (Image)null, "Unable to launch. See error in Error view.", MessageDialog.ERROR, new String[] { "Close" }, 0);
		dialog.open();
	}
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:29,代码来源:GW4ELaunchShortcut.java

示例15: launch

import org.eclipse.debug.ui.DebugUITools; //导入方法依赖的package包/类
public static void launch(NgCommand ngCommand, IProject project, String mode) throws CoreException {
	String workingDir = AngularCLILaunchHelper.getWorkingDir(project);
	String operation = ngCommand.name().toLowerCase();

	// Check if configuration already exists
	ILaunchConfiguration ngConfiguration = chooseLaunchConfiguration(workingDir, operation);
	if (ngConfiguration != null) {
		ILaunchConfigurationWorkingCopy wc = ngConfiguration.getWorkingCopy();
		// Update nodejs file path if needed
		if (wc.getAttribute(AngularCLILaunchConstants.NODE_FILE_PATH, (String) null) == null) {
			updateNodeFilePath(project, wc);
		}
		// Update ng file path
		if (wc.getAttribute(AngularCLILaunchConstants.NG_FILE_PATH, (String) null) == null) {
			updateNgFilePath(project, wc);
		}
		ngConfiguration = wc.doSave();
		DebugUITools.launch(ngConfiguration, mode);
	} else {
		// Creating Launch Configuration from scratch
		ILaunchConfigurationWorkingCopy newConfiguration = createEmptyLaunchConfiguration(project.getName(),
				operation);
		// nodejs file to use
		updateNodeFilePath(project, newConfiguration);
		// ng file to use
		updateNgFilePath(project, newConfiguration);
		newConfiguration.setAttribute(AngularCLILaunchConstants.WORKING_DIR, workingDir);
		newConfiguration.setAttribute(AngularCLILaunchConstants.OPERATION, operation);
		// newConfiguration.setAttribute(AngularCLILaunchConstants.OPERATION_PARAMETERS,
		// "--live-reload-port 65535");
		newConfiguration.doSave();
		DebugUITools.launch(newConfiguration, mode);
	}
}
 
开发者ID:angelozerr,项目名称:angular-eclipse,代码行数:35,代码来源:AngularCLILaunchHelper.java


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