當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。