Пример #1
0
 private void addSuggestPanel() {
   HorizontalPanel langPanel = new HorizontalPanel();
   langPanel.setSpacing(5);
   langPanel.add(new HTML("Enter language:"));
   MultiWordSuggestOracle langChoices = new ProgrammingLanguageOracle();
   SuggestBox langBox = new SuggestBox(langChoices);
   langPanel.add(langBox);
   Button searchButton = new Button("Send to Google");
   searchButton.addClickHandler(new SearchHandler(langBox));
   langPanel.add(searchButton);
   RootPanel.get("suggest-panel").add(langPanel);
 }
Пример #2
0
 private void addPanelForPopups() {
   HorizontalPanel buttonPanel = new HorizontalPanel();
   buttonPanel.setSpacing(10);
   Button button1 = new Button("DialogBox");
   button1.addClickHandler(new DialogHandler());
   buttonPanel.add(button1);
   Button button2 = new Button("PopupPanel");
   button2.addClickHandler(new PopupHandler());
   buttonPanel.add(button2);
   Button button3 = new Button("Native Dialog (Alert) Box");
   button3.addClickHandler(new AlertHandler());
   buttonPanel.add(button3);
   RootPanel.get("popup-buttons").add(buttonPanel);
 }
Пример #3
0
  public OrderDetails() {
    main = new HorizontalPanel();
    initWidget(main);
    main.setWidth("100%");

    parent = null;
  }
Пример #4
0
 private void addMenuPanel() {
   HorizontalPanel searchPanel = new HorizontalPanel();
   searchPanel.setSpacing(5);
   searchPanel.add(new HTML("Enter language:"));
   MultiWordSuggestOracle langChoices = new ProgrammingLanguageOracle();
   final SuggestBox langBox = new SuggestBox(langChoices);
   searchPanel.add(langBox);
   MenuBar mainMenu = new MenuBar();
   MenuBar searchMenu = new SearchMenuBar(langBox);
   mainMenu.addItem("Search", searchMenu);
   Command alertCommand =
       new Command() {
         public void execute() {
           Window.alert("Selection is " + langBox.getText());
         }
       };
   mainMenu.addItem("Alert", alertCommand);
   MenuBar modifierMenu = new ModifierMenuBar(langBox);
   mainMenu.addItem("Modify", modifierMenu);
   searchPanel.add(mainMenu);
   RootPanel.get("menu-panel").add(searchPanel);
 }
Пример #5
0
  /** **************************************************************** ObjectWidget */
  public void setValue(FromServer element) {
    boolean edit;
    Supplier supp;
    CustomCaptionPanel frame;

    super.setValue(element);
    main.clear();

    if (element != null) {
      supp = (Supplier) element.getObject("supplier");
      edit = (supp.iAmReference() && element.sharingStatus() <= ACL.ACL_READWRITE);
    } else {
      edit = false;
    }

    frame = new CustomCaptionPanel("Attributi");
    main.add(frame);
    main.setCellWidth(frame, "50%");

    supplier = new NameLabelWidget();
    frame.addPair("Fornitore", widgetWarp("supplier", supplier));

    status = Order.doOrderStatusSelector(edit);
    frame.addPair("Stato", widgetWarp("status", status));

    if (edit == true) anticipated = new PercentageBox();
    else anticipated = new PercentageViewer();

    frame.addPair("Anticipo", widgetWarp("anticipated", (Widget) anticipated));

    frame = new CustomCaptionPanel("Date");
    main.add(frame);
    main.setCellWidth(frame, "50%");

    if (edit == true) {
      BankMovementSelector bms;

      startdate = new DateSelector();
      enddate = new DateSelector();
      shippingdate = new DateSelector();

      bms = new BankMovementSelector();
      bms.setDefaultType(BankMovement.ORDER_PAYMENT);
      bms.setDefaultTargetSupplier(element.getObject("supplier"));
      bms.setDefaultNote("Pagamento ordine a " + element.getObject("supplier").getString("name"));
      payment = bms;
    } else {
      startdate = new DateViewer();
      enddate = new DateViewer();
      shippingdate = new DateViewer();
      payment = new BankMovementCellViewer();
    }

    frame.addPair("Data apertura", widgetWarp("startdate", (Widget) startdate));
    frame.addPair("Data chiusura", widgetWarp("enddate", (Widget) enddate));
    frame.addPair("Data consegna", widgetWarp("shippingdate", (Widget) shippingdate));

    if (Session.getGAS().getBool("use_bank") == true)
      frame.addPair("Pagamento", widgetWarp("payment_event", (Widget) payment));

    if (element != null) {
      supplier.setValue(element.getObject("supplier"));
      status.setVal(element.getInt("status"));
      anticipated.setValue(element.getString("anticipated"));
      startdate.setValue(element.getDate("startdate"));
      enddate.setValue(element.getDate("enddate"));
      shippingdate.setValue(element.getDate("shippingdate"));
      payment.setValue(element.getObject("payment_event"));
    }
  }