本文整理汇总了Java中org.w3c.css.sac.LexicalUnit.SAC_DIMENSION属性的典型用法代码示例。如果您正苦于以下问题:Java LexicalUnit.SAC_DIMENSION属性的具体用法?Java LexicalUnit.SAC_DIMENSION怎么用?Java LexicalUnit.SAC_DIMENSION使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.w3c.css.sac.LexicalUnit
的用法示例。
在下文中一共展示了LexicalUnit.SAC_DIMENSION属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPrimitiveType
public short getPrimitiveType() {
switch (value.getLexicalUnitType()) {
case LexicalUnit.SAC_IDENT:
return CSS_IDENT;
case LexicalUnit.SAC_INTEGER:
case LexicalUnit.SAC_REAL:
return CSS_NUMBER;
case LexicalUnit.SAC_URI:
return CSS_URI;
case LexicalUnit.SAC_PERCENTAGE:
return CSS_PERCENTAGE;
case LexicalUnit.SAC_PIXEL:
return CSS_PX;
case LexicalUnit.SAC_CENTIMETER:
return CSS_CM;
case LexicalUnit.SAC_EM:
return CSS_EMS;
case LexicalUnit.SAC_EX:
return CSS_EXS;
case LexicalUnit.SAC_INCH:
return CSS_IN;
case LexicalUnit.SAC_STRING_VALUE:
return CSS_STRING;
case LexicalUnit.SAC_DIMENSION:
return CSS_DIMENSION;
case LexicalUnit.SAC_OPERATOR_COMMA:
return CSS_CUSTOM; // TODO don't think this is right, see bug
// #278139
case LexicalUnit.SAC_INHERIT:
return CSS_INHERIT;
}
// TODO Auto-generated method stub
throw new UnsupportedOperationException(
"NOT YET IMPLEMENTED - LexicalUnit type: " + value.getLexicalUnitType());
}
示例2: isNumber
public boolean isNumber() {
short type = getLexicalUnitType();
switch (type) {
case LexicalUnit.SAC_INTEGER:
case LexicalUnit.SAC_REAL:
case LexicalUnit.SAC_EM:
case SCSSLexicalUnit.SAC_LEM:
case SCSSLexicalUnit.SAC_REM:
case LexicalUnit.SAC_EX:
case LexicalUnit.SAC_PIXEL:
case LexicalUnit.SAC_INCH:
case LexicalUnit.SAC_CENTIMETER:
case LexicalUnit.SAC_MILLIMETER:
case LexicalUnit.SAC_POINT:
case LexicalUnit.SAC_PICA:
case LexicalUnit.SAC_PERCENTAGE:
case LexicalUnit.SAC_DEGREE:
case LexicalUnit.SAC_GRADIAN:
case LexicalUnit.SAC_RADIAN:
case LexicalUnit.SAC_MILLISECOND:
case LexicalUnit.SAC_SECOND:
case LexicalUnit.SAC_HERTZ:
case LexicalUnit.SAC_KILOHERTZ:
case LexicalUnit.SAC_DIMENSION:
return true;
default:
return false;
}
}