當前位置: 首頁>>代碼示例>>Java>>正文


Java IconLoader.getIcon方法代碼示例

本文整理匯總了Java中com.intellij.openapi.util.IconLoader.getIcon方法的典型用法代碼示例。如果您正苦於以下問題:Java IconLoader.getIcon方法的具體用法?Java IconLoader.getIcon怎麽用?Java IconLoader.getIcon使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.intellij.openapi.util.IconLoader的用法示例。


在下文中一共展示了IconLoader.getIcon方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getIcon

import com.intellij.openapi.util.IconLoader; //導入方法依賴的package包/類
private Icon getIcon() {
  if (icon == null) {
    String selector;
    if (SystemInfo.isMac) {
      selector = "OSX";
    }
    else if (SystemInfo.isWindows) {
      selector = "Windows";
    }
    else {
      selector = "Linux";
    }
    icon = IconLoader.getIcon("/lafs/" + selector + previewFileName + ".png");
  }
  return icon;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:17,代碼來源:CustomizeUIThemeStepPanel.java

示例2: load

import com.intellij.openapi.util.IconLoader; //導入方法依賴的package包/類
private static Icon load(String path) {
    try {
        return IconLoader.getIcon(path, PluginIcons.class);
    } catch (IllegalStateException e) {
        return null;
    }
}
 
開發者ID:beansoftapp,項目名稱:react-native-console,代碼行數:8,代碼來源:PluginIcons.java

示例3: replaceIcons

import com.intellij.openapi.util.IconLoader; //導入方法依賴的package包/類
public static void replaceIcons(final Class iconsClass, final String iconsRootPath) {
  // Iterate all fields (which hold icon locations) and patch them if necessary
  for (final Field field : iconsClass.getDeclaredFields()) {
    if (Modifier.isStatic(field.getModifiers())) {
      try {
        // Object should be some kind of javax.swing.Icon
        final Object value = field.get(null);
        final Class byClass = value.getClass();

        if (byClass.getName().endsWith("$ByClass")) {
          StaticPatcher.setFieldValue(value, "myCallerClass", IconReplacer.class);
          StaticPatcher.setFieldValue(value, "myWasComputed", Boolean.FALSE);
          StaticPatcher.setFieldValue(value, "myIcon", null);
        }
        else if (byClass.getName().endsWith("$CachedImageIcon")) {
          final String newPath = patchUrlIfNeeded(value, iconsRootPath);
          if (newPath != null) {
            final Icon newIcon = IconLoader.getIcon(newPath);
            StaticPatcher.setFinalStatic(field, newIcon);
          }
        }
      }
      catch (final Exception e) {
        // suppress
        //          e.printStackTrace();
      }
    }
  }

  // Recurse into nested classes
  for (final Class subClass : iconsClass.getDeclaredClasses()) {
    replaceIcons(subClass, iconsRootPath);
  }
}
 
開發者ID:mallowigi,項目名稱:a-file-icon-idea,代碼行數:35,代碼來源:IconReplacer.java

示例4: loadIcon

import com.intellij.openapi.util.IconLoader; //導入方法依賴的package包/類
/**
 * Load the association's icon
 *
 * @param file
 * @param association
 * @return
 */
private Icon loadIcon(final FileInfo file, final Association association) {
  Icon icon = null;

  try {
    if (association instanceof PsiElementAssociation) {
      icon = ((PsiElementAssociation) association).getIconForFile(file);
    } else {
      icon = IconLoader.getIcon(association.getIcon());
    }
  } catch (Exception e) {
    e.printStackTrace();
  }
  return icon;
}
 
開發者ID:mallowigi,項目名稱:a-file-icon-idea,代碼行數:22,代碼來源:FileIconProvider.java

示例5: projectOpened

import com.intellij.openapi.util.IconLoader; //導入方法依賴的package包/類
@Override
public void projectOpened() {
    Icon icon = IconLoader.getIcon(ICON_NYANDROID);
    ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project);
    ToolWindow toolWindow = toolWindowManager.getToolWindow("Logcat");
    if (toolWindow != null) {
        toolWindow.setIcon(icon);
    }
}
 
開發者ID:evant,項目名稱:NyandroidRestorer,代碼行數:10,代碼來源:NyandroidProject.java

示例6: getIcon

import com.intellij.openapi.util.IconLoader; //導入方法依賴的package包/類
/**
 * Get the device icon representing the device class of the given AVD (e.g. phone/tablet or TV)
 */
private static Icon getIcon(@NotNull AvdInfo info) {
  String id = info.getTag().getId();
  String path;
  if (id.contains("android-")) {
    path = String.format("/icons/formfactors/%s_32.png", id.substring("android-".length()));
    return IconLoader.getIcon(path, AvdDisplayList.class);
  } else {
    return AndroidIcons.FormFactors.Mobile_32;
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:14,代碼來源:AvdDisplayList.java

示例7: getIcon

import com.intellij.openapi.util.IconLoader; //導入方法依賴的package包/類
@NotNull
@Override
public Icon getIcon() {
  final String customIcon = getCustomIcon();
  if (customIcon != null) {
    return IconLoader.getIcon(customIcon, LocalTask.class);
  }
  return getIconFromType(myType, isIssue());
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:10,代碼來源:LocalTaskImpl.java

示例8: intellijLoad

import com.intellij.openapi.util.IconLoader; //導入方法依賴的package包/類
private static Icon intellijLoad(String path) {
    return IconLoader.getIcon(path, AllIcons.class);
}
 
開發者ID:beansoftapp,項目名稱:react-native-console,代碼行數:4,代碼來源:PluginIcons.java

示例9: load

import com.intellij.openapi.util.IconLoader; //導入方法依賴的package包/類
private static Icon load(String path) {
    return IconLoader.getIcon(path, Icons.class);
}
 
開發者ID:TNG,項目名稱:jgiven-intellij-plugin,代碼行數:4,代碼來源:Icons.java

示例10: load

import com.intellij.openapi.util.IconLoader; //導入方法依賴的package包/類
private static Icon load(String path) {
    return IconLoader.getIcon(path, SourcetrailIcons.class);
}
 
開發者ID:CoatiSoftware,項目名稱:idea-sourcetrail,代碼行數:4,代碼來源:SourcetrailIcons.java

示例11: getSlackIcon

import com.intellij.openapi.util.IconLoader; //導入方法依賴的package包/類
public static Icon getSlackIcon() {
    return IconLoader.getIcon("/icons/slack.png");
}
 
開發者ID:chakki-works,項目名稱:watchMe,代碼行數:4,代碼來源:SlackStorage.java

示例12: GoogleTranslation

import com.intellij.openapi.util.IconLoader; //導入方法依賴的package包/類
public GoogleTranslation() {
    super(IconLoader.getIcon("/icons/translate.png"));
}
 
開發者ID:a483210,項目名稱:GoogleTranslation,代碼行數:4,代碼來源:GoogleTranslation.java

示例13: load

import com.intellij.openapi.util.IconLoader; //導入方法依賴的package包/類
private static Icon load(String path) {
  return IconLoader.getIcon(path, EducationalCoreIcons.class);
}
 
開發者ID:medvector,項目名稱:educational-plugin,代碼行數:4,代碼來源:EducationalCoreIcons.java

示例14: load

import com.intellij.openapi.util.IconLoader; //導入方法依賴的package包/類
private static Icon load(String path) {
  return IconLoader.getIcon(path, CourseCreatorPythonIcons.class);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:4,代碼來源:CourseCreatorPythonIcons.java

示例15: load

import com.intellij.openapi.util.IconLoader; //導入方法依賴的package包/類
private static Icon load(String path) {
  return IconLoader.getIcon(path, PythonIcons.class);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:4,代碼來源:PythonIcons.java


注:本文中的com.intellij.openapi.util.IconLoader.getIcon方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。