本文整理汇总了Java中org.w3c.dom.stylesheets.StyleSheet类的典型用法代码示例。如果您正苦于以下问题:Java StyleSheet类的具体用法?Java StyleSheet怎么用?Java StyleSheet使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
StyleSheet类属于org.w3c.dom.stylesheets包,在下文中一共展示了StyleSheet类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSheet
import org.w3c.dom.stylesheets.StyleSheet; //导入依赖的package包/类
/**
* The style sheet.
*/
public StyleSheet getSheet() {
if (sheet == null) {
sheet = factory.createStyleSheet(this, getPseudoAttributes());
}
return sheet;
}
示例2: merge
import org.w3c.dom.stylesheets.StyleSheet; //导入依赖的package包/类
/**
* Merges all StyleSheets in this list into one.
*
* @return the new (merged) StyleSheet
*/
public StyleSheet merge() {
final CSSStyleSheetImpl merged = new CSSStyleSheetImpl();
final CSSRuleListImpl cssRuleList = new CSSRuleListImpl();
final Iterator<CSSStyleSheet> it = getCSSStyleSheets().iterator();
while (it.hasNext()) {
final CSSStyleSheetImpl cssStyleSheet = (CSSStyleSheetImpl) it.next();
final CSSMediaRuleImpl cssMediaRule = new CSSMediaRuleImpl(merged, null, cssStyleSheet.getMedia());
cssMediaRule.setRuleList((CSSRuleListImpl) cssStyleSheet.getCssRules());
cssRuleList.add(cssMediaRule);
}
merged.setCssRules(cssRuleList);
merged.setMediaText("all");
return merged;
}
示例3: equalsStyleSheets
import org.w3c.dom.stylesheets.StyleSheet; //导入依赖的package包/类
private boolean equalsStyleSheets(final StyleSheetList ssl) {
if ((ssl == null) || (getLength() != ssl.getLength())) {
return false;
}
for (int i = 0; i < getLength(); i++) {
final StyleSheet styleSheet1 = item(i);
final StyleSheet styleSheet2 = ssl.item(i);
if (!LangUtils.equals(styleSheet1, styleSheet2)) {
return false;
}
}
return true;
}
示例4: JStyleSheetWrapper
import org.w3c.dom.stylesheets.StyleSheet; //导入依赖的package包/类
JStyleSheetWrapper(final cz.vutbr.web.css.StyleSheet jStyleSheet, final String mediaStr, final String href, final Node ownerNode,
final CSSStyleSheet parentStyleSheet, final String type, final String title, final StyleSheetBridge bridge) {
this.jStyleSheet = jStyleSheet;
this.mediaStr = mediaStr;
this.href = href;
this.bridge = bridge;
this.ownerNode = ownerNode;
this.type = type;
this.title = title;
this.parentStyleSheet = parentStyleSheet;
}
示例5: createStyleSheet
import org.w3c.dom.stylesheets.StyleSheet; //导入依赖的package包/类
/**
* Creates a stylesheet from the data of an xml-stylesheet
* processing instruction or return null.
*/
public StyleSheet createStyleSheet(Node n, HashTable attrs) {
throw new UnsupportedOperationException
("StyleSheetFactory.createStyleSheet is not implemented"); // XXX
}
示例6: getParentStyleSheet
import org.w3c.dom.stylesheets.StyleSheet; //导入依赖的package包/类
@Override
public StyleSheet getParentStyleSheet() {
return parentStyleSheet_;
}
示例7: setParentStyleSheet
import org.w3c.dom.stylesheets.StyleSheet; //导入依赖的package包/类
public void setParentStyleSheet(final StyleSheet parentStyleSheet) {
parentStyleSheet_ = parentStyleSheet;
}
示例8: item
import org.w3c.dom.stylesheets.StyleSheet; //导入依赖的package包/类
@Override
public StyleSheet item(final int index) {
return getCSSStyleSheets().get(index);
}
示例9: getJStyleSheet
import org.w3c.dom.stylesheets.StyleSheet; //导入依赖的package包/类
public cz.vutbr.web.css.StyleSheet getJStyleSheet() {
return this.jStyleSheet;
}
示例10: setJStyleSheet
import org.w3c.dom.stylesheets.StyleSheet; //导入依赖的package包/类
public void setJStyleSheet(final cz.vutbr.web.css.StyleSheet jStyleSheet) {
this.jStyleSheet = jStyleSheet;
}
示例11: insertRule
import org.w3c.dom.stylesheets.StyleSheet; //导入依赖的package包/类
/**
* Used to insert a new rule into the style sheet. The new rule now becomes
* part of the cascade.
*
* @param rule
* The parsable text representing the rule. For rule sets this
* contains both the selector and the style declaration. For
* at-rules, this specifies both the at-identifier and the rule
* content.
* @param index
* The index within the style sheet's rule list of the rule before
* which to insert the specified rule. If the specified index is
* equal to the length of the style sheet's rule collection, the rule
* will be added to the end of the style sheet.
* @return The index within the style sheet's rule collection of the newly
* inserted rule.
* @exception DOMException
* HIERARCHY_REQUEST_ERR: Raised if the rule cannot be inserted
* at the specified index e.g. if an <code>@import</code> rule is
* inserted after a standard rule set or other at-rule. <br>
* INDEX_SIZE_ERR: Raised if the specified index is not a valid
* insertion point. <br>
* NO_MODIFICATION_ALLOWED_ERR: Raised if this style sheet is
* readonly. <br>
* SYNTAX_ERR: Raised if the specified rule has a syntax error
* and is unparsable.
*/
//TODO handle all the different types of exceptions as mentioned above
public int insertRule(final String rule, final int index) throws DOMException {
final cz.vutbr.web.css.StyleSheet jSheet = CSSUtils.parse(rule);
if (jSheet.size() > 0) {
this.jStyleSheet.add(index, jSheet.get(0));
bridge.notifyStyleSheetChanged(this);
return index;
}
return -1;
}
示例12: createStyleSheet
import org.w3c.dom.stylesheets.StyleSheet; //导入依赖的package包/类
/**
* Creates a stylesheet from the data of the xml-stylesheet
* processing instruction or return null when it is not possible
* to create the given stylesheet.
*/
StyleSheet createStyleSheet(Node node, HashTable pseudoAttrs);
示例13: getParentStyleSheet
import org.w3c.dom.stylesheets.StyleSheet; //导入依赖的package包/类
/**
* @return The containing <code>Style Sheet</code>, applicable only for
* <code>@import</code> rules. <code>null</code> for nodes as the
* style sheet is a top-level style sheet, either from
* <code>LINK</code> or <code>STYLE</code> element.
*/
public StyleSheet getParentStyleSheet() {
return this.parentStyleSheet;
}