当前位置: 首页>>代码示例>>Java>>正文


Java EmptyIcon.create方法代码示例

本文整理汇总了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();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:AdvancedSettingsAction.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:StackFrameDescriptorImpl.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:SimpleTree.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:GtkMenuItemUI.java

示例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();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:34,代码来源:NavBarItem.java

示例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();
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:32,代码来源:NavBarItem.java

示例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));
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:11,代码来源:PopupFactoryImpl.java

示例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);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:10,代码来源:ModernMenuUI.java

示例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);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:10,代码来源:LookupCellRenderer.java

示例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();
}
 
开发者ID:consulo,项目名称:consulo,代码行数:30,代码来源:AdvancedSettingsAction.java

示例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);
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:5,代码来源:CCSubtaskEditorNotificationProvider.java

示例12: getEmptyIcon

import com.intellij.util.ui.EmptyIcon; //导入方法依赖的package包/类
private Icon getEmptyIcon() {
  if (myEmptyIcon == null) {
    myEmptyIcon = EmptyIcon.create(getIcon(true).getIconWidth());
  }
  return myEmptyIcon;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:JBComboBoxTableCellEditorComponent.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:StructureFilterPopupComponent.java

示例14: compute

import com.intellij.util.ui.EmptyIcon; //导入方法依赖的package包/类
@NotNull
@Override
protected Icon compute() {
  return EmptyIcon.create(PlatformIcons.PUBLIC_ICON);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:ElementBase.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:AndroidColorAnnotator.java


注:本文中的com.intellij.util.ui.EmptyIcon.create方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。