本文整理汇总了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);
}
}
示例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);
}
});
}
示例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);
}
示例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);
}
示例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;
}
示例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();
}
示例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);
}
示例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)));
}
示例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);
}
示例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;
}
}
示例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)));
}
示例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;
}
}
}
}
示例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;
}
示例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;
}
示例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();
}
};
}