本文整理汇总了Java中com.intellij.ui.ColoredTreeCellRenderer.setIconOnTheRight方法的典型用法代码示例。如果您正苦于以下问题:Java ColoredTreeCellRenderer.setIconOnTheRight方法的具体用法?Java ColoredTreeCellRenderer.setIconOnTheRight怎么用?Java ColoredTreeCellRenderer.setIconOnTheRight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.ui.ColoredTreeCellRenderer
的用法示例。
在下文中一共展示了ColoredTreeCellRenderer.setIconOnTheRight方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
示例2: 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));
}
}
}