本文整理汇总了Java中org.eclipse.debug.core.ILaunchManager.getLaunches方法的典型用法代码示例。如果您正苦于以下问题:Java ILaunchManager.getLaunches方法的具体用法?Java ILaunchManager.getLaunches怎么用?Java ILaunchManager.getLaunches使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.debug.core.ILaunchManager
的用法示例。
在下文中一共展示了ILaunchManager.getLaunches方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getRunningLaunchConfiguration
import org.eclipse.debug.core.ILaunchManager; //导入方法依赖的package包/类
private ILaunchConfiguration getRunningLaunchConfiguration() {
Set<IProject> projects = new HashSet<IProject>(
Arrays.asList(ProjectUtil.getProjects(repository)));
ILaunchManager launchManager = DebugPlugin.getDefault()
.getLaunchManager();
ILaunch[] launches = launchManager.getLaunches();
for (ILaunch launch : launches) {
if (launch.isTerminated())
continue;
ISourceLocator locator = launch.getSourceLocator();
if (locator instanceof ISourceLookupDirector) {
ISourceLookupDirector director = (ISourceLookupDirector) locator;
ISourceContainer[] containers = director.getSourceContainers();
if (isAnyProjectInSourceContainers(containers, projects))
return launch.getLaunchConfiguration();
}
}
return null;
}
示例2: terminateAllLaunchConfigs
import org.eclipse.debug.core.ILaunchManager; //导入方法依赖的package包/类
public static void terminateAllLaunchConfigs(SWTBot bot) {
SwtBotUtils.print("Terminating Launches");
ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
ILaunch[] launches = manager.getLaunches();
if (launches == null || launches.length == 0) {
SwtBotUtils.print("No Launches to terminate");
}
for (ILaunch launch : launches) {
if (!launch.isTerminated()) {
try {
launch.terminate();
} catch (DebugException e) {
SwtBotUtils.printError("Could not terminate launch." + e.getMessage());
}
}
}
SwtBotWorkbenchActions.waitForIdle(bot);
SwtBotUtils.print("Terminated Launches");
}
示例3: isRunning
import org.eclipse.debug.core.ILaunchManager; //导入方法依赖的package包/类
public boolean isRunning() {
final ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
final ILaunch[] launches = launchManager.getLaunches();
for (int i = 0; i < launches.length; i++) {
final ILaunch launch = launches[i];
if (launch.getLaunchConfiguration() != null
&& launch.getLaunchConfiguration().contentsEqual(this.launchConfig)) {
if (!launch.isTerminated()) {
return true;
}
}
}
return false;
}
示例4: processInitialize
import org.eclipse.debug.core.ILaunchManager; //导入方法依赖的package包/类
private Response processInitialize(Initialize initialize) {
String clientId = initialize.getClientId();
assert (clientId != null);
ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
ILaunch[] launches = launchManager.getLaunches();
ILaunch launch = null;
for (int i = 0; launch == null && i < launches.length; ++i) {
IProcess[] processes = launches[i].getProcesses();
for (IProcess iProcess : processes) {
String commandLine = iProcess.getAttribute(IProcess.ATTR_CMDLINE);
if (commandLine != null && commandLine.indexOf(clientId) != -1) {
launch = launches[i];
break;
}
}
}
WebAppDebugModel model = WebAppDebugModel.getInstance();
LaunchConfiguration lc = model.addOrReturnExistingLaunchConfiguration(launch, clientId, null);
lc.setLaunchUrls(initialize.getStartupURLsList());
setLaunchConfiguration(lc);
DevModeServiceClient devModeServiceClient = new DevModeServiceClient(getTransport());
DevModeServiceClientManager.getInstance().putClient(getLaunchConfiguration(),
devModeServiceClient);
performDevModeServiceCapabilityExchange(devModeServiceClient);
return buildResponse(null);
}
示例5: ThreadColorManager
import org.eclipse.debug.core.ILaunchManager; //导入方法依赖的package包/类
ThreadColorManager()
{
updateList = new LinkedList<IThreadColorListener>();
threadColors = new ArrayList<Color>();
targetToThreadColorsMap = new HashMap<IJiveDebugTarget, TargetThreadColors>();
final IPreferenceStore store = PreferencesPlugin.getDefault().getPreferenceStore();
store.addPropertyChangeListener(this);
final ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
for (final ILaunch launch : manager.getLaunches())
{
launchChanged(launch);
}
manager.addLaunchListener(this);
}
示例6: waitForLaunchAvailable
import org.eclipse.debug.core.ILaunchManager; //导入方法依赖的package包/类
/**
* Waits until a launch becomes available
* @return the launch that was found
*/
public ILaunch waitForLaunchAvailable() throws Throwable {
final ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
waitForCondition(new ICallback() {
@Override
public Object call(Object args) throws Exception {
ILaunch[] launches = launchManager.getLaunches();
return launches.length > 0;
}
}, "waitForLaunchAvailable");
return launchManager.getLaunches()[0];
}
示例7: clearToLaunch
import org.eclipse.debug.core.ILaunchManager; //导入方法依赖的package包/类
/**
* Checks whether a dLabPro process of the extended type <code>sExtProcType</code>
* can be launched. If other processes of the same type are running and dLabPro
* console recycling is enabled (see
* {@link de.tudresden.ias.eclipse.dlabpro.run.actions.common#ReuseConsoleViewActionDelegate
* ReuseConsoleViewActionDelegate}) the method will display a dialog which will
* prompt the user for terminating concurrent processes.
*
* @param sExtProcType the extended process type
* @return <code>true</code> if a new dLabPro process can be launched
*/
private static boolean clearToLaunch(String sExtProcType)
{
ILaunchManager iLm = DebugPlugin.getDefault().getLaunchManager();
ILaunch[] aiLn = iLm.getLaunches();
if (ReuseConsoleViewActionDelegate.isEnabled() && aiLn.length > 0)
for (int i=0; i<aiLn.length; i++)
{
if (aiLn[i].getProcesses().length==0) continue;
IProcess iIpr = aiLn[i].getProcesses()[0];
if (iIpr.isTerminated()) continue;
if (!iIpr
.getAttribute(ATTR_PROCESS_EXTTYPE).equals(sExtProcType))
continue;
String sTitle = sExtProcType+" - Confirm Termination";
String sMsg = "This will terminate the running "+sExtProcType+" session.";
sMsg += "\n\nUncheck the \"Recycle Console\" button in the console toolbar if you";
sMsg += " want to run multiple "+sExtProcType+" sessions at the same time.";
if (UIUtil.openConfirmDialog(sTitle,sMsg))
{
try
{
aiLn[i].terminate();
}
catch (DebugException e)
{
return false;
}
}
else return false;
}
return true;
}
示例8: closeOutputDocument
import org.eclipse.debug.core.ILaunchManager; //导入方法依赖的package包/类
/**
* Closes the target output document using the DDE command from the
* default viewer, or the most recently launched preview. This method
* is probably fragile since the process and launches handling in
* Texlipse is too weak to always know what documents are locked and
* needs closing.
*
* @throws CoreException
*/
public static void closeOutputDocument() throws CoreException {
ViewerAttributeRegistry registry = new ViewerAttributeRegistry();
// Check to see if we have a running launch configuration which should
// override the DDE close command
ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
ILaunch[] launches = manager.getLaunches();
for (int i = 0; i < launches.length; i++) {
ILaunch l = launches[i];
ILaunchConfiguration configuration = l.getLaunchConfiguration();
if (configuration != null && configuration.exists() && configuration.getType().getIdentifier().equals(
TexLaunchConfigurationDelegate.CONFIGURATION_ID)) {
Map regMap = configuration.getAttributes();
registry.setValues(regMap);
break;
}
}
ViewerManager mgr = new ViewerManager(registry, null);
if (!mgr.initialize()) {
return;
}
// Can only close documents opened by DDE commands themselves
Process process = mgr.getExisting();
if (process != null) {
mgr.sendDDECloseCommand();
try {
Thread.sleep(500); // A small delay required
} catch (InterruptedException e) {
// swallow
}
returnFocusToEclipse(false);
}
}