7b5ed449636c0cf63ac2c42edcbe00d2c6372b48
[portal/sdk.git] /
1 /*-
2  * ================================================================================
3  * ECOMP Portal SDK
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ================================================================================
19  */
20 package org.openecomp.portalsdk.analytics.model.runtime;
21
22 import java.util.*;
23
24 import org.openecomp.portalsdk.analytics.*;
25 import org.openecomp.portalsdk.analytics.system.*;
26 import org.openecomp.portalsdk.analytics.util.*;
27
28 public class VisualManager extends RaptorObject {
29         private HashMap hiddenCols = new HashMap();
30
31         private String sortByColId = "";
32
33         private String sortByAscDesc = AppConstants.SO_ASC;
34
35         public VisualManager() {
36                 super();
37         }
38
39         public void hideColumn(String colId) {
40                 hiddenCols.put(colId, "Y");
41         } // hideColumn
42
43         public void showColumn(String colId) {
44                 hiddenCols.put(colId, "N");
45         } // showColumn
46
47         public boolean isColumnVisible(String colId) {
48                 return nvl((String) hiddenCols.get(colId), "N").equals("N");
49         } // isColumnVisible
50
51         public void setSortByColumn(String colId) {
52                 if (sortByColId.equals(colId))
53                         sortByAscDesc = sortByAscDesc.equals(AppConstants.SO_ASC) ? AppConstants.SO_DESC
54                                         : AppConstants.SO_ASC;
55                 else {
56                         sortByColId = colId;
57                         sortByAscDesc = AppConstants.SO_ASC;
58                 }
59         } // setSortByColumn
60
61         public String getSortByColId() {
62                 return sortByColId;
63         }
64
65         public String getSortByAscDesc() {
66                 return sortByAscDesc;
67         }
68
69 } // VisualManager