1 /*******************************************************************************
\r
2 * Copyright (c) 2006 Sybase, Inc. and others.
\r
4 * All rights reserved. This program and the accompanying materials
\r
5 * are made available under the terms of the Eclipse Public License v1.0
\r
6 * which accompanies this distribution, and is available at
\r
7 * http://www.eclipse.org/legal/epl-v10.html
\r
10 * Sybase, Inc. - initial API and implementation
\r
11 *******************************************************************************/
\r
12 package org.eclipse.jst.pagedesigner.css2.property;
\r
14 import org.eclipse.jst.pagedesigner.IHTMLConstants;
\r
15 import org.eclipse.jst.pagedesigner.css2.ICSSStyle;
\r
16 import org.eclipse.jst.pagedesigner.utils.DOMUtil;
\r
17 import org.w3c.dom.Element;
\r
22 public class WhiteSpaceMeta extends CSSPropertyMeta {
\r
23 static final String[] KEYWORDS = new String[] { ICSSPropertyID.VAL_NORMAL,
\r
24 ICSSPropertyID.VAL_PRE, ICSSPropertyID.VAL_NOWRAP };
\r
27 * Default constructor
\r
29 public WhiteSpaceMeta() {
\r
30 super(true, ICSSPropertyID.VAL_NORMAL);
\r
36 * @see org.eclipse.jst.pagedesigner.css2.property.CSSPropertyMeta#getKeywordValues()
\r
38 protected String[] getKeywordValues() {
\r
42 public Object calculateHTMLAttributeOverride(Element element,
\r
43 String htmltag, String propertyName, ICSSStyle style) {
\r
44 if (IHTMLConstants.TAG_TD.equalsIgnoreCase(htmltag)
\r
45 || IHTMLConstants.TAG_TH.equalsIgnoreCase(htmltag)) {
\r
46 String noWrap = DOMUtil.getAttributeIgnoreCase(element,
\r
47 IHTMLConstants.ATTR_NOWRAP);
\r
48 if (Boolean.TRUE.toString().equalsIgnoreCase(noWrap)) {
\r
49 return ICSSPropertyID.VAL_NOWRAP;
\r
52 return super.calculateHTMLAttributeOverride(element, htmltag,
\r
53 propertyName, style);
\r