當前位置: 首頁>>代碼示例>>Java>>正文


Java PlatformIcons.DIRECTORY_CLOSED_ICON屬性代碼示例

本文整理匯總了Java中com.intellij.util.PlatformIcons.DIRECTORY_CLOSED_ICON屬性的典型用法代碼示例。如果您正苦於以下問題:Java PlatformIcons.DIRECTORY_CLOSED_ICON屬性的具體用法?Java PlatformIcons.DIRECTORY_CLOSED_ICON怎麽用?Java PlatformIcons.DIRECTORY_CLOSED_ICON使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在com.intellij.util.PlatformIcons的用法示例。


在下文中一共展示了PlatformIcons.DIRECTORY_CLOSED_ICON屬性的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getIcon

@Override
public Icon getIcon(@NotNull final PsiElement element, final int flags) {
  if (element instanceof PsiDirectory) {
    final PsiDirectory psiDirectory = (PsiDirectory)element;
    final VirtualFile vFile = psiDirectory.getVirtualFile();
    Project project = psiDirectory.getProject();
    SourceFolder sourceFolder = ProjectRootsUtil.getModuleSourceRoot(vFile, project);
    if (sourceFolder != null) {
      return SourceRootPresentation.getSourceRootIcon(sourceFolder);
    }
    else {
      Icon excludedIcon = getIconIfExcluded(project, vFile);
      return excludedIcon != null ? excludedIcon : PlatformIcons.DIRECTORY_CLOSED_ICON;
    }
  }
  return null;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:17,代碼來源:DirectoryIconProvider.java

示例2: getIcon

@Override
@Nullable
public Icon getIcon(@NotNull PsiElement element, int flags) {
  if (element instanceof PsiDirectory) {
    final PsiDirectory psiDirectory = (PsiDirectory)element;
    final VirtualFile vFile = psiDirectory.getVirtualFile();
    final Project project = psiDirectory.getProject();

    SourceFolder sourceFolder;
    Icon symbolIcon;
    if (vFile.getParent() == null && vFile.getFileSystem() instanceof ArchiveFileSystem) {
      symbolIcon = PlatformIcons.JAR_ICON;
    }
    else if (ProjectRootsUtil.isModuleContentRoot(vFile, project)) {
      Module module = ProjectRootManager.getInstance(project).getFileIndex().getModuleForFile(vFile);
      symbolIcon = module != null ? ModuleType.get(module).getIcon() : PlatformIcons.CONTENT_ROOT_ICON_CLOSED;
    }
    else if ((sourceFolder = ProjectRootsUtil.getModuleSourceRoot(vFile, project)) != null) {
      symbolIcon = SourceRootPresentation.getSourceRootIcon(sourceFolder);
    }
    else if (JavaDirectoryService.getInstance().getPackage(psiDirectory) != null) {
      symbolIcon = PlatformIcons.PACKAGE_ICON;
    }
    else if (!Registry.is("ide.hide.excluded.files") && ProjectRootManager.getInstance(project).getFileIndex().isExcluded(vFile)) {
      symbolIcon = AllIcons.Modules.ExcludeRoot;
    }
    else {
      symbolIcon = PlatformIcons.DIRECTORY_CLOSED_ICON;
    }

    return ElementBase.createLayeredIcon(element, symbolIcon, 0);
  }

  return null;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:35,代碼來源:JavaDirectoryIconProvider.java

示例3: getIconForUrl

private static Icon getIconForUrl(final String url, final boolean isValid, final boolean isJarDirectory) {
  final Icon icon;
  if (isValid) {
    VirtualFile presentableFile;
    if (isJarFileRoot(url)) {
      presentableFile = LocalFileSystem.getInstance().findFileByPath(getPresentablePath(url));
    }
    else {
      presentableFile = VirtualFileManager.getInstance().findFileByUrl(url);
    }
    if (presentableFile != null && presentableFile.isValid()) {
      if (presentableFile.getFileSystem() instanceof HttpFileSystem) {
        icon = PlatformIcons.WEB_ICON;
      }
      else {
        if (presentableFile.isDirectory()) {
          if (isJarDirectory) {
            icon = AllIcons.Nodes.JarDirectory;
          }
          else {
            icon = PlatformIcons.DIRECTORY_CLOSED_ICON;
          }
        }
        else {
          icon = IconUtilEx.getIcon(presentableFile, 0, null);
        }
      }
    }
    else {
      icon = AllIcons.Nodes.PpInvalid;
    }
  }
  else {
    icon = AllIcons.Nodes.PpInvalid;
  }
  return icon;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:37,代碼來源:ItemElement.java

示例4: getElementIcon

@Nullable
protected Icon getElementIcon(Object element) {
  if (element instanceof ModuleDescriptor) {
    return ((ModuleDescriptor)element).getModuleType().getIcon();
  }
  if (element instanceof LibraryDescriptor) {
    return PlatformIcons.LIBRARY_ICON;
  }
  if (element instanceof File) {
    final File file = (File)element;
    return file.isDirectory()? PlatformIcons.DIRECTORY_CLOSED_ICON : PlatformIcons.JAR_ICON;
  }
  return null;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:14,代碼來源:ProjectLayoutPanel.java

示例5: getIcon

@Override
public Icon getIcon(boolean expanded) {
  if (myFile.isDirectory()) {
    return PlatformIcons.DIRECTORY_CLOSED_ICON;
  }
  return FileTypeManager.getInstance().getFileTypeByFileName(myFile.getName()).getIcon();
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:7,代碼來源:FileTreeNode.java

示例6: NavBarItem

public NavBarItem(NavBarPanel panel, Object object, int idx, Disposable parent) {
  myPanel = panel;
  myUI = panel.getNavBarUI();
  myObject = object;
  myIndex = idx;
  isPopupElement = idx == -1;

  if (object != null) {
    NavBarPresentation presentation = myPanel.getPresentation();
    myText = presentation.getPresentableText(object);
    Icon icon = presentation.getIcon(object);
    myIcon = icon != null ? icon : EmptyIcon.create(5);
    myAttributes = presentation.getTextAttributes(object, false);
  }
  else {
    myText = "Sample";
    myIcon = PlatformIcons.DIRECTORY_CLOSED_ICON;
    myAttributes = SimpleTextAttributes.REGULAR_ATTRIBUTES;
  }

  Disposer.register(parent == null ? panel : parent, this);

  setOpaque(false);
  setIpad(myUI.getElementIpad(isPopupElement));

  if (!isPopupElement) {
    setMyBorder(null);
    setBorder(null);
    setPaintFocusBorder(false);
  }

  update();
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:33,代碼來源:NavBarItem.java

示例7: getIcon

@Override
public Icon getIcon(boolean isOpen) {
  return PlatformIcons.DIRECTORY_CLOSED_ICON;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:4,代碼來源:DirectoryGroupingRule.java

示例8: getIcon

@Nullable
public Icon getIcon() {
  return myFile != null ? (myFile.isDirectory() ? PlatformIcons.DIRECTORY_CLOSED_ICON : VirtualFilePresentation.getIcon(myFile)) : null;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:4,代碼來源:LocalFsFinder.java

示例9: getElementIcon

@Override
protected Icon getElementIcon(final int flags) {
  return PlatformIcons.DIRECTORY_CLOSED_ICON;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:4,代碼來源:PsiDirectoryImpl.java

示例10: getSourceRootIcon

@NotNull
private static <P extends JpsElement> Icon getSourceRootIcon(@NotNull JpsTypedModuleSourceRoot<P> root) {
  ModuleSourceRootEditHandler<P> handler = ModuleSourceRootEditHandler.getEditHandler(root.getRootType());
  return handler != null ? handler.getRootIcon(root.getProperties()) : PlatformIcons.DIRECTORY_CLOSED_ICON;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:5,代碼來源:SourceRootPresentation.java

示例11: CreateResourceDirectoryAction

public CreateResourceDirectoryAction(@Nullable ResourceFolderType resourceFolderType) {
  super(AndroidBundle.message("new.resource.dir.action.title"), AndroidBundle.message("new.resource.action.description"),
        PlatformIcons.DIRECTORY_CLOSED_ICON);
  myResourceFolderType = resourceFolderType;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:5,代碼來源:CreateResourceDirectoryAction.java


注:本文中的com.intellij.util.PlatformIcons.DIRECTORY_CLOSED_ICON屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。