]>
git.argeo.org Git - lgpl/argeo-commons.git/blob - org.argeo.security.ui.admin/src/org/argeo/security/ui/admin/views/JcrRolesView.java
2 * Copyright (C) 2007-2012 Argeo GmbH
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 package org
.argeo
.security
.ui
.admin
.views
;
18 public class JcrRolesView
{
21 /** List all roles. Legacy. TODO Remove */
22 // public class JcrRolesView extends ViewPart {
23 // public final static String ID = SecurityAdminPlugin.PLUGIN_ID
26 // private Text newRole;
28 // private TableViewer viewer;
29 // private UserAdminService userAdminService;
31 // private String addNewRoleText = "<add new role here>";
34 // public void createPartControl(Composite parent) {
35 // parent.setLayout(new GridLayout(1, false));
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;
45 // public void handleEvent(Event evt) {
46 // IWorkbench iw = SecurityAdminPlugin.getDefault().getWorkbench();
47 // IHandlerService handlerService = (IHandlerService) iw
48 // .getService(IHandlerService.class);
50 // handlerService.executeCommand(AddRole.COMMAND_ID, evt);
51 // } catch (Exception e) {
52 // throw new ArgeoException("Cannot execute add role command",
57 // // select all on focus
58 // newRole.addListener(SWT.FocusIn, new Listener() {
59 // private static final long serialVersionUID = 2612811281477034356L;
61 // public void handleEvent(Event e) {
62 // newRole.selectAll();
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());
79 // public void setFocus() {
80 // viewer.getTable().setFocus();
83 // public void setUserAdminService(UserAdminService userAdminService) {
84 // this.userAdminService = userAdminService;
87 // public String getAddNewRoleText() {
88 // return addNewRoleText;
91 // private class RolesContentProvider implements IStructuredContentProvider {
92 // private static final long serialVersionUID = 7446442682717419289L;
94 // public Object[] getElements(Object inputElement) {
95 // return userAdminService.listEditableRoles().toArray();
98 // public void dispose() {
101 // public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
106 // private class UsersLabelProvider extends LabelProvider implements
107 // ITableLabelProvider {
108 // private static final long serialVersionUID = -1886204791002421430L;
110 // public String getColumnText(Object element, int columnIndex) {
111 // return element.toString();
114 // public Image getColumnImage(Object element, int columnIndex) {
120 // public String getNewRole() {
121 // return newRole.getText();
124 // public void refresh() {
126 // newRole.setText(addNewRoleText);