Java 类com.intellij.ui.CustomizeColoredTreeCellRenderer 实例源码

项目:intellij-ce-playground    文件:NewErrorTreeRenderer.java   
@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);
}
项目:intellij-ce-playground    文件:FixedHotfixGroupElement.java   
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);
    }
  };
}
项目:intellij-ce-playground    文件:HotfixGroupElement.java   
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();
}
项目:tools-idea    文件:NewErrorTreeRenderer.java   
@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);
}
项目:tools-idea    文件:FixedHotfixGroupElement.java   
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);
    }
  };
}
项目:tools-idea    文件:HotfixGroupElement.java   
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();
}
项目:consulo    文件:NewErrorTreeRenderer.java   
@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);
}
项目:consulo    文件:FixedHotfixGroupElement.java   
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);
    }
  };
}
项目:consulo    文件:HotfixGroupElement.java   
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();
}
项目:intellij-ce-playground    文件:ErrorViewStructure.java   
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);
    }
  };
}
项目:intellij-ce-playground    文件:NewErrorTreeEditor.java   
@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);
}
项目:tools-idea    文件:ErrorViewStructure.java   
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);
    }
  };
}
项目:consulo    文件:ErrorViewStructure.java   
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);
    }
  };
}
项目:consulo    文件:NewErrorTreeEditor.java   
@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);
}
项目:intellij-ce-playground    文件:NotificationMessageElement.java   
@Nullable
@Override
public CustomizeColoredTreeCellRenderer getRightSelfRenderer() {
  return myRightTreeCellRenderer;
}
项目:intellij-ce-playground    文件:NotificationMessageElement.java   
@Nullable
@Override
public CustomizeColoredTreeCellRenderer getLeftSelfRenderer() {
  return myLeftTreeCellRenderer;
}
项目:intellij-ce-playground    文件:NewErrorTreeRenderer.java   
public void setCurrentCallback(final CustomizeColoredTreeCellRenderer currentCallback) {
  myCurrentCallback = currentCallback;
}
项目:intellij-ce-playground    文件:EditableMessageElement.java   
@Nullable
CustomizeColoredTreeCellRenderer getLeftSelfRenderer();
项目:intellij-ce-playground    文件:FixedHotfixGroupElement.java   
@Override
public CustomizeColoredTreeCellRenderer getLeftSelfRenderer() {
  return myCustomizeColoredTreeCellRenderer;
}
项目:intellij-ce-playground    文件:ErrorViewStructure.java   
@Override
public CustomizeColoredTreeCellRenderer getLeftSelfRenderer() {
  return myCustomizeColoredTreeCellRenderer;
}
项目:intellij-ce-playground    文件:HotfixGroupElement.java   
@Override
public CustomizeColoredTreeCellRenderer getLeftSelfRenderer() {
  return myLeftTreeCellRenderer;
}
项目:intellij-ce-playground    文件:HotfixGroupElement.java   
@Override
public CustomizeColoredTreeCellRenderer getRightSelfRenderer() {
  return myRightTreeCellRenderer;
}
项目:intellij-ce-playground    文件:ErrorTreeElement.java   
@Nullable
public CustomizeColoredTreeCellRenderer getLeftSelfRenderer() {
  return null;
}
项目:intellij-ce-playground    文件:ErrorTreeElement.java   
@Nullable
public CustomizeColoredTreeCellRenderer getRightSelfRenderer() {
  return null;
}
项目:intellij-ce-playground    文件:CallingBackColoredTreeCellRenderer.java   
public void setCurrentCallback(final CustomizeColoredTreeCellRenderer currentCallback) {
  myCurrentCallback = currentCallback;
}
项目:tools-idea    文件:NewErrorTreeRenderer.java   
public void setCurrentCallback(final CustomizeColoredTreeCellRenderer currentCallback) {
  myCurrentCallback = currentCallback;
}
项目:tools-idea    文件:FixedHotfixGroupElement.java   
@Override
public CustomizeColoredTreeCellRenderer getLeftSelfRenderer() {
  return myCustomizeColoredTreeCellRenderer;
}
项目:tools-idea    文件:ErrorViewStructure.java   
@Override
public CustomizeColoredTreeCellRenderer getLeftSelfRenderer() {
  return myCustomizeColoredTreeCellRenderer;
}
项目:tools-idea    文件:HotfixGroupElement.java   
@Override
public CustomizeColoredTreeCellRenderer getLeftSelfRenderer() {
  return myLeftTreeCellRenderer;
}
项目:tools-idea    文件:HotfixGroupElement.java   
@Override
public CustomizeColoredTreeCellRenderer getRightSelfRenderer() {
  return myRightTreeCellRenderer;
}
项目:tools-idea    文件:ErrorTreeElement.java   
@Nullable
public CustomizeColoredTreeCellRenderer getLeftSelfRenderer() {
  return null;
}
项目:tools-idea    文件:ErrorTreeElement.java   
@Nullable
public CustomizeColoredTreeCellRenderer getRightSelfRenderer() {
  return null;
}
项目:tools-idea    文件:CallingBackColoredTreeCellRenderer.java   
public void setCurrentCallback(final CustomizeColoredTreeCellRenderer currentCallback) {
  myCurrentCallback = currentCallback;
}
项目:consulo    文件:NotificationMessageElement.java   
@javax.annotation.Nullable
@Override
public CustomizeColoredTreeCellRenderer getRightSelfRenderer() {
  return myRightTreeCellRenderer;
}
项目:consulo    文件:NotificationMessageElement.java   
@javax.annotation.Nullable
@Override
public CustomizeColoredTreeCellRenderer getLeftSelfRenderer() {
  return myLeftTreeCellRenderer;
}
项目:consulo    文件:NewErrorTreeRenderer.java   
public void setCurrentCallback(final CustomizeColoredTreeCellRenderer currentCallback) {
  myCurrentCallback = currentCallback;
}
项目:consulo    文件:EditableMessageElement.java   
@Nullable
CustomizeColoredTreeCellRenderer getLeftSelfRenderer();
项目:consulo    文件:FixedHotfixGroupElement.java   
@Override
public CustomizeColoredTreeCellRenderer getLeftSelfRenderer() {
  return myCustomizeColoredTreeCellRenderer;
}
项目:consulo    文件:ErrorViewStructure.java   
@Override
public CustomizeColoredTreeCellRenderer getLeftSelfRenderer() {
  return myCustomizeColoredTreeCellRenderer;
}
项目:consulo    文件:HotfixGroupElement.java   
@Override
public CustomizeColoredTreeCellRenderer getLeftSelfRenderer() {
  return myLeftTreeCellRenderer;
}