IconUtil.getGlyphIcon

Hello,

I see you guys have a method to return GlyphIcons in the SDK. I’m wondering if you guys have any kind of guide/documentation on what these Glyph Icon numbers/names correspond to? I’m hoping I can reuse some of the Icons you guys already have in your designer :slight_smile:

Java Doc Link

IconUtil is probably not the class to use. I would start with the static methods on VectorIcons. I think you should be able to run the main method on that class, which will open a dialog showing our built in icons.

1 Like

If I wanted to add my own custom svg icons into a .json file like you guys are doing with that class, what format do I need to convert those into?

It’s pretty rudimentary; a truncated example:

[
  {
    "name": "session",
    "paths": [
      "M14.25,3.53l-5.5,-3.17c-0.463542,-0.270029 ..."
    ]
  },
  {
    "name": "page",
    "paths": [
      "M14.5,1c0.276142,0 ..."
    ]
  }
]

I am also trying to see the built-in Icons, and I am running into some problems doing this.

Am I missing something on this command?

java -cp './client-api-8.0.5.jar' com.inductiveautomation.ignition.client.icons.VectorIcons 

I am getting an issue with some other potential libraries missing, is there an easier way to execute the main method on that class?

Exception in thread "main" java.lang.NoClassDefFoundError: com/inductiveautomation/ignition/common/gson/JsonParser
        at com.inductiveautomation.ignition.client.icons.VectorIcons.init(VectorIcons.java:65)
        at com.inductiveautomation.ignition.client.icons.VectorIcons.<clinit>(VectorIcons.java:43)
Caused by: java.lang.ClassNotFoundException: com.inductiveautomation.ignition.common.gson.JsonParser
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
        ... 2 more

From within an IDE that knows about all of the dependencies. In a project that targets Vision Client scope (that’s what client-api is for). You are unlikely to easily succeed on the command line.

Darn! I use VSCode as my typical IDE, sounds like I am going to need to open up Eclipse for this one… lol

You are trying to use VSCode for module development? And your fallback is Eclipse?

Masochist.

IntelliJ for the win! (Says the guy who dug in his heels for years before switching.)

2 Likes

Has surprisingly worked pretty well, but I won’t act like an expert in module development here, so I am sure there is stuff I am missing.

I’ll try this out instead, since I didnt even have Eclipse installed lol

+1 for IntelliJ
I’m not sure how I would be able to function without the bytecode decompiler.