-
Notifications
You must be signed in to change notification settings - Fork 3
3. How to import one CssFile in another CssFile
Web Firm Framework edited this page Jun 14, 2016
·
2 revisions
Here we are importing CssFileSample1 in CssFileSample2.
import java.util.Set;
import com.webfirmframework.wffweb.css.BackgroundRepeat;
import com.webfirmframework.wffweb.css.ListStylePosition;
import com.webfirmframework.wffweb.css.core.CssProperty;
@SuppressWarnings("serial")
public class CssFileSample2 extends CssFile {
public CssFileSample2() {
}
public final CssBlock cssBlock1 = new CssBlock(".test1-class") {
@Override
protected void load(final Set<CssProperty> cssProperties) {
cssProperties.add(ListStylePosition.INSIDE);
}
};
@ImportCssFile
private final CssFileSample1 cssFileSample1 = new CssFileSample1();
private final CssBlock cssBlock7 = new CssBlock(".test7-class") {
@Override
protected void load(final Set<CssProperty> cssProperties) {
cssProperties.add(BackgroundRepeat.REPEAT_X);
}
};
@Override
public String toString() {
return "CssFileSample2";
}
}
the following code
public static void main(String[] args) {
final CssFileSample2 cssFileSample2 = new CssFileSample2();
final String cssString = cssFileSample2.toCssString();
System.out.println(cssString);
}
will print
.test1-class {
list-style-position: inside;
}
.test4-class {
background-repeat: no-repeat;
list-style-position: outside;
}
.test7-class {
background-repeat: repeat-x;
}
Refer wffweb-javadoc, Watch technical videos
Feel free to write us @ [email protected] for any assistance
or
[email protected] for any technical support.
webfirmframework.com since 2014