1 7 8 package org.jdesktop.jdnc.markup.attr; 9 10 import javax.swing.JSplitPane ; 11 12 import net.openmarkup.ApplierException; 13 import net.openmarkup.AttributeApplier; 14 import net.openmarkup.Realizable; 15 16 17 20 public class SplitPaneAttributes { 21 22 23 public static final AttributeApplier orientationApplier = new AttributeApplier() { 24 public void apply(Realizable target, String namespaceURI, 25 String attributeName, String attributeValue) 26 throws ApplierException { 27 JSplitPane splitPane = (JSplitPane ) target.getObject(); 28 if (attributeValue.equals("vertical")) { 29 splitPane.setOrientation(JSplitPane.VERTICAL_SPLIT); 30 } else if (attributeValue.equals("horizontal")) { 31 splitPane.setOrientation(JSplitPane.HORIZONTAL_SPLIT); 32 } else { 33 34 System.out.println("unsupported orientation value="+attributeValue); 35 } 36 } 37 }; 38 39 40 } 42 | Popular Tags |