]> git.argeo.org Git - lgpl/argeo-commons.git/blob - org.argeo.security.ui.admin/src/org/argeo/security/ui/admin/views/JcrRolesView.java
Work on user and group editors. Comment out legacy code that use old userAdminService
[lgpl/argeo-commons.git] / org.argeo.security.ui.admin / src / org / argeo / security / ui / admin / views / JcrRolesView.java
1 /*
2 * Copyright (C) 2007-2012 Argeo GmbH
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package org.argeo.security.ui.admin.views;
17
18 public class JcrRolesView {
19 }
20
21 /** List all roles. Legacy. TODO Remove */
22 // public class JcrRolesView extends ViewPart {
23 // public final static String ID = SecurityAdminPlugin.PLUGIN_ID
24 // + ".jcrRolesView";
25 //
26 // private Text newRole;
27 //
28 // private TableViewer viewer;
29 // private UserAdminService userAdminService;
30 //
31 // private String addNewRoleText = "<add new role here>";
32 //
33 // @Override
34 // public void createPartControl(Composite parent) {
35 // parent.setLayout(new GridLayout(1, false));
36 //
37 // // new role text field
38 // newRole = new Text(parent, SWT.BORDER);
39 // newRole.setText(addNewRoleText);
40 // newRole.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
41 // // default action is add role
42 // newRole.addListener(SWT.DefaultSelection, new Listener() {
43 // private static final long serialVersionUID = -2367261849260929505L;
44 //
45 // public void handleEvent(Event evt) {
46 // IWorkbench iw = SecurityAdminPlugin.getDefault().getWorkbench();
47 // IHandlerService handlerService = (IHandlerService) iw
48 // .getService(IHandlerService.class);
49 // try {
50 // handlerService.executeCommand(AddRole.COMMAND_ID, evt);
51 // } catch (Exception e) {
52 // throw new ArgeoException("Cannot execute add role command",
53 // e);
54 // }
55 // }
56 // });
57 // // select all on focus
58 // newRole.addListener(SWT.FocusIn, new Listener() {
59 // private static final long serialVersionUID = 2612811281477034356L;
60 //
61 // public void handleEvent(Event e) {
62 // newRole.selectAll();
63 // }
64 // });
65 //
66 // // roles table
67 // Table table = new Table(parent, SWT.V_SCROLL | SWT.BORDER);
68 // table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
69 // table.setLinesVisible(false);
70 // table.setHeaderVisible(false);
71 // viewer = new TableViewer(table);
72 // viewer.setContentProvider(new RolesContentProvider());
73 // viewer.setLabelProvider(new UsersLabelProvider());
74 // getViewSite().setSelectionProvider(viewer);
75 // viewer.setInput(getViewSite());
76 // }
77 //
78 // @Override
79 // public void setFocus() {
80 // viewer.getTable().setFocus();
81 // }
82 //
83 // public void setUserAdminService(UserAdminService userAdminService) {
84 // this.userAdminService = userAdminService;
85 // }
86 //
87 // public String getAddNewRoleText() {
88 // return addNewRoleText;
89 // }
90 //
91 // private class RolesContentProvider implements IStructuredContentProvider {
92 // private static final long serialVersionUID = 7446442682717419289L;
93 //
94 // public Object[] getElements(Object inputElement) {
95 // return userAdminService.listEditableRoles().toArray();
96 // }
97 //
98 // public void dispose() {
99 // }
100 //
101 // public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
102 // }
103 //
104 // }
105 //
106 // private class UsersLabelProvider extends LabelProvider implements
107 // ITableLabelProvider {
108 // private static final long serialVersionUID = -1886204791002421430L;
109 //
110 // public String getColumnText(Object element, int columnIndex) {
111 // return element.toString();
112 // }
113 //
114 // public Image getColumnImage(Object element, int columnIndex) {
115 // return null;
116 // }
117 //
118 // }
119 //
120 // public String getNewRole() {
121 // return newRole.getText();
122 // }
123 //
124 // public void refresh() {
125 // viewer.refresh();
126 // newRole.setText(addNewRoleText);
127 // }
128 // }