| 1 |
|
package org.kuali.student.lum.lu.ui.course.client.controllers; |
| 2 |
|
|
| 3 |
|
import org.kuali.student.common.ui.client.application.ViewContext; |
| 4 |
|
import org.kuali.student.common.ui.client.configurable.mvc.layouts.BasicLayout; |
| 5 |
|
import org.kuali.student.common.ui.client.mvc.Callback; |
| 6 |
|
import org.kuali.student.common.ui.client.mvc.breadcrumb.BreadcrumbManager; |
| 7 |
|
import org.kuali.student.common.ui.client.mvc.history.HistoryManager; |
| 8 |
|
|
|
|
|
| 0% |
Uncovered Elements: 36 (36) |
Complexity: 10 |
Complexity Density: 0.42 |
|
| 9 |
|
public class ViewCourseParentController extends BasicLayout{ |
| 10 |
|
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 0 |
Complexity Density: - |
|
| 11 |
|
public static enum Views{VIEW, VERSIONS} |
| 12 |
|
|
| 13 |
|
private ViewCourseController view; |
| 14 |
|
private VersionsController versions; |
| 15 |
|
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
| 16 |
0
|
public ViewCourseParentController() {... |
| 17 |
0
|
super(ViewCourseParentController.class.toString()); |
| 18 |
0
|
this.setDefaultView(Views.VIEW); |
| 19 |
0
|
setupDefaultView(); |
| 20 |
|
} |
| 21 |
|
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 1 |
Complexity Density: 0.17 |
|
| 22 |
0
|
private void setupDefaultView() {... |
| 23 |
0
|
view = new ViewCourseController(Views.VIEW); |
| 24 |
0
|
view.setParentController(this); |
| 25 |
0
|
versions = new VersionsController(Views.VERSIONS); |
| 26 |
0
|
view.setParentController(this); |
| 27 |
0
|
this.addView(view); |
| 28 |
0
|
this.addView(versions); |
| 29 |
|
} |
| 30 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 31 |
0
|
@Override... |
| 32 |
|
public void setViewContext(ViewContext viewContext) { |
| 33 |
|
|
| 34 |
0
|
view.setViewContext(viewContext); |
| 35 |
|
} |
| 36 |
|
|
|
|
|
| 0% |
Uncovered Elements: 14 (14) |
Complexity: 3 |
Complexity Density: 0.3 |
|
| 37 |
0
|
@Override... |
| 38 |
|
public <V extends Enum<?>> void showView(final V viewType, final Callback<Boolean> onReadyCallback) { |
| 39 |
0
|
if(viewType == Views.VERSIONS){ |
| 40 |
0
|
view.setName(""); |
| 41 |
0
|
this.setName(view.getCourseTitle()); |
| 42 |
0
|
versions.setVersionIndId(view.getVersionIndId()); |
| 43 |
0
|
versions.setCurrentVersionId(view.getCurrentId()); |
| 44 |
0
|
versions.setCurrentTitle(view.getCourseTitle()); |
| 45 |
|
} |
| 46 |
0
|
else if(viewType == Views.VIEW){ |
| 47 |
0
|
view.setName(view.getCourseTitle()); |
| 48 |
0
|
this.setName(""); |
| 49 |
|
} |
| 50 |
0
|
super.showView(viewType, onReadyCallback); |
| 51 |
|
} |
| 52 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 53 |
0
|
@Override... |
| 54 |
|
public Enum<?> getViewEnumValue(String enumValue) { |
| 55 |
0
|
return Views.valueOf(enumValue); |
| 56 |
|
} |
| 57 |
|
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 3 |
Complexity Density: 1 |
|
| 58 |
0
|
@Override... |
| 59 |
|
public void beforeShow(Callback<Boolean> onReadyCallback) { |
| 60 |
0
|
if(this.getName() != null && !this.getName().equals("")){ |
| 61 |
0
|
this.setName(""); |
| 62 |
|
} |
| 63 |
0
|
super.beforeShow(onReadyCallback); |
| 64 |
|
} |
| 65 |
|
|
| 66 |
|
} |