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


Java ColoredTreeCellRenderer.append方法代码示例

本文整理汇总了Java中com.intellij.ui.ColoredTreeCellRenderer.append方法的典型用法代码示例。如果您正苦于以下问题:Java ColoredTreeCellRenderer.append方法的具体用法?Java ColoredTreeCellRenderer.append怎么用?Java ColoredTreeCellRenderer.append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.ui.ColoredTreeCellRenderer的用法示例。


在下文中一共展示了ColoredTreeCellRenderer.append方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: customizeRendererText

import com.intellij.ui.ColoredTreeCellRenderer; //导入方法依赖的package包/类
@Override
protected void customizeRendererText(ColoredTreeCellRenderer renderer) {
  final StringBuilder buffer = new StringBuilder(128);
  final PsiClass containingClass = myMethod.getContainingClass();
  if (containingClass != null) {
    buffer.append(ClassPresentationUtil.getNameForClass(containingClass, false));
    buffer.append('.');
  }
  final String methodText = PsiFormatUtil.formatMethod(
    myMethod,
    PsiSubstitutor.EMPTY, PsiFormatUtil.SHOW_NAME | PsiFormatUtil.SHOW_PARAMETERS,
    PsiFormatUtil.SHOW_TYPE
  );
  buffer.append(methodText);

  final SimpleTextAttributes attributes = isEnabled() ?
                                          new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, UIUtil.getTreeForeground()) :
                                          SimpleTextAttributes.EXCLUDED_ATTRIBUTES;
  renderer.append(buffer.toString(), attributes);

  if (containingClass != null) {
    final String packageName = getPackageName(containingClass);
    renderer.append("  (" + packageName + ")", new SimpleTextAttributes(SimpleTextAttributes.STYLE_ITALIC, JBColor.GRAY));
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:JavaMethodNode.java

示例2: customizeRenderer

import com.intellij.ui.ColoredTreeCellRenderer; //导入方法依赖的package包/类
private static void customizeRenderer(Project project,
                                      Object value,
                                      boolean selected,
                                      boolean expanded,
                                      ColoredTreeCellRenderer renderer) {
  if (value instanceof BreakpointItemNode) {
    BreakpointItemNode node = (BreakpointItemNode)value;
    BreakpointItem breakpoint = node.getBreakpointItem();
    breakpoint.setupRenderer(renderer, project, selected);
  }
  else if (value instanceof BreakpointsGroupNode) {
    XBreakpointGroup group = ((BreakpointsGroupNode)value).getGroup();
    renderer.setIcon(group.getIcon(expanded));
    if (group instanceof XBreakpointCustomGroup && ((XBreakpointCustomGroup)group).isDefault()) {
      renderer.append(group.getName(), SIMPLE_CELL_ATTRIBUTES_BOLD);
    }
    else {
      renderer.append(group.getName(), SimpleTextAttributes.SIMPLE_CELL_ATTRIBUTES);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:BreakpointsTreeCellRenderer.java

示例3: customizeRenderer

import com.intellij.ui.ColoredTreeCellRenderer; //导入方法依赖的package包/类
@Override
public void customizeRenderer(ColoredTreeCellRenderer renderer,
                              JTree tree,
                              @NotNull Object value,
                              boolean selected,
                              boolean expanded,
                              boolean leaf,
                              int row,
                              boolean hasFocus) {
  renderer.clear();
  renderer.setIcon(AllIcons.Debugger.Db_set_breakpoint);
  if (value instanceof BreakpointItem) {
    BreakpointItem breakpointItem = (BreakpointItem)value;
    breakpointItem.setupGenericRenderer(renderer, true);
  }
  else if (value instanceof XBreakpointGroup) {
    renderer.append(((XBreakpointGroup)value).getName());
    renderer.setIcon(((XBreakpointGroup)value).getIcon(expanded));
  }
  else if (value instanceof XBreakpointGroupingRule) {
    renderer.append(((XBreakpointGroupingRule)value).getPresentableName());
  }
  else {
    renderer.append(String.valueOf(value));
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:BreakpointsFavoriteListProvider.java

示例4: customizeRenderer

import com.intellij.ui.ColoredTreeCellRenderer; //导入方法依赖的package包/类
@Override
public void customizeRenderer(ColoredTreeCellRenderer renderer,
                              JTree tree,
                              @NotNull Object value,
                              boolean selected,
                              boolean expanded,
                              boolean leaf,
                              int row,
                              boolean hasFocus) {
  renderer.clear();
  renderer.setIcon(Bookmark.DEFAULT_ICON);
  if (value instanceof Bookmark) {
    Bookmark bookmark = (Bookmark)value;
    BookmarkItem.setupRenderer(renderer, myProject, bookmark, selected);
    if (renderer.getIcon() != null) {
      renderer.setIcon(LayeredIcon.createHorizontalIcon(bookmark.getIcon(), renderer.getIcon()));
    }
    else {
      renderer.setIcon(bookmark.getIcon());
    }
  }
  else {
    renderer.append(getListName(myProject));
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:BookmarksFavoriteListProvider.java

示例5: customizeRendererText

import com.intellij.ui.ColoredTreeCellRenderer; //导入方法依赖的package包/类
@Override
protected void customizeRendererText(ColoredTreeCellRenderer renderer) {
  final StringBuffer buffer = new StringBuffer(128);
  final PsiClass containingClass = myMethod.getContainingClass();
  if (containingClass != null) {
    buffer.append(ClassPresentationUtil.getNameForClass(containingClass, false));
    buffer.append('.');
  }
  final String methodText = PsiFormatUtil.formatMethod(
    myMethod,
    PsiSubstitutor.EMPTY, PsiFormatUtil.SHOW_NAME | PsiFormatUtil.SHOW_PARAMETERS,
    PsiFormatUtil.SHOW_TYPE
  );
  buffer.append(methodText);

  final SimpleTextAttributes attributes = isEnabled() ?
                                          new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, UIUtil.getTreeForeground()) :
                                          SimpleTextAttributes.EXCLUDED_ATTRIBUTES;
  renderer.append(buffer.toString(), attributes);

  if (containingClass != null) {
    final String packageName = getPackageName(containingClass);
    renderer.append("  (" + packageName + ")", new SimpleTextAttributes(SimpleTextAttributes.STYLE_ITALIC, JBColor.GRAY));
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:26,代码来源:JavaMethodNode.java

示例6: customizeRenderer

import com.intellij.ui.ColoredTreeCellRenderer; //导入方法依赖的package包/类
private static void customizeRenderer(Project project,
                                      Object value,
                                      boolean selected,
                                      boolean expanded,
                                      ColoredTreeCellRenderer renderer) {
  if (value instanceof BreakpointItemNode) {
    BreakpointItemNode node = (BreakpointItemNode)value;
    BreakpointItem breakpoint = node.getBreakpointItem();
    breakpoint.setupRenderer(renderer, project, selected);
  }
  else if (value instanceof BreakpointsGroupNode) {
    XBreakpointGroup group = ((BreakpointsGroupNode)value).getGroup();
    renderer.setIcon(group.getIcon(expanded));
    renderer.append(group.getName(), SimpleTextAttributes.SIMPLE_CELL_ATTRIBUTES);
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:BreakpointsTreeCellRenderer.java

示例7: customizeRenderer

import com.intellij.ui.ColoredTreeCellRenderer; //导入方法依赖的package包/类
@Override
public void customizeRenderer(ColoredTreeCellRenderer renderer,
                              JTree tree,
                              @Nonnull Object value,
                              boolean selected,
                              boolean expanded,
                              boolean leaf,
                              int row,
                              boolean hasFocus) {
  renderer.clear();
  renderer.setIcon(AllIcons.Debugger.Db_set_breakpoint);
  if (value instanceof BreakpointItem) {
    BreakpointItem breakpointItem = (BreakpointItem)value;
    breakpointItem.setupGenericRenderer(renderer, true);
  }
  else if (value instanceof XBreakpointGroup) {
    renderer.append(((XBreakpointGroup)value).getName());
    renderer.setIcon(((XBreakpointGroup)value).getIcon(expanded));
  }
  else if (value instanceof XBreakpointGroupingRule) {
    renderer.append(((XBreakpointGroupingRule)value).getPresentableName());
  }
  else {
    renderer.append(String.valueOf(value));
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:27,代码来源:BreakpointsFavoriteListProvider.java

示例8: customizeRenderer

import com.intellij.ui.ColoredTreeCellRenderer; //导入方法依赖的package包/类
@Override
public void customizeRenderer(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) {
  if (value instanceof ExtensionCheckedTreeNode) {
    ExtensionCheckedTreeNode extensionCheckedTreeNode = (ExtensionCheckedTreeNode)value;

    final ModuleExtensionProviderEP providerEP = extensionCheckedTreeNode.getProviderEP();
    if (providerEP == null) {
      return;
    }

    ColoredTreeCellRenderer textRenderer = getTextRenderer();

    boolean enabled = extensionCheckedTreeNode.isEnabled();
    textRenderer.setIcon(enabled ? providerEP.getIcon() : IconLoader.getTransparentIcon(providerEP.getIcon()));
    if (enabled) {
      textRenderer.append(providerEP.getName(), SimpleTextAttributes.REGULAR_ATTRIBUTES);
    }
    else {
      textRenderer.append(providerEP.getName(), SimpleTextAttributes.GRAY_ATTRIBUTES);
    }
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:23,代码来源:ExtensionTreeCellRenderer.java

示例9: render

import com.intellij.ui.ColoredTreeCellRenderer; //导入方法依赖的package包/类
@Override
public void render(@NotNull ColoredTreeCellRenderer renderer) {
  if (myLoading.get()) {
    renderer.setIcon(myRepositoryPanel.getLoadingIcon());
    renderer.setIconOnTheRight(true);
  }
  renderer.append(" ");
  renderer.append(myRepositoryPanel.getSourceName(), SimpleTextAttributes.REGULAR_ATTRIBUTES);
  renderer.append(myRepositoryPanel.getArrow(), SimpleTextAttributes.REGULAR_ATTRIBUTES);
  PushTargetPanel pushTargetPanel = myRepositoryPanel.getTargetPanel();
  pushTargetPanel.render(renderer, renderer.getTree().isPathSelected(TreeUtil.getPathFromRoot(this)), true, null);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:SingleRepositoryNode.java

示例10: render

import com.intellij.ui.ColoredTreeCellRenderer; //导入方法依赖的package包/类
@Override
public void render(@NotNull ColoredTreeCellRenderer renderer) {
  renderer.append("   ");
  myLinkedText.setSelected(renderer.getTree().isPathSelected(TreeUtil.getPathFromRoot(this)));
  TreeNode parent = getParent();
  if (parent instanceof RepositoryNode) {
    myLinkedText.setTransparent(!((RepositoryNode)parent).isChecked());
  }
  myLinkedText.render(renderer);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:TextWithLinkNode.java

示例11: render

import com.intellij.ui.ColoredTreeCellRenderer; //导入方法依赖的package包/类
@Override
public void render(@NotNull ColoredTreeCellRenderer renderer) {
  renderer.append("   ");
  TreeNode parent = getParent();
  new IssueLinkRenderer(myProject, renderer).appendTextWithLinks(getUserObject().getSubject(), PushLogTreeUtil
    .addTransparencyIfNeeded(SimpleTextAttributes.REGULAR_ATTRIBUTES,
                             !(parent instanceof RepositoryNode) || ((RepositoryNode)parent).isChecked()));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:CommitNode.java

示例12: render

import com.intellij.ui.ColoredTreeCellRenderer; //导入方法依赖的package包/类
public void render(@NotNull ColoredTreeCellRenderer renderer, @Nullable String syncEditingText) {
  int repoFixedWidth = 120;
  int borderHOffset = myRepositoryPanel.getHBorderOffset(renderer);
  if (myLoading.get()) {
    renderer.setIcon(myLoadingIcon);
    renderer.setIconOnTheRight(false);
    int checkBoxWidth = myRepositoryPanel.getCheckBoxWidth();
    repoFixedWidth += checkBoxWidth;
    if (myCheckBoxHGap > 0) {
      renderer.append("");
      renderer.appendTextPadding(checkBoxWidth + renderer.getIconTextGap() + borderHOffset);
    }
  }
  else {
    if (myCheckBoxHGap <= 0) {
      renderer.append("");
      renderer.appendTextPadding(myRepositoryPanel.calculateRendererShiftH(renderer));
    }
  }
  SimpleTextAttributes repositoryDetailsTextAttributes = PushLogTreeUtil
    .addTransparencyIfNeeded(SimpleTextAttributes.REGULAR_ATTRIBUTES, isChecked());

  renderer.append(getRepoName(renderer, repoFixedWidth), repositoryDetailsTextAttributes);
  renderer.appendTextPadding(repoFixedWidth);
  renderer.append(myRepositoryPanel.getSourceName(), repositoryDetailsTextAttributes);
  renderer.append(myRepositoryPanel.getArrow(), repositoryDetailsTextAttributes);
  PushTargetPanel pushTargetPanel = myRepositoryPanel.getTargetPanel();
  pushTargetPanel.render(renderer, renderer.getTree().isPathSelected(TreeUtil.getPathFromRoot(this)), isChecked(), syncEditingText);

  int maxSize = Math.max(myRepositoryPanel.getCheckBoxHeight(), myLoadingIcon.getIconHeight());
  int rendererHeight = renderer.getPreferredSize().height;
  if (maxSize > rendererHeight) {
    if (myCheckBoxVGap > 0 && isLoading() || myCheckBoxVGap < 0 && !isLoading()) {
      int vShift = maxSize - rendererHeight;
      renderer.setBorder(new EmptyBorder((vShift + 1) / 2, 0, (vShift) / 2, 0));
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:39,代码来源:RepositoryNode.java

示例13: render

import com.intellij.ui.ColoredTreeCellRenderer; //导入方法依赖的package包/类
public void render(@NotNull ColoredTreeCellRenderer renderer) {
  boolean isActive = mySelected || myUnderlined;
  SimpleTextAttributes linkTextAttributes = isActive ? SimpleTextAttributes.LINK_ATTRIBUTES : SimpleTextAttributes.SYNTHETIC_ATTRIBUTES;
  isActive = isActive || !myTransparent;
  SimpleTextAttributes wrappedTextAttributes = PushLogTreeUtil
    .addTransparencyIfNeeded(SimpleTextAttributes.REGULAR_ATTRIBUTES, isActive);
  if (!StringUtil.isEmptyOrSpaces(myTextBefore)) {
    renderer.append(myTextBefore, wrappedTextAttributes);
    renderer.append(" ");
  }
  if (!StringUtil.isEmptyOrSpaces(myHandledLink)) {
    renderer.append(myHandledLink, PushLogTreeUtil.addTransparencyIfNeeded(linkTextAttributes, isActive), this);
  }
  renderer.append(myTextAfter, wrappedTextAttributes);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:VcsLinkedTextComponent.java

示例14: renderNode

import com.intellij.ui.ColoredTreeCellRenderer; //导入方法依赖的package包/类
@Override
public void renderNode(ColoredTreeCellRenderer renderer) {
  renderer.setIcon(myDescription.getDetector().getFrameworkType().getIcon());
  final Collection<? extends VirtualFile> files = myDescription.getRelatedFiles();
  final VirtualFile firstFile = ContainerUtil.getFirstItem(files);
  LOG.assertTrue(firstFile != null);
  if (files.size() == 1) {
    renderer.append(firstFile.getName());
    appendDirectoryPath(renderer, firstFile.getParent());
  }
  else {
    String commonName = firstFile.getName();
    VirtualFile commonParent = firstFile.getParent();
    for (VirtualFile file : files) {
      if (commonName != null && !commonName.equals(file.getName())) {
        commonName = null;
      }
      if (commonParent != null && !commonParent.equals(file.getParent())) {
        commonParent = null;
      }
    }
    renderer.append(files.size() + " " + (commonName != null ? commonName : firstFile.getFileType().getDefaultExtension()) + " files");
    if (commonParent != null) {
      appendDirectoryPath(renderer, commonParent);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:DetectedFrameworkNode.java

示例15: appendModule

import com.intellij.ui.ColoredTreeCellRenderer; //导入方法依赖的package包/类
protected void appendModule(@NotNull Module module, @Nullable String variant) {
  ColoredTreeCellRenderer textRenderer = getTextRenderer();
  textRenderer.append(module.getName());
  textRenderer.setIcon(GradleUtil.getModuleIcon(module));
  if (StringUtil.isNotEmpty(variant)) {
    textRenderer.append(" ", REGULAR_ATTRIBUTES);
    textRenderer.append("(" + variant + ")", GRAY_ATTRIBUTES);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:VariantCheckboxTreeCellRenderer.java


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