本文整理匯總了Java中com.intellij.navigation.ItemPresentation.getIcon方法的典型用法代碼示例。如果您正苦於以下問題:Java ItemPresentation.getIcon方法的具體用法?Java ItemPresentation.getIcon怎麽用?Java ItemPresentation.getIcon使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.intellij.navigation.ItemPresentation
的用法示例。
在下文中一共展示了ItemPresentation.getIcon方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: updateImpl
import com.intellij.navigation.ItemPresentation; //導入方法依賴的package包/類
@Override
protected void updateImpl(PresentationData data) {
final PyElement value = getValue();
final String name = value.getName();
final ItemPresentation presentation = value.getPresentation();
String presentableText = name != null ? name : PyNames.UNNAMED_ELEMENT;
Icon presentableIcon = value.getIcon(0);
if (presentation != null) {
final String text = presentation.getPresentableText();
if (text != null) {
presentableText = text;
}
final Icon icon = presentation.getIcon(false);
if (icon != null) {
presentableIcon = icon;
}
}
data.setPresentableText(presentableText);
data.setIcon(presentableIcon);
}
示例2: create
import com.intellij.navigation.ItemPresentation; //導入方法依賴的package包/類
public static ComputableIcon create(final ItemPresentation presentation, final boolean isOpen) {
return new ComputableIcon(new Computable<Icon>() {
@Override
public Icon compute() {
return presentation.getIcon(isOpen);
}
});
}
示例3: getPresentation
import com.intellij.navigation.ItemPresentation; //導入方法依賴的package包/類
@NotNull
@Override
public ItemPresentation getPresentation() {
ItemPresentation presentation = SchemaPresentationUtil.getPresentation(element, true);
// remove location
return new StaticItemPresentation(
presentation.getPresentableText(),
null,
presentation.getIcon(false)
);
}