Package org.apache.wicket.markup.html.basic

Examples of org.apache.wicket.markup.html.basic.Label


      }
      else
      {
         label += ":";
      }
      Label labelComponent = new Label("label", label);
      add(labelComponent);
      feedbackPanel = new FeedbackPanel("message", new ContainerFeedbackMessageFilter(this));
      add(component, model, modelClass, propertyExpression);
      add(feedbackPanel);
   }
View Full Code Here


{

   public HotelViewPanel(String id, Hotel hotel)
   {
      super(id);
      add(new OutputBorder("hotelNameBorder", "Name", new Label("hotelName", hotel.getName())));
      add(new OutputBorder("hotelAddressBorder", "Address", new Label("hotelAddress", hotel.getAddress())));
      add(new OutputBorder("hotelCityBorder", "City", new Label("hotelCity", hotel.getCity())));
      add(new OutputBorder("hotelStateBorder", "State", new Label("hotelState", hotel.getState())));
      add(new OutputBorder("hotelZipBorder", "Zip", new Label("hotelZip", hotel.getZip())));
      add(new OutputBorder("hotelCountryBorder", "Country", new Label("hotelCountry", hotel.getCountry())));
      add(new OutputBorder("hotelPriceBorder", "Nightly Rate", new Label("hotelPrice", DecimalFormat.getCurrencyInstance(Locale.US).format(hotel.getPrice()))));
   }
View Full Code Here

      body.add(messages);
     
      /*
       * Hotel Search results
       */
      noHotelsFound = new Label("noResults", "No Hotels Found")
      {
         /**
          * Only display the message if no hotels are found
          *
          */
         @Override
         public boolean isVisible()
         {
            return Identity.instance().isLoggedIn() && hotelSearch.getHotels().size() == 0;
         }
      };
      body.add(noHotelsFound.setOutputMarkupId(true));
      hotelDataView = new DataView("hotel", new SimpleDataProvider() // A DataProvider adapts between your data and Wicket's internal representation
      {
         public Iterator iterator(int from, int count)
         {
            return hotelSearch.getHotels().subList(from, from + count).iterator();
         }

         public int size()
         {
            return hotelSearch.getHotels().size();
         }

      })
      {
         /**
          * You specify the tr in the html, and populate each one here
          */
         @Override
         protected void populateItem(Item item)
         {
            final Hotel hotel = (Hotel) item.getModelObject();
            item.add(new Label("hotelName", hotel.getName()));
            item.add(new Label("hotelAddress", hotel.getAddress()));
            item.add(new Label("hotelCityStateCountry", hotel.getCity() + ", " + hotel.getState() + ", " + hotel.getCountry()));
            item.add(new Label("hotelZip", hotel.getZip()));
            //item.add(new BookmarkablePageLink("viewHotel", org.jboss.seam.example.wicket.Hotel.class).setParameter("hotelId", hotel.getId()));
            item.add(new Link("viewHotel")
            {

               @Begin
               @Override
               public void onClick()
               {
                  hotelBooking.selectHotel(hotel);
                  setResponsePage(new org.jboss.seam.example.wicket.Hotel(new PageParameters()));
               }
           
            });
         }
        
      };
     
      // Set the maximum items per page
      hotelDataView.setItemsPerPage(hotelSearchForm.getPageSize());
      hotelDataView.setOutputMarkupId(true);
      hotels = new WebMarkupContainer("hotels");
      hotels.add(hotelDataView).setOutputMarkupId(true);
     
     
      // Add a pager
      hotels.add(new AjaxPagingNavigator("hotelPager", hotelDataView)
      {
         @Override
         public boolean isVisible()
         {
            return hotelDataView.isVisible();
         }

      });
     
      body.add(hotels);
     
      /*
       * Existing hotel booking
       */
      bookedHotelDataView = new DataView("bookedHotel", new SimpleDataProvider()
      {
         public Iterator iterator(int from, int count)
         {
            return bookings.subList(from, from + count).iterator();
         }

         public int size()
         {
            return bookings.size();
         }
        
        

      })
      {

         @Override
         protected void populateItem(Item item)
         {
            final Booking booking = (Booking) item.getModelObject();
            item.add(new Label("hotelName", booking.getHotel().getName()));
            item.add(new Label("hotelAddress", booking.getHotel().getAddress()));
            item.add(new Label("hotelCityStateCountry", booking.getHotel().getCity() + ", " + booking.getHotel().getState() + ", " + booking.getHotel().getState()));
            item.add(new Label("hotelCheckInDate", booking.getCheckinDate().toString()));
            item.add(new Label("hotelCheckOutDate", booking.getCheckoutDate().toString()));
            item.add(new Label("hotelConfirmationNumber", booking.getId().toString()));
            item.add(new Link("cancel")
            {

               @Override
               public void onClick()
               {
                  bookingList.cancel(booking);
               }
              
            });
         }
        
         @Override
         public boolean isVisible()
         {
            return Identity.instance().isLoggedIn() && bookings.size() > 0;
         }

      };
      body.add(bookedHotelDataView);
      body.add(new Label("noHotelsBooked", "No Bookings Found")
      {
         @Override
         public boolean isVisible()
         {
            return Identity.instance().isLoggedIn() && bookings.size() == 0;
View Full Code Here

    * @param component The component to wrap
    */
   public OutputBorder(String id, String label, WebComponent component)
   {
      super(id);
      add(new Label("label", label + ": "));
      add(component);
   }
View Full Code Here

  public Confirm(final PageParameters parameters)
  {
     super(parameters);
     Template body = new Template("body");
     body.add(new HotelViewPanel("hotel", booking.getHotel()));
     body.add(new OutputBorder("totalBorder", "Total Payment", new Label("total", DecimalFormat.getCurrencyInstance(Locale.US).format(booking.getTotal()))));
     body.add(new OutputBorder("checkinDateBorder", "Check in", new Label("checkinDate", new SimpleDateFormat().format(booking.getCheckinDate()))));
     body.add(new OutputBorder("checkoutDateBorder", "Check out", new Label("checkoutDate", new SimpleDateFormat().format(booking.getCheckoutDate()))));
     body.add(new OutputBorder("creditCardNumberBorder", "Credit Card #", new Label("creditCardNumber", booking.getCreditCard())));
     body.add(new Link("revise")
      {
         @Override
         public void onClick()
         {
View Full Code Here

         {
            identity.logout();
            setResponsePage(Home.class);
         }
      });
      add(new Label("userName", user.getName()));
   }
View Full Code Here

   *
   * @param parameters
   *            Page parameters
   */
    public HomePage(final PageParameters parameters) {
        add(new Label("message", "This clock updates the time using Atmosphere Meteor PUSH framework"));
        add(new ClockPanel("clockPanel"));
    }
View Full Code Here

public class ClockPanel extends Panel {

    public ClockPanel(String id) {
        super(id);
        add(new BookmarkablePageLink<PushPage>("cometStart", PushPage.class));
        add(new Label("clock", new AbstractReadOnlyModel<String>() {
            @Override
            public String getObject() {
                return new Date().toString();
            }
        }));
View Full Code Here

            this.consoleLoggerController = consoleLoggerController;
        }

        @Override
        protected void populateItem(final ListItem<LoggerTO> item) {
            item.add(new Label("name"));

            DropDownChoice<SyncopeLoggerLevel> level = new DropDownChoice<SyncopeLoggerLevel>("level");
            level.setModel(new IModel<SyncopeLoggerLevel>() {

                private static final long serialVersionUID = -2350428186089596562L;
View Full Code Here

   * @return The editor
   */
  protected Component newLabel(final MarkupContainer parent, final String componentId,
    final IModel<T> model)
  {
    Label label = new Label(componentId, model)
    {
      private static final long serialVersionUID = 1L;

      @Override
      public <C> IConverter<C> getConverter(final Class<C> type)
      {
        IConverter<C> c = AjaxEditableLabel.this.getConverter(type);
        return c != null ? c : super.getConverter(type);
      }

      /**
       * {@inheritDoc}
       */
      @Override
      public void onComponentTagBody(final MarkupStream markupStream,
        final ComponentTag openTag)
      {
        Object modelObject = getDefaultModelObject();
        if ((modelObject == null) || "".equals(modelObject))
        {
          replaceComponentTagBody(markupStream, openTag, defaultNullLabel());
        }
        else
        {
          super.onComponentTagBody(markupStream, openTag);
        }
      }
    };
    label.setOutputMarkupId(true);
    label.add(new LabelAjaxBehavior(getLabelAjaxEvent()));
    return label;
  }
View Full Code Here

TOP

Related Classes of org.apache.wicket.markup.html.basic.Label

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.