| 1 |  |   | 
  | 2 |  |   | 
  | 3 |  |   | 
  | 4 |  |   | 
  | 5 |  |   | 
  | 6 |  |   | 
  | 7 |  |   | 
  | 8 |  |   | 
  | 9 |  |   | 
  | 10 |  |   | 
  | 11 |  |   | 
  | 12 |  |   | 
  | 13 |  |   | 
  | 14 |  |   | 
  | 15 |  |   | 
  | 16 |  |  package org.kuali.student.common.ui.client.configurable.mvc.sections; | 
  | 17 |  |   | 
  | 18 |  |  import org.kuali.student.common.ui.client.configurable.mvc.SectionTitle; | 
  | 19 |  |  import org.kuali.student.common.ui.client.widgets.KSButton; | 
  | 20 |  |  import org.kuali.student.common.ui.client.widgets.KSButtonAbstract.ButtonStyle; | 
  | 21 |  |   | 
  | 22 |  |  import com.google.gwt.event.dom.client.ClickHandler; | 
  | 23 |  |  import com.google.gwt.user.client.ui.Composite; | 
  | 24 |  |  import com.google.gwt.user.client.ui.FlowPanel; | 
  | 25 |  |   | 
  | 26 |  |  public class MultiplicityHeader extends Composite{ | 
  | 27 |  |           | 
  | 28 | 0 |          private FlowPanel header = new FlowPanel(); | 
  | 29 | 0 |          private FlowPanel actions = new FlowPanel(); | 
  | 30 | 0 |          private FlowPanel clearDiv = new FlowPanel(); | 
  | 31 |  |          private SectionTitle title; | 
  | 32 |  |          private KSButton help; | 
  | 33 | 0 |          private KSButton delete = null; | 
  | 34 |  |           | 
  | 35 | 0 |          public MultiplicityHeader(SectionTitle title, boolean readOnly){ | 
  | 36 | 0 |                  this.title = title; | 
  | 37 | 0 |                  header.add(title); | 
  | 38 |  |                   | 
  | 39 | 0 |                  help = new KSButton("?", ButtonStyle.HELP); | 
  | 40 | 0 |                  actions.add(help); | 
  | 41 |  |                   | 
  | 42 | 0 |                  if(!readOnly){ | 
  | 43 | 0 |                          delete = new KSButton("X", ButtonStyle.DELETE); | 
  | 44 | 0 |                          actions.add(delete); | 
  | 45 |  |                  } | 
  | 46 |  |                   | 
  | 47 | 0 |                  actions.setStyleName("ks-form-header-title-actions"); | 
  | 48 |  |                   | 
  | 49 | 0 |                  header.add(actions); | 
  | 50 |  |                   | 
  | 51 | 0 |                  clearDiv.setStyleName("clear"); | 
  | 52 | 0 |                  header.add(clearDiv); | 
  | 53 | 0 |                  this.initWidget(header); | 
  | 54 | 0 |          } | 
  | 55 |  |   | 
  | 56 |  |          public void addDeleteHandler(ClickHandler handler){ | 
  | 57 | 0 |                  if(delete!=null){ | 
  | 58 | 0 |                          delete.addClickHandler(handler); | 
  | 59 |  |                  } | 
  | 60 | 0 |          } | 
  | 61 |  |           | 
  | 62 |  |          public void addHelpHandler(ClickHandler handler){ | 
  | 63 | 0 |                  help.addClickHandler(handler); | 
  | 64 | 0 |          } | 
  | 65 |  |           | 
  | 66 |  |  } |