当前位置: 首页>>代码示例>>Java>>正文


Java CSSValue.getCssText方法代码示例

本文整理汇总了Java中org.w3c.dom.css.CSSValue.getCssText方法的典型用法代码示例。如果您正苦于以下问题:Java CSSValue.getCssText方法的具体用法?Java CSSValue.getCssText怎么用?Java CSSValue.getCssText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.w3c.dom.css.CSSValue的用法示例。


在下文中一共展示了CSSValue.getCssText方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: isNullValue

import org.w3c.dom.css.CSSValue; //导入方法依赖的package包/类
protected boolean isNullValue( CSSValue value )
{
	if ( value == null )
	{
		return true;
	}

	if ( value instanceof DataFormatValue )
	{
		return true;
	}

	if ( value instanceof FloatValue )
	{
		return false;
	}
	String cssText = value.getCssText( );
	return "none".equalsIgnoreCase( cssText ) //$NON-NLS-1$
			|| "transparent".equalsIgnoreCase( cssText ); //$NON-NLS-1$
}
 
开发者ID:eclipse,项目名称:birt,代码行数:21,代码来源:OdtEmitter.java

示例2: isNullValue

import org.w3c.dom.css.CSSValue; //导入方法依赖的package包/类
private boolean isNullValue( CSSValue value )
{
	if ( value == null )
	{
		return true;
	}

	if ( value instanceof DataFormatValue )
	{
		return true;
	}

	String cssText = value.getCssText( );
	return "none".equalsIgnoreCase( cssText )
			|| "transparent".equalsIgnoreCase( cssText );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:17,代码来源:ReportletBodyExecutor.java

示例3: isNullValue

import org.w3c.dom.css.CSSValue; //导入方法依赖的package包/类
protected boolean isNullValue( CSSValue value )
{
	if ( value == null )
	{
		return true;
	}

	if ( value instanceof DataFormatValue )
	{
		return true;
	}

	if ( value instanceof FloatValue )
	{
		return false;
	}
	String cssText = value.getCssText( );
	return "none".equalsIgnoreCase( cssText )
			|| "transparent".equalsIgnoreCase( cssText );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:21,代码来源:AbstractEmitterImpl.java

示例4: cleanupQuotes

import org.w3c.dom.css.CSSValue; //导入方法依赖的package包/类
/**
 * Remove quotes surrounding a string.
 * @param family
 * The string that may be surrounded by double quotes.
 * @return
 * family, without any surrounding double quotes.
 */
private static String cleanupQuotes( CSSValue value ) {
	if( value == null ) {
		return null;
	} 

	if( value instanceof ListValue ){
		ListValue listValue = (ListValue)value;
		if( listValue.getLength() > 0 ) {
			value = listValue.item(0);
		}
	}
	
	String stringValue = ( value instanceof StringValue ? ((StringValue)value).getStringValue() : value.getCssText() );
	if( ( stringValue == null ) || stringValue.isEmpty() ) {
		return stringValue;
	}
	if( stringValue.startsWith( "\"" ) && stringValue.endsWith( "\"" ) ) {
		String newFamily = stringValue.substring(1, stringValue.length()-1);
		return newFamily;
	}
	return stringValue;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:30,代码来源:FontManager.java

示例5: parseProperty

import org.w3c.dom.css.CSSValue; //导入方法依赖的package包/类
private String parseProperty( String text )
{
	int at = text.indexOf( ':' );
	if ( at != -1 )
	{
		String name = text.substring( 0, at );
		String valueText = text.substring( at + 1 ).trim( );
		int idx = engine.getPropertyIndex( name );
		if ( idx != -1 )
		{
			CSSValue value = engine.parsePropertyValue( idx, valueText );
			return name + ": " + value.getCssText( );
		}
	}
	return "";
}
 
开发者ID:eclipse,项目名称:birt,代码行数:17,代码来源:CSSPaserTest.java

示例6: handleRowAlign

import org.w3c.dom.css.CSSValue; //导入方法依赖的package包/类
/**
 * Handles the alignment property of the row content.
 */
public void handleRowAlign( IRowContent row )
{
	IStyle rowComputedStyle = row.getComputedStyle( );

	// Build the Vertical-Align property of the row content
	CSSValue vAlign = rowComputedStyle.getProperty( IStyle.STYLE_VERTICAL_ALIGN );
	if ( null == vAlign || IStyle.BASELINE_VALUE == vAlign )
	{
		// The default vertical-align value of cell is top. And the cell can
		// inherit the valign from parent row.
		vAlign = IStyle.TOP_VALUE;
	}
	writer.attribute( HTMLTags.ATTR_VALIGN, vAlign.getCssText( ) );
	
	String hAlignText = null;
	CSSValue hAlign = rowComputedStyle.getProperty( IStyle.STYLE_TEXT_ALIGN );
	if ( null != hAlign )
	{
		hAlignText = hAlign.getCssText( );
	}
	if( null == hAlignText )
	{
		if( htmlRtLFlag )
		{
			hAlignText = "right";
		}
		else
		{
			hAlignText = "left";
		}
	}
	writer.attribute( HTMLTags.ATTR_ALIGN, hAlignText );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:37,代码来源:HTMLVisionOptimize.java

示例7: getCssText

import org.w3c.dom.css.CSSValue; //导入方法依赖的package包/类
protected String getCssText( CSSValue value )
{
	if ( value == null )
	{
		return null;
	}
	return value.getCssText( );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:9,代码来源:AbstractStyle.java

示例8: applyBorderStyle

import org.w3c.dom.css.CSSValue; //导入方法依赖的package包/类
@Override
public void applyBorderStyle(Workbook workbook, CellStyle style, BorderSide side, CSSValue colour, CSSValue borderStyle, CSSValue width) {
	if( ( colour != null ) || ( borderStyle != null ) || ( width != null ) ) {
		String colourString = colour == null ? "rgb(0,0,0)" : colour.getCssText();
		String borderStyleString = borderStyle == null ? "solid" : borderStyle.getCssText();
		String widthString = width == null ? "medium" : width.getCssText();
		
		if( style instanceof XSSFCellStyle ) {
			XSSFCellStyle xStyle = (XSSFCellStyle)style;
			
			BorderStyle xBorderStyle = poiBorderStyleFromBirt(borderStyleString, widthString);
			XSSFColor xBorderColour = getXColour(colourString);
			if(xBorderStyle != BorderStyle.NONE) {
				switch( side ) {
				case TOP:
					xStyle.setBorderTop(xBorderStyle);
					xStyle.setTopBorderColor(xBorderColour);
					// log.debug( "Top border: " + xStyle.getBorderTop() + " / " + xStyle.getTopBorderXSSFColor().getARGBHex() );
					break;
				case LEFT:
					xStyle.setBorderLeft(xBorderStyle);
					xStyle.setLeftBorderColor(xBorderColour);
					// log.debug( "Left border: " + xStyle.getBorderLeft() + " / " + xStyle.getLeftBorderXSSFColor().getARGBHex() );
					break;
				case RIGHT:
					xStyle.setBorderRight(xBorderStyle);
					xStyle.setRightBorderColor(xBorderColour);
					// log.debug( "Right border: " + xStyle.getBorderRight() + " / " + xStyle.getRightBorderXSSFColor().getARGBHex() );
					break;
				case BOTTOM:
					xStyle.setBorderBottom(xBorderStyle);
					xStyle.setBottomBorderColor(xBorderColour);
					// log.debug( "Bottom border: " + xStyle.getBorderBottom() + " / " + xStyle.getBottomBorderXSSFColor().getARGBHex() );
					break;
				}
			}
		}
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:40,代码来源:StyleManagerXUtils.java

示例9: getStyleProperty

import org.w3c.dom.css.CSSValue; //导入方法依赖的package包/类
protected static String getStyleProperty( IStyledElement element, int property, String defaultValue ) {
	CSSValue value = element.getComputedStyle().getProperty(property);
	if( value != null ) {
		return value.getCssText();
	} else {
		return defaultValue;
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:9,代码来源:AbstractHandler.java

示例10: getString

import org.w3c.dom.css.CSSValue; //导入方法依赖的package包/类
public String getString( int propIndex ) {
	CSSValue value = getProperty( propIndex );
	if( value != null ) {
		return value.getCssText();
	} else {
		return null;
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:9,代码来源:BirtStyle.java

示例11: getColor

import org.w3c.dom.css.CSSValue; //导入方法依赖的package包/类
Color getColor( CSSValue value ) {
  String key = value.getCssText();
  if( !colorRegistry.hasValueFor( key ) ) {
    colorRegistry.put( key, getRGBA( value ).rgb );
  }
  return colorRegistry.get( key );
}
 
开发者ID:fappel,项目名称:xiliary,代码行数:8,代码来源:TopLevelWindowAttributeContribution.java

示例12: getColor

import org.w3c.dom.css.CSSValue; //导入方法依赖的package包/类
@SuppressWarnings("restriction")
private Color getColor( CSSValue value ) {
  String key = value.getCssText();
  if( !colorRegistry.hasValueFor( key ) ) {
    colorRegistry.put( key, getRGBA( value ).rgb );
  }
  return colorRegistry.get( key );
}
 
开发者ID:fappel,项目名称:xiliary,代码行数:9,代码来源:ColorApplicator.java

示例13: applyBorderStyle

import org.w3c.dom.css.CSSValue; //导入方法依赖的package包/类
@Override
public void applyBorderStyle(Workbook workbook, CellStyle style, BorderSide side, CSSValue colour, CSSValue borderStyle, CSSValue width) {
	if( ( colour != null ) || ( borderStyle != null ) || ( width != null ) ) {
		String colourString = colour == null ? "rgb(0,0,0)" : colour.getCssText();
		String borderStyleString = borderStyle == null ? "solid" : borderStyle.getCssText();
		String widthString = width == null ? "medium" : width.getCssText();

		if( style instanceof HSSFCellStyle ) {
			HSSFCellStyle hStyle = (HSSFCellStyle)style;
			
			short hBorderStyle = poiBorderStyleFromBirt(borderStyleString, widthString);
			short colourIndex = getHColour((HSSFWorkbook)workbook, colourString);
			if( colourIndex > 0 ) {
				if(hBorderStyle != CellStyle.BORDER_NONE) {
					switch( side ) {
					case TOP:
						hStyle.setBorderTop(hBorderStyle);
						hStyle.setTopBorderColor(colourIndex);
						// log.debug( "Top border: " + xStyle.getBorderTop() + " / " + xStyle.getTopBorderXSSFColor().getARGBHex() );
						break;
					case LEFT:
						hStyle.setBorderLeft(hBorderStyle);
						hStyle.setLeftBorderColor(colourIndex);
						// log.debug( "Left border: " + xStyle.getBorderLeft() + " / " + xStyle.getLeftBorderXSSFColor().getARGBHex() );
						break;
					case RIGHT:
						hStyle.setBorderRight(hBorderStyle);
						hStyle.setRightBorderColor(colourIndex);
						// log.debug( "Right border: " + xStyle.getBorderRight() + " / " + xStyle.getRightBorderXSSFColor().getARGBHex() );
						break;
					case BOTTOM:
						hStyle.setBorderBottom(hBorderStyle);
						hStyle.setBottomBorderColor(colourIndex);
						// log.debug( "Bottom border: " + xStyle.getBorderBottom() + " / " + xStyle.getBottomBorderXSSFColor().getARGBHex() );
						break;
					}
				}
			}
		}
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:42,代码来源:StyleManagerHUtils.java


注:本文中的org.w3c.dom.css.CSSValue.getCssText方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。