• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java CellAppearanceEx类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.intellij.openapi.roots.ui.CellAppearanceEx的典型用法代码示例。如果您正苦于以下问题:Java CellAppearanceEx类的具体用法?Java CellAppearanceEx怎么用?Java CellAppearanceEx使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CellAppearanceEx类属于com.intellij.openapi.roots.ui包,在下文中一共展示了CellAppearanceEx类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: forNodeDescriptorInTree

import com.intellij.openapi.roots.ui.CellAppearanceEx; //导入依赖的package包/类
public static CellAppearanceEx forNodeDescriptorInTree(Object node, boolean expanded) {
  NodeDescriptor descriptor = getNodeDescriptor(node);
  if (descriptor == null) return FileAppearanceService.getInstance().empty();
  String name = descriptor.toString();
  Object psiElement = descriptor.getElement();
  ModifiableCellAppearanceEx result;
  if (psiElement instanceof PsiElement && !((PsiElement)psiElement).isValid()) {
    result = CompositeAppearance.single(name);
  }
  else {
    PsiClass psiClass = getContainingClass(psiElement);
    if (isInheritedMember(node, psiClass) && psiClass != null) {
      CompositeAppearance.DequeEnd ending = new CompositeAppearance().getEnding();
      ending.addText(name, applyDeprecation(psiElement, SimpleTextAttributes.DARK_TEXT));
      ending.addComment(psiClass.getName(), applyDeprecation(psiClass, SimpleTextAttributes.GRAY_ATTRIBUTES));
      result = ending.getAppearance();
    }
    else {
      SimpleTextAttributes textAttributes = applyDeprecation(psiElement, SimpleTextAttributes.REGULAR_ATTRIBUTES);
      result = CompositeAppearance.single(name, textAttributes);
    }
  }

  result.setIcon(descriptor.getIcon());
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:StructureNodeRenderer.java


示例2: init

import com.intellij.openapi.roots.ui.CellAppearanceEx; //导入依赖的package包/类
/**
 * Initialize components
 */
private void init() {
  myTree.setCellRenderer(new ColoredTreeCellRenderer() {
    @Override
    public void customizeCellRenderer(JTree tree,
                                      Object value,
                                      boolean selected,
                                      boolean expanded,
                                      boolean leaf,
                                      int row,
                                      boolean hasFocus) {
      //if(getBackground() == null) {
      //  setBackground(UIUtil.getTreeTextBackground());
      //}
      if (value instanceof MyNode && !(value instanceof MyRootNode)) {
        final MyNode node = (MyNode)value;
        PathNode<?> n = (PathNode<?>)node.getUserObject();
        CellAppearanceEx a = n.getAppearance(selected, node.isDisplayInBold());
        a.customize(this);
      }
    }
  });
  myTree.setShowsRootHandles(false);
  myTree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
  reloadTree();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:29,代码来源:AnalyzeDependenciesComponent.java


示例3: customizeCellRenderer

import com.intellij.openapi.roots.ui.CellAppearanceEx; //导入依赖的package包/类
@Override
public void customizeCellRenderer(JTree tree,
                                  Object value,
                                  boolean selected,
                                  boolean expanded,
                                  boolean leaf,
                                  int row,
                                  boolean hasFocus) {
  DefaultMutableTreeNode n = (DefaultMutableTreeNode)value;
  final Object userObject = n.getUserObject();
  if (!(userObject instanceof ModuleDependenciesAnalyzer.OrderPathElement)) {
    return;
  }
  ModuleDependenciesAnalyzer.OrderPathElement e = (ModuleDependenciesAnalyzer.OrderPathElement)userObject;
  final CellAppearanceEx appearance = e.getAppearance(selected);
  appearance.customize(this);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:AnalyzeDependenciesComponent.java


示例4: getCellAppearance

import com.intellij.openapi.roots.ui.CellAppearanceEx; //导入依赖的package包/类
@NotNull
private static CellAppearanceEx getCellAppearance(@NotNull final ModuleDependenciesTableItem item) {
  BuildFileStatement entry = item.getEntry();
  String data = "";
  Icon icon = null;
  if (entry instanceof Dependency) {
    Dependency dependency = (Dependency)entry;
    data = dependency.getValueAsString();
    //noinspection EnumSwitchStatementWhichMissesCases
    switch (dependency.type) {
      case EXTERNAL:
        icon = AndroidIcons.MavenLogo;
        break;
      case FILES:
        icon = PlatformIcons.LIBRARY_ICON;
        break;
      case MODULE:
        icon = AllIcons.Nodes.Module;
        break;
    }
  } else if (entry != null) {
    data = entry.toString();
  }
  return SimpleTextCellAppearance.regular(data, icon);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:ModuleDependenciesPanel.java


示例5: ProjectLibraryTabContext

import com.intellij.openapi.roots.ui.CellAppearanceEx; //导入依赖的package包/类
public ProjectLibraryTabContext(final ClasspathPanel classpathPanel, StructureConfigurableContext context) {
  super(classpathPanel, context);

  StructureLibraryTableModifiableModelProvider projectLibrariesProvider = context.getProjectLibrariesProvider();
  Library[] libraries = projectLibrariesProvider.getModifiableModel().getLibraries();
  final Condition<Library> condition = LibraryEditingUtil.getNotAddedLibrariesCondition(myClasspathPanel.getRootModel());

  myItems = ContainerUtil.filter(libraries, condition);
  ContainerUtil.sort(myItems, new Comparator<Library>() {
    @Override
    public int compare(Library o1, Library o2) {
      return StringUtil.compare(o1.getName(), o2.getName(), false);
    }
  });

  myLibraryList = new JBList(myItems);
  myLibraryList.setCellRenderer(new ColoredListCellRendererWrapper<Library>() {
    @Override
    protected void doCustomize(JList list, Library value, int index, boolean selected, boolean hasFocus) {
      final CellAppearanceEx appearance = OrderEntryAppearanceService.getInstance().forLibrary(classpathPanel.getProject(), value, false);

      appearance.customize(this);
    }
  });
  new ListSpeedSearch(myLibraryList);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:27,代码来源:ProjectLibraryTabContext.java


示例6: getAppearance

import com.intellij.openapi.roots.ui.CellAppearanceEx; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public CellAppearanceEx getAppearance(boolean selected, final boolean isBold) {
  return new CellAppearanceEx() {
    @Override
    public void customize(@NotNull SimpleColoredComponent component) {
      component.setIcon(getIcon());
      final Font font = UIUtil.getTreeFont();
      if (isBold) {
        component.setFont(font.deriveFont(Font.BOLD));
      }
      else {
        component.setFont(font.deriveFont(Font.PLAIN));
      }
      final String p = PathUtil.toPresentableUrl(getEditableObject().url());
      component.append(PathUtil.getFileName(p),
                       isBold ? SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES : SimpleTextAttributes.REGULAR_ATTRIBUTES);
      component.append(" (" + PathUtil.getParentPath(p) + ")", SimpleTextAttributes.GRAYED_ATTRIBUTES);
    }

    @Override
    public void customize(@NotNull final HtmlListCellRenderer renderer) {
      throw new UnsupportedOperationException("Rendering in combo box not supported yet.");
    }

    @NotNull
    @Override
    public String getText() {
      return getDisplayName();
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:35,代码来源:AnalyzeDependenciesComponent.java


示例7: getCellAppearance

import com.intellij.openapi.roots.ui.CellAppearanceEx; //导入依赖的package包/类
static CellAppearanceEx getCellAppearance(final ClasspathTableItem<?> item,
                                          final StructureConfigurableContext context,
                                          final boolean selected) {
  final OrderEntryAppearanceService service = OrderEntryAppearanceService.getInstance();
  if (item instanceof InvalidJdkItem) {
    return service.forJdk(null, false, selected, true);
  }
  else {
    final OrderEntry entry = item.getEntry();
    assert entry != null : item;
    return service.forOrderEntry(context.getProject(), entry, selected);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:ClasspathPanelImpl.java


示例8: LibraryDescriptor

import com.intellij.openapi.roots.ui.CellAppearanceEx; //导入依赖的package包/类
protected LibraryDescriptor(final Project project, final NodeDescriptor parentDescriptor, final Library element) {
  super(project, parentDescriptor, element);
  final CellAppearanceEx appearance = OrderEntryAppearanceService.getInstance().forLibrary(project, element, false);
  final SimpleColoredComponent coloredComponent = new SimpleColoredComponent();
  appearance.customize(coloredComponent);
  final PresentationData templatePresentation = getTemplatePresentation();
  templatePresentation.setIcon(coloredComponent.getIcon());
  templatePresentation.addText(notEmpty(appearance.getText()), SimpleTextAttributes.REGULAR_ATTRIBUTES);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:ChooseLibrariesDialogBase.java


示例9: getAppearance

import com.intellij.openapi.roots.ui.CellAppearanceEx; //导入依赖的package包/类
public CellAppearanceEx getAppearance() {
  CellAppearanceEx appearance = FileAppearanceService.getInstance().forIoFile(myDir);
  if (appearance instanceof ModifiableCellAppearanceEx) {
    ((ModifiableCellAppearanceEx)appearance).setIcon(AllIcons.Nodes.JarDirectory);
  }
  return appearance;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:AllJarsUnderDirEntry.java


示例10: getCellAppearance

import com.intellij.openapi.roots.ui.CellAppearanceEx; //导入依赖的package包/类
private static CellAppearanceEx getCellAppearance(final ClasspathTableItem<?> item,
                                                  final StructureConfigurableContext context,
                                                  final boolean selected) {
  final OrderEntryAppearanceService service = OrderEntryAppearanceService.getInstance();
  if (item instanceof InvalidJdkItem) {
    return service.forJdk(null, false, selected, true);
  }
  else {
    final OrderEntry entry = item.getEntry();
    assert entry != null : item;
    return service.forOrderEntry(context.getProject(), entry, selected);
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:14,代码来源:ClasspathPanelImpl.java


示例11: getCellAppearance

import com.intellij.openapi.roots.ui.CellAppearanceEx; //导入依赖的package包/类
@NotNull
@Override
public CellAppearanceEx getCellAppearance(@NotNull DotNetLibraryOrderEntryImpl dotNetLibraryOrderEntry)
{
	ModuleRootLayerImpl moduleRootLayer = dotNetLibraryOrderEntry.getModuleRootLayer();

	DotNetSimpleModuleExtension extension = moduleRootLayer.getExtension(DotNetSimpleModuleExtension.class);

	ModuleExtensionProviderEP providerEP = extension == null ? null : ModuleExtensionProviders.findProvider(extension.getId());

	return SimpleTextCellAppearance.synthetic(dotNetLibraryOrderEntry.getPresentableName(), providerEP == null ? AllIcons.Toolbar.Unknown :
			providerEP.getIcon());
}
 
开发者ID:consulo,项目名称:consulo-dotnet,代码行数:14,代码来源:DotNetLibraryOrderEntryTypeEditor.java


示例12: getCellAppearance

import com.intellij.openapi.roots.ui.CellAppearanceEx; //导入依赖的package包/类
@Nonnull
@Override
public CellAppearanceEx getCellAppearance(@Nonnull ModuleExtensionWithSdkOrderEntryImpl orderEntry) {
  Sdk sdk = orderEntry.getSdk();
  return new SimpleTextCellAppearance(orderEntry.getPresentableName(), SdkUtil.getIcon(sdk),
                                      sdk == null ? SimpleTextAttributes.ERROR_ATTRIBUTES : SimpleTextAttributes.SYNTHETIC_ATTRIBUTES);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:8,代码来源:ModuleExtensionWithSdkOrderEntryTypeEditor.java


示例13: getCellAppearance

import com.intellij.openapi.roots.ui.CellAppearanceEx; //导入依赖的package包/类
@Nonnull
@Override
public CellAppearanceEx getCellAppearance(@Nonnull ModuleLibraryOrderEntryImpl orderEntry) {
  if (!orderEntry.isValid()) { //library can be removed
    return FileAppearanceService.getInstance().forInvalidUrl(orderEntry.getPresentableName());
  }
  Library library = orderEntry.getLibrary();
  assert library != null : orderEntry;
  return OrderEntryAppearanceService.getInstance().forLibrary(orderEntry.getModuleRootLayer().getProject(), library,
                                                              !((LibraryEx)library).getInvalidRootUrls(BinariesOrderRootType.getInstance()).isEmpty());
}
 
开发者ID:consulo,项目名称:consulo,代码行数:12,代码来源:ModuleLibraryOrderEntryTypeEditor.java


示例14: getCellAppearance

import com.intellij.openapi.roots.ui.CellAppearanceEx; //导入依赖的package包/类
@Nonnull
@Override
public CellAppearanceEx getCellAppearance(@Nonnull LibraryOrderEntryImpl orderEntry) {
  if (!orderEntry.isValid()) { //library can be removed
    return FileAppearanceService.getInstance().forInvalidUrl(orderEntry.getPresentableName());
  }
  Library library = orderEntry.getLibrary();
  assert library != null : orderEntry;
  return OrderEntryAppearanceService.getInstance().forLibrary(orderEntry.getModuleRootLayer().getProject(), library,
                                                              !((LibraryEx)library).getInvalidRootUrls(BinariesOrderRootType.getInstance()).isEmpty());
}
 
开发者ID:consulo,项目名称:consulo,代码行数:12,代码来源:LibraryOrderEntryTypeEditor.java


示例15: getAppearance

import com.intellij.openapi.roots.ui.CellAppearanceEx; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public CellAppearanceEx getAppearance(boolean selected, final boolean isBold) {
  return new CellAppearanceEx() {
    @Override
    public void customize(@Nonnull SimpleColoredComponent component) {
      component.setIcon(getIcon());
      final Font font = UIUtil.getTreeFont();
      if (isBold) {
        component.setFont(font.deriveFont(Font.BOLD));
      }
      else {
        component.setFont(font.deriveFont(Font.PLAIN));
      }
      final String p = PathUtil.toPresentableUrl(getEditableObject().url());
      component.append(PathUtil.getFileName(p),
                       isBold ? SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES : SimpleTextAttributes.REGULAR_ATTRIBUTES);
      component.append(" (" + PathUtil.getParentPath(p) + ")", SimpleTextAttributes.GRAYED_ATTRIBUTES);
    }

    @Override
    public void customize(@Nonnull final HtmlListCellRenderer renderer) {
      throw new UnsupportedOperationException("Rendering in combo box not supported yet.");
    }

    @Nonnull
    @Override
    public String getText() {
      return getDisplayName();
    }
  };
}
 
开发者ID:consulo,项目名称:consulo,代码行数:35,代码来源:AnalyzeDependenciesComponent.java


示例16: update

import com.intellij.openapi.roots.ui.CellAppearanceEx; //导入依赖的package包/类
@Override
public void update(PresentationData presentation) {
  presentation.setPresentableText(getValue().getName());
  final OrderEntry orderEntry = getValue().getOrderEntry();

  if (orderEntry instanceof ModuleExtensionWithSdkOrderEntry) {
    final ModuleExtensionWithSdkOrderEntry sdkOrderEntry = (ModuleExtensionWithSdkOrderEntry)orderEntry;
    final Sdk sdk = sdkOrderEntry.getSdk();
    presentation.setIcon(SdkUtil.getIcon(((ModuleExtensionWithSdkOrderEntry)orderEntry).getSdk()));
    if (sdk != null) { //jdk not specified
      final String path = sdk.getHomePath();
      if (path != null) {
        presentation.setLocationString(FileUtil.toSystemDependentName(path));
      }
    }
    presentation.setTooltip(null);
  }
  else if (orderEntry instanceof LibraryOrderEntry) {
    presentation.setIcon(getIconForLibrary(orderEntry));
    presentation.setTooltip(StringUtil.capitalize(IdeBundle.message("node.projectview.library", ((LibraryOrderEntry)orderEntry).getLibraryLevel())));
  }
  else if(orderEntry instanceof OrderEntryWithTracking) {
    Icon icon = null;
    CellAppearanceEx cellAppearance = OrderEntryAppearanceService.getInstance().forOrderEntry(orderEntry);
    if(cellAppearance instanceof ModifiableCellAppearanceEx) {
      icon = ((ModifiableCellAppearanceEx)cellAppearance).getIcon();
    }
    presentation.setIcon(icon == null ? AllIcons.Toolbar.Unknown : icon);
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:31,代码来源:NamedLibraryElementNode.java


示例17: getAppearance

import com.intellij.openapi.roots.ui.CellAppearanceEx; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@NotNull
@Override
public CellAppearanceEx getAppearance(boolean isSelected) {
  return OrderEntryAppearanceService.getInstance().forOrderEntry(myEntry.getOwnerModule().getProject(), myEntry, isSelected);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:ModuleDependenciesAnalyzer.java


示例18: getCellAppearance

import com.intellij.openapi.roots.ui.CellAppearanceEx; //导入依赖的package包/类
@NotNull
public CellAppearanceEx getCellAppearance() {
  return myCellAppearance;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:TableItem.java


示例19: getHighlightedText

import com.intellij.openapi.roots.ui.CellAppearanceEx; //导入依赖的package包/类
public CellAppearanceEx getHighlightedText() {
  return myHighlightedText;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:AntTargetNodeDescriptor.java


示例20: getAppearance

import com.intellij.openapi.roots.ui.CellAppearanceEx; //导入依赖的package包/类
public CellAppearanceEx getAppearance() {
  return FileAppearanceService.getInstance().forIoFile(myFile);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:SinglePathEntry.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java BooleanLiteralImpl类代码示例发布时间:2022-05-22
下一篇:
Java PanHandlerFX类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap