本文整理汇总了Java中com.intellij.ui.ColoredTextContainer.append方法的典型用法代码示例。如果您正苦于以下问题:Java ColoredTextContainer.append方法的具体用法?Java ColoredTextContainer.append怎么用?Java ColoredTextContainer.append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.ui.ColoredTextContainer
的用法示例。
在下文中一共展示了ColoredTextContainer.append方法的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) {
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);
}
示例5: 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);
}
示例6: 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);
}
}
}
示例7: 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);
}
}
示例8: 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);
}
}
示例9: 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);
}
}
示例10: 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));
}
示例11: 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);
}
}
}
示例12: 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);
}
}
示例13: customizePresentation
import com.intellij.ui.ColoredTextContainer; //导入方法依赖的package包/类
@Override
public void customizePresentation(@NotNull ColoredTextContainer component) {
component.setIcon(AllIcons.Debugger.StackFrame);
if (myPosition == null) {
component.append("<frame not available>", SimpleTextAttributes.GRAY_ATTRIBUTES);
return;
}
boolean isExternal = true;
final VirtualFile file = myPosition.getFile();
AccessToken lock = ApplicationManager.getApplication().acquireReadActionLock();
try {
final Document document = FileDocumentManager.getInstance().getDocument(file);
if (document != null) {
isExternal = !ProjectRootManager.getInstance(myProject).getFileIndex().isInContent(file);
}
}
finally {
lock.finish();
}
component.append(myFrameInfo.getName(), gray(SimpleTextAttributes.REGULAR_ATTRIBUTES, isExternal));
component.append(", ", gray(SimpleTextAttributes.REGULAR_ATTRIBUTES, isExternal));
component.append(myPosition.getFile().getName(), gray(SimpleTextAttributes.REGULAR_ATTRIBUTES, isExternal));
component.append(":", gray(SimpleTextAttributes.REGULAR_ATTRIBUTES, isExternal));
component.append(Integer.toString(myPosition.getLine() + 1), gray(SimpleTextAttributes.REGULAR_ATTRIBUTES, isExternal));
}
示例14: renderDeviceName
import com.intellij.ui.ColoredTextContainer; //导入方法依赖的package包/类
static void renderDeviceName(IDevice d, ColoredTextContainer component, AvdManager avdManager) {
component.setIcon(d.isEmulator() ? AndroidIcons.Ddms.Emulator2 : AndroidIcons.Ddms.RealDevice);
String name;
if (d.isEmulator()) {
String avdName = d.getAvdName();
if (avdManager != null) {
AvdInfo info = avdManager.getAvd(avdName, true);
if (info != null) {
avdName = info.getProperties().get(AvdManagerConnection.AVD_INI_DISPLAY_NAME);
}
}
if (avdName == null) {
avdName = "unknown";
}
name = String.format("%1$s %2$s ", AndroidBundle.message("android.emulator"), avdName);
}
else {
name = String.format("%1$s %2$s ", DevicePropertyUtil.getManufacturer(d, ""), DevicePropertyUtil.getModel(d, ""));
}
component.append(name, SimpleTextAttributes.REGULAR_ATTRIBUTES);
if (d.getState() != IDevice.DeviceState.ONLINE) {
String state = String.format("%1$s [%2$s] ", d.getSerialNumber(), d.getState());
component.append(state, SimpleTextAttributes.GRAYED_BOLD_ATTRIBUTES);
}
component.append(DevicePropertyUtil.getBuild(d), SimpleTextAttributes.GRAY_ATTRIBUTES);
}
示例15: renderCloudDeviceName
import com.intellij.ui.ColoredTextContainer; //导入方法依赖的package包/类
private static void renderCloudDeviceName(IDevice device, ColoredTextContainer component,
@NotNull CloudConfigurationProvider cloudConfigurationProvider) {
component.setIcon(cloudConfigurationProvider.getCloudDeviceIcon());
String cloudDeviceConfiguration = cloudConfigurationProvider.getCloudDeviceConfiguration(device);
if (device.getState() == IDevice.DeviceState.OFFLINE) {
component.append("Launching " + cloudDeviceConfiguration, SimpleTextAttributes.GRAYED_BOLD_ATTRIBUTES);
}
else {
component.append(cloudDeviceConfiguration, SimpleTextAttributes.REGULAR_ATTRIBUTES);
}
}