KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * $Id: SearchPanelAttributes.java,v 1.2 2004/07/28 21:21:18 aim 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.JComponent JavaDoc;
11
12 import org.jdesktop.swing.JXSearchPanel;
13 import org.jdesktop.swing.decorator.PatternFilter;
14 import org.jdesktop.swing.decorator.PatternHighlighter;
15 import net.openmarkup.ApplierException;
16 import net.openmarkup.AttributeApplier;
17 import net.openmarkup.Realizable;
18
19 /**
20  * @author Ramesh Gupta
21  */

22 public class SearchPanelAttributes {
23     public static final AttributeApplier patternFilterApplier = new AttributeApplier() {
24         public void apply(Realizable target, String JavaDoc namespaceURI,
25                           String JavaDoc attributeName, String JavaDoc attributeValue) throws ApplierException {
26             PatternFilter filter = (PatternFilter)BaseAttribute.getReferencedObject(target, attributeValue);
27             ((JXSearchPanel)target.getObject()).setPatternFilter(filter);
28         }
29     };
30
31     public static final AttributeApplier patternHighlighterApplier = new AttributeApplier() {
32         public void apply(Realizable target, String JavaDoc namespaceURI,
33                           String JavaDoc attributeName, String JavaDoc attributeValue) throws ApplierException {
34             PatternHighlighter highlighter = (PatternHighlighter)BaseAttribute.getReferencedObject(target, attributeValue);
35             ((JXSearchPanel)target.getObject()).setPatternHighlighter(highlighter);
36         }
37     };
38
39     public static final AttributeApplier targetApplier = new AttributeApplier() {
40         public void apply(Realizable target, String JavaDoc namespaceURI,
41                           String JavaDoc attributeName, String JavaDoc attributeValue) throws ApplierException {
42             JComponent JavaDoc component = (JComponent JavaDoc)BaseAttribute.getReferencedObject(target, attributeValue);
43             ((JXSearchPanel)target.getObject()).setTargetComponent(component);
44         }
45     };
46 }
47
Popular Tags