EMMA Coverage Report (generated Wed Feb 13 07:49:24 ICT 2008)
[all classes][net.sourceforge.hiveboard.command]

COVERAGE SUMMARY FOR SOURCE FILE [AccountCommands.java]

nameclass, %method, %block, %line, %
AccountCommands.java100% (2/2)100% (7/7)98%  (81/83)93%  (13/14)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class AccountCommands100% (1/1)100% (5/5)97%  (63/65)91%  (10/11)
destroyAccount (): Task 100% (1/1)93%  (27/29)75%  (3/4)
AccountCommands (): void 100% (1/1)100% (3/3)100% (1/1)
changePassword (): void 100% (1/1)100% (13/13)100% (2/2)
createAccount (): void 100% (1/1)100% (7/7)100% (2/2)
modifyAccount (): void 100% (1/1)100% (13/13)100% (2/2)
     
class AccountCommands$1100% (1/1)100% (2/2)100% (18/18)100% (3/3)
AccountCommands$1 (AccountCommands, HiveGuiApplicationMain, int): void 100% (1/1)100% (10/10)100% (1/1)
doInBackground (): Void 100% (1/1)100% (8/8)100% (2/2)

1//  Copyright 2004-2007 Jean-Francois Poilpret
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14 
15package net.sourceforge.hiveboard.command;
16 
17import org.jdesktop.application.Action;
18import org.jdesktop.application.Task;
19 
20import net.sourceforge.hivegui.message.UserChoice;
21 
22public class AccountCommands extends AbstractCommandHolder
23{
24        @Action(enabledProperty = SELF_ADMIN)
25        public void        createAccount()
26        {
27                showDialog("create-account-panel");
28        }
29        
30        @Action(enabledProperty = ACCOUNT_MODIFIABLE, block = Task.BlockingScope.WINDOW)
31        public Task        destroyAccount()
32        {
33                if (showMessage("confirm-destroy-account", 
34                                                _guiContext.getAccount().getVisa()) == UserChoice.YES)
35                {
36                        final int id = _guiContext.getAccount().getId();
37                        return new AbstractTask<Void, Void>(_application)
38                        {
39                                @Override protected Void doInBackground() throws Exception
40                                {
41                                        _service.removeAccount(id);
42                                        return null;
43                                }
44                        };
45                }
46                else
47                {
48                        return null;
49                }
50        }
51        
52        @Action(enabledProperty = ACCOUNT_MODIFIABLE)
53        public void        modifyAccount()
54        {
55                showDialog("modify-account-panel", _guiContext.getAccount());
56        }
57        
58        @Action(enabledProperty = ACCOUNT_MODIFIABLE)
59        public void        changePassword()
60        {
61                showDialog("change-account-password-panel", _guiContext.getAccount());
62        }
63}

[all classes][net.sourceforge.hiveboard.command]
EMMA 2.0.5312 (C) Vladimir Roubtsov