Skip to content

Commit 36d4f9a

Browse files
author
Open Lowcode SAS
committed
Close #180
1 parent 5482c53 commit 36d4f9a

File tree

1 file changed

+6
-8
lines changed
  • src/org/openlowcode/client/graphic/widget

1 file changed

+6
-8
lines changed

src/org/openlowcode/client/graphic/widget/CMenu.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ public class CMenu {
3636
private String label;
3737
private ArrayList<CMenuItem> listofitems;
3838
private String icon;
39-
private static HashMap<String,ImageView> imagesperpath = new HashMap<String,ImageView>();
4039

4140
/**
4241
* create a menu from a message from the server
@@ -71,16 +70,15 @@ public CMenu(MessageReader reader, CPageSignifPath parentpath) throws OLcRemoteE
7170
*/
7271
public Menu getMenu(PageActionManager actionmanager, CPageData inputdata, Window parentwindow) {
7372
Menu menu = new Menu(label);
74-
if (icon!=null) if (icon.length()>0) {
75-
ImageView image = imagesperpath.get(icon);
76-
if (image==null) {
77-
image = new ImageView(new Image(icon));
73+
if (icon != null)
74+
if (icon.length() > 0) {
75+
ImageView image = new ImageView(new Image(icon));
7876
image.setFitHeight(16);
7977
image.setFitWidth(16);
80-
imagesperpath.put(icon, image);
78+
79+
if (image != null)
80+
menu.setGraphic(image);
8181
}
82-
if (image!=null) menu.setGraphic(image);
83-
}
8482
for (int i = 0; i < listofitems.size(); i++) {
8583
menu.getItems().add(listofitems.get(i).getMenuItem(actionmanager, inputdata, parentwindow));
8684
}

0 commit comments

Comments
 (0)