View Javadoc
1   package com.jsql.view.swing.menubar;
2   
3   import com.jsql.view.swing.util.UiUtil;
4   import org.apache.commons.lang3.SystemUtils;
5   
6   import javax.swing.*;
7   
8   public class JMenuItemWithMargin extends JMenuItem {
9   
10      public JMenuItemWithMargin() {
11          this.setMargin();
12      }
13  
14      public JMenuItemWithMargin(String valueByKey, char c) {
15          
16          super(valueByKey, c);
17          this.setMargin();
18      }
19      
20      public JMenuItemWithMargin(String valueByKey) {
21          
22          super(valueByKey);
23          this.setMargin();
24      }
25  
26      public JMenuItemWithMargin(Action action) {
27  
28          super(action);
29          this.setMargin();
30      }
31  
32      private void setMargin() {
33          
34          // Menu item on Mac has enough margin
35          if (!SystemUtils.IS_OS_MAC) {
36              this.setIcon(UiUtil.ICON_EMPTY);
37          }
38      }
39  }