Skip to content

Commit

Permalink
Merge pull request #4269 from kwvanderlinde/bugfix/4268-fix-error-on-…
Browse files Browse the repository at this point in the history
…missing-classic-icons

Fix table import/export buttons with classic icons.
  • Loading branch information
cwisniew authored Aug 30, 2023
2 parents d335783 + a9acbc9 commit 35b62ea
Showing 1 changed file with 24 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ public class RessourceManager {
new HashMap<>() {
{
// This icons don't exist in classic.
put(Icons.ACTION_EXPORT, "");
put(Icons.ACTION_IMPORT, "");
put(Icons.PROPERTIES_TABLE_ALPHABETIC, "");
put(Icons.PROPERTIES_TABLE_CATEGORIES, "");
put(Icons.PROPERTIES_TABLE_COLLAPSE, "");
put(Icons.PROPERTIES_TABLE_EXPAND, "");
put(Icons.PROPERTIES_TABLE_HIDE_DESCRIPTION, "");
put(Icons.ACTION_EXPORT, null);
put(Icons.ACTION_IMPORT, null);
put(Icons.PROPERTIES_TABLE_ALPHABETIC, null);
put(Icons.PROPERTIES_TABLE_CATEGORIES, null);
put(Icons.PROPERTIES_TABLE_COLLAPSE, null);
put(Icons.PROPERTIES_TABLE_EXPAND, null);
put(Icons.PROPERTIES_TABLE_HIDE_DESCRIPTION, null);

put(Icons.ACTION_CANCEL, IMAGE_DIR + "cancel_sm.png");
put(Icons.ACTION_CLOSE, IMAGE_DIR + "collapse.png");
Expand Down Expand Up @@ -509,6 +509,8 @@ private static <KEY, CACHEKEY, RESULT> RESULT getFromHashMapsAndCache(
for (var map : maps) {
if (map.containsKey(key)) {
ressourcePath = map.get(key);
}
if (ressourcePath != null) {
break;
}
}
Expand Down Expand Up @@ -544,22 +546,34 @@ private static void checkMissingIcons(

public static void checkMissingFiles() {
String basedir = "C:\\Users\\tkunze\\Source\\maptool\\src\\main\\resources\\";
for (String value : Set.copyOf(images.values())) {
for (String value : images.values()) {
if (value == null) {
continue;
}

var source = Path.of(basedir, value);
var target = Path.of(basedir, IMAGE_DIR, "images", source.getFileName().toString());

if (Files.notExists(source)) {
System.out.println(value + " is missing!");
}
}
for (String value : Set.copyOf(classicIcons.values())) {
for (String value : classicIcons.values()) {
if (value == null) {
continue;
}

var source = Path.of(basedir, value);

if (Files.notExists(source)) {
System.out.println(value + " is missing!");
}
}
for (String value : Set.copyOf(rodIcons.values())) {
for (String value : rodIcons.values()) {
if (value == null) {
continue;
}

var source = Path.of(basedir, value);

if (Files.notExists(source)) {
Expand Down

0 comments on commit 35b62ea

Please sign in to comment.