本文整理汇总了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));
}
}
示例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);
}
}
}
示例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));
}
}
示例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));
}
}
示例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));
}
}
示例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);
}
}
示例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));
}
}
示例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);
}
}
}
示例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);
}
示例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);
}
示例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()));
}
示例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));
}
}
}
示例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);
}
示例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);
}
}
}
示例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);
}
}