Search in sources :

Example 6 with ICSSSelector

use of org.eclipse.wst.css.core.internal.provisional.document.ICSSSelector in project webtools.sourceediting by eclipse.

the class CSSSelectorTest method testSelector03.

public void testSelector03() {
    ICSSSelectorList list = createSelectorList("H1.pastoral");
    checkSelectorList(list, "H1.pastoral", 1, 0);
    ICSSSelector selector;
    ICSSSelectorItem item;
    selector = list.getSelector(0);
    checkSelector(selector, "H1.pastoral", 1, 101, 0);
    item = selector.getItem(0);
    checkSimpleSelector(item, "H1", false, 0, 1, 0, 0);
    checkSimpleSelectorClasses(item, new String[] { "pastoral" });
}
Also used : ICSSSelectorList(org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorList) ICSSSelector(org.eclipse.wst.css.core.internal.provisional.document.ICSSSelector) ICSSSelectorItem(org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorItem)

Example 7 with ICSSSelector

use of org.eclipse.wst.css.core.internal.provisional.document.ICSSSelector in project webtools.sourceediting by eclipse.

the class CSSSelectorTest method testSelector13.

public void testSelector13() {
    ICSSSelectorList list = createSelectorList("DIV * P");
    checkSelectorList(list, "DIV * P", 1, 0);
    ICSSSelector selector;
    ICSSSelectorItem item;
    selector = list.getSelector(0);
    checkSelector(selector, "DIV * P", 5, 2, 0);
    item = selector.getItem(0);
    checkSimpleSelector(item, "DIV", false, 0, 0, 0, 0);
    item = selector.getItem(1);
    checkSelectorCombinator(item, " ", ICSSSelectorCombinator.DESCENDANT);
    item = selector.getItem(2);
    checkSimpleSelector(item, "*", true, 0, 0, 0, 0);
    item = selector.getItem(3);
    checkSelectorCombinator(item, " ", ICSSSelectorCombinator.DESCENDANT);
    item = selector.getItem(4);
    checkSimpleSelector(item, "P", false, 0, 0, 0, 0);
}
Also used : ICSSSelectorList(org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorList) ICSSSelector(org.eclipse.wst.css.core.internal.provisional.document.ICSSSelector) ICSSSelectorItem(org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorItem)

Example 8 with ICSSSelector

use of org.eclipse.wst.css.core.internal.provisional.document.ICSSSelector in project webtools.sourceediting by eclipse.

the class CSSSelectorTest method testSelector24.

public void testSelector24() {
    ICSSSelectorList list = createSelectorList("A:link");
    checkSelectorList(list, "A:link", 1, 0);
    ICSSSelector selector;
    ICSSSelectorItem item;
    selector = list.getSelector(0);
    checkSelector(selector, "A:link", 1, 101, 0);
    item = selector.getItem(0);
    checkSimpleSelector(item, "A", false, 0, 0, 0, 1);
    checkSimpleSelectorPseudoNames(item, new String[] { "link" });
}
Also used : ICSSSelectorList(org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorList) ICSSSelector(org.eclipse.wst.css.core.internal.provisional.document.ICSSSelector) ICSSSelectorItem(org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorItem)

Example 9 with ICSSSelector

use of org.eclipse.wst.css.core.internal.provisional.document.ICSSSelector in project webtools.sourceediting by eclipse.

the class CSSSelectorTest method testSelector10.

public void testSelector10() {
    ICSSSelectorList list = createSelectorList("#myid");
    checkSelectorList(list, "#myid", 1, 0);
    ICSSSelector selector;
    ICSSSelectorItem item;
    selector = list.getSelector(0);
    checkSelector(selector, "#myid", 1, 10000, 0);
    item = selector.getItem(0);
    checkSimpleSelector(item, "", true, 0, 0, 1, 0);
    checkSimpleSelectorIDs(item, new String[] { "myid" });
}
Also used : ICSSSelectorList(org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorList) ICSSSelector(org.eclipse.wst.css.core.internal.provisional.document.ICSSSelector) ICSSSelectorItem(org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorItem)

Example 10 with ICSSSelector

use of org.eclipse.wst.css.core.internal.provisional.document.ICSSSelector in project webtools.sourceediting by eclipse.

the class CSSSelectorTest method testSelector36.

public void testSelector36() {
    ICSSSelectorList list = createSelectorList("H3.1x3#4t2");
    checkSelectorList(list, "H3.1x3#4t2", 1, 1);
    ICSSSelector selector;
    ICSSSelectorItem item;
    selector = list.getSelector(0);
    checkSelector(selector, "H3.1x3#4t2", 1, 10101, 1);
    item = selector.getItem(0);
    checkSimpleSelector(item, "H3", false, 0, 1, 1, 0);
    checkSimpleSelectorClasses(item, new String[] { "1x3" });
    checkSimpleSelectorIDs(item, new String[] { "4t2" });
}
Also used : ICSSSelectorList(org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorList) ICSSSelector(org.eclipse.wst.css.core.internal.provisional.document.ICSSSelector) ICSSSelectorItem(org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorItem)

Aggregations

ICSSSelector (org.eclipse.wst.css.core.internal.provisional.document.ICSSSelector)52 ICSSSelectorList (org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorList)48 ICSSSelectorItem (org.eclipse.wst.css.core.internal.provisional.document.ICSSSelectorItem)42 Iterator (java.util.Iterator)7 ICSSStyleRule (org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleRule)3 ImportedCollector (org.eclipse.wst.css.core.internal.util.ImportedCollector)3 SelectorsCollector (org.eclipse.wst.css.core.internal.util.SelectorsCollector)3 ArrayList (java.util.ArrayList)2 List (java.util.List)2 ICSSNode (org.eclipse.wst.css.core.internal.provisional.document.ICSSNode)2 ICSSSimpleSelector (org.eclipse.wst.css.core.internal.provisional.document.ICSSSimpleSelector)2 ICSSStyleSheet (org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleSheet)2 Vector (java.util.Vector)1 CSSTextParser (org.eclipse.wst.css.core.internal.parserz.CSSTextParser)1 CSSTextToken (org.eclipse.wst.css.core.internal.parserz.CSSTextToken)1 ICSSImportRule (org.eclipse.wst.css.core.internal.provisional.document.ICSSImportRule)1 ICSSValue (org.eclipse.wst.css.core.internal.provisional.document.ICSSValue)1 ImportRuleCollector (org.eclipse.wst.css.core.internal.util.ImportRuleCollector)1