本文整理汇总了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$
}
示例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 );
}
示例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 );
}
示例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;
}
示例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 "";
}
示例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 );
}
示例7: getCssText
import org.w3c.dom.css.CSSValue; //导入方法依赖的package包/类
protected String getCssText( CSSValue value )
{
if ( value == null )
{
return null;
}
return value.getCssText( );
}
示例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;
}
}
}
}
}
示例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;
}
}
示例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;
}
}
示例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 );
}
示例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 );
}
示例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;
}
}
}
}
}
}