/******************************************************************************* * Copyright (c) 2011 BestSolution.at and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Tom Schindl<tom.schindl@bestsolution.at> - initial API and implementation *******************************************************************************/ package at.bestsolution.efxclipse.tooling.css.web; import static at.bestsolution.efxclipse.tooling.css.CssDialectExtension.Util.createEnumProperties; import static at.bestsolution.efxclipse.tooling.css.CssDialectExtension.Util.createReflective; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import at.bestsolution.efxclipse.tooling.css.CssDialectExtension.Property; import at.bestsolution.efxclipse.tooling.css.CssDialectExtension.Proposal; public class Fonts { public static List<Property> init() { List<Property> PROPERTIES = new ArrayList<Property>(); PROPERTIES.addAll(createReflective(FontFamilyProperty.class, "font-family")); PROPERTIES.addAll(createReflective(FontSizeProperty.class, "font-size")); PROPERTIES.addAll( createEnumProperties( Arrays.asList("normal","italic","oblique","inherit"), "font-style") ); PROPERTIES.addAll( createEnumProperties( Arrays.asList("normal","small-caps","inherit"), "font-variant") ); PROPERTIES.addAll( createEnumProperties( Arrays.asList("normal","bold","bolder","lighter","100","200","300","400","500","600","700","800","900","inherit"), "font-weight") ); PROPERTIES.addAll(createReflective(FontProperty.class, "font")); return PROPERTIES; } public static class FontFamilyProperty extends Property { private List<Proposal> proposals = new ArrayList<Proposal>(); public FontFamilyProperty(String name) { super(name); } @Override public List<Proposal> getInitialTermProposals() { return proposals; } } public static class FontSizeProperty extends Property { private List<Proposal> proposals = new ArrayList<Proposal>(); public FontSizeProperty(String name) { super(name); } @Override public List<Proposal> getInitialTermProposals() { return proposals; } } public static class FontProperty extends Property { private List<Proposal> proposals = new ArrayList<Proposal>(); public FontProperty(String name) { super(name); } @Override public List<Proposal> getInitialTermProposals() { return proposals; } } }