Ejemplo n.º 1
0
  private VerticalPanel buildExtras() {

    HorizontalPanel extsBaseRow = new HorizontalPanel();

    ToggleButton bShowOnly = new ToggleButton(new Image("images/button_eye.gif"), this);
    bShowOnly.setTitle("Click to hide all route segments except this one! Click again to restore.");
    extsBaseRow.add(bShowOnly);

    soClick = new HTML("<div class=\"togglelink\">詳細內容</div>");
    soClick.setTitle("顯示詳細內容.");
    soClick.addClickListener(this);
    extsBaseRow.add(soClick);

    VerticalPanel exts = new VerticalPanel();
    exts.add(extsBaseRow);

    detailPanel = buildStopOvers();
    exts.add(detailPanel);

    exts.setStyleName("extras");
    extsBaseRow.setStyleName("base_row");
    bShowOnly.setStyleName("eye");
    detailPanel.setStyleName("stopovers");
    return exts;
  }
 public HideShowAnnotationsButton(final AnnotationController annotationController) {
   final TranslationConstants translationConstants = GWT.create(TranslationConstants.class);
   final ToggleButton button =
       new ToggleButton(
           translationConstants.showAnnotations(), translationConstants.hideAnnotations());
   button.setStyleName("annotation-hide-show-button");
   button.setDown(annotationController.isAnnotationsVisible());
   button.addClickHandler(
       new ClickHandler() {
         @Override
         public void onClick(ClickEvent event) {
           if (button.isDown()) {
             showAnnotations();
           } else {
             hideAnnotations();
           }
         }
       });
   initWidget(button);
 }
 public MultiValuedEntityMultiselected(
     MetaUnitMultivaluedEntityDTO dto,
     JSON_Representation represent,
     HashMap<String, String> filling,
     String base_name) {
   initWidget((Widget) uiBinder.createAndBindUi(this));
   this.dto = dto;
   this.entity_name.setText(dto.getDesc());
   this.filling = filling;
   if (this.filling == null) this.filling = new HashMap<String, String>();
   editBtn.setStyleName("metaoptsBtn");
   this.base_name =
       base_name.equals("") ? dto.getUnique_name() : base_name + "_" + dto.getUnique_name();
   if (this.filling.containsKey(this.base_name)) {
     String val = (String) filling.get(this.base_name);
     if (val != null) {
       this.items_list.setText(val);
       if (val.contains(";")) {
         String[] tokens = val.split(";");
         for (String token : tokens) {
           int index = dto.getItem_names().indexOf(token);
           long idd = ((Long) dto.getItem_ids().get(index)).longValue();
           this.initial_selected_ids.add(Long.valueOf(idd));
           this.selected_ids.add(Long.valueOf(idd));
         }
       } else {
         int index = dto.getItem_names().indexOf(val);
         if (index != -1) {
           long idd = ((Long) dto.getItem_ids().get(index)).longValue();
           this.initial_selected_ids.add(Long.valueOf(idd));
           this.selected_ids.add(Long.valueOf(idd));
         }
       }
     }
   }
 }