com.intellij.ui.ColoredTextContainer Java Examples

The following examples show how to use com.intellij.ui.ColoredTextContainer. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CppStackFrame.java    From CppTools with Apache License 2.0 6 votes vote down vote up
@Override
  public void customizePresentation(ColoredTextContainer component) {

  XSourcePosition position = getSourcePosition();
  component.append(myScope, SimpleTextAttributes.REGULAR_ATTRIBUTES);
  component.append(" in ", SimpleTextAttributes.REGULAR_ATTRIBUTES);

  if (position != null) {
    component.append(position.getFile().getName(), SimpleTextAttributes.REGULAR_ATTRIBUTES);
    component.append(":" + position.getLine(), SimpleTextAttributes.REGULAR_ATTRIBUTES);
  }
  else {
    component.append("<file name is not available>", SimpleTextAttributes.REGULAR_ATTRIBUTES);
  }
  component.setIcon(AllIcons.Debugger.StackFrame);
}
 
Example #2
Source File: DartVmServiceStackFrame.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
@Override
public void customizePresentation(@NotNull final ColoredTextContainer component) {
  final String unoptimizedPrefix = "[Unoptimized] ";

  String name = StringUtil.trimEnd(myVmFrame.getCode().getName(), "="); // trim setter postfix
  name = StringUtil.trimStart(name, unoptimizedPrefix);

  final boolean causal = myVmFrame.getKind() == FrameKind.AsyncCausal;
  component.append(name, causal ? SimpleTextAttributes.REGULAR_ITALIC_ATTRIBUTES : SimpleTextAttributes.REGULAR_ATTRIBUTES);

  if (mySourcePosition != null) {
    final String text = " (" + mySourcePosition.getFile().getName() + ":" + (mySourcePosition.getLine() + 1) + ")";
    component.append(text, SimpleTextAttributes.GRAY_ATTRIBUTES);
  }

  component.setIcon(AllIcons.Debugger.Frame);
}
 
Example #3
Source File: DartVmServiceStackFrame.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
@Override
public void customizePresentation(@NotNull final ColoredTextContainer component) {
  final String unoptimizedPrefix = "[Unoptimized] ";

  String name = StringUtil.trimEnd(myVmFrame.getCode().getName(), "="); // trim setter postfix
  name = StringUtil.trimStart(name, unoptimizedPrefix);

  final boolean causal = myVmFrame.getKind() == FrameKind.AsyncCausal;
  component.append(name, causal ? SimpleTextAttributes.REGULAR_ITALIC_ATTRIBUTES : SimpleTextAttributes.REGULAR_ATTRIBUTES);

  if (mySourcePosition != null) {
    final String text = " (" + mySourcePosition.getFile().getName() + ":" + (mySourcePosition.getLine() + 1) + ")";
    component.append(text, SimpleTextAttributes.GRAY_ATTRIBUTES);
  }

  component.setIcon(AllIcons.Debugger.Frame);
}
 
Example #4
Source File: HaxeDebugRunner.java    From intellij-haxe with Apache License 2.0 5 votes vote down vote up
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);
}
 
Example #5
Source File: XDebuggerTreeNode.java    From consulo with Apache License 2.0 5 votes vote down vote up
public void appendToComponent(@Nonnull ColoredTextContainer component) {
  getText().appendToComponent(component);

  XDebuggerTreeNodeHyperlink link = getLink();
  if (link != null) {
    component.append(link.getLinkText(), link.getTextAttributes(), link);
  }
}
 
Example #6
Source File: MessageTreeNode.java    From consulo with Apache License 2.0 5 votes vote down vote up
@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);
    }
  }
}
 
Example #7
Source File: XValueNodeImpl.java    From consulo with Apache License 2.0 5 votes vote down vote up
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));
}
 
Example #8
Source File: XStackFrame.java    From consulo with Apache License 2.0 5 votes vote down vote up
/**
 * 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);
  }
}
 
Example #9
Source File: XQueryStackFrame.java    From intellij-xquery with Apache License 2.0 5 votes vote down vote up
@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);
    }

}
 
Example #10
Source File: ClientCellRenderer.java    From logviewer with Apache License 2.0 5 votes vote down vote up
/**
 * 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);
        }
    }
}
 
Example #11
Source File: SkylarkStackFrame.java    From intellij with Apache License 2.0 5 votes vote down vote up
@Override
public void customizePresentation(ColoredTextContainer component) {
  if (frame.hasLocation()) {
    component.append(frame.getFunctionName() + " at ", SimpleTextAttributes.REGULAR_ATTRIBUTES);
  }
  super.customizePresentation(component);
}
 
Example #12
Source File: LogSourcePanel.java    From logviewer with Apache License 2.0 5 votes vote down vote up
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);
    }

}
 
Example #13
Source File: DartAsyncMarkerFrame.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
public void customizePresentation(@NotNull ColoredTextContainer component) {
  component.append("<asynchronous gap>", SimpleTextAttributes.EXCLUDED_ATTRIBUTES);
  component.setIcon(AllIcons.General.SeparatorH);
}
 
Example #14
Source File: XValueNodeImpl.java    From consulo with Apache License 2.0 4 votes vote down vote up
public static void buildText(@Nonnull XValuePresentation valuePresenter, @Nonnull ColoredTextContainer text) {
  buildText(valuePresenter, text, true);
}
 
Example #15
Source File: DartAsyncMarkerFrame.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
public void customizePresentation(@NotNull ColoredTextContainer component) {
  component.append("<asynchronous gap>", SimpleTextAttributes.EXCLUDED_ATTRIBUTES);
  component.setIcon(AllIcons.General.SeparatorH);
}
 
Example #16
Source File: XValueTextRendererImpl.java    From consulo with Apache License 2.0 4 votes vote down vote up
public XValueTextRendererImpl(ColoredTextContainer text) {
  myText = text;
}
 
Example #17
Source File: XValuePresentationUtil.java    From consulo with Apache License 2.0 4 votes vote down vote up
public static void appendSeparator(@Nonnull ColoredTextContainer text, @Nonnull String separator) {
  if (!separator.isEmpty()) {
    text.append(separator, SimpleTextAttributes.REGULAR_ATTRIBUTES);
  }
}
 
Example #18
Source File: WeaveIntegrationStackFrame.java    From mule-intellij-plugins with Apache License 2.0 4 votes vote down vote up
public void customizePresentation(@NotNull ColoredTextContainer component)
{
    component.append("DataWeave", SimpleTextAttributes.REGULAR_ATTRIBUTES);
}
 
Example #19
Source File: MuleStackFrame.java    From mule-intellij-plugins with Apache License 2.0 4 votes vote down vote up
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);
}