1 |
|
package org.kuali.student.lum.program.client; |
2 |
|
|
3 |
|
import java.util.ArrayList; |
4 |
|
|
5 |
|
import org.kuali.student.common.ui.client.configurable.mvc.Configurer; |
6 |
|
import org.kuali.student.common.ui.client.mvc.DataModel; |
7 |
|
import org.kuali.student.lum.common.client.configuration.AbstractControllerConfiguration; |
8 |
|
import org.kuali.student.lum.common.client.configuration.Configuration; |
9 |
|
import org.kuali.student.lum.common.client.configuration.ConfigurationManager; |
10 |
|
import org.kuali.student.lum.program.client.major.edit.MajorSummaryConfiguration; |
11 |
|
import org.kuali.student.lum.program.client.properties.ProgramProperties; |
12 |
|
|
13 |
|
|
14 |
|
@author |
15 |
|
|
|
|
| 0% |
Uncovered Elements: 29 (29) |
Complexity: 8 |
Complexity Density: 0.44 |
|
16 |
|
public abstract class AbstractProgramConfigurer extends Configurer { |
17 |
|
|
18 |
|
private ProgramController programController; |
19 |
|
|
20 |
|
protected ConfigurationManager programSectionConfigManager; |
21 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
22 |
0
|
public void configure(ProgramController viewController) {... |
23 |
0
|
this.programController = viewController; |
24 |
0
|
configureProgramSections(); |
25 |
|
} |
26 |
|
|
27 |
|
|
28 |
|
|
29 |
|
|
|
|
| 0% |
Uncovered Elements: 13 (13) |
Complexity: 3 |
Complexity Density: 0.33 |
|
30 |
0
|
private void configureProgramSections() {... |
31 |
0
|
String programSectionLabel = ProgramProperties.get().program_menu_sections(); |
32 |
0
|
programController.addMenu(programSectionLabel); |
33 |
0
|
ArrayList<Configuration> configurations = programSectionConfigManager.getConfigurations(); |
34 |
0
|
for (Configuration configuration : configurations) { |
35 |
0
|
if (configuration instanceof AbstractControllerConfiguration) { |
36 |
0
|
((AbstractControllerConfiguration) configuration).setController(programController); |
37 |
|
} |
38 |
0
|
if (configuration instanceof MajorSummaryConfiguration) { |
39 |
0
|
programController.addSpecialMenuItem(configuration.getView(), programSectionLabel); |
40 |
|
} else { |
41 |
0
|
programController.addMenuItem(programSectionLabel, configuration.getView()); |
42 |
|
} |
43 |
|
} |
44 |
|
} |
45 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
46 |
0
|
public ProgramController getProgramController() {... |
47 |
0
|
return programController; |
48 |
|
} |
49 |
|
|
|
|
| 0% |
Uncovered Elements: 7 (7) |
Complexity: 2 |
Complexity Density: 0.4 |
|
50 |
0
|
public void applyPermissions() {... |
51 |
0
|
DataModel dataModel = programController.getProgramModel(); |
52 |
0
|
for (Configuration configuration : programSectionConfigManager.getConfigurations()) { |
53 |
0
|
if (configuration.checkPermission(dataModel)) { |
54 |
0
|
configuration.applyRestrictions(); |
55 |
|
}else{ |
56 |
0
|
configuration.removeRestrictions(); |
57 |
|
} |
58 |
|
} |
59 |
|
} |
60 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
61 |
0
|
public ConfigurationManager getProgramSectionConfigManager() {... |
62 |
0
|
return programSectionConfigManager; |
63 |
|
} |
64 |
|
} |