1 7 8 package org.jdesktop.jdnc.markup.attr; 9 10 import javax.swing.JComponent ; 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 22 public class SearchPanelAttributes { 23 public static final AttributeApplier patternFilterApplier = new AttributeApplier() { 24 public void apply(Realizable target, String namespaceURI, 25 String attributeName, String 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 namespaceURI, 33 String attributeName, String 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 namespaceURI, 41 String attributeName, String attributeValue) throws ApplierException { 42 JComponent component = (JComponent )BaseAttribute.getReferencedObject(target, attributeValue); 43 ((JXSearchPanel)target.getObject()).setTargetComponent(component); 44 } 45 }; 46 } 47 | Popular Tags |