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


Java EmptyIcon类代码示例

本文整理汇总了Java中com.intellij.util.ui.EmptyIcon的典型用法代码示例。如果您正苦于以下问题:Java EmptyIcon类的具体用法?Java EmptyIcon怎么用?Java EmptyIcon使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


EmptyIcon类属于com.intellij.util.ui包,在下文中一共展示了EmptyIcon类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: importFromSources

import com.intellij.util.ui.EmptyIcon; //导入依赖的package包/类
protected void importFromSources(File dir) {
  myRootDir = dir;
  try {
    myProject = doCreateProject(getIprFile());
    myBuilder.setBaseProjectPath(dir.getAbsolutePath());
    List<DetectedRootData> list = RootDetectionProcessor.detectRoots(dir);
    MultiMap<ProjectStructureDetector,DetectedProjectRoot> map = RootDetectionProcessor.createRootsMap(list);
    myBuilder.setupProjectStructure(map);
    for (ProjectStructureDetector detector : map.keySet()) {
      List<ModuleWizardStep> steps = detector.createWizardSteps(myBuilder, myBuilder.getProjectDescriptor(detector), EmptyIcon.ICON_16);
      for (ModuleWizardStep step : steps) {
        if (step instanceof AbstractStepWithProgress<?>) {
          performStep((AbstractStepWithProgress<?>)step);
        }
      }
    }
    myBuilder.commit(myProject, null, ModulesProvider.EMPTY_MODULES_PROVIDER);
  }
  catch (Exception e) {
    throw new RuntimeException(e);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:ImportFromSourcesTestCase.java

示例2: fillActions

import com.intellij.util.ui.EmptyIcon; //导入依赖的package包/类
@Override
public void fillActions(final LookupElement element, Lookup lookup, Consumer<LookupElementAction> consumer) {
  final StaticallyImportable item = element.as(StaticallyImportable.CLASS_CONDITION_KEY);
  if (item == null || !item.canBeImported()) {
    return;
  }

  final Icon checkIcon = PlatformIcons.CHECK_ICON;
  final Icon icon = item.willBeImported() ? checkIcon : new EmptyIcon(checkIcon.getIconWidth(), checkIcon.getIconHeight());
  consumer.consume(new LookupElementAction(icon, "Import statically") {
    @Override
    public Result performLookupAction() {
      item.setShouldBeImported(!item.willBeImported());
      return new Result.ChooseItem(element);
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:ImportStaticLookupActionProvider.java

示例3: update

import com.intellij.util.ui.EmptyIcon; //导入依赖的package包/类
@Override
public void update(final Graphics g, final JComponent c) {
  myHiddenItem.setSelected(menuItem.isSelected());

  if (UIUtil.isMurrineBasedTheme()) {
    acceleratorFont = menuItem.getFont();
    final Color fg = GtkPaintingUtil.getForeground(myOriginalUI, menuItem);
    acceleratorForeground = UIUtil.mix(fg, menuItem.getBackground(), menuItem.isSelected() ? 0.4 : 0.2);
    disabledForeground = fg;
  }
  if (checkIcon != null && !(checkIcon instanceof IconWrapper) && !(checkIcon instanceof EmptyIcon)) {
    checkIcon = new IconWrapper(checkIcon, myOriginalUI);
  }

  super.update(g, c);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:GtkMenuItemUI.java

示例4: ActionButton

import com.intellij.util.ui.EmptyIcon; //导入依赖的package包/类
public ActionButton(AnAction action) {
  myAction = action;

  Presentation presentation = action.getTemplatePresentation();
  InplaceButton button = new InplaceButton(KeymapUtil.createTooltipText(presentation.getText(), action), EmptyIcon.ICON_16, this) {
    @Override
    public boolean isActive() {
      return LightToolWindow.this.isActive();
    }
  };
  button.setHoveringEnabled(!SystemInfo.isMac);
  setContent(button);

  Icon icon = presentation.getIcon();
  Icon hoveredIcon = presentation.getHoveredIcon();
  button.setIcons(icon, icon, hoveredIcon == null ? icon : hoveredIcon);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:LightToolWindow.java

示例5: getSmallApplicationIcon

import com.intellij.util.ui.EmptyIcon; //导入依赖的package包/类
protected static Icon getSmallApplicationIcon() {
  if (ourSmallAppIcon == null) {
    try {
      Icon appIcon = IconLoader.findIcon(ApplicationInfoEx.getInstanceEx().getIconUrl());

      if (appIcon != null) {
        if (appIcon.getIconWidth() == JBUI.scale(16) && appIcon.getIconHeight() == JBUI.scale(16)) {
          ourSmallAppIcon = appIcon;
        } else {
          BufferedImage image = ImageUtil.toBufferedImage(IconUtil.toImage(appIcon));
          image = Scalr.resize(image, Scalr.Method.ULTRA_QUALITY, UIUtil.isRetina() ? 32 : JBUI.scale(16));
          ourSmallAppIcon = toRetinaAwareIcon(image);
        }
      }
    }
    catch (Exception e) {//
    }
    if (ourSmallAppIcon == null) {
      ourSmallAppIcon = EmptyIcon.ICON_16;
    }
  }

  return ourSmallAppIcon;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:RecentProjectsManagerBase.java

示例6: 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

示例7: recalculateWidth

import com.intellij.util.ui.EmptyIcon; //导入依赖的package包/类
public void recalculateWidth() {
  ListModel model = myList.getModel();
  myTitle.setIcon(EmptyIcon.ICON_16);
  myTitle.setFont(getTitleFont());
  int index = 0;
  while (index < model.getSize()) {
    String title = getModel().titleIndex.getTitle(index);
    if (title != null) {
      myTitle.setText(title);
    }
    index++;
  }

  myTitle.setForeground(Gray._122);
  myTitle.setAlignmentY(BOTTOM_ALIGNMENT);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:SearchEverywhereAction.java

示例8: recalculateWidth

import com.intellij.util.ui.EmptyIcon; //导入依赖的package包/类
public void recalculateWidth() {
  myLeftWidth = 16;
  ListModel model = myList.getModel();
  myTitle.setIcon(EmptyIcon.ICON_16);
  myTitle.setFont(getTitleFont());
  int index = 0;
  while (index < model.getSize()) {
    Object el = model.getElementAt(index);
    Object prev = index == 0 ? null : model.getElementAt(index - 1);
    String title = getTitle(index, el, prev);
    if (title != null) {
      myTitle.setText(title);
      myLeftWidth = Math.max(myLeftWidth, myTitle.getPreferredSize().width);
    }
    index++;
  }

  myLeftWidth += 10;
  myTitle.setForeground(Gray._122);
  myTitle.setAlignmentY(BOTTOM_ALIGNMENT);
  myLeftPanel.setBorder(new CompoundBorder(new CustomLineBorder(Gray._206, 0,0,0,1), new EmptyBorder(0,0,0,5)));
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:23,代码来源:SearchEverywhereAction.java

示例9: ActionButton

import com.intellij.util.ui.EmptyIcon; //导入依赖的package包/类
public ActionButton(AnAction action) {
  myAction = action;

  Presentation presentation = action.getTemplatePresentation();
  InplaceButton button = new InplaceButton(AnAction.createTooltipText(presentation.getText(), action), EmptyIcon.ICON_16, this) {
    @Override
    public boolean isActive() {
      return LightToolWindow.this.isActive();
    }
  };
  button.setHoveringEnabled(!SystemInfo.isMac);
  setContent(button);

  Icon icon = presentation.getIcon();
  Icon hoveredIcon = presentation.getHoveredIcon();
  button.setIcons(icon, icon, hoveredIcon == null ? icon : hoveredIcon);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:18,代码来源:LightToolWindow.java

示例10: toIcon

import com.intellij.util.ui.EmptyIcon; //导入依赖的package包/类
@Nonnull
public Icon toIcon() {
  Icon mainIcon = null;
  if(myLayerIcons == null) {
    mainIcon = myMainIcon;
  }
  else {
    LayeredIcon layeredIcon = new LayeredIcon(myLayerIcons.size() + 1);
    layeredIcon.setIcon(myMainIcon, 0);
    for (int i = 0; i < myLayerIcons.size(); i++) {
      Icon icon = myLayerIcons.get(i);
      layeredIcon.setIcon(icon, i + 1);
    }
    mainIcon = layeredIcon;
  }

  if(myRightIcon == null) {
    return mainIcon == null ? EmptyIcon.ICON_16 : mainIcon;
  }
  else {
    RowIcon baseIcon = new RowIcon(2);
    baseIcon.setIcon(mainIcon, 0);
    baseIcon.setIcon(myRightIcon, 1);
    return baseIcon;
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:27,代码来源:IconDescriptor.java

示例11: PresentationModeProgressPanel

import com.intellij.util.ui.EmptyIcon; //导入依赖的package包/类
public PresentationModeProgressPanel(InlineProgressIndicator progress) {
  myProgress = progress;
  Font font = JBUI.Fonts.label(11);
  myText.setFont(font);
  myText2.setFont(font);
  myText.setIcon(JBUI.scale(EmptyIcon.create(1, 16)));
  myText2.setIcon(JBUI.scale(EmptyIcon.create(1, 16)));
  myUpdateQueue = new MergingUpdateQueue("Presentation Mode Progress", 100, true, null);
  myUpdate = new Update("Update UI") {
    @Override
    public void run() {
      updateImpl();
    }
  };
  myEastButtons = myProgress.createEastButtons();
  myButtonPanel.add(InlineProgressIndicator.createButtonPanel(myEastButtons.map(b -> b.button)));
}
 
开发者ID:consulo,项目名称:consulo,代码行数:18,代码来源:PresentationModeProgressPanel.java

示例12: calcMaxIconSize

import com.intellij.util.ui.EmptyIcon; //导入依赖的package包/类
private void calcMaxIconSize(final ActionGroup actionGroup) {
  AnAction[] actions = actionGroup.getChildren(createActionEvent(actionGroup));
  for (AnAction action : actions) {
    if (action == null) continue;
    if (action instanceof ActionGroup) {
      final ActionGroup group = (ActionGroup)action;
      if (!group.isPopup()) {
        calcMaxIconSize(group);
        continue;
      }
    }

    Icon icon = action.getTemplatePresentation().getIcon();
    if (icon == null && action instanceof Toggleable) icon = EmptyIcon.ICON_16;
    if (icon != null) {
      final int width = icon.getIconWidth();
      final int height = icon.getIconHeight();
      if (myMaxIconWidth < width) {
        myMaxIconWidth = width;
      }
      if (myMaxIconHeight < height) {
        myMaxIconHeight = height;
      }
    }
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:27,代码来源:PopupFactoryImpl.java

示例13: 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

示例14: 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

示例15: PresentationModeProgressPanel

import com.intellij.util.ui.EmptyIcon; //导入依赖的package包/类
public PresentationModeProgressPanel(InlineProgressIndicator progress) {
  myProgress = progress;
  Font font = JBUI.Fonts.label(11);
  myText.setFont(font);
  myText2.setFont(font);
  myText.setIcon(EmptyIcon.create(1, 16));
  myText2.setIcon(EmptyIcon.create(1, 16));
  myUpdateQueue = new MergingUpdateQueue("Presentation Mode Progress", 100, true, null);
  myUpdate = new Update("Update UI") {
    @Override
    public void run() {
      updateImpl();
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:PresentationModeProgressPanel.java


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