本文整理汇总了Java中org.eclipse.debug.core.model.IProcess.getLabel方法的典型用法代码示例。如果您正苦于以下问题:Java IProcess.getLabel方法的具体用法?Java IProcess.getLabel怎么用?Java IProcess.getLabel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.debug.core.model.IProcess
的用法示例。
在下文中一共展示了IProcess.getLabel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: computeName
import org.eclipse.debug.core.model.IProcess; //导入方法依赖的package包/类
/**
* Computes and returns the current name of this console.
*
* @return a name for this console
*/
protected String computeName() {
String label = null;
final IProcess process = getProcess();
final ILaunchConfiguration config = process.getLaunch().getLaunchConfiguration();
label = process.getAttribute(IProcess.ATTR_PROCESS_LABEL);
if (label == null) {
if (config == null) {
label = process.getLabel();
} else {
// check if PRIVATE config
if (DebugUITools.isPrivate(config)) {
label = process.getLabel();
} else {
String type = null;
try {
type = config.getType().getName();
} catch (final CoreException e) {
}
final StringBuffer buffer = new StringBuffer();
buffer.append("Remote shell connection to: ");
buffer.append(config.getName());
if (type != null) {
buffer.append(" ["); //$NON-NLS-1$
buffer.append(type);
buffer.append("] "); //$NON-NLS-1$
}
buffer.append(process.getLabel());
label = buffer.toString();
}
}
}
if (process.isTerminated()) {
return MessageFormat.format("<disconnected> {0}", (Object[]) new String[] { label });
}
return label;
}
示例2: getName
import org.eclipse.debug.core.model.IProcess; //导入方法依赖的package包/类
@Override
public String getName() throws DebugException {
if (getDebugTarget() == null || getDebugTarget().getProcess() == null) {
// probably being terminated, return constant string
return "Interactive Console";
}
IProcess process = getDebugTarget().getProcess();
return "Interactive Console: " + process.getLabel();
}