【问题标题】:Where can I find eclipse icons?我在哪里可以找到日食图标?
【发布时间】:2014-06-24 08:39:39
【问题描述】:

我搜索库、“.zip”-archiv 或其他简单的方法来获取所有“eclipse-icons”。我的意思是选项卡顶部的图标(错误、调试、搜索、任务等..)

有什么想法吗?

【问题讨论】:

标签: eclipse icons


【解决方案1】:

Eclipse 实际上有一个特殊的视图来显示所有可用的图标:

窗口 ▸ 显示视图 ▸ 其他... ▸ 插件开发 ▸ 插件图像浏览器

【讨论】:

    【解决方案2】:

    您想找到它们所在的插件,还是下载类似的插件?试试http://eclipse-icons.i24.cc/

    【讨论】:

    • 很遗憾,这个超级有用的网站似乎不再在线了。
    【解决方案3】:

    试试这个工具:http://www.angusj.com/resourcehacker/

    它允许您提取/更改 exe 文件中几乎任何图标/图片。

    【讨论】:

      【解决方案4】:

      我发现编写一个小程序来提取图像要容易得多。下面的代码从 Eclipse 插件目录中的 JAR 文件中提取所有 *.png。

      import java.io.File;
      import java.io.FileOutputStream;
      import java.io.IOException;
      import java.io.InputStream;
      import java.io.OutputStream;
      import java.util.Collections;
      import java.util.zip.ZipEntry;
      import java.util.zip.ZipFile;
      
      public class ExtractEclipseIcons {
      
          public static void main(String[] args) {
              String dir="C:\\eclipse\\e47dtp\\eclipse\\plugins";
      
              for (File file : new File(dir).listFiles()) {
                  if(file.getName().endsWith(".jar")) {
                      unpackImagesFromJAR(file);
                  }
              }
          }
      
          private static void unpackImagesFromJAR(File file) {
              try (ZipFile zip = new ZipFile(file)){
                  for (ZipEntry ze : Collections.list(zip.entries())) {
                      String name = ze.getName();
                      if(name.endsWith(".png")) {
                          try(InputStream in = zip.getInputStream(ze)){
                              String outname = file.getName()+"/"+name;
                              File outfile = new File("data/"+outname.replace('/', '_').replace('\\', '_'));
                              stream2File(in,outfile);
                          }
                      }
                  }
              } catch (Exception e) {
                  e.printStackTrace();
              }
      
          }
      
          public static void stream2File(InputStream is, File file) throws IOException {
              byte[] buffer = new byte[8 * 1024];
              try {
                  OutputStream output = new FileOutputStream(file);
                  try {
                      int bytesRead;
                      while ((bytesRead = is.read(buffer)) != -1) {
                          output.write(buffer, 0, bytesRead);
                      }
                  } finally {
                      output.close();
                  }
              } finally {
                  is.close();
              }
          }
      }
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2022-01-23
        • 2010-10-03
        • 1970-01-01
        • 1970-01-01
        • 2018-07-02
        • 2014-07-16
        相关资源
        最近更新 更多