X-Git-Url: http://source.jalview.org/gitweb/?p=jalviewjs.git;a=blobdiff_plain;f=src%2Fjavajs%2Fswing%2FJMenuItem.java;fp=src%2Fjavajs%2Fswing%2FJMenuItem.java;h=643da954dacee50766691315e2a92cd1258b62bd;hp=3df1a149adc5723cdd7da19ef5571572b6678cf0;hb=b9b7a352eee79b7764c3b09c9d19663075061d8c;hpb=7301a2415adab88038b291fc54caeeb3a5a47a44 diff --git a/src/javajs/swing/JMenuItem.java b/src/javajs/swing/JMenuItem.java index 3df1a14..643da95 100644 --- a/src/javajs/swing/JMenuItem.java +++ b/src/javajs/swing/JMenuItem.java @@ -1,46 +1,46 @@ -package javajs.swing; - -public class JMenuItem extends AbstractButton { - - public final int btnType; - - public static final int TYPE_SEPARATOR = 0; - public static final int TYPE_BUTTON = 1; - public static final int TYPE_CHECKBOX = 2; - public static final int TYPE_RADIO = 3; - public static final int TYPE_MENU = 4; - - - public JMenuItem(String text) { - super("btn"); - setText(text); - btnType = (text == null ? 0 : 1); - } - - public JMenuItem(String type, int i) { - super(type); - btnType = i; - } - - @Override - public String toHTML() { - return htmlMenuOpener("li") - + (text == null ? "" : "" + htmlLabel() + "") + ""; - } - - @Override - protected String getHtmlDisabled() { - return " class=\"ui-state-disabled\""; - } - - private String htmlLabel() { - return (btnType == TYPE_BUTTON ? text - : ""); - } - - -} +package javajs.swing; + +public class JMenuItem extends AbstractButton { + + public final int btnType; + + public static final int TYPE_SEPARATOR = 0; + public static final int TYPE_BUTTON = 1; + public static final int TYPE_CHECKBOX = 2; + public static final int TYPE_RADIO = 3; + public static final int TYPE_MENU = 4; + + + public JMenuItem(String text) { + super("btn"); + setText(text); + btnType = (text == null ? 0 : 1); + } + + public JMenuItem(String type, int i) { + super(type); + btnType = i; + } + + @Override + public String toHTML() { + return htmlMenuOpener("li") + + (text == null ? "" : "" + htmlLabel() + "") + ""; + } + + @Override + protected String getHtmlDisabled() { + return " class=\"ui-state-disabled\""; + } + + private String htmlLabel() { + return (btnType == TYPE_BUTTON ? text + : ""); + } + + +}