]>
git.argeo.org Git - lgpl/argeo-commons.git/blob - org.argeo.security.ui.admin/src/org/argeo/security/ui/admin/commands/NewGroup.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
.commands
;
18 import org
.argeo
.security
.ui
.admin
.SecurityAdminPlugin
;
19 import org
.eclipse
.core
.commands
.AbstractHandler
;
20 import org
.eclipse
.core
.commands
.ExecutionEvent
;
21 import org
.eclipse
.core
.commands
.ExecutionException
;
22 import org
.eclipse
.jface
.dialogs
.MessageDialog
;
23 import org
.eclipse
.ui
.handlers
.HandlerUtil
;
24 import org
.osgi
.service
.useradmin
.UserAdmin
;
26 /** Create a new group. */
27 public class NewGroup
extends AbstractHandler
{
28 public final static String ID
= SecurityAdminPlugin
.PLUGIN_ID
+ ".newGroup";
30 private UserAdmin userAdmin
;
32 public Object
execute(ExecutionEvent event
) throws ExecutionException
{
35 .openError(HandlerUtil
.getActiveShell(event
),
36 "Unimplemented method",
37 "Group creation is not yet implemented");
41 /* DEPENDENCY INJECTION */
42 public void setUserAdmin(UserAdmin userAdmin
) {
43 this.userAdmin
= userAdmin
;
47 // JcrRolesView rolesView = (JcrRolesView) HandlerUtil
48 // .getActiveWorkbenchWindow(event).getActivePage()
49 // .findView(JcrRolesView.ID);
50 // String role = rolesView.getNewRole();
51 // if (role.trim().equals(""))
53 // if (role.equals(rolesView.getAddNewRoleText()))
55 // role = role.trim().toUpperCase();
56 // if (!role.startsWith(rolePrefix))
57 // role = rolePrefix + role;
58 // if (userAdminService.listEditableRoles().contains(role))
59 // throw new ArgeoException("Role " + role + " already exists");
60 // userAdminService.newRole(role);
61 // rolesView.refresh();
64 // IEditorReference[] refs = HandlerUtil.getActiveWorkbenchWindow(event)
66 // .findEditors(null, JcrArgeoUserEditor.ID, IWorkbenchPage.MATCH_ID);
67 // for (IEditorReference ref : refs) {
68 // JcrArgeoUserEditor userEditor = (JcrArgeoUserEditor) ref.getEditor(false);
69 // if (userEditor != null) {
70 // userEditor.refresh();
76 // public void setUserAdminService(UserAdminService userAdminService) {
77 // this.userAdminService = userAdminService;