本文整理汇总了Java中com.intellij.util.ui.EmptyIcon.create方法的典型用法代码示例。如果您正苦于以下问题:Java EmptyIcon.create方法的具体用法?Java EmptyIcon.create怎么用?Java EmptyIcon.create使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.util.ui.EmptyIcon
的用法示例。
在下文中一共展示了EmptyIcon.create方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: calculateCheckBoxIndent
import com.intellij.util.ui.EmptyIcon; //导入方法依赖的package包/类
private static int calculateCheckBoxIndent() {
JCheckBox checkBox = new JCheckBox();
Icon icon = checkBox.getIcon();
int indent = 0;
if (icon == null) {
icon = UIManager.getIcon("CheckBox.icon");
}
if (UIUtil.isUnderDarcula() || UIUtil.isUnderIntelliJLaF()) {
icon = EmptyIcon.create(20, 18);
}
if (icon != null) {
final Rectangle r1 = new Rectangle(checkBox.getWidth(), checkBox.getHeight());
JBInsets.removeFrom(r1, checkBox.getInsets());
final Rectangle iconRect = new Rectangle();
SwingUtilities.layoutCompoundLabel(
checkBox, checkBox.getFontMetrics(checkBox.getFont()), checkBox.getText(), icon,
checkBox.getVerticalAlignment(), checkBox.getHorizontalAlignment(),
checkBox.getVerticalTextPosition(), checkBox.getHorizontalTextPosition(),
r1, new Rectangle(), iconRect,
checkBox.getText() == null ? 0 : checkBox.getIconTextGap());
indent = iconRect.x;
}
return indent + checkBox.getIconTextGap();
}
示例2: calcIcon
import com.intellij.util.ui.EmptyIcon; //导入方法依赖的package包/类
private Icon calcIcon() {
try {
if(myFrame.isObsolete()) {
return AllIcons.Debugger.Db_obsolete;
}
}
catch (EvaluateException ignored) {
}
return EmptyIcon.create(6);//AllIcons.Debugger.StackFrame;
}
示例3: getEmptyHandle
import com.intellij.util.ui.EmptyIcon; //导入方法依赖的package包/类
public Icon getEmptyHandle() {
if (myEmptyHandle == null) {
final Icon expand = getExpandedHandle();
myEmptyHandle = expand != null ? EmptyIcon.create(expand) : EmptyIcon.create(0);
}
return myEmptyHandle;
}
示例4: installUI
import com.intellij.util.ui.EmptyIcon; //导入方法依赖的package包/类
@Override
public void installUI(final JComponent c) {
super.installUI(c);
myHiddenItem = new JCheckBoxMenuItem();
myOriginalUI.installUI(myHiddenItem);
menuItem.setBorder(myHiddenItem.getBorder());
final Icon icon = getCheckIconFromContext(myOriginalUI, myHiddenItem);
checkIcon = isCheckBoxItem() ? icon : EmptyIcon.create(icon);
}
示例5: NavBarItem
import com.intellij.util.ui.EmptyIcon; //导入方法依赖的package包/类
public NavBarItem(NavBarPanel panel, Object object, int idx, Disposable parent) {
myPanel = panel;
myUI = panel.getNavBarUI();
myObject = object;
myIndex = idx;
isPopupElement = idx == -1;
if (object != null) {
NavBarPresentation presentation = myPanel.getPresentation();
myText = presentation.getPresentableText(object);
Icon icon = presentation.getIcon(object);
myIcon = icon != null ? icon : EmptyIcon.create(5);
myAttributes = presentation.getTextAttributes(object, false);
}
else {
myText = "Sample";
myIcon = PlatformIcons.DIRECTORY_CLOSED_ICON;
myAttributes = SimpleTextAttributes.REGULAR_ATTRIBUTES;
}
Disposer.register(parent == null ? panel : parent, this);
setOpaque(false);
setIpad(myUI.getElementIpad(isPopupElement));
if (!isPopupElement) {
setMyBorder(null);
setBorder(null);
setPaintFocusBorder(false);
}
update();
}
示例6: NavBarItem
import com.intellij.util.ui.EmptyIcon; //导入方法依赖的package包/类
public NavBarItem(NavBarPanel panel, Object object, int idx, Disposable parent) {
//count++;
//System.out.println(count);
myPanel = panel;
myUI = panel.getNavBarUI();
myObject = object;
myIndex = idx;
isPopupElement = idx == -1;
if (object != null) {
final NavBarPresentation presentation = myPanel.getPresentation();
myText = presentation.getPresentableText(object);
Icon icon = presentation.getIcon(object);
myIcon = icon != null ? icon : EmptyIcon.create(5);
myAttributes = presentation.getTextAttributes(object, false);
} else {
myText = "Sample";
myIcon = PlatformIcons.DIRECTORY_CLOSED_ICON;
myAttributes = SimpleTextAttributes.REGULAR_ATTRIBUTES;
}
Disposer.register(parent == null ? panel : parent, this);
setOpaque(false);
setIpad(myUI.getElementIpad(isPopupElement));
if (!isPopupElement) {
setMyBorder(null);
setBorder(null);
setPaintFocusBorder(false);
}
update();
}
示例7: buildGroup
import com.intellij.util.ui.EmptyIcon; //导入方法依赖的package包/类
public void buildGroup(@Nonnull ActionGroup actionGroup) {
calcMaxIconSize(actionGroup);
myEmptyIcon = myMaxIconHeight != -1 && myMaxIconWidth != -1 ? EmptyIcon.create(myMaxIconWidth, myMaxIconHeight) : null;
appendActionsFromGroup(actionGroup);
if (myListModel.isEmpty()) {
myListModel.add(new ActionItem(Utils.EMPTY_MENU_FILLER, Utils.NOTHING_HERE, null, false, null, null, false, null));
}
}
示例8: installDefaults
import com.intellij.util.ui.EmptyIcon; //导入方法依赖的package包/类
@Override
protected void installDefaults() {
super.installDefaults();
Integer integer = UIUtil.getPropertyMaxGutterIconWidth(getPropertyPrefix());
if (integer != null) {
myMaxGutterIconWidth = JBUI.scale(integer.intValue());
}
arrowIcon = EmptyIcon.create(myMaxGutterIconWidth);
}
示例9: updateMaximumWidth
import com.intellij.util.ui.EmptyIcon; //导入方法依赖的package包/类
int updateMaximumWidth(final LookupElementPresentation p, LookupElement item) {
final Icon icon = p.getIcon();
if (icon != null && (icon.getIconWidth() > myEmptyIcon.getIconWidth() || icon.getIconHeight() > myEmptyIcon.getIconHeight())) {
myEmptyIcon = EmptyIcon.create(Math.max(icon.getIconWidth(), myEmptyIcon.getIconWidth()), Math.max(icon.getIconHeight(), myEmptyIcon.getIconHeight()));
}
return RealLookupElementPresentation.calculateWidth(p, getRealFontMetrics(item, false), getRealFontMetrics(item, true)) +
calcSpacing(myTailComponent, null) + calcSpacing(myTypeLabel, null);
}
示例10: calculateCheckBoxIndent
import com.intellij.util.ui.EmptyIcon; //导入方法依赖的package包/类
private static int calculateCheckBoxIndent() {
JCheckBox checkBox = new JCheckBox();
Icon icon = checkBox.getIcon();
int indent = 0;
if (icon == null) {
icon = UIManager.getIcon("CheckBox.icon");
}
if (UIUtil.isUnderDarcula() || UIUtil.isUnderIntelliJLaF()) {
icon = EmptyIcon.create(20, 18);
}
if (icon != null) {
final Insets i = checkBox.getInsets();
final Rectangle r = checkBox.getBounds();
final Rectangle r1 = new Rectangle();
r1.x = i.left;
r1.y = i.top;
r1.width = r.width - (i.right + r1.x);
r1.height = r.height - (i.bottom + r1.y);
final Rectangle iconRect = new Rectangle();
SwingUtilities.layoutCompoundLabel(
checkBox, checkBox.getFontMetrics(checkBox.getFont()), checkBox.getText(), icon,
checkBox.getVerticalAlignment(), checkBox.getHorizontalAlignment(),
checkBox.getVerticalTextPosition(), checkBox.getHorizontalTextPosition(),
r1, new Rectangle(), iconRect,
checkBox.getText() == null ? 0 : checkBox.getIconTextGap());
indent = iconRect.x;
}
return indent + checkBox.getIconTextGap();
}
示例11: getIconFor
import com.intellij.util.ui.EmptyIcon; //导入方法依赖的package包/类
@Override
public Icon getIconFor(Integer value) {
return value == myTask.getActiveSubtaskIndex() ? AllIcons.Actions.Checked : EmptyIcon.create(AllIcons.Actions.Checked);
}
示例12: getEmptyIcon
import com.intellij.util.ui.EmptyIcon; //导入方法依赖的package包/类
private Icon getEmptyIcon() {
if (myEmptyIcon == null) {
myEmptyIcon = EmptyIcon.create(getIcon(true).getIconWidth());
}
return myEmptyIcon;
}
示例13: SelectFromHistoryAction
import com.intellij.util.ui.EmptyIcon; //导入方法依赖的package包/类
private SelectFromHistoryAction(@NotNull VcsLogStructureFilter filter) {
super(getStructureActionText(filter), getTooltipTextForFiles(filter.getFiles(), false).replace("\n", " "), null);
myFilter = filter;
myIcon = new SizedIcon(PlatformIcons.CHECK_ICON_SMALL, CHECKBOX_ICON_SIZE, CHECKBOX_ICON_SIZE);
myEmptyIcon = EmptyIcon.create(CHECKBOX_ICON_SIZE);
}
示例14: compute
import com.intellij.util.ui.EmptyIcon; //导入方法依赖的package包/类
@NotNull
@Override
protected Icon compute() {
return EmptyIcon.create(PlatformIcons.PUBLIC_ICON);
}
示例15: getIcon
import com.intellij.util.ui.EmptyIcon; //导入方法依赖的package包/类
@NotNull
@Override
public Icon getIcon() {
final Color color = getCurrentColor();
return color == null ? EmptyIcon.create(ICON_SIZE) : new ColorIcon(ICON_SIZE, color);
}