| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
package org.kuali.student.common.ui.client.mvc; |
| 17 |
|
|
| 18 |
|
import java.util.List; |
| 19 |
|
|
| 20 |
|
import org.kuali.student.common.rice.authorization.PermissionType; |
| 21 |
|
import org.kuali.student.common.ui.client.security.AuthorizationCallback; |
| 22 |
|
import org.kuali.student.common.ui.client.security.RequiresAuthorization; |
| 23 |
|
|
| 24 |
|
|
| 25 |
|
|
| 26 |
|
|
| 27 |
|
|
| 28 |
|
|
| 29 |
|
|
| 30 |
|
@author |
| 31 |
|
|
| 32 |
|
|
| 33 |
|
@Deprecated |
|
|
|
| 0% |
Uncovered Elements: 40 (40) |
Complexity: 16 |
Complexity Density: 0.8 |
|
| 34 |
|
public class DelegatingViewComposite extends ViewComposite implements RequiresAuthorization { |
| 35 |
|
Controller childController; |
| 36 |
|
|
| 37 |
|
|
| 38 |
|
@param |
| 39 |
|
@param |
| 40 |
|
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
| 41 |
0
|
public DelegatingViewComposite(Controller parentController, Controller childController, Enum<?> viewType) {... |
| 42 |
0
|
super(parentController, "DelegatingViewComposite", viewType); |
| 43 |
0
|
initWidget(childController); |
| 44 |
0
|
this.childController = childController; |
| 45 |
|
} |
| 46 |
|
|
| 47 |
|
|
| 48 |
|
|
| 49 |
|
|
| 50 |
|
@see |
| 51 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 52 |
0
|
@Override... |
| 53 |
|
public boolean beforeHide() { |
| 54 |
0
|
return childController.getCurrentView().beforeHide(); |
| 55 |
|
} |
| 56 |
|
|
| 57 |
|
|
| 58 |
|
@see |
| 59 |
|
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
| 60 |
0
|
@Override... |
| 61 |
|
public void beforeShow(final Callback<Boolean> onReadyCallback) { |
| 62 |
0
|
if (childController.getCurrentView() == null){ |
| 63 |
0
|
childController.showDefaultView(onReadyCallback); |
| 64 |
|
} else { |
| 65 |
0
|
childController.getCurrentView().beforeShow(onReadyCallback); |
| 66 |
|
} |
| 67 |
|
} |
| 68 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 69 |
0
|
public Controller getChildController(){... |
| 70 |
0
|
return childController; |
| 71 |
|
} |
| 72 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 73 |
0
|
public void setChildController(Controller controller){... |
| 74 |
0
|
this.childController = controller; |
| 75 |
|
} |
| 76 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 77 |
0
|
@Override... |
| 78 |
|
public String collectHistory(String historyStack) { |
| 79 |
0
|
return childController.collectHistory(historyStack); |
| 80 |
|
} |
| 81 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 82 |
0
|
@Override... |
| 83 |
|
public void onHistoryEvent(String historyStack) { |
| 84 |
0
|
childController.onHistoryEvent(historyStack); |
| 85 |
|
} |
| 86 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 87 |
0
|
@Override... |
| 88 |
|
public void clear() { |
| 89 |
0
|
childController.resetCurrentView(); |
| 90 |
|
} |
| 91 |
|
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
| 92 |
0
|
@Override... |
| 93 |
|
public void checkAuthorization(PermissionType permissionType, AuthorizationCallback callback) { |
| 94 |
0
|
if (childController instanceof RequiresAuthorization){ |
| 95 |
0
|
((RequiresAuthorization)childController).checkAuthorization(permissionType, callback); |
| 96 |
|
} |
| 97 |
|
} |
| 98 |
|
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
| 99 |
0
|
@Override... |
| 100 |
|
public boolean isAuthorizationRequired() { |
| 101 |
0
|
if (childController instanceof RequiresAuthorization){ |
| 102 |
0
|
return ((RequiresAuthorization)childController).isAuthorizationRequired(); |
| 103 |
|
} else { |
| 104 |
0
|
return false; |
| 105 |
|
} |
| 106 |
|
} |
| 107 |
|
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
| 108 |
0
|
@Override... |
| 109 |
|
public void setAuthorizationRequired(boolean required) { |
| 110 |
0
|
if (childController instanceof RequiresAuthorization){ |
| 111 |
0
|
((RequiresAuthorization)childController).setAuthorizationRequired(required); |
| 112 |
|
} |
| 113 |
|
} |
| 114 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 115 |
0
|
@Override... |
| 116 |
|
public void collectBreadcrumbNames(List<String> names) { |
| 117 |
0
|
childController.collectBreadcrumbNames(names); |
| 118 |
|
|
| 119 |
|
} |
| 120 |
|
|
| 121 |
|
} |