当前位置: 首页>>代码示例>>Java>>正文


Java PresentationData.setPresentableText方法代码示例

本文整理汇总了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);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:AndroidBuildScriptNode.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:MethodSmartPointerNode.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:PsiMethodNode.java

示例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());
    }
}
 
开发者ID:PioBeat,项目名称:GravSupport,代码行数:10,代码来源:LanguageNestingNode.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:FieldSmartPointerNode.java

示例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());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:FileGroupingProjectNode.java

示例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());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:ClassTreeNode.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:PsiFieldNode.java

示例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);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:PackageElementNode.java

示例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());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:FormNode.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:35,代码来源:TodoDirNode.java

示例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());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:AbstractModuleNode.java

示例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));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:ResourceDirectoryNode.java

示例14: setPresentation

import com.intellij.ide.projectView.PresentationData; //导入方法依赖的package包/类
protected void setPresentation(PresentationData data, String name, Icon icon) {
  data.setPresentableText(name);
  data.setIcon(icon);
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:5,代码来源:StudyDirectoryNode.java

示例15: updateImpl

import com.intellij.ide.projectView.PresentationData; //导入方法依赖的package包/类
@Override
protected void updateImpl(PresentationData data) {
    data.setPresentableText(StringUtil.notNullize(getFunctionName(getValue()), "<anon>"));
}
 
开发者ID:internetisalie,项目名称:lua-for-idea,代码行数:5,代码来源:LuaFunctionNode.java


注:本文中的com.intellij.ide.projectView.PresentationData.setPresentableText方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。