예제 #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);
 }
 private HorizontalPanel buildParameterEntry(String key, String value) {
   HorizontalPanel entry = new HorizontalPanel();
   entry.setSpacing(5);
   entry.add(buildParameterTextBox(key));
   entry.add(buildEqualsLabel());
   entry.add(buildParameterTextBox(value));
   entry.add(buildRemoveParameterButton(entry));
   return entry;
 }
  public DebugAgentsMessagesMapWindow() {

    statusBar.add(mousexLabel);
    statusBar.add(mouseyLabel);
    mousexLabel.setWidth("100px");

    infoWindow = MessageInfoWindowOnCanvas.getInstance();
    infoWindow.setCanvas(gwtBitsCanvas);

    calculatePositions();
    mainAgentsPanel.add(gwtBitsCanvas);

    mainAgentsPanel.add(statusBar);
    mainAgentsPanel.add(propertyPanel);

    initWidget(mainAgentsPanel);

    gwtBitsCanvas.addMouseMoveHandler(
        new MouseMoveHandler() {
          public void onMouseMove(MouseMoveEvent event) {
            mouseX = event.getRelativeX(gwtBitsCanvas.getElement());
            mouseY = event.getRelativeY(gwtBitsCanvas.getElement());
            mousexLabel.setText("" + mouseX);
            mouseyLabel.setText("" + mouseY);
            //
            //                IAgent newagent =getSelectedAgent();
            //                if (currentAgent != newagent){
            //                    setNewAgentSelected(newagent);
            //                }
          }
        });

    gwtBitsCanvas.addMouseOverAgentHandler(
        new MouseOverCanvasItemHandler() {
          @Override
          public void mouseOverCanvasItem(GwtBitsCanvasItemBaseClass canvasItem) {
            propertyPanel.clear();
            propertyPanel.add(new Label(canvasItem.getDebugString()));
          }
        });

    Esb.register(this);
    Esb.registerScreenPosition(this, 0.9, 0.9);
  }
예제 #7
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"));
    }
  }
 private String getParameterValue(HorizontalPanel entry) {
   TextBox key = (TextBox) entry.getWidget(2);
   return key.getText();
 }