本文整理汇总了Java中com.intellij.ui.ColoredTextContainer类的典型用法代码示例。如果您正苦于以下问题:Java ColoredTextContainer类的具体用法?Java ColoredTextContainer怎么用?Java ColoredTextContainer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ColoredTextContainer类属于com.intellij.ui包,在下文中一共展示了ColoredTextContainer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: customizePresentation
import com.intellij.ui.ColoredTextContainer; //导入依赖的package包/类
@Override
public void customizePresentation(@NotNull ColoredTextContainer component) {
if (myPosition == null) {
component.append("<frame not available>", SimpleTextAttributes.GRAY_ATTRIBUTES);
return;
}
final VirtualFile file = myPosition.getFile();
String frameName = myFrameInfo.getName();
component.setIcon(MODULE.equals(frameName) ? PythonPsiApiIcons.PythonFile : PythonEducationalIcons.Field);
if (MODULE.equals(frameName)) {
component.append(GLOBAL_FRAME, SimpleTextAttributes.REGULAR_ATTRIBUTES);
component.append(" (" + file.getName() + ")", getGrayAttributes(SimpleTextAttributes.REGULAR_ATTRIBUTES));
}
else {
component.append(frameName, SimpleTextAttributes.REGULAR_ATTRIBUTES);
}
}
示例2: renderClient
import com.intellij.ui.ColoredTextContainer; //导入依赖的package包/类
private static void renderClient(@NotNull Client c, ColoredTextContainer container) {
ClientData cd = c.getClientData();
String name = cd.getClientDescription();
if (name == null) {
return;
}
Pair<String, String> app = splitApplicationName(name);
container.append(app.getFirst(), SimpleTextAttributes.REGULAR_ATTRIBUTES);
container.append(app.getSecond(), SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES);
if (cd.isValidUserId() && cd.getUserId() != 0) {
container.append(String.format(" (user %1$d)", cd.getUserId()), SimpleTextAttributes.GRAY_ATTRIBUTES);
}
container.append(String.format(" (%1$d)", cd.getPid()), SimpleTextAttributes.GRAY_ATTRIBUTES);
if (!c.isValid()) {
container.append(" [DEAD]", SimpleTextAttributes.GRAYED_BOLD_ATTRIBUTES);
}
}
示例3: _customizePresentation
import com.intellij.ui.ColoredTextContainer; //导入依赖的package包/类
private void _customizePresentation(ColoredTextContainer component) {
final Debugger.Frame frame = myFrame;
if (frame instanceof Debugger.StyleFrame) {
component.append(((Debugger.StyleFrame)frame).getInstruction(), SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES);
} else if (frame instanceof Debugger.SourceFrame) {
component.append(((Debugger.SourceFrame)frame).getXPath(), SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES);
}
component.append(" ", SimpleTextAttributes.REGULAR_ATTRIBUTES);
try {
final VirtualFile file = VfsUtil.findFileByURL(new URI(frame.getURI()).toURL());
if (file != null) {
component.append(file.getName(), SimpleTextAttributes.REGULAR_ATTRIBUTES);
if (frame.getLineNumber() > 0) {
component.append(":" + frame.getLineNumber(), SimpleTextAttributes.REGULAR_ATTRIBUTES);
}
component.setToolTipText(file.getPresentableUrl());
} else {
component.append(frame.getURI() + ":" + frame.getLineNumber(), SimpleTextAttributes.REGULAR_ATTRIBUTES);
}
} catch (Exception ignored) {
component.append(frame.getURI() + ":" + frame.getLineNumber(), SimpleTextAttributes.REGULAR_ATTRIBUTES);
}
}
示例4: customizePresentation
import com.intellij.ui.ColoredTextContainer; //导入依赖的package包/类
@Override
public void customizePresentation(@NotNull ColoredTextContainer component) {
// String functionName = mySourcePosition != null ? mySourcePosition.getFunctionName() : null;
// if (functionName != null) {
// SquirrelFile module = myResolver.findPsi(mySourcePosition.getSourcePosition().getFile());
// SquirrelFunction function = module != null ? module.getFunction(functionName, mySourcePosition.getFunctionArity()) : null;
// if (function != null) {
// String title = SquirrelPsiImplUtil.getQualifiedFunctionName(function);
// SquirrelFunExpression funExpression = SquirrelPsiImplUtil.findFunExpression(function, mySourcePosition.getFunExpressionArity());
// if (funExpression != null) {
// int line = 1 + StringUtil.offsetToLineNumber(funExpression.getContainingFile().getText(), funExpression.getTextOffset());
// title += ": " + mySourcePosition.getFunExpressionName() + " at line " + line;
// }
// component.append(title, SimpleTextAttributes.REGULAR_ATTRIBUTES);
// component.setIcon(AllIcons.Debugger.StackFrame);
// return;
// }
// }
super.customizePresentation(component);
}
示例5: customizePresentation
import com.intellij.ui.ColoredTextContainer; //导入依赖的package包/类
@Override
public void customizePresentation(@NotNull ColoredTextContainer component) {
component.setIcon(AllIcons.Debugger.StackFrame);
String functionName = frame.getFunction();
String className = "";
String packageName = "";
int lastDot = frame.getFunction().lastIndexOf('.');
if (lastDot > 0 && lastDot < functionName.length() - 1) {
functionName = functionName.substring(lastDot + 1);
className = frame.getFunction().substring(0, lastDot);
int classNameDot = className.lastIndexOf('.');
if (classNameDot > 0 && classNameDot < className.length() - 1) {
className = className.substring(classNameDot + 1);
packageName = frame.getFunction().substring(0, classNameDot);
}
}
component.append(
functionName + "():" + frame.getLocation().getLine().toString() + ", " + className,
sourcePosition != null
? SimpleTextAttributes.REGULAR_ATTRIBUTES
: SimpleTextAttributes.GRAYED_ATTRIBUTES);
component.append(" (" + packageName + ")", SimpleTextAttributes.GRAYED_ITALIC_ATTRIBUTES);
}
示例6: customizePresentation
import com.intellij.ui.ColoredTextContainer; //导入依赖的package包/类
@Override
public void customizePresentation(ColoredTextContainer component)
{
TextStreamPosition statementStartPosition = myCallFrame.getStatementStartPosition();
XSourcePosition position = getSourcePosition();
if(position != null)
{
component.append(position.getFile().getName(), SimpleTextAttributes.REGULAR_ATTRIBUTES);
}
else
{
component.append(myCallFrame.getScript().getName(), SimpleTextAttributes.REGULAR_ATTRIBUTES);
}
component.append(":" + (statementStartPosition.getLine() + 1), SimpleTextAttributes.REGULAR_ATTRIBUTES);
component.setIcon(AllIcons.Debugger.StackFrame);
}
示例7: customizePresentation
import com.intellij.ui.ColoredTextContainer; //导入依赖的package包/类
@Override
public void customizePresentation(@NotNull ColoredTextContainer component)
{
StackFrameDescriptorImpl selectedDescriptor = null;
DebuggerSession session = myDebugProcess.getSession();
if(session != null)
{
XDebugSession xSession = session.getXDebugSession();
if(xSession != null)
{
XStackFrame frame = xSession.getCurrentStackFrame();
if(frame instanceof JavaStackFrame)
{
selectedDescriptor = ((JavaStackFrame) frame).getDescriptor();
}
}
}
FRAME_RENDERER.customizePresentation(myDescriptor, component, selectedDescriptor);
if(myInsertCapturePoint != null)
{
component.setIcon(XDebuggerUIConstants.INFORMATION_MESSAGE_ICON);
}
}
示例8: renderClient
import com.intellij.ui.ColoredTextContainer; //导入依赖的package包/类
/**
* Render the given {@link LogProcess} object
*/
private void renderClient(@NotNull LogProcess c, ColoredTextContainer container) {
String name = c.getProcessName();
if (name != null) {
Pair<String, String> app = splitApplicationName(name);
container.append(app.getFirst(), SimpleTextAttributes.REGULAR_ATTRIBUTES);
container.append(app.getSecond(), SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES);
if (c.getProcessID() != 0) {
container.append(String.format(" (%1$d)", c.getProcessID()), SimpleTextAttributes.GRAY_ATTRIBUTES);
}
}
}
示例9: renderDeviceName
import com.intellij.ui.ColoredTextContainer; //导入依赖的package包/类
static void renderDeviceName(@NotNull IDevice d, @NotNull ColoredTextContainer component) {
component.setIcon(d.isEmulator() ? AndroidIcons.Ddms.Emulator2 : AndroidIcons.Ddms.RealDevice);
String name;
if (d.isEmulator()) {
String avdName = d.getAvdName();
if (avdName == null) {
avdName = "unknown";
}
name = String.format(" %1$s %2$s ", "Emulator", avdName);
} else {
name = String.format(" %1$s ", DevicePropertyUtil.getModel(d, ""));
}
component.append(d.getSerialNumber(), SimpleTextAttributes.GRAYED_BOLD_ATTRIBUTES);
component.append(name, SimpleTextAttributes.REGULAR_ATTRIBUTES);
IDevice.DeviceState deviceState = d.getState();
if (deviceState != IDevice.DeviceState.ONLINE) {
String state = String.format("[%1$s] ", d.getState());
component.append(state, SimpleTextAttributes.GRAYED_BOLD_ATTRIBUTES);
}
if (deviceState != IDevice.DeviceState.DISCONNECTED && deviceState != IDevice.DeviceState.OFFLINE) {
component.append(DevicePropertyUtil.getBuild(d), SimpleTextAttributes.GRAY_ATTRIBUTES);
}
}
示例10: customizePresentation
import com.intellij.ui.ColoredTextContainer; //导入依赖的package包/类
public void customizePresentation(@NotNull ColoredTextContainer component) {
if (mySourcePosition != null) {
super.customizePresentation(component);
if (contextName != null){
component.append(String.format(" (%s)", contextName), SimpleTextAttributes.REGULAR_ITALIC_ATTRIBUTES);
}
} else {
component.append("<internal C>", SimpleTextAttributes.GRAYED_ATTRIBUTES);
component.setIcon(AllIcons.Debugger.StackFrame);
}
}
示例11: customizePresentation
import com.intellij.ui.ColoredTextContainer; //导入依赖的package包/类
@Override
public void customizePresentation(@NotNull ColoredTextContainer component) {
StackFrameDescriptorImpl selectedDescriptor = null;
DebuggerSession session = myDebugProcess.getSession();
if (session != null) {
XDebugSession xSession = session.getXDebugSession();
if (xSession != null) {
XStackFrame frame = xSession.getCurrentStackFrame();
if (frame instanceof JavaStackFrame) {
selectedDescriptor = ((JavaStackFrame)frame).getDescriptor();
}
}
}
FRAME_RENDERER.customizePresentation(myDescriptor, component, selectedDescriptor);
}
示例12: customizePresentation
import com.intellij.ui.ColoredTextContainer; //导入依赖的package包/类
/**
* Customize presentation of the stack frame in frames list
* @param component component
*/
public void customizePresentation(@NotNull ColoredTextContainer component) {
XSourcePosition position = getSourcePosition();
if (position != null) {
component.append(position.getFile().getName(), SimpleTextAttributes.REGULAR_ATTRIBUTES);
component.append(":" + (position.getLine() + 1), SimpleTextAttributes.REGULAR_ATTRIBUTES);
component.setIcon(AllIcons.Debugger.StackFrame);
}
else {
component.append(XDebuggerBundle.message("invalid.frame"), SimpleTextAttributes.ERROR_ATTRIBUTES);
}
}
示例13: buildText
import com.intellij.ui.ColoredTextContainer; //导入依赖的package包/类
public static void buildText(@NotNull XValuePresentation valuePresenter, @NotNull ColoredTextContainer text, boolean appendSeparator) {
if (appendSeparator) {
XValuePresentationUtil.appendSeparator(text, valuePresenter.getSeparator());
}
String type = valuePresenter.getType();
if (type != null) {
text.append("{" + type + "} ", XDebuggerUIConstants.TYPE_ATTRIBUTES);
}
valuePresenter.renderValue(new XValueTextRendererImpl(text));
}
示例14: appendToComponent
import com.intellij.ui.ColoredTextContainer; //导入依赖的package包/类
@Override
public void appendToComponent(@NotNull ColoredTextContainer component) {
for (Object object : objects) {
if (object instanceof String) {
component.append((String)object, SimpleTextAttributes.REGULAR_ATTRIBUTES);
}
else {
XDebuggerTreeNodeHyperlink hyperlink = (XDebuggerTreeNodeHyperlink)object;
component.append(hyperlink.getLinkText(), SimpleTextAttributes.LINK_ATTRIBUTES, hyperlink);
}
}
}
示例15: appendToComponent
import com.intellij.ui.ColoredTextContainer; //导入依赖的package包/类
public void appendToComponent(@NotNull ColoredTextContainer component) {
getText().appendToComponent(component);
XDebuggerTreeNodeHyperlink link = getLink();
if (link != null) {
component.append(link.getLinkText(), link.getTextAttributes(), link);
}
}