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


Java CustomizeColoredTreeCellRenderer类代码示例

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


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

示例1: getTreeCellRendererComponent

import com.intellij.ui.CustomizeColoredTreeCellRenderer; //导入依赖的package包/类
@Override
public Component getTreeCellRendererComponent(JTree tree,
                                              Object value,
                                              boolean selected,
                                              boolean expanded,
                                              boolean leaf,
                                              int row,
                                              boolean hasFocus) {
  final ErrorTreeElement element = getElement(value);
  if (element != null) {
    final CustomizeColoredTreeCellRenderer leftSelfRenderer = element.getLeftSelfRenderer();
    final CustomizeColoredTreeCellRenderer rightSelfRenderer = element.getRightSelfRenderer();
    if (leftSelfRenderer != null || rightSelfRenderer != null) {
      myColoredTreeCellRenderer.setCurrentCallback(leftSelfRenderer);
      myRightCellRenderer.setCurrentCallback(rightSelfRenderer);
      return myWrapperRenderer.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus);
    }
  }
  return super.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:NewErrorTreeRenderer.java

示例2: FixedHotfixGroupElement

import com.intellij.ui.CustomizeColoredTreeCellRenderer; //导入依赖的package包/类
public FixedHotfixGroupElement(String name, Object data, VirtualFile file) {
  super(name, data, file);
  myCustomizeColoredTreeCellRenderer = new CustomizeColoredTreeCellRenderer() {
    public void customizeCellRenderer(SimpleColoredComponent renderer,
                                      JTree tree,
                                      Object value,
                                      boolean selected,
                                      boolean expanded,
                                      boolean leaf,
                                      int row,
                                      boolean hasFocus) {
      renderer.setIcon(AllIcons.General.Information);
      renderer.append("Fixed: ", SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES);
      final String[] text = getText();
      final String checkedText = ((text != null) && (text.length > 0)) ? text[0] : "";
      renderer.append(checkedText, SimpleTextAttributes.REGULAR_ATTRIBUTES);
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:FixedHotfixGroupElement.java

示例3: HotfixGroupElement

import com.intellij.ui.CustomizeColoredTreeCellRenderer; //导入依赖的package包/类
public HotfixGroupElement(final String name, final Object data, final VirtualFile file, final Consumer<HotfixGate> hotfix,
                          final String fixDescription, final MutableErrorTreeView view) {
  super(name, data, file);
  myHotfix = hotfix;
  myFixDescription = fixDescription;
  myView = view;
  myLeftTreeCellRenderer = new CustomizeColoredTreeCellRenderer() {
    public void customizeCellRenderer(SimpleColoredComponent renderer,
                                      JTree tree,
                                      Object value,
                                      boolean selected,
                                      boolean expanded,
                                      boolean leaf,
                                      int row,
                                      boolean hasFocus) {
      renderer.setIcon(AllIcons.General.Error);

      final String[] text = getText();
      final String errorText = ((text != null) && (text.length > 0)) ? text[0] : "";
      renderer.append("Error: " + errorText, SimpleTextAttributes.REGULAR_ATTRIBUTES);
    }
  };
  myRightTreeCellRenderer = new MyRightRenderer();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:HotfixGroupElement.java

示例4: MyNavigatableWithDataElement

import com.intellij.ui.CustomizeColoredTreeCellRenderer; //导入依赖的package包/类
private MyNavigatableWithDataElement(final Project project,
                                     @NotNull ErrorTreeElementKind kind,
                                     GroupingElement parent,
                                     String[] message,
                                     @NotNull final VirtualFile vf,
                                     String exportText,
                                     String rendererTextPrefix) {
  super(kind, parent, message, new OpenFileDescriptor(project, vf, -1, -1), exportText, rendererTextPrefix);
  myVf = vf;
  myCustomizeColoredTreeCellRenderer = new CustomizeColoredTreeCellRenderer() {
    @Override
    public void customizeCellRenderer(SimpleColoredComponent renderer,
                                      JTree tree,
                                      Object value,
                                      boolean selected,
                                      boolean expanded,
                                      boolean leaf,
                                      int row,
                                      boolean hasFocus) {
      final Icon icon = myVf.getFileType().getIcon();
      renderer.setIcon(icon);
      final String[] messages = getText();
      final String text = messages == null || messages.length == 0 ? vf.getPath() : messages[0];
      renderer.append(text);
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:ErrorViewStructure.java

示例5: getTreeCellEditorComponent

import com.intellij.ui.CustomizeColoredTreeCellRenderer; //导入依赖的package包/类
@Override
public Component getTreeCellEditorComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row) {
  final ErrorTreeElement element = getElement(value);
  if (element instanceof EditableMessageElement) {
    EditableMessageElement editableMessageElement = (EditableMessageElement)element;
    final CustomizeColoredTreeCellRenderer leftSelfRenderer = editableMessageElement.getLeftSelfRenderer();
    final TreeCellEditor rightSelfEditor = editableMessageElement.getRightSelfEditor();
    myColoredTreeCellRenderer.setCurrentCallback(leftSelfRenderer);
    myRightCellRenderer.setCurrentCallback(rightSelfEditor);
    return myWrapperEditor.getTreeCellEditorComponent(tree, value, selected, expanded, leaf, row);
  }
  return myTree.getCellRenderer().getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, true);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:NewErrorTreeEditor.java

示例6: MyNavigatableWithDataElement

import com.intellij.ui.CustomizeColoredTreeCellRenderer; //导入依赖的package包/类
private MyNavigatableWithDataElement(final Project project,
                                     @Nonnull ErrorTreeElementKind kind,
                                     GroupingElement parent,
                                     String[] message,
                                     @Nonnull final VirtualFile vf,
                                     String exportText,
                                     String rendererTextPrefix) {
  super(kind, parent, message, new OpenFileDescriptor(project, vf, -1, -1), exportText, rendererTextPrefix);
  myVf = vf;
  myCustomizeColoredTreeCellRenderer = new CustomizeColoredTreeCellRenderer() {
    @Override
    public void customizeCellRenderer(SimpleColoredComponent renderer,
                                      JTree tree,
                                      Object value,
                                      boolean selected,
                                      boolean expanded,
                                      boolean leaf,
                                      int row,
                                      boolean hasFocus) {
      final Icon icon = myVf.getFileType().getIcon();
      renderer.setIcon(icon);
      final String[] messages = getText();
      final String text = messages == null || messages.length == 0 ? vf.getPath() : messages[0];
      renderer.append(text);
    }
  };
}
 
开发者ID:consulo,项目名称:consulo,代码行数:28,代码来源:ErrorViewStructure.java

示例7: getRightSelfRenderer

import com.intellij.ui.CustomizeColoredTreeCellRenderer; //导入依赖的package包/类
@Nullable
@Override
public CustomizeColoredTreeCellRenderer getRightSelfRenderer() {
  return myRightTreeCellRenderer;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:NotificationMessageElement.java

示例8: getLeftSelfRenderer

import com.intellij.ui.CustomizeColoredTreeCellRenderer; //导入依赖的package包/类
@Nullable
@Override
public CustomizeColoredTreeCellRenderer getLeftSelfRenderer() {
  return myLeftTreeCellRenderer;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:NotificationMessageElement.java

示例9: setCurrentCallback

import com.intellij.ui.CustomizeColoredTreeCellRenderer; //导入依赖的package包/类
public void setCurrentCallback(final CustomizeColoredTreeCellRenderer currentCallback) {
  myCurrentCallback = currentCallback;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:NewErrorTreeRenderer.java

示例10: getLeftSelfRenderer

import com.intellij.ui.CustomizeColoredTreeCellRenderer; //导入依赖的package包/类
@Nullable
CustomizeColoredTreeCellRenderer getLeftSelfRenderer();
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:3,代码来源:EditableMessageElement.java

示例11: getLeftSelfRenderer

import com.intellij.ui.CustomizeColoredTreeCellRenderer; //导入依赖的package包/类
@Override
public CustomizeColoredTreeCellRenderer getLeftSelfRenderer() {
  return myCustomizeColoredTreeCellRenderer;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:FixedHotfixGroupElement.java

示例12: getLeftSelfRenderer

import com.intellij.ui.CustomizeColoredTreeCellRenderer; //导入依赖的package包/类
@Override
public CustomizeColoredTreeCellRenderer getLeftSelfRenderer() {
  return myLeftTreeCellRenderer;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:HotfixGroupElement.java

示例13: getRightSelfRenderer

import com.intellij.ui.CustomizeColoredTreeCellRenderer; //导入依赖的package包/类
@Override
public CustomizeColoredTreeCellRenderer getRightSelfRenderer() {
  return myRightTreeCellRenderer;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:HotfixGroupElement.java

示例14: getLeftSelfRenderer

import com.intellij.ui.CustomizeColoredTreeCellRenderer; //导入依赖的package包/类
@Nullable
public CustomizeColoredTreeCellRenderer getLeftSelfRenderer() {
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:ErrorTreeElement.java

示例15: getRightSelfRenderer

import com.intellij.ui.CustomizeColoredTreeCellRenderer; //导入依赖的package包/类
@Nullable
public CustomizeColoredTreeCellRenderer getRightSelfRenderer() {
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:ErrorTreeElement.java


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