-
Notifications
You must be signed in to change notification settings - Fork 8
How to create iconsets and imagesets for TG applications
homedirectory edited this page Dec 16, 2022
·
3 revisions
Often during the development of new application functionality some specific icons are required.
The following steps explain how to use newly created icons:
- All required icons should be optimized (https://jakearchibald.github.io/svgomg/ + add id="iconname") and put into one folder. It is better to change every icon id to some meaningful name by opening an icon in a text editor and correcting the id which is at the beginning.
- Copy this folder to
src/main/resources
(*-web-ui
project). - Now we should combine all icons into one iconset. To do that we can use
IronIconsetUtility
.
This is an example how to do that:
public class MenuIconsetCreator {
public static void main(final String[] args) throws IOException {
final String srcFolder= "src/main/resources/folder_with_icons_name";
final String iconsetId = "iconset-id";
final int svgWidth = 1000;
final String outputFile = "src/main/resources/iconset-file-name.js";
final IronIconsetUtility iconsetUtility = new IronIconsetUtility(iconsetId, svgWidth, srcFolder);
iconsetUtility.createSvgIconset(outputFile);
}
}
This will create a .js
iconset file in src/main/resources
.
- Now this file should be imported by
application-startup-resources.js
/* menu icons */
import '/resources/tgpsa-main-menu.js';
And now icons are ready to be used in this way: "iconset-id:iconId"
Per aspera ad astra
- Web UI Design and Web API
- Safe Communication and User Authentication
- Gitworkflow
- JavaScript: Testing with Maven
- Java Application Profiling
- TG Development Guidelines
- Full Text Search
- Deployment recipes
- JRebel Installation and Integration
- Compile-time mechanisms