1 7 8 package org.jdesktop.jdnc.markup.attr; 9 10 import javax.swing.JMenu ; 11 12 import net.openmarkup.ApplierException; 13 import net.openmarkup.AttributeApplier; 14 import net.openmarkup.Realizable; 15 16 21 public class MenuAttributes { 22 23 public static final AttributeApplier titleApplier = new AttributeApplier() { 24 public void apply(Realizable target, String namespaceURI, 25 String attributeName, String attributeValue) 26 throws ApplierException { 27 JMenu menu = (JMenu )target.getObject(); 28 menu.setText(attributeValue); 29 } 30 }; 31 32 public static final AttributeApplier mnemonicApplier = new AttributeApplier() { 33 public void apply(Realizable target, String namespaceURI, 34 String attributeName, String attributeValue) 35 throws ApplierException { 36 JMenu menu = (JMenu )target.getObject(); 37 menu.setMnemonic(attributeValue.charAt(0)); 38 } 39 }; 40 41 public static final AttributeApplier descriptionApplier = new AttributeApplier() { 42 public void apply(Realizable target, String namespaceURI, 43 String attributeName, String attributeValue) 44 throws ApplierException { 45 JMenu menu = (JMenu )target.getObject(); 46 menu.setToolTipText(attributeValue); 47 } 48 }; 49 } 50 | Popular Tags |