diff options
Diffstat (limited to 'jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/TableUtil.java')
-rw-r--r-- | jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/TableUtil.java | 103 |
1 files changed, 0 insertions, 103 deletions
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/TableUtil.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/TableUtil.java deleted file mode 100644 index 13661641c..000000000 --- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/css2/property/TableUtil.java +++ /dev/null @@ -1,103 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 Sybase, Inc. 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: - * Sybase, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.pagedesigner.css2.property; - -import org.eclipse.jst.pagedesigner.utils.HTMLUtil; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import org.w3c.dom.Text; - -/** - * @author mengbo - * @version 1.5 - */ -public class TableUtil { - static final String TOP = "top"; - - static final String BOTTOM = "bottom"; - - static final String LEFT = "left"; - - static final String RIGHT = "right"; - - /** - * @param edge - * @param frame - * @return true if there is a match - */ - public static boolean matchFrame(String edge, String frame) { - if ("above".equalsIgnoreCase(frame)) { - return TOP.equalsIgnoreCase(edge); - } else if ("below".equalsIgnoreCase(frame)) { - return BOTTOM.equalsIgnoreCase(edge); - } else if ("hsides".equalsIgnoreCase(frame)) { - return TOP.equalsIgnoreCase(edge) || BOTTOM.equalsIgnoreCase(edge); - } else if ("vsides".equalsIgnoreCase(frame)) { - return LEFT.equalsIgnoreCase(edge) || RIGHT.equalsIgnoreCase(edge); - } else if ("lhs".equalsIgnoreCase(frame)) { - return LEFT.equalsIgnoreCase(edge); - } else if ("rhs".equalsIgnoreCase(frame)) { - return RIGHT.equalsIgnoreCase(edge); - } else if ("box".equalsIgnoreCase(frame) - || "border".equalsIgnoreCase(frame)) { - return true; - } else { - return false; - } - } - - /** - * @param edge - * @param rules - * @return true if rules match - */ - public static boolean matchRules(String edge, String rules) { - // TODO: "groups" not supported. - - if ("rows".equalsIgnoreCase(rules)) { - return TOP.equalsIgnoreCase(edge) || BOTTOM.equalsIgnoreCase(edge); - } else if ("cols".equalsIgnoreCase(rules)) { - return LEFT.equalsIgnoreCase(edge) || RIGHT.equalsIgnoreCase(edge); - } else if ("all".equalsIgnoreCase(rules)) { - return true; - } else { - return false; - } - - } - - /** - * @param element - * @return true if cell is empty - * see http://www.w3.org/TR/CSS21/tables.html#empty-cells - */ - public static boolean isEmptyCell(Element element) { - NodeList children = element.getChildNodes(); - if (children.getLength() == 0) { - return true; - } - // we only do simple checking here. When the element has one child - // and is text and is whitespace only, then we also treat as empty cell - if (children.getLength() == 1) { - Node child = children.item(0); - if (child instanceof Text) { - String text = child.getNodeValue(); - if (HTMLUtil.isHTMLWhitespaceString(text)) { - return true; - } - } - } - - return false; - } -} |