001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.kernel.lar;
016    
017    import com.liferay.portal.kernel.util.StringPool;
018    
019    /**
020     * @author Raymond Augé
021     */
022    public class PortletDataHandlerControl {
023    
024            public static String getNamespacedControlName(
025                    String namespace, String controlName) {
026    
027                    StringBuilder sb = new StringBuilder();
028    
029                    sb.append(StringPool.UNDERLINE);
030                    sb.append(namespace);
031                    sb.append(StringPool.UNDERLINE);
032                    sb.append(controlName);
033    
034                    return sb.toString();
035            }
036    
037            public PortletDataHandlerControl(String namespace, String controlName) {
038                    this(namespace, controlName, false);
039            }
040    
041            public PortletDataHandlerControl(
042                    String namespace, String controlName, boolean disabled) {
043    
044                    _namespace = namespace;
045                    _controlName = controlName;
046                    _disabled = disabled;
047            }
048    
049            public String getNamespace() {
050                    return _namespace;
051            }
052    
053            public String getControlName() {
054                    return _controlName;
055            }
056    
057            public String getNamespacedControlName() {
058                    return getNamespacedControlName(_namespace, getControlName());
059            }
060    
061            public boolean isDisabled() {
062                    return _disabled;
063            }
064    
065            private String _namespace;
066            private String _controlName;
067            private boolean _disabled;
068    
069    }