本文整理匯總了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();
}