KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jdesktop > jdnc > markup > attr > SplitPaneAttributes


1 /*
2  * $Id: SplitPaneAttributes.java,v 1.1.1.1 2004/06/16 01:43:40 davidson1 Exp $
3  *
4  * Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle,
5  * Santa Clara, California 95054, U.S.A. All rights reserved.
6  */

7
8 package org.jdesktop.jdnc.markup.attr;
9
10 import javax.swing.JSplitPane JavaDoc;
11
12 import net.openmarkup.ApplierException;
13 import net.openmarkup.AttributeApplier;
14 import net.openmarkup.Realizable;
15
16
17 /**
18  * @author Amy Fowler
19  */

20 public class SplitPaneAttributes {
21
22
23     public static final AttributeApplier orientationApplier = new AttributeApplier() {
24         public void apply(Realizable target, String JavaDoc namespaceURI,
25                           String JavaDoc attributeName, String JavaDoc attributeValue)
26             throws ApplierException {
27             JSplitPane JavaDoc splitPane = (JSplitPane JavaDoc) 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                 /**@todo aim: real error handling */
34                 System.out.println("unsupported orientation value="+attributeValue);
35             }
36         }
37     };
38
39
40      // ...
41
}
42
Popular Tags