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


Java ColoredTreeCellRenderer.setIcon方法代码示例

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


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

示例1: 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

示例2: 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

示例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(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

示例4: 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

示例5: 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

示例6: 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

示例7: 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

示例8: 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

示例9: customizeRenderer

import com.intellij.ui.ColoredTreeCellRenderer; //导入方法依赖的package包/类
public void customizeRenderer(ColoredTreeCellRenderer renderer) {
  if (myMethod == null) return;
  int flags = Iconable.ICON_FLAG_VISIBILITY | Iconable.ICON_FLAG_READ_STATUS;
  renderer.setIcon(myMethod.getIcon(flags));

  customizeRendererText(renderer);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:MethodNodeBase.java

示例10: 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

示例11: 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

示例12: decorateChangeList

import com.intellij.ui.ColoredTreeCellRenderer; //导入方法依赖的package包/类
public void decorateChangeList(@NotNull LocalChangeList changeList,
                               @NotNull ColoredTreeCellRenderer cellRenderer,
                               boolean selected,
                               boolean expanded,
                               boolean hasFocus) {
  LocalTask task = getAssociatedTask(changeList);
  if (task != null && task.isIssue()) {
    cellRenderer.setIcon(task.getIcon());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:TaskManagerImpl.java

示例13: decorateChangeList

import com.intellij.ui.ColoredTreeCellRenderer; //导入方法依赖的package包/类
public void decorateChangeList(LocalChangeList changeList, ColoredTreeCellRenderer cellRenderer, boolean selected,
                               boolean expanded, boolean hasFocus) {
  LocalTask task = getAssociatedTask(changeList);
  if (task != null && task.isIssue()) {
    cellRenderer.setIcon(task.getIcon());
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:8,代码来源:TaskManagerImpl.java

示例14: renderNode

import com.intellij.ui.ColoredTreeCellRenderer; //导入方法依赖的package包/类
public void renderNode(ColoredTreeCellRenderer cellRenderer) {
    cellRenderer.setIcon(this.icon);
    if (this.keyType != null) {
        cellRenderer.append(this.keyType.name(), StyleAttributesProvider.getIndexAttribute());
        cellRenderer.append(" ");
    }
    cellRenderer.append(getFormattedKey(), StyleAttributesProvider.getKeyValueAttribute());
}
 
开发者ID:dboissier,项目名称:nosql4idea,代码行数:9,代码来源:RedisKeyValueDescriptor.java

示例15: decorateChangeList

import com.intellij.ui.ColoredTreeCellRenderer; //导入方法依赖的package包/类
public void decorateChangeList(@NotNull LocalChangeList changeList, @NotNull ColoredTreeCellRenderer cellRenderer, boolean selected, boolean expanded, boolean hasFocus)
{
	LocalTask task = getAssociatedTask(changeList);
	if(task != null && task.isIssue())
	{
		cellRenderer.setIcon(task.getIcon());
	}
}
 
开发者ID:consulo,项目名称:consulo-tasks,代码行数:9,代码来源:TaskManagerImpl.java


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