Java 类com.intellij.ui.ColoredTextContainer 实例源码

项目:intellij-ce-playground    文件:PyEduStackFrame.java   
@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);
  }
}
项目:intellij-ce-playground    文件:ClientCellRenderer.java   
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);
  }
}
项目:intellij-ce-playground    文件:XsltStackFrame.java   
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);
  }
}
项目:squirrel-lang-idea-plugin    文件:SquirrelStackFrame.java   
@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);
    }
项目:google-cloud-intellij    文件:CloudStackFrame.java   
@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);
}
项目:tools-idea    文件:XsltStackFrame.java   
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);
  }
}
项目:consulo-javascript    文件:V8StackFrame.java   
@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);
}
项目:consulo-java    文件:JavaStackFrame.java   
@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);
    }
}
项目:logviewer    文件:ClientCellRenderer.java   
/**
 * 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);
        }
    }
}
项目:logviewer    文件:LogSourcePanel.java   
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);
    }

}
项目:lua-for-idea    文件:LuaStackFrame.java   
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);
    }
}
项目:intellij-ce-playground    文件:JavaStackFrame.java   
@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);
}
项目:intellij-ce-playground    文件:XStackFrame.java   
/**
 * 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);
  }
}
项目:intellij-ce-playground    文件:XValueNodeImpl.java   
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));
}
项目:intellij-ce-playground    文件:MessageTreeNode.java   
@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);
    }
  }
}
项目:intellij-ce-playground    文件:XDebuggerTreeNode.java   
public void appendToComponent(@NotNull ColoredTextContainer component) {
  getText().appendToComponent(component);

  XDebuggerTreeNodeHyperlink link = getLink();
  if (link != null) {
    component.append(link.getLinkText(), link.getTextAttributes(), link);
  }
}
项目:intellij-ce-playground    文件:PyStackFrame.java   
@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));
}
项目:intellij-ce-playground    文件:DeviceRenderer.java   
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);
}
项目:intellij-ce-playground    文件:DeviceRenderer.java   
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);
  }
}
项目:TheRPlugin    文件:TheRXStackFrame.java   
@Override
public void customizePresentation(@NotNull final ColoredTextContainer component) {
  if (myPosition == null || myFrame.getLocation().getFunctionName().equals(MAIN_FUNCTION_NAME)) {
    super.customizePresentation(component);
  }
  else {
    component.append(getPresentationText(), SimpleTextAttributes.REGULAR_ATTRIBUTES);
    component.setIcon(AllIcons.Debugger.StackFrame);
  }
}
项目:tools-idea    文件:XStackFrame.java   
/**
 * Customize presentation of the stack frame in frames list
 * @param component component
 */
public void customizePresentation(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);
  }
}
项目:intellij-haxe    文件:HaxeDebugRunner.java   
public void customizePresentation
  (@NotNull ColoredTextContainer component) {
  SimpleTextAttributes attr = (mSourcePosition == null) ?
                              SimpleTextAttributes.GRAYED_ATTRIBUTES :
                              SimpleTextAttributes.REGULAR_ATTRIBUTES;

  component.append(mClassAndFunctionName + "  [" + mFileName +
                   ":" + mLineNumber + "]", attr);
  component.setIcon(AllIcons.Debugger.StackFrame);
}
项目:intellij-xquery    文件:XQueryStackFrame.java   
@Override
public void customizePresentation(@NotNull ColoredTextContainer component) {
    XSourcePosition position = this.getSourcePosition();
    if(position != null) {
        component.append(where != null && !"".equals(where) ? where + "()" : "<main>()", SimpleTextAttributes.REGULAR_ATTRIBUTES);
        component.append(":" + (lineNumber) +", ", SimpleTextAttributes.REGULAR_ATTRIBUTES);
        component.append(position.getFile().getName(), SimpleTextAttributes.REGULAR_ATTRIBUTES);
        component.append("(" + position.getFile().getPath() + ")", SimpleTextAttributes.GRAYED_ATTRIBUTES);
        component.setIcon(AllIcons.Debugger.StackFrame);
    } else {
        component.append(XDebuggerBundle.message("invalid.frame", new Object[0]), SimpleTextAttributes.ERROR_ATTRIBUTES);
    }

}
项目:consulo    文件:XStackFrame.java   
/**
 * Customize presentation of the stack frame in frames list
 * @param component component
 */
public void customizePresentation(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);
  }
}
项目:consulo    文件:XValueNodeImpl.java   
public static void buildText(@Nonnull XValuePresentation valuePresenter, @Nonnull 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));
}
项目:consulo    文件:XValuePresentationUtil.java   
public static void renderValue(@Nonnull String value, @Nonnull ColoredTextContainer text, @Nonnull SimpleTextAttributes attributes, int maxLength,
                               @Nullable String additionalCharsToEscape) {
  SimpleTextAttributes escapeAttributes = null;
  int lastOffset = 0;
  int length = maxLength == -1 ? value.length() : Math.min(value.length(), maxLength);
  for (int i = 0; i < length; i++) {
    char ch = value.charAt(i);
    int additionalCharIndex = -1;
    if (ch == '\n' || ch == '\r' || ch == '\t' || ch == '\b' || ch == '\f'
        || (additionalCharsToEscape != null && (additionalCharIndex = additionalCharsToEscape.indexOf(ch)) != -1)) {
      if (i > lastOffset) {
        text.append(value.substring(lastOffset, i), attributes);
      }
      lastOffset = i + 1;

      if (escapeAttributes == null) {
        TextAttributes fromHighlighter = EditorColorsManager.getInstance().getGlobalScheme().getAttributes(DefaultLanguageHighlighterColors.VALID_STRING_ESCAPE);
        if (fromHighlighter != null) {
          escapeAttributes = SimpleTextAttributes.fromTextAttributes(fromHighlighter);
        }
        else {
          escapeAttributes = new SimpleTextAttributes(SimpleTextAttributes.STYLE_BOLD, JBColor.GRAY);
        }
      }

      if (additionalCharIndex == -1) {
        text.append("\\", escapeAttributes);
      }

      text.append(String.valueOf(getEscapingSymbol(ch)), escapeAttributes);
    }
  }

  if (lastOffset < length) {
    text.append(value.substring(lastOffset, length), attributes);
  }
}
项目:consulo    文件:MessageTreeNode.java   
@Override
public void appendToComponent(@Nonnull 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);
    }
  }
}
项目:consulo    文件:XDebuggerTreeNode.java   
public void appendToComponent(@Nonnull ColoredTextContainer component) {
  getText().appendToComponent(component);

  XDebuggerTreeNodeHyperlink link = getLink();
  if (link != null) {
    component.append(link.getLinkText(), link.getTextAttributes(), link);
  }
}
项目:consulo-xslt    文件:XsltStackFrame.java   
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 e)
    {
        component.append(frame.getURI() + ":" + frame.getLineNumber(), SimpleTextAttributes.REGULAR_ATTRIBUTES);
    }
}
项目:consulo-java    文件:StackFrameItem.java   
@Override
public void customizePresentation(@NotNull ColoredTextContainer component)
{
    component.setIcon(JBUI.scale(EmptyIcon.create(6)));
    component.append(String.format("%s:%d, %s", myMethodName, myLineNumber, StringUtil.getShortName(myPath)), getAttributes());
    String packageName = StringUtil.getPackageName(myPath);
    if(!packageName.trim().isEmpty())
    {
        component.append(String.format(" (%s)", packageName), SimpleTextAttributes.GRAYED_ITALIC_ATTRIBUTES);
    }
}
项目:mule-intellij-plugins    文件:MuleStackFrame.java   
public void customizePresentation(@NotNull ColoredTextContainer component)
{
    final String mp = StringUtils.isNotBlank(tag.getNamespacePrefix()) ? tag.getNamespacePrefix() + ":" + tag.getLocalName() : tag.getLocalName();
    component.append(mp, SimpleTextAttributes.REGULAR_ATTRIBUTES);
}
项目:mule-intellij-plugins    文件:WeaveIntegrationStackFrame.java   
public void customizePresentation(@NotNull ColoredTextContainer component)
{
    component.append("DataWeave", SimpleTextAttributes.REGULAR_ATTRIBUTES);
}
项目:intellij-ce-playground    文件:JavaFramesListRenderer.java   
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);
      }
  }
}
项目:intellij-ce-playground    文件:XValueNodeImpl.java   
public static void buildText(@NotNull XValuePresentation valuePresenter, @NotNull ColoredTextContainer text) {
  buildText(valuePresenter, text, true);
}
项目:intellij-ce-playground    文件:XValueTextRendererImpl.java   
public XValueTextRendererImpl(@NotNull ColoredTextContainer text) {
  myText = text;
}
项目:intellij-ce-playground    文件:XValuePresentationUtil.java   
public static void appendSeparator(@NotNull ColoredTextContainer text, @NotNull String separator) {
  if (!separator.isEmpty()) {
    text.append(separator, SimpleTextAttributes.REGULAR_ATTRIBUTES);
  }
}
项目:intellij-ce-playground    文件:DeviceRenderer.java   
@VisibleForTesting
static void renderDeviceName(IDevice d, ColoredTextContainer component) {
  renderDeviceName(d, component, null);
}
项目:consulo-dotnet    文件:DotNetStackFrame.java   
@Override
public void customizePresentation(ColoredTextContainer component)
{
    DotNetSourceLocation sourceLocation = mySourceLocation;
    if(sourceLocation == null)
    {
        component.setIcon(AllIcons.Debugger.Frame);
        component.append("<unknown>", SimpleTextAttributes.REGULAR_ATTRIBUTES);
        return;
    }

    DotNetMethodProxy method = sourceLocation.getMethod();

    DotNetTypeProxy declarationType = method.getDeclarationType();

    String name = method.getName();
    switch(name)
    {
        case XStubUtil.CONSTRUCTOR_NAME:
            name = declarationType.getName() + "()";
            break;
        case XStubUtil.STATIC_CONSTRUCTOR_NAME:
            name = declarationType.getName();
            break;
        default:
            name = method.getName() + "()";
            break;
    }

    Couple<String> lambdaInfo = DotNetDebuggerCompilerGenerateUtil.extractLambdaInfo(method);
    if(lambdaInfo != null)
    {
        name = "lambda$" + lambdaInfo.getSecond();
    }

    component.setIcon(AllIcons.Debugger.Frame);
    component.append(name, SimpleTextAttributes.REGULAR_ATTRIBUTES);

    StringBuilder builder = new StringBuilder();
    String fileName = sourceLocation.getFilePath();
    if(fileName != null)
    {
        builder.append(":");
        builder.append(new File(fileName).getName());
    }

    builder.append(":");
    builder.append(sourceLocation.getLineOneBased());
    builder.append(":");
    builder.append(sourceLocation.getColumn());
    builder.append(", ");
    if(lambdaInfo == null)
    {
        builder.append(DotNetVirtualMachineUtil.formatNameWithGeneric(declarationType));
    }
    else
    {
        builder.append(lambdaInfo.getFirst()).append("(...)");
    }

    component.append(builder.toString(), SimpleTextAttributes.GRAY_ATTRIBUTES);
}
项目:consulo    文件:XValueNodeImpl.java   
public static void buildText(@Nonnull XValuePresentation valuePresenter, @Nonnull ColoredTextContainer text) {
  buildText(valuePresenter, text, true);
}
项目:consulo    文件:XValueTextRendererImpl.java   
public XValueTextRendererImpl(ColoredTextContainer text) {
  myText = text;
}