1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
13   */
14  
15  package com.liferay.portal.lar;
16  
17  import com.liferay.portal.kernel.util.StringPool;
18  
19  /**
20   * <a href="PortletDataHandlerControl.java.html"><b><i>View Source</i></b></a>
21   *
22   * @author Raymond Augé
23   */
24  public class PortletDataHandlerControl {
25  
26      public static String getNamespacedControlName(
27          String namespace, String controlName) {
28  
29          StringBuilder sb = new StringBuilder();
30  
31          sb.append(StringPool.UNDERLINE);
32          sb.append(namespace);
33          sb.append(StringPool.UNDERLINE);
34          sb.append(controlName);
35  
36          return sb.toString();
37      }
38  
39      public PortletDataHandlerControl(String namespace, String controlName) {
40          this(namespace, controlName, false);
41      }
42  
43      public PortletDataHandlerControl(
44          String namespace, String controlName, boolean disabled) {
45  
46          _namespace = namespace;
47          _controlName = controlName;
48          _disabled = disabled;
49      }
50  
51      public String getNamespace() {
52          return _namespace;
53      }
54  
55      public String getControlName() {
56          return _controlName;
57      }
58  
59      public String getNamespacedControlName() {
60          return getNamespacedControlName(_namespace, getControlName());
61      }
62  
63      public boolean isDisabled() {
64          return _disabled;
65      }
66  
67      private String _namespace;
68      private String _controlName;
69      private boolean _disabled;
70  
71  }