1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
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  }