| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| DisplayItem |
|
| 1.3333333333333333;1.333 |
| 1 | /** | |
| 2 | * Copyright 2010 The Kuali Foundation Licensed under the | |
| 3 | * Educational Community License, Version 2.0 (the "License"); you may | |
| 4 | * not use this file except in compliance with the License. You may | |
| 5 | * obtain a copy of the License at | |
| 6 | * | |
| 7 | * http://www.osedu.org/licenses/ECL-2.0 | |
| 8 | * | |
| 9 | * Unless required by applicable law or agreed to in writing, | |
| 10 | * software distributed under the License is distributed on an "AS IS" | |
| 11 | * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express | |
| 12 | * or implied. See the License for the specific language governing | |
| 13 | * permissions and limitations under the License. | |
| 14 | */ | |
| 15 | ||
| 16 | package org.kuali.student.common.ui.client.configurable.mvc.multiplicity; | |
| 17 | ||
| 18 | ||
| 19 | import org.kuali.student.common.ui.client.configurable.mvc.multiplicity.MultiplicityComposite.StyleType; | |
| 20 | import org.kuali.student.common.ui.client.widgets.KSLabel; | |
| 21 | ||
| 22 | import com.google.gwt.user.client.ui.FlowPanel; | |
| 23 | import com.google.gwt.user.client.ui.Widget; | |
| 24 | ||
| 25 | /** | |
| 26 | * This is a read only version of MultiplicityItem for use in read only multiplicity composites. | |
| 27 | * | |
| 28 | * | |
| 29 | * @author Kuali Student Team | |
| 30 | */ | |
| 31 | ||
| 32 | /** | |
| 33 | * @deprecated | |
| 34 | */ | |
| 35 | public class DisplayItem extends MultiplicityItem { | |
| 36 | 0 | private boolean loaded = false; |
| 37 | private KSLabel itemLabel; | |
| 38 | ||
| 39 | 0 | protected FlowPanel itemPanel = new FlowPanel(); |
| 40 | ||
| 41 | 0 | public DisplayItem(){ |
| 42 | 0 | initWidget(itemPanel); |
| 43 | 0 | } |
| 44 | ||
| 45 | 0 | public DisplayItem(StyleType style){ |
| 46 | 0 | this.initWidget(itemPanel); |
| 47 | ||
| 48 | 0 | } |
| 49 | public void onLoad(){ | |
| 50 | 0 | } |
| 51 | ||
| 52 | /** | |
| 53 | * @see org.kuali.student.common.ui.client.configurable.mvc.multiplicity.MultiplicityItem#clear() | |
| 54 | */ | |
| 55 | @Override | |
| 56 | public void clear() { | |
| 57 | 0 | loaded = false; |
| 58 | 0 | } |
| 59 | ||
| 60 | /** | |
| 61 | * @see org.kuali.student.common.ui.client.configurable.mvc.multiplicity.MultiplicityItem#redraw() | |
| 62 | */ | |
| 63 | @Override | |
| 64 | public void redraw() { | |
| 65 | 0 | Widget item = getItemWidget(); |
| 66 | 0 | if (!loaded){ |
| 67 | ||
| 68 | 0 | if (itemLabel != null) { |
| 69 | 0 | itemPanel.add(itemLabel); |
| 70 | 0 | itemLabel.addStyleName("KS-Multiplicity-Item-Header"); |
| 71 | } | |
| 72 | 0 | itemPanel.add(item); |
| 73 | 0 | itemPanel.addStyleName("KS-Multiplicity-Display-Item"); |
| 74 | 0 | loaded = true; |
| 75 | } | |
| 76 | //redraw() removed, probably not needed here | |
| 77 | /* if (item instanceof Section){ | |
| 78 | ((Section)item).redraw(); | |
| 79 | }*/ | |
| 80 | 0 | } |
| 81 | ||
| 82 | ||
| 83 | public void setItemLabel(String itemLabel) { | |
| 84 | 0 | this.itemLabel = new KSLabel(itemLabel); |
| 85 | 0 | } |
| 86 | ||
| 87 | } |