本文整理汇总了Java中com.intellij.ide.projectView.PresentationData.setPresentableText方法的典型用法代码示例。如果您正苦于以下问题:Java PresentationData.setPresentableText方法的具体用法?Java PresentationData.setPresentableText怎么用?Java PresentationData.setPresentableText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.ide.projectView.PresentationData
的用法示例。
在下文中一共展示了PresentationData.setPresentableText方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: update
import com.intellij.ide.projectView.PresentationData; //导入方法依赖的package包/类
@Override
public void update(PresentationData data) {
super.update(data);
PsiFile psiFile = getValue();
if (psiFile == null || !psiFile.isValid()) {
return;
}
String fileName = psiFile.getName();
data.addText(fileName, SimpleTextAttributes.REGULAR_ATTRIBUTES);
data.setPresentableText(fileName);
if (myQualifier != null) {
data.addText(" (" + myQualifier + ")", SimpleTextAttributes.GRAY_ATTRIBUTES);
}
}
示例2: updateImpl
import com.intellij.ide.projectView.PresentationData; //导入方法依赖的package包/类
@Override
public void updateImpl(PresentationData data) {
String name = PsiFormatUtil.formatMethod(
(PsiMethod)getPsiElement(),
PsiSubstitutor.EMPTY, PsiFormatUtilBase.SHOW_NAME |
PsiFormatUtilBase.SHOW_TYPE |
PsiFormatUtilBase.TYPE_AFTER |
PsiFormatUtilBase.SHOW_PARAMETERS,
PsiFormatUtilBase.SHOW_TYPE
);
int c = name.indexOf('\n');
if (c > -1) {
name = name.substring(0, c - 1);
}
data.setPresentableText(name);
}
示例3: updateImpl
import com.intellij.ide.projectView.PresentationData; //导入方法依赖的package包/类
@Override
public void updateImpl(PresentationData data) {
String name = PsiFormatUtil.formatMethod(
getValue(),
PsiSubstitutor.EMPTY, PsiFormatUtilBase.SHOW_NAME |
PsiFormatUtilBase.SHOW_TYPE |
PsiFormatUtilBase.TYPE_AFTER |
PsiFormatUtilBase.SHOW_PARAMETERS,
PsiFormatUtilBase.SHOW_TYPE
);
int c = name.indexOf('\n');
if (c > -1) {
name = name.substring(0, c - 1);
}
data.setPresentableText(name);
}
示例4: update
import com.intellij.ide.projectView.PresentationData; //导入方法依赖的package包/类
public void update(PresentationData presentation) {
super.update(presentation);
if (getValue() == null) {
setValue(null);
} else {
presentation.setPresentableText("localization");
presentation.setIcon(StdFileTypes.PROPERTIES.getIcon());
}
}
示例5: updateImpl
import com.intellij.ide.projectView.PresentationData; //导入方法依赖的package包/类
@Override
public void updateImpl(PresentationData data) {
String name = PsiFormatUtil.formatVariable(
(PsiField)getPsiElement(),
PsiFormatUtilBase.SHOW_NAME | PsiFormatUtilBase.SHOW_TYPE | PsiFormatUtilBase.TYPE_AFTER | PsiFormatUtilBase.SHOW_INITIALIZER,
PsiSubstitutor.EMPTY);
int c = name.indexOf('\n');
if (c > -1) {
name = name.substring(0, c - 1);
}
data.setPresentableText(name);
}
示例6: update
import com.intellij.ide.projectView.PresentationData; //导入方法依赖的package包/类
@Override
protected void update(PresentationData presentation) {
if (myVirtualFile != null && myVirtualFile.isDirectory()) {
presentation.setIcon(AllIcons.Nodes.TreeClosed);
}
else if (myVirtualFile != null) {
presentation.setIcon(myVirtualFile.getFileType().getIcon());
}
else {
presentation.setIcon(AllIcons.FileTypes.Unknown);
}
presentation.setPresentableText(getValue().getName());
}
示例7: updateImpl
import com.intellij.ide.projectView.PresentationData; //导入方法依赖的package包/类
@Override
public void updateImpl(PresentationData data) {
final PsiClass aClass = getValue();
if (aClass != null) {
data.setPresentableText(aClass.getName());
}
}
示例8: updateImpl
import com.intellij.ide.projectView.PresentationData; //导入方法依赖的package包/类
@Override
public void updateImpl(PresentationData data) {
String name = PsiFormatUtil.formatVariable(getValue(),
PsiFormatUtilBase.SHOW_NAME | PsiFormatUtilBase.SHOW_TYPE | PsiFormatUtilBase.TYPE_AFTER | PsiFormatUtilBase.SHOW_INITIALIZER,
PsiSubstitutor.EMPTY);
int c = name.indexOf('\n');
if (c > -1) {
name = name.substring(0, c - 1);
}
data.setPresentableText(name);
}
示例9: updateValidData
import com.intellij.ide.projectView.PresentationData; //导入方法依赖的package包/类
private void updateValidData(final PresentationData presentation) {
final PackageElement value = getValue();
final PsiPackage aPackage = value.getPackage();
if (!getSettings().isFlattenPackages()
&& getSettings().isHideEmptyMiddlePackages()
&& PackageUtil.isPackageEmpty(aPackage, value.getModule(), true, isLibraryElement())) {
setValue(null);
return;
}
PsiPackage parentPackage;
Object parentValue = getParentValue();
if (parentValue instanceof PackageElement) {
parentPackage = ((PackageElement)parentValue).getPackage();
}
else {
parentPackage = null;
}
String qName = aPackage.getQualifiedName();
String name = PackageUtil.getNodeName(getSettings(), aPackage,parentPackage, qName, showFQName(aPackage));
presentation.setPresentableText(name);
presentation.setIcon(PlatformIcons.PACKAGE_ICON);
for(ProjectViewNodeDecorator decorator: Extensions.getExtensions(ProjectViewNodeDecorator.EP_NAME, myProject)) {
decorator.decorate(this, presentation);
}
}
示例10: update
import com.intellij.ide.projectView.PresentationData; //导入方法依赖的package包/类
public void update(PresentationData presentation) {
if (getValue() == null || !getValue().isValid()) {
setValue(null);
} else {
presentation.setPresentableText(getValue().getName());
presentation.setIcon(StdFileTypes.GUI_DESIGNER_FORM.getIcon());
}
}
示例11: updateImpl
import com.intellij.ide.projectView.PresentationData; //导入方法依赖的package包/类
@Override
protected void updateImpl(PresentationData data) {
super.updateImpl(data);
int fileCount = getFileCount(getValue());
if (getValue() == null || !getValue().isValid() || fileCount == 0) {
setValue(null);
return;
}
VirtualFile directory = getValue().getVirtualFile();
boolean isProjectRoot = !ProjectRootManager.getInstance(getProject()).getFileIndex().isInContent(directory);
String newName = isProjectRoot || getStructure().getIsFlattenPackages() ? getValue().getVirtualFile().getPresentableUrl() : getValue().getName();
int nameEndOffset = newName.length();
int todoItemCount = getTodoItemCount(getValue());
newName = IdeBundle.message("node.todo.group", newName, todoItemCount, fileCount);
myHighlightedRegions.clear();
TextAttributes textAttributes = new TextAttributes();
Color newColor = FileStatusManager.getInstance(getProject()).getStatus(getValue().getVirtualFile()).getColor();
if (CopyPasteManager.getInstance().isCutElement(getValue())) {
newColor = CopyPasteManager.CUT_COLOR;
}
textAttributes.setForegroundColor(newColor);
myHighlightedRegions.add(new HighlightedRegion(0, nameEndOffset, textAttributes));
EditorColorsScheme colorsScheme = UsageTreeColorsScheme.getInstance().getScheme();
myHighlightedRegions.add(
new HighlightedRegion(nameEndOffset, newName.length(), colorsScheme.getAttributes(UsageTreeColors.NUMBER_OF_USAGES)));
data.setPresentableText(newName);
}
示例12: update
import com.intellij.ide.projectView.PresentationData; //导入方法依赖的package包/类
@Override
public void update(PresentationData presentation) {
if (getValue().isDisposed()) {
setValue(null);
return;
}
presentation.setPresentableText(getValue().getName());
if (showModuleNameInBold()) {
presentation.addText(getValue().getName(), SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES);
}
presentation.setIcon(ModuleType.get(getValue()).getIcon());
}
示例13: update
import com.intellij.ide.projectView.PresentationData; //导入方法依赖的package包/类
@Override
protected void update(PresentationData presentation) {
presentation.clearText();
presentation.addText(getValue().getName(), SimpleTextAttributes.REGULAR_ATTRIBUTES);
presentation.setPresentableText(getValue().getName());
presentation.setIcon(getValue().getIcon(0));
}
示例14: setPresentation
import com.intellij.ide.projectView.PresentationData; //导入方法依赖的package包/类
protected void setPresentation(PresentationData data, String name, Icon icon) {
data.setPresentableText(name);
data.setIcon(icon);
}
示例15: updateImpl
import com.intellij.ide.projectView.PresentationData; //导入方法依赖的package包/类
@Override
protected void updateImpl(PresentationData data) {
data.setPresentableText(StringUtil.notNullize(getFunctionName(getValue()), "<anon>"));
}