本文整理匯總了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;
}
示例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;
}
}
示例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);
}
}
示例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;
}
示例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);
}
}
示例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;
}
}
示例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());
}
示例8: intellijLoad
import com.intellij.openapi.util.IconLoader; //導入方法依賴的package包/類
private static Icon intellijLoad(String path) {
return IconLoader.getIcon(path, AllIcons.class);
}
示例9: load
import com.intellij.openapi.util.IconLoader; //導入方法依賴的package包/類
private static Icon load(String path) {
return IconLoader.getIcon(path, Icons.class);
}
示例10: load
import com.intellij.openapi.util.IconLoader; //導入方法依賴的package包/類
private static Icon load(String path) {
return IconLoader.getIcon(path, SourcetrailIcons.class);
}
示例11: getSlackIcon
import com.intellij.openapi.util.IconLoader; //導入方法依賴的package包/類
public static Icon getSlackIcon() {
return IconLoader.getIcon("/icons/slack.png");
}
示例12: GoogleTranslation
import com.intellij.openapi.util.IconLoader; //導入方法依賴的package包/類
public GoogleTranslation() {
super(IconLoader.getIcon("/icons/translate.png"));
}
示例13: load
import com.intellij.openapi.util.IconLoader; //導入方法依賴的package包/類
private static Icon load(String path) {
return IconLoader.getIcon(path, EducationalCoreIcons.class);
}
示例14: load
import com.intellij.openapi.util.IconLoader; //導入方法依賴的package包/類
private static Icon load(String path) {
return IconLoader.getIcon(path, CourseCreatorPythonIcons.class);
}
示例15: load
import com.intellij.openapi.util.IconLoader; //導入方法依賴的package包/類
private static Icon load(String path) {
return IconLoader.getIcon(path, PythonIcons.class);
}