// Path: com/sun/stylesheet/StylesheetException.java
// public class StylesheetException extends RuntimeException {
//     /** Creates a new <code>StylesheetException</code>. */
//     public StylesheetException() {
//     }
//     
//     
//     /** 
//      * Creates a new <code>StylesheetException</code> with the specified detail 
//      * message. 
//      *
//      *@param msg the exception's detail message
//      */
//     public StylesheetException(String msg) {
//         super(msg);
//     }
// 
//  
//     /**
//      * Creates a new <code>StylesheetException</code> with the specified cause.
//      *
//      *@param initCause the exception's initCause
//      */
//     public StylesheetException(Throwable initCause) {
//         super(initCause);
//     }
// 
// 
//     /**
//      * Creates a new <code>StylesheetException</code> with the specified detail 
//      * message and cause.
//      *
//      *@param msg the exception's detail message
//      *@param initCause the exception's initCause
//      */
//     public StylesheetException(String msg, Throwable initCause) {
//         super(msg, initCause);
//     }
// }
// 
// Path: com/sun/stylesheet/styleable/PropertyHandler.java
// public interface PropertyHandler {
//     public Class getPropertyType(Object object) throws StylesheetException;
//     
//     public Object getProperty(Object object) throws StylesheetException;
//     
//     public void setProperty(Object object, Object value) throws StylesheetException;
// }
// 
// Path: com/sun/stylesheet/styleable/StyleSupport.java
// public interface StyleSupport {
//     String getID(Object object);
//     
//     String getStyleClass(Object object);
//     
//     Class[] getObjectClasses(Object object);
//     
//     Styleable getStyleableParent(Object object);
//     
//     Styleable[] getStyleableChildren(Object object);
//     
//     Class getPropertyType(Object object, String propertyName);
//     
//     Object getProperty(Object object, String propertyName);
//     
//     void setProperty(Object object, String propertyName, Object value);
//     
//     void addPseudoclassListener(DefaultStyleable object, String pseudoclass, 
//             PseudoclassListener listener);
// 
//     void removePseudoclassListener(DefaultStyleable object, String pseudoclass, 
//             PseudoclassListener listener);
//     
//     Map<String, Object> splitCompoundProperty(Object object, String property, 
//                 Object value);
// 
//     boolean isPropertyInherited(Object object, String propertyName);
//     
//     PropertyHandler getPropertyHandler(String property);
//     
//     void addHierarchyListener(DefaultStyleable object);
// }


import javax.swing.JComponent;
import com.sun.stylesheet.StylesheetException;
import com.sun.stylesheet.styleable.PropertyHandler;
import com.sun.stylesheet.styleable.StyleSupport;
    
    public TextDecorationHandler(StyleSupport styleSupport) {
        this.styleSupport = styleSupport;
    }


    public Class getPropertyType(Object object) {
        return Decoration.class;
    }
    
    
    private String stripText(String text) {
        if (text.startsWith(UNDERLINE_START) && text.endsWith(UNDERLINE_END))
            text = text.substring(UNDERLINE_START.length(), text.length() - 
                    UNDERLINE_END.length());
        if (text.startsWith(LINETHROUGH_START) && 
                text.endsWith(LINETHROUGH_END))
            text = text.substring(LINETHROUGH_START.length(), text.length() - 
                    LINETHROUGH_END.length());
        return text;
    }
    
    
    TextHandler getTextHandler() {
        if (textHandler == null)
            textHandler = (TextHandler) styleSupport.getPropertyHandler("text");
        return textHandler;
    }


// Path: com/sun/stylesheet/StylesheetException.java
// public class StylesheetException extends RuntimeException {
//     /** Creates a new <code>StylesheetException</code>. */
//     public StylesheetException() {
//     }
//     
//     
//     /** 
//      * Creates a new <code>StylesheetException</code> with the specified detail 
//      * message. 
//      *
//      *@param msg the exception's detail message
//      */
//     public StylesheetException(String msg) {
//         super(msg);
//     }
// 
//  
//     /**
//      * Creates a new <code>StylesheetException</code> with the specified cause.
//      *
//      *@param initCause the exception's initCause
//      */
//     public StylesheetException(Throwable initCause) {
//         super(initCause);
//     }
// 
// 
//     /**
//      * Creates a new <code>StylesheetException</code> with the specified detail 
//      * message and cause.
//      *
//      *@param msg the exception's detail message
//      *@param initCause the exception's initCause
//      */
//     public StylesheetException(String msg, Throwable initCause) {
//         super(msg, initCause);
//     }
// }
// 
// Path: com/sun/stylesheet/styleable/PropertyHandler.java
// public interface PropertyHandler {
//     public Class getPropertyType(Object object) throws StylesheetException;
//     
//     public Object getProperty(Object object) throws StylesheetException;
//     
//     public void setProperty(Object object, Object value) throws StylesheetException;
// }
// 
// Path: com/sun/stylesheet/styleable/StyleSupport.java
// public interface StyleSupport {
//     String getID(Object object);
//     
//     String getStyleClass(Object object);
//     
//     Class[] getObjectClasses(Object object);
//     
//     Styleable getStyleableParent(Object object);
//     
//     Styleable[] getStyleableChildren(Object object);
//     
//     Class getPropertyType(Object object, String propertyName);
//     
//     Object getProperty(Object object, String propertyName);
//     
//     void setProperty(Object object, String propertyName, Object value);
//     
//     void addPseudoclassListener(DefaultStyleable object, String pseudoclass, 
//             PseudoclassListener listener);
// 
//     void removePseudoclassListener(DefaultStyleable object, String pseudoclass, 
//             PseudoclassListener listener);
//     
//     Map<String, Object> splitCompoundProperty(Object object, String property, 
//                 Object value);
// 
//     boolean isPropertyInherited(Object object, String propertyName);
//     
//     PropertyHandler getPropertyHandler(String property);
//     
//     void addHierarchyListener(DefaultStyleable object);
// }


// Path: com/sun/stylesheet/swing/TextDecorationHandler.java
import javax.swing.JComponent;
import com.sun.stylesheet.StylesheetException;
import com.sun.stylesheet.styleable.PropertyHandler;
import com.sun.stylesheet.styleable.StyleSupport;

    
    public TextDecorationHandler(StyleSupport styleSupport) {
        this.styleSupport = styleSupport;
    }


    public Class getPropertyType(Object object) {
        return Decoration.class;
    }
    
    
    private String stripText(String text) {
        if (text.startsWith(UNDERLINE_START) && text.endsWith(UNDERLINE_END))
            text = text.substring(UNDERLINE_START.length(), text.length() - 
                    UNDERLINE_END.length());
        if (text.startsWith(LINETHROUGH_START) && 
                text.endsWith(LINETHROUGH_END))
            text = text.substring(LINETHROUGH_START.length(), text.length() - 
                    LINETHROUGH_END.length());
        return text;
    }
    
    
    TextHandler getTextHandler() {
        if (textHandler == null)
            textHandler = (TextHandler) styleSupport.getPropertyHandler("text");
        return textHandler;
    }


    public Object getProperty(Object object) throws StylesheetException {