本文整理汇总了Java中org.eclipse.debug.core.model.IProcess.getLaunch方法的典型用法代码示例。如果您正苦于以下问题:Java IProcess.getLaunch方法的具体用法?Java IProcess.getLaunch怎么用?Java IProcess.getLaunch使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.debug.core.model.IProcess
的用法示例。
在下文中一共展示了IProcess.getLaunch方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onAfterCodeServerStarted
import org.eclipse.debug.core.model.IProcess; //导入方法依赖的package包/类
private void onAfterCodeServerStarted(DebugEvent event) {
if (!(event.getSource() instanceof IProcess)) {
return;
}
IProcess runtimeProcess = (IProcess) event.getSource();
final ILaunch launch = runtimeProcess.getLaunch();
IProcess[] processes = launch.getProcesses();
final IProcess process = processes[0];
// Look for the links in the sdm console output
consoleStreamListenerCodeServer = new IStreamListener() {
@Override
public void streamAppended(String text, IStreamMonitor monitor) {
displayCodeServerUrlInDevMode(launch, text);
}
};
// Listen to Console output
streamMonitorCodeServer = process.getStreamsProxy().getOutputStreamMonitor();
streamMonitorCodeServer.addListener(consoleStreamListenerCodeServer);
}
示例2: getEncodingFromFrame
import org.eclipse.debug.core.model.IProcess; //导入方法依赖的package包/类
public static String getEncodingFromFrame(PyStackFrame selectedFrame) {
try {
IDebugTarget adapter = (IDebugTarget) selectedFrame.getAdapter(IDebugTarget.class);
if (adapter == null) {
return "UTF-8";
}
IProcess process = adapter.getProcess();
if (process == null) {
return "UTF-8";
}
ILaunch launch = process.getLaunch();
if (launch == null) {
Log.log("Unable to get launch for: " + process);
return "UTF-8";
}
return getEncodingFromLaunch(launch);
} catch (Exception e) {
Log.log(e);
return "UTF-8";
}
}
示例3: init
import org.eclipse.debug.core.model.IProcess; //导入方法依赖的package包/类
@Override
public void init(final IConsole console) {
IProcess process = console.getProcess();
if (process != null) {
ILaunch launch = process.getLaunch();
if (launch != null) {
initLaunchConfiguration(launch.getLaunchConfiguration());
}
}
this.linkContainer = new ILinkContainer() {
@Override
public void addLink(IHyperlink link, int offset, int length) {
console.addLink(link, offset, length);
}
@Override
public String getContents(int offset, int length) throws BadLocationException {
return console.getDocument().get(offset, length);
}
};
}
示例4: handleDebugEvents
import org.eclipse.debug.core.model.IProcess; //导入方法依赖的package包/类
public void handleDebugEvents(DebugEvent[] events) {
for (final DebugEvent e : events) {
if (e.getSource() instanceof IProcess
&& e.getKind() == DebugEvent.TERMINATE) {
final IProcess proc = (IProcess) e.getSource();
final ILaunch launch = proc.getLaunch();
if (launch instanceof CoverageLaunch) {
final CoverageLaunch coverageLaunch = (CoverageLaunch) launch;
coverageLaunch.getAgentServer().stop();
checkExecutionData(coverageLaunch);
}
}
}
}
示例5: updateProjectAndWorkingDir
import org.eclipse.debug.core.model.IProcess; //导入方法依赖的package包/类
private void updateProjectAndWorkingDir() {
IProcess process = DebugUITools.getCurrentProcess();
if (process != null) {
ILaunch launch = process.getLaunch();
if (launch != null) {
ILaunchConfiguration lc = launch.getLaunchConfiguration();
initLaunchConfiguration(lc);
}
}
}
示例6: calcExtendedProcessLabel
import org.eclipse.debug.core.model.IProcess; //导入方法依赖的package包/类
public static String calcExtendedProcessLabel(IProcess process) {
ILaunch launch = process.getLaunch();
StringBuffer buffer = new StringBuffer();
if (process.isTerminated()) {
try {
int exitValue = process.getExitValue();
buffer.append("<exit code: " + exitValue + "> ");
} catch (DebugException e) {
// Should not happen
}
}
ILaunchConfiguration launchConfiguration = launch.getLaunchConfiguration();
if (launchConfiguration != null) {
buffer.append(launchConfiguration.getName());
try {
ILaunchConfigurationType launchConfigType = launchConfiguration.getType();
if (launchConfigType != null) {
String type = launchConfigType.getName();
buffer.append(" [");
buffer.append(type);
buffer.append("] ");
}
} catch (CoreException ce) {
EclipseCore.logStatus(ce);
}
}
buffer.append(process.getLabel());
return buffer.toString();
}
示例7: onServerStarted
import org.eclipse.debug.core.model.IProcess; //导入方法依赖的package包/类
/**
* Possibly start the GWT Super Dev Mode CodeServer. <br/>
* <br/>
* This starts as separate process, which allows for custom args modification. <br/>
* It adds a launcher id to both processes for reference. <br/>
* 1. Get it from classic launch config <br/>
* 2. Get it from server VM properties <br/>
*/
protected void onServerStarted(DebugEvent event) {
onAfterWebServerStarted(event);
IProcess runtimeProcess = (IProcess) event.getSource();
ILaunch launch = runtimeProcess.getLaunch();
ILaunchConfiguration launchConfig = launch.getLaunchConfiguration();
String launchMode = launch.getLaunchMode();
IServer server = null;
try {
server = ServerUtil.getServer(launchConfig);
} catch (CoreException e) {
logError("possiblyLaunchGwtSuperDevModeCodeServer: Could get the WTP server.", e);
return;
}
if (server == null) {
logMessage("possiblyLaunchGwtSuperDevModeCodeServer: No WTP server runtime found.");
return;
}
IFacetedProject gwtFacetedProject = GwtFacetUtils.getGwtFacetedProject(server);
// If one of the server modules has a gwt facet
if (gwtFacetedProject == null) {
logMessage("possiblyLaunchGwtSuperDevModeCodeServer: Does not have a GWT Facet.");
return;
}
// Sync Option - the sync is off, ignore stopping the server
if (!GWTProjectProperties.getFacetSyncCodeServer(gwtFacetedProject.getProject())) {
logMessage("possiblyLaunchGwtSuperDevModeCodeServer: GWT Facet project properties, the code server sync is off.");
return;
}
/**
* Get the war output path for the `-launcherDir` in SDM launcher
*/
String launcherDir = getLauncherDirectory(server, launchConfig, gwtFacetedProject);
// LauncherId used to reference and terminate the the process
String launcherId = setLauncherIdToWtpRunTimeLaunchConfig(launchConfig);
logMessage("possiblyLaunchGwtSuperDevModeCodeServer: Launching GWT Super Dev Mode CodeServer. launcherId="
+ launcherId + " launcherDir=" + launcherDir);
// Just in case
if (launchMode == null) {
// run the code server, no need to debug it
launchMode = "run";
}
if (launcherId == null) { // ids to link two processes together
logMessage("possiblyLaunchGwtSuperDevModeCodeServer: No launcherId.");
}
// Add server urls to DevMode view for easy clicking on
addServerUrlsToDevModeView(launch);
// Creates ore launches an existing Super Dev Mode Code Server process
GwtSuperDevModeCodeServerLaunchUtil.launch(gwtFacetedProject.getProject(), launchMode, launcherDir, launcherId);
}