@Override protected void render(ColoredTreeCellRenderer renderer) { SimpleTextAttributes rootAttributes; SimpleTextAttributes branchAttributes; if (remoteName != null && commits.size() != 0 && remoteCommits != 0 || currentBranch == null) { rootAttributes = SimpleTextAttributes.ERROR_ATTRIBUTES.derive( SimpleTextAttributes.STYLE_BOLD, null, null, null); branchAttributes = SimpleTextAttributes.ERROR_ATTRIBUTES; } else if (remoteName == null || commits.size() == 0) { rootAttributes = SimpleTextAttributes.GRAYED_BOLD_ATTRIBUTES; branchAttributes = SimpleTextAttributes.GRAYED_ATTRIBUTES; } else { branchAttributes = SimpleTextAttributes.REGULAR_ATTRIBUTES; rootAttributes = SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES; } renderer.append(root.getPresentableUrl(), rootAttributes); if (currentBranch != null) { renderer.append(" [" + currentBranch, branchAttributes); if (remoteName != null) { renderer.append(" -> " + remoteName + "#" + remoteBranch, branchAttributes); } renderer.append("]", branchAttributes); } }
@Override protected void render(ColoredTreeCellRenderer renderer) { renderer.append( revision.asString().substring(0, HASH_PREFIX_SIZE), SimpleTextAttributes.GRAYED_ATTRIBUTES); renderer.append(": "); renderer.append(message); if (isMerge) { renderer.append( " " + GitBundle.getString("push.active.commit.node.merge"), SimpleTextAttributes.GRAYED_ATTRIBUTES); } }
public void customizeCellRenderer( final ColoredTreeCellRenderer targetRenderer, CheckedTreeNode node, boolean selected, final boolean checked, boolean expanded, boolean leaf, boolean hasFocus) { targetRenderer.setIcon(PlatformIcons.PACKAGE_ICON); final String displayName; final CheckedTreeNode parent = (CheckedTreeNode) node.getParent(); if (parent != null && parent.getUserObject() instanceof PackageDescriptor) { final String parentPackageInTree = ((PackageDescriptor) parent.getUserObject()).getPackageName() + "."; displayName = myPackageName.startsWith(parentPackageInTree) ? myPackageName.substring(parentPackageInTree.length()) : myPackageName; } else { displayName = myPackageName; } targetRenderer.append( displayName, checked ? SimpleTextAttributes.SIMPLE_CELL_ATTRIBUTES : SimpleTextAttributes.GRAYED_ATTRIBUTES); }
protected void customizeCellRenderer( final ColoredTreeCellRenderer targetRenderer, CheckedTreeNode node, boolean selected, final boolean checked, boolean expanded, boolean leaf, boolean hasFocus) { targetRenderer.setIcon(getDisplayIcon()); targetRenderer.append( getDisplayString(), checked ? SimpleTextAttributes.SIMPLE_CELL_ATTRIBUTES : SimpleTextAttributes.GRAYED_ATTRIBUTES); }
@Override protected void render(ColoredTreeCellRenderer renderer) { renderer.append(GitBundle.getString("push.active.status.status")); if (root.currentBranch == null) { myMessage = GitBundle.message("push.active.status.no.branch"); renderer.append(myMessage, SimpleTextAttributes.ERROR_ATTRIBUTES); } else if (root.remoteName == null) { myMessage = GitBundle.message("push.active.status.no.tracked"); renderer.append(myMessage, SimpleTextAttributes.GRAYED_BOLD_ATTRIBUTES); } else if (root.remoteCommits != 0 && root.commits.size() == 0) { myMessage = GitBundle.message("push.active.status.no.commits.behind", root.remoteCommits); renderer.append(myMessage, SimpleTextAttributes.GRAYED_BOLD_ATTRIBUTES); } else if (root.commits.size() == 0) { myMessage = GitBundle.message("push.active.status.no.commits"); renderer.append(myMessage, SimpleTextAttributes.GRAYED_BOLD_ATTRIBUTES); } else if (root.remoteCommits != 0) { myMessage = GitBundle.message("push.active.status.behind", root.remoteCommits); renderer.append(myMessage, SimpleTextAttributes.ERROR_ATTRIBUTES); } else { myMessage = GitBundle.message("push.active.status.push", root.commits.size()); renderer.append(myMessage); } }