Repository: empire-db Updated Branches: refs/heads/master 4f02a5d99 -> 8dbffdbc5
EMPIREDB-270 Added interface TagContextInfo Project: http://git-wip-us.apache.org/repos/asf/empire-db/repo Commit: http://git-wip-us.apache.org/repos/asf/empire-db/commit/8dbffdbc Tree: http://git-wip-us.apache.org/repos/asf/empire-db/tree/8dbffdbc Diff: http://git-wip-us.apache.org/repos/asf/empire-db/diff/8dbffdbc Branch: refs/heads/master Commit: 8dbffdbc57228fc45bf86a64a6c8c11bbc400bb1 Parents: 4f02a5d Author: Rainer Döbele <[email protected]> Authored: Tue Jan 16 09:34:29 2018 +0100 Committer: Rainer Döbele <[email protected]> Committed: Tue Jan 16 09:34:29 2018 +0100 ---------------------------------------------------------------------- .../empire/jsf2/utils/TagContextInfo.java | 26 ++++++++++++++++++++ .../empire/jsf2/utils/TagEncodingHelper.java | 21 +++++++++++++++- 2 files changed, 46 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/empire-db/blob/8dbffdbc/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/utils/TagContextInfo.java ---------------------------------------------------------------------- diff --git a/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/utils/TagContextInfo.java b/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/utils/TagContextInfo.java new file mode 100644 index 0000000..222d3d4 --- /dev/null +++ b/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/utils/TagContextInfo.java @@ -0,0 +1,26 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.empire.jsf2.utils; + +import org.apache.empire.data.Column; + +public interface TagContextInfo +{ + String getContextStyleClass(Column col); +} http://git-wip-us.apache.org/repos/asf/empire-db/blob/8dbffdbc/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/utils/TagEncodingHelper.java ---------------------------------------------------------------------- diff --git a/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/utils/TagEncodingHelper.java b/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/utils/TagEncodingHelper.java index efb6cb0..6f2ba39 100644 --- a/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/utils/TagEncodingHelper.java +++ b/empire-db-jsf2/src/main/java/org/apache/empire/jsf2/utils/TagEncodingHelper.java @@ -1419,7 +1419,8 @@ public class TagEncodingHelper implements NamingContainer public final String getTagStyleClass(DataType dataType, String addlStyle, String userStyle) { String typeClass = getDataTypeClass(dataType); - return getTagStyleClass(tagCssStyle, typeClass, addlStyle, userStyle); + String contextStyle = getContextStyleClass(addlStyle); + return getTagStyleClass(tagCssStyle, typeClass, contextStyle, userStyle); } public final String getTagStyleClass(DataType dataType, String addlStyle) @@ -1443,6 +1444,24 @@ public class TagEncodingHelper implements NamingContainer return getTagStyleClass(tagCssStyle, typeClass, null, userStyle); } + private final String getContextStyleClass(String addlStyle) + { + String contextStyle = null; + if ((getRecord() instanceof TagContextInfo) && hasColumn()) + { + contextStyle = ((TagContextInfo)getRecord()).getContextStyleClass(getColumn()); + } + if (StringUtils.isEmpty(addlStyle)) + { + return contextStyle; + } + if (StringUtils.isEmpty(contextStyle)) + { + return addlStyle; + } + return addlStyle + " " + contextStyle; + } + public boolean isInsideUIData() { if (tag==null)
