// 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;
/*
 * Copyright 2008 Sun Microsystems, Inc.  All Rights Reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 only, as
 * published by the Free Software Foundation.  
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * version 2 for more details (a copy is included in the LICENSE file that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 along with this work; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
 * CA 95054 USA or visit www.sun.com if you need additional information or
 * have any questions.
 */

/* Modified by Volker Härtel, 8 Dec 2011 */ package com.sun.stylesheet.swing;



/**
 * Provides support for the <code>text-decoration</code> synthetic property.
 *
 *@author Ethan Nicholas
 */
public class TextDecorationHandler implements PropertyHandler {
    public enum Decoration { none, underline, linethrough };
    
    private static final StringBuilder TEXT_DECORATION_KEY = 
            new StringBuilder("$cssTextDecoration");
    private static final String UNDERLINE_START = "<html><!-- css --><u>";
    private static final String UNDERLINE_END = "</u>";
    private static final String LINETHROUGH_START = 
            "<html><!-- css --><strike>";
    private static final String LINETHROUGH_END = "</strike>";

// 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;

/*
 * Copyright 2008 Sun Microsystems, Inc.  All Rights Reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 only, as
 * published by the Free Software Foundation.  
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * version 2 for more details (a copy is included in the LICENSE file that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 along with this work; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
 * CA 95054 USA or visit www.sun.com if you need additional information or
 * have any questions.
 */

/* Modified by Volker Härtel, 8 Dec 2011 */ package com.sun.stylesheet.swing;



/**
 * Provides support for the <code>text-decoration</code> synthetic property.
 *
 *@author Ethan Nicholas
 */
public class TextDecorationHandler implements PropertyHandler {
    public enum Decoration { none, underline, linethrough };
    
    private static final StringBuilder TEXT_DECORATION_KEY = 
            new StringBuilder("$cssTextDecoration");
    private static final String UNDERLINE_START = "<html><!-- css --><u>";
    private static final String UNDERLINE_END = "</u>";
    private static final String LINETHROUGH_START = 
            "<html><!-- css --><strike>";
    private static final String LINETHROUGH_END = "</strike>";

    private StyleSupport styleSupport;