blob: 8fb7fe758dec18d48c7c43c39aeb5c8925174c8c [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2008 Innoopract Informationssysteme GmbH.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Innoopract Informationssysteme GmbH - initial API and implementation
******************************************************************************/
package org.eclipse.rwt.internal.theme.css;
import org.w3c.css.sac.DocumentHandler;
public class ParserUtil {
public static void handlePropertyString( final DocumentHandler documentHandler,
final String propertyName,
final String propertyString,
final int propertyLine )
{
if( propertyString != null ) {
String trimmedString = propertyString.trim();
if( documentHandler instanceof DocumentHandlerExt ) {
int length = trimmedString.length();
if( trimmedString.charAt( length - 1 ) == ';' ) {
trimmedString = trimmedString.substring( 0, length - 1 );
}
( ( DocumentHandlerExt )documentHandler ).propertyString( propertyName,
trimmedString );
( ( DocumentHandlerExt )documentHandler ).propertyLine( propertyName,
propertyLine );
}
}
}
}