当前位置: 首页>>代码示例>>Java>>正文


Java ColoredTextContainer.append方法代码示例

本文整理汇总了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);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:PyEduStackFrame.java

示例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);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:ClientCellRenderer.java

示例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);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:XsltStackFrame.java

示例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);
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-intellij,代码行数:25,代码来源:CloudStackFrame.java

示例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);
}
 
开发者ID:consulo,项目名称:consulo-javascript,代码行数:19,代码来源:V8StackFrame.java

示例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);
        }
    }
}
 
开发者ID:josesamuel,项目名称:logviewer,代码行数:16,代码来源:ClientCellRenderer.java

示例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);
    }

}
 
开发者ID:josesamuel,项目名称:logviewer,代码行数:30,代码来源:LogSourcePanel.java

示例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);
    }
}
 
开发者ID:internetisalie,项目名称:lua-for-idea,代码行数:13,代码来源:LuaStackFrame.java

示例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);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:XStackFrame.java

示例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));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:XValueNodeImpl.java

示例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);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:MessageTreeNode.java

示例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);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:XDebuggerTreeNode.java

示例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));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:29,代码来源:PyStackFrame.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:31,代码来源:DeviceRenderer.java

示例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);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:DeviceRenderer.java


注:本文中的com.intellij.ui.ColoredTextContainer.append方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。