本文整理汇总了Java中com.intellij.debugger.ui.impl.watch.StackFrameDescriptorImpl.isRecursiveCall方法的典型用法代码示例。如果您正苦于以下问题:Java StackFrameDescriptorImpl.isRecursiveCall方法的具体用法?Java StackFrameDescriptorImpl.isRecursiveCall怎么用?Java StackFrameDescriptorImpl.isRecursiveCall使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.debugger.ui.impl.watch.StackFrameDescriptorImpl
的用法示例。
在下文中一共展示了StackFrameDescriptorImpl.isRecursiveCall方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: customizePresentation
import com.intellij.debugger.ui.impl.watch.StackFrameDescriptorImpl; //导入方法依赖的package包/类
public void customizePresentation(StackFrameDescriptorImpl descriptor, @NotNull ColoredTextContainer component, StackFrameDescriptorImpl selectedDescriptor) {
component.setIcon(descriptor.getIcon());
//final Object selectedValue = list.getSelectedValue();
final boolean shouldHighlightAsRecursive = isOccurrenceOfSelectedFrame(selectedDescriptor, descriptor);
final ValueMarkup markup = descriptor.getValueMarkup();
if (markup != null) {
component.append("["+ markup.getText() + "] ", new SimpleTextAttributes(SimpleTextAttributes.STYLE_BOLD, markup.getColor()));
}
boolean needSeparator = false;
//if (index > 0) {
// final int currentFrameIndex = descriptor.getUiIndex();
// final Object elementAt = list.getModel().getElementAt(index - 1);
// if (elementAt instanceof StackFrameDescriptorImpl) {
// StackFrameDescriptorImpl previousDescriptor = (StackFrameDescriptorImpl)elementAt;
// final int previousFrameIndex = previousDescriptor.getUiIndex();
// needSeparator = (currentFrameIndex - previousFrameIndex != 1);
// }
//}
//if (selected) {
// setBackground(UIUtil.getListSelectionBackground());
//}
//else {
// Color bg = descriptor.getBackgroundColor();
// if (bg == null) bg = UIUtil.getListBackground();
// if (shouldHighlightAsRecursive) bg = myColorScheme.getColor(DebuggerColors.RECURSIVE_CALL_ATTRIBUTES);
// setBackground(bg);
//}
//
//if (needSeparator) {
// final MatteBorder border = BorderFactory.createMatteBorder(1, 0, 0, 0, JBColor.GRAY);
// setBorder(border);
//}
//else {
// setBorder(null);
//}
final String label = descriptor.getLabel();
final int openingBrace = label.indexOf("{");
final int closingBrace = (openingBrace < 0) ? -1 : label.indexOf("}");
final SimpleTextAttributes attributes = getAttributes(descriptor);
if (openingBrace < 0 || closingBrace < 0) {
component.append(label, attributes);
}
else {
component.append(label.substring(0, openingBrace - 1), attributes);
component.append(" (" + label.substring(openingBrace + 1, closingBrace) + ")", SimpleTextAttributes.GRAY_ITALIC_ATTRIBUTES);
component.append(label.substring(closingBrace + 1, label.length()), attributes);
if (shouldHighlightAsRecursive && descriptor.isRecursiveCall()) {
component.append(" [" + descriptor.getOccurrenceIndex() + "]", SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES);
}
}
}
示例2: customizeCellRenderer
import com.intellij.debugger.ui.impl.watch.StackFrameDescriptorImpl; //导入方法依赖的package包/类
protected void customizeCellRenderer(final JList list, final Object item, final int index, final boolean selected, final boolean hasFocus) {
if (!(item instanceof StackFrameDescriptorImpl)) {
append(item.toString(), SimpleTextAttributes.GRAYED_ATTRIBUTES);
}
else {
final StackFrameDescriptorImpl descriptor = (StackFrameDescriptorImpl)item;
setIcon(descriptor.getIcon());
final Object selectedValue = list.getSelectedValue();
final boolean shouldHighlightAsRecursive = (selectedValue instanceof StackFrameDescriptorImpl) &&
isOccurrenceOfSelectedFrame((StackFrameDescriptorImpl)selectedValue, descriptor);
final ValueMarkup markup = descriptor.getValueMarkup();
if (markup != null) {
append("["+ markup.getText() + "] ", new SimpleTextAttributes(SimpleTextAttributes.STYLE_BOLD, markup.getColor()));
}
boolean needSeparator = false;
if (index > 0) {
final int currentFrameIndex = descriptor.getUiIndex();
final Object elementAt = list.getModel().getElementAt(index - 1);
if (elementAt instanceof StackFrameDescriptorImpl) {
StackFrameDescriptorImpl previousDescriptor = (StackFrameDescriptorImpl)elementAt;
final int previousFrameIndex = previousDescriptor.getUiIndex();
needSeparator = (currentFrameIndex - previousFrameIndex != 1);
}
}
if (selected) {
setBackground(UIUtil.getListSelectionBackground());
}
else {
Color bg = descriptor.getBackgroundColor();
if (bg == null) bg = UIUtil.getListBackground();
if (shouldHighlightAsRecursive) bg = myColorScheme.getColor(DebuggerColors.RECURSIVE_CALL_ATTRIBUTES);
setBackground(bg);
}
if (needSeparator) {
final MatteBorder border = BorderFactory.createMatteBorder(1, 0, 0, 0, JBColor.GRAY);
setBorder(border);
}
else {
setBorder(null);
}
final String label = descriptor.getLabel();
final int openingBrace = label.indexOf("{");
final int closingBrace = (openingBrace < 0) ? -1 : label.indexOf("}");
final SimpleTextAttributes attributes = getAttributes(descriptor);
if (openingBrace < 0 || closingBrace < 0) {
append(label, attributes);
}
else {
append(label.substring(0, openingBrace - 1), attributes);
append(" (" + label.substring(openingBrace + 1, closingBrace) + ")", SimpleTextAttributes.GRAY_ITALIC_ATTRIBUTES);
append(label.substring(closingBrace + 1, label.length()), attributes);
if (shouldHighlightAsRecursive && descriptor.isRecursiveCall()) {
append(" [" + descriptor.getOccurrenceIndex() + "]", SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES);
}
}
}
}
示例3: customizePresentation
import com.intellij.debugger.ui.impl.watch.StackFrameDescriptorImpl; //导入方法依赖的package包/类
public void customizePresentation(StackFrameDescriptorImpl descriptor, @NotNull ColoredTextContainer component, StackFrameDescriptorImpl selectedDescriptor)
{
component.setIcon(descriptor.getIcon());
//final Object selectedValue = list.getSelectedValue();
final boolean shouldHighlightAsRecursive = isOccurrenceOfSelectedFrame(selectedDescriptor, descriptor);
final ValueMarkup markup = descriptor.getValueMarkup();
if(markup != null)
{
component.append("[" + markup.getText() + "] ", new SimpleTextAttributes(SimpleTextAttributes.STYLE_BOLD, markup.getColor()));
}
boolean needSeparator = false;
//if (index > 0) {
// final int currentFrameIndex = descriptor.getUiIndex();
// final Object elementAt = list.getModel().getElementAt(index - 1);
// if (elementAt instanceof StackFrameDescriptorImpl) {
// StackFrameDescriptorImpl previousDescriptor = (StackFrameDescriptorImpl)elementAt;
// final int previousFrameIndex = previousDescriptor.getUiIndex();
// needSeparator = (currentFrameIndex - previousFrameIndex != 1);
// }
//}
//if (selected) {
// setBackground(UIUtil.getListSelectionBackground());
//}
//else {
// Color bg = descriptor.getBackgroundColor();
// if (bg == null) bg = UIUtil.getListBackground();
// if (shouldHighlightAsRecursive) bg = myColorScheme.getColor(DebuggerColors.RECURSIVE_CALL_ATTRIBUTES);
// setBackground(bg);
//}
//
//if (needSeparator) {
// final MatteBorder border = BorderFactory.createMatteBorder(1, 0, 0, 0, JBColor.GRAY);
// setBorder(border);
//}
//else {
// setBorder(null);
//}
final String label = descriptor.getLabel();
final int openingBrace = label.indexOf("{");
final int closingBrace = (openingBrace < 0) ? -1 : label.indexOf("}");
final SimpleTextAttributes attributes = getAttributes(descriptor);
if(openingBrace < 0 || closingBrace < 0)
{
component.append(label, attributes);
}
else
{
component.append(label.substring(0, openingBrace - 1), attributes);
component.append(" (" + label.substring(openingBrace + 1, closingBrace) + ")", SimpleTextAttributes.GRAY_ITALIC_ATTRIBUTES);
component.append(label.substring(closingBrace + 1, label.length()), attributes);
if(shouldHighlightAsRecursive && descriptor.isRecursiveCall())
{
component.append(" [" + descriptor.getOccurrenceIndex() + "]", SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES);
}
}
}