Example #1
0
  private void addImageAndTitle(HorizontalPanel hp, GWTAppProperties properties) {
    Image logo = new Image(properties.getHeaderLogo());
    logo.setStyleName("square-header-LogoImage");
    logo.addClickHandler(
        new ClickHandler() {

          public void onClick(ClickEvent event) {
            // when you click on the image, go to the home page.
            History.newItem(ChooseCasePilot.generateNavigationId(ChooseCasePilot.PageId.home));
          }
        });

    logo.setPixelSize(50, 50);
    hp.add(logo);

    VerticalPanel titleVerticalPane = new VerticalPanel();
    titleVerticalPane.setSize("100%", "100%");
    Label title = new Label(properties.getHeaderTitle1());
    Label subTitle = new Label(properties.getHeaderTitle2());
    title.setStyleName("square-headerpane-title");
    subTitle.setStyleName("square-headerpane-tagline");

    titleVerticalPane.add(title);
    titleVerticalPane.add(subTitle);

    hp.add(titleVerticalPane);
  }
  private VerticalPanel getPanel() {
    VerticalPanel panel = new VerticalPanel();
    panel.setStyleName("StudioPopup");

    VerticalPanel info = new VerticalPanel();
    info.setSpacing(10);

    Label lbl = new Label();
    lbl.setStyleName("StudioPopup-Msg-Strong");
    lbl.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
    lbl.setText("Add Value");

    Label lblName = new Label();
    lblName.setStyleName("StudioPopup-Msg");
    lblName.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    lblName.setText("Value");

    enumValue = new TextBox();
    enumValue.setWidth("155px");

    HorizontalPanel namePanel = new HorizontalPanel();
    namePanel.setSpacing(10);
    namePanel.add(lblName);
    namePanel.add(enumValue);
    namePanel.setCellVerticalAlignment(lblName, HasVerticalAlignment.ALIGN_MIDDLE);

    info.add(lbl);
    info.add(namePanel);

    panel.add(info);
    panel.add(getButtonPanel());

    return panel;
  }
  private Panel createButtons() {

    final HorizontalPanel panel = new HorizontalPanel();

    Button save = new Button("Save");
    save.setStyleName("button");
    save.addClickListener(
        new ClickListener() {

          public void onClick(Widget widget) {
            if (validateFormInput()) {
              createNote(inputNoteTitle.getText(), inputNoteText.getText());
              resetForm();
            }
          }
        });

    Button clear = new Button("Clear");
    save.setStyleName("button");
    clear.addClickListener(
        new ClickListener() {

          public void onClick(Widget widget) {
            resetForm();
          }
        });

    panel.add(save);
    panel.add(clear);

    return panel;
  }
Example #4
0
  private Panel createNewNameInput(final ScrollPanel contentPanel) {
    VerticalPanel form = new VerticalPanel();
    HorizontalPanel nameForm = new HorizontalPanel();
    nameForm.add(new Label("Name"));
    final TextBox nameTextBox = new TextBox();
    nameTextBox.setName("personName");
    nameForm.add(nameTextBox);
    form.add(nameForm);
    Button saveButton =
        new Button(
            "Store",
            new ClickListener() {
              public void onClick(Widget sender) {
                String name = nameTextBox.getText();
                RaffleServiceGwtRemoteAsync service = RaffleServiceGwtRemote.App.getInstance();
                AsyncCallback callback =
                    new AsyncCallback() {
                      public void onFailure(Throwable caught) {
                        GWT.log("Failure while creating a new name", caught);
                      }

                      public void onSuccess(Object result) {
                        contentPanel.setWidget(new Label("Name is stored"));
                      }
                    };
                service.storeName(name, callback);
              }
            });
    form.add(saveButton);
    return form;
  }
  protected Widget createCurrentSelectionWidget() {
    if (!displayerSettings.isFilterEnabled()) return null;

    Set<String> columnFilters = filterColumns();
    if (columnFilters.isEmpty()) return null;

    HorizontalPanel panel = new HorizontalPanel();
    panel.getElement().setAttribute("cellpadding", "2");

    for (String columnId : columnFilters) {
      List<Interval> selectedValues = filterIntervals(columnId);
      DataColumn column = dataSet.getColumnById(columnId);
      for (Interval interval : selectedValues) {
        String formattedValue = formatInterval(interval, column);
        panel.add(new Label(formattedValue));
      }
    }

    Anchor anchor = new Anchor(GoogleDisplayerConstants.INSTANCE.googleDisplayer_resetAnchor());
    panel.add(anchor);
    anchor.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            filterReset();

            // Update the chart view in order to reflect the current selection
            // (only if not has already been redrawn in the previous filterUpdate() call)
            if (!displayerSettings.isFilterSelfApplyEnabled()) {
              updateVisualization();
            }
          }
        });
    return panel;
  }
Example #6
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;
  }
Example #7
0
  public Widget asWidget() {

    HorizontalPanel layout = new HorizontalPanel();
    layout.getElement().setAttribute("style", "padding:4px;");

    server = new ComboBox();
    server.addValueChangeHandler(
        new ValueChangeHandler<String>() {
          @Override
          public void onValueChange(final ValueChangeEvent<String> event) {

            Scheduler.get()
                .scheduleEntry(
                    new Scheduler.ScheduledCommand() {
                      @Override
                      public void execute() {
                        // Console.MODULES.getEventBus().fireEvent(new
                        // ServerSelectionEvent(event.getValue()));
                      }
                    });
          }
        });

    Label hostLabel = new Label("Server:");
    hostLabel.setStyleName("header-label");
    layout.add(hostLabel);
    Widget hWidget = server.asWidget();
    layout.add(hWidget);

    // combo box use all available space
    hWidget.getElement().getParentElement().setAttribute("width", "100%");

    return layout;
  }
Example #8
0
  // PostData page contains a list of Posts
  //  Created when user clicks "View Posts"
  public void viewPostData(List<PostData> posts) {
    if (posts == null) return;

    RootPanel rootPanel = RootPanel.get();
    rootPanel.clear();
    makeMenuBar(rootPanel);

    HorizontalPanel horizontalPanel = new HorizontalPanel();
    rootPanel.add(horizontalPanel, 10, 79);

    makeSideBar(horizontalPanel);

    VerticalPanel dataListPanel = new VerticalPanel();
    horizontalPanel.add(dataListPanel);

    FlowPanel flowPanel = new FlowPanel();
    dataListPanel.add(flowPanel);

    Label programTitlebar = new Label("GusList");
    programTitlebar.addStyleName("appTitleBar");
    programTitlebar.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    flowPanel.add(programTitlebar);

    makePostTable(posts, flowPanel, dataListPanel);
  }
  public void showContainerSizePanel() {
    CaptionPanel bodySize = new CaptionPanel(constants.containerSizeTitle());
    bodySize.setWidth("185px");

    final VerticalPanel content = new VerticalPanel();

    containerSizeListBox = new CustomListBox();

    content.add(containerSizeListBox);
    bodySize.setContentWidget(content);

    HorizontalPanel setSizePanel = new HorizontalPanel();

    setSizeDisclosurePanel = new DisclosurePanel(constants.sizeInPixel());
    setSizeDisclosurePanel.setAnimationEnabled(true);
    setSizeDisclosurePanel.setOpen(true);
    setSizeDisclosurePanel.setVisible(false);

    setSizeDisclosurePanel.add(setSizePanel);

    customSizeTextBox = new TextBox();
    customSizeTextBox.setWidth("50px");
    setSizePanel.add(customSizeTextBox);

    validCustomSizeButton = new Button("OK");

    setSizePanel.add(validCustomSizeButton);

    content.add(setSizeDisclosurePanel);

    builderContent.add(bodySize);
  }
Example #10
0
    public CmdButton(String name, Widget icon, Command cmd, String label, String desc) {
      this.name = name;
      this.command = cmd;
      this.name = name;
      String htmlstr = label == null ? name : label;
      html = new HTML(htmlstr);
      if (desc != null) {
        html.setTitle(desc);
      }
      this.command = cmd;
      html.setWordWrap(false);
      if (command instanceof GeneralCommand) {
        addListeners();
        setButtonEnabled(((GeneralCommand) command).isEnabled());
      }

      GwtUtil.setStyles(iconHolderLeft, "padding", "none", "marginRight", "3px");
      GwtUtil.setStyle(html, "padding", "6px 0");
      container = GwtUtil.makeHoriPanel(null, null, iconHolderLeft, html, iconHolderRight);
      container.setCellVerticalAlignment(iconHolderLeft, VerticalPanel.ALIGN_MIDDLE);
      container.setCellVerticalAlignment(iconHolderRight, VerticalPanel.ALIGN_MIDDLE);
      setIconLeft(icon);
      setIconRight(null);
      GwtUtil.setStyle(container, "margin", "0px auto");
      initWidget(new SimplePanel(container));
    }
Example #11
0
        public void onSuccess(List<PacketUserData> result) {
          clear();
          add(html);
          HorizontalPanel horizontalPanel = new HorizontalPanel();
          for (PacketUserData data : result) {
            final VerticalPanel panel = new VerticalPanel();
            panel.setHorizontalAlignment(ALIGN_CENTER);

            final Image image = new Image(Constant.ICON_URL_PREFIX + data.imageFileName);
            image.setPixelSize(Constant.ICON_SIZE_BIG, Constant.ICON_SIZE_BIG);
            panel.add(image);

            final Label label = new Label(data.playerName);
            panel.add(label);

            horizontalPanel.add(panel);

            if (horizontalPanel.getWidgetCount() == 8) {
              add(horizontalPanel);
              horizontalPanel = new HorizontalPanel();
            }
          }

          if (horizontalPanel.getWidgetCount() != 0) {
            add(horizontalPanel);
          }
        }
 private void showMessagePopup() {
   Label validationMessageLabel = new Label();
   validationMessageLabel.setStyleName("validation-textbox-message-label"); // $NON-NLS-1$
   validationMessageLabel.setText(getValidationMessage());
   VerticalPanel messagePanel = new VerticalPanel();
   messagePanel.add(validationMessageLabel);
   HorizontalPanel bottomPanel = new HorizontalPanel();
   SimplePanel hSpacer = new SimplePanel();
   hSpacer.setStylePrimaryName("validation-textbox-left-image-buffer"); // $NON-NLS-1$
   bottomPanel.add(hSpacer);
   SimplePanel tailImagePanel = new SimplePanel();
   image = new Image(GWT.getModuleBaseURL() + "images/spacer.gif"); // $NON-NLS-1$
   image.setStylePrimaryName("validation-textbox-tail-image"); // $NON-NLS-1$
   tailImagePanel.add(image);
   bottomPanel.add(tailImagePanel);
   messagePanel.add(bottomPanel);
   popupPanel = new PopupPanel(true, false);
   popupPanel.setWidget(messagePanel);
   popupPanel.setPopupPositionAndShow(
       new PositionCallback() {
         public void setPosition(int offsetWidth, int offsetHeight) {
           int absLeft = -1;
           int absTop = -1;
           absLeft = textBox.getAbsoluteLeft();
           absTop = textBox.getAbsoluteTop();
           Rectangle popupSize = ElementUtils.getSize(popupPanel.getElement());
           popupPanel.setPopupPosition(
               absLeft, absTop - popupSize.height >= 0 ? absTop - popupSize.height : absTop);
         }
       });
   popupPanel.show();
 }
  public ActionRetractFactWidget(RuleModeller modeller, ActionRetractFact model, Boolean readOnly) {
    super(modeller);
    HorizontalPanel layout = new HorizontalPanel();
    layout.setWidth("100%");
    layout.setStyleName("model-builderInner-Background");

    if (readOnly == null) {
      this.readOnly =
          !modeller
              .getSuggestionCompletions()
              .containsFactType(modeller.getModel().getLHSBindingType(model.variableName));
    } else {
      this.readOnly = readOnly;
    }

    if (this.readOnly) {
      layout.addStyleName("editor-disabled-widget");
    }

    String desc =
        modeller.getModel().getLHSBindingType(model.variableName) + " [" + model.variableName + "]";
    layout.add(
        new SmallLabel(
            HumanReadable.getActionDisplayName("retract") + "&nbsp;<b>" + desc + "</b>"));

    // This widget couldn't be modified.
    this.setModified(false);

    initWidget(layout);
  }
Example #14
0
  public void run(final RootPanel rp, final String nick) {

    if (Cookies.getCookie(nick) == null) Cookies.setCookie(nick, "" + 0);

    cl.setPageSize(500);

    final Button sendMessage =
        new Button(
            "sendMessage",
            new ClickHandler() {

              public void onClick(ClickEvent event) {

                if (!message.getText().equals("")) {
                  new Post().postJson(SERVERURL, nick.toString(), message.getText());
                  message.setText("");
                }
              }
            });

    rp.get("mainDiv2").setVisible(true);
    message.getElement().setAttribute("placeholder", "Introduce your message");
    message.getElement().setAttribute("id", "message");

    cl.getElement().setAttribute("id", "chatBox");

    sendMessage.getElement().setAttribute("id", "sendMessage");
    sendMessage.setText("Send");

    vp.getElement().setAttribute("id", "verticalPanel");
    hp.getElement().setAttribute("id", "horizontalPanel");

    panel.getElement().setAttribute("id", "scroller");

    hp.add(message);
    hp.add(sendMessage);
    panel.add(cl);
    vp.add(panel);

    vp.add(hp);
    rp.get("mainDiv2").add(vp);

    Timer t =
        new Timer() {
          @Override
          public void run() {
            getMessages();

            if (chatList != null && Integer.parseInt(Cookies.getCookie(nick)) < chatList.size()) {
              cl.setRowCount(chatList.size() + 1, true);
              cl.setRowData(
                  Integer.parseInt(Cookies.getCookie(nick)),
                  chatList.subList(Integer.parseInt(Cookies.getCookie(nick)), chatList.size()));
              panel.setVerticalScrollPosition(panel.getMaximumVerticalScrollPosition() - 1);
              Cookies.setCookie(nick, "" + chatList.size());
            }
          }
        };
    t.scheduleRepeating(1000);
  }
  public LocalRepositoriesWidget() {
    RStudioGinjector.INSTANCE.injectMembers(this);

    VerticalPanel panel = new VerticalPanel();
    panel.add(new LabelWithHelp("Local repositories:", "packrat_local_repos"));

    HorizontalPanel hp = new HorizontalPanel();
    listBox_ = new ListBox(true);
    listBox_.addStyleName(RES.styles().listBox());
    listBox_.getElement().<SelectElement>cast().setSize(3);
    hp.add(listBox_);

    VerticalPanel buttonPanel = new VerticalPanel();
    SmallButton buttonAdd = createButton("Add...");
    buttonAdd.addClickHandler(addButtonClicked_);
    buttonPanel.add(buttonAdd);
    SmallButton buttonRemove = createButton("Remove");
    buttonRemove.addClickHandler(removeButtonClicked_);
    buttonPanel.add(buttonRemove);
    hp.add(buttonPanel);

    panel.add(hp);

    initWidget(panel);
  }
Example #16
0
  public void showFile(FileSystemItem file, String commitId, String contents) {
    commitId_ = commitId;
    targetFile_ = file;

    docDisplay_.setCode(contents, false);

    adaptToFileType(fileTypeRegistry_.getTextTypeForFile(file));

    // header widget has icon + label
    HorizontalPanel panel = new HorizontalPanel();

    Image imgFile = new Image(fileTypeRegistry_.getIconForFile(file));
    imgFile.addStyleName(RES.styles().captionIcon());
    panel.add(imgFile);

    Label lblCaption = new Label(file.getPath() + " @ " + commitId);
    lblCaption.addStyleName(RES.styles().captionLabel());
    panel.add(lblCaption);

    popupPanel_ = new FullscreenPopupPanel(panel, asWidget(), false);
    popupPanel_.center();

    // set focus to the doc display after 100ms
    Timer timer =
        new Timer() {
          public void run() {
            docDisplay_.focus();
          }
        };
    timer.schedule(100);
  }
  public RuleAttributeWidget(
      final RuleModeller parent, final RuleModel model, final boolean isReadOnly) {
    this.parent = parent;
    this.model = model;
    FormStyleLayout layout = new FormStyleLayout();
    // Adding metadata here, seems redundant to add a new widget for metadata. Model does handle
    // meta data separate.
    RuleMetadata[] meta = model.metadataList;
    if (meta.length > 0) {
      HorizontalPanel hp = new HorizontalPanel();
      hp.add(new SmallLabel(Constants.INSTANCE.Metadata2()));
      layout.addRow(hp);
    }
    for (int i = 0; i < meta.length; i++) {
      RuleMetadata rmd = meta[i];
      layout.addAttribute(rmd.getAttributeName(), getEditorWidget(rmd, i, isReadOnly));
    }
    RuleAttribute[] attrs = model.attributes;
    if (attrs.length > 0) {
      HorizontalPanel hp = new HorizontalPanel();
      hp.add(new SmallLabel(Constants.INSTANCE.Attributes1()));
      layout.addRow(hp);
    }
    for (int i = 0; i < attrs.length; i++) {
      RuleAttribute at = attrs[i];
      layout.addAttribute(at.getAttributeName(), getEditorWidget(at, i, isReadOnly));
    }

    initWidget(layout);
  }
Example #18
0
  private FlowLayoutContainer createButtons(Category cat) {
    VerticalPanel vp = new VerticalPanel();
    vp.setSpacing(10);
    vp.setWidth("400px");

    for (Type type : Type.values()) {
      vp.add(format(type.getText()));

      HorizontalPanel hp = new HorizontalPanel();
      hp.setSpacing(5);

      CellButtonBase<?> small = createButton(cat, type);
      CellButtonBase<?> medium = createButton(cat, type);
      CellButtonBase<?> large = createButton(cat, type);

      configureButton(small, type, ButtonScale.SMALL);
      configureButton(medium, type, ButtonScale.MEDIUM);
      configureButton(large, type, ButtonScale.LARGE);

      hp.add(small);
      hp.add(medium);
      hp.add(large);

      vp.add(hp);
    }

    FlowLayoutContainer f = new FlowLayoutContainer();
    f.getScrollSupport().setScrollMode(ScrollMode.AUTO);
    f.add(vp);

    con.add(f);

    return f;
  }
  /** Constructor */
  public ConfirmDialog() {
    dialogBox = new DialogBox(false, true);

    confirmPanel = new DockPanel();
    messageLabel = createMessageLabel();
    confirmPanel.add(messageLabel, DockPanel.CENTER);

    HorizontalPanel horizontalPanel = new HorizontalPanel();
    horizontalPanel.setSpacing(10);
    okButton = createOkButton();
    horizontalPanel.add(okButton);
    cancelButton = createCancelButton();
    horizontalPanel.add(cancelButton);

    if (defaultCloseHandlers != null) {
      for (CloseHandler<ConfirmDialog> closeHandler : defaultCloseHandlers) {
        this.addCloseHandler(closeHandler);
      }
    }

    if (defaultOpenHandlers != null) {
      for (OpenHandler<ConfirmDialog> openHandler : defaultOpenHandlers) {
        this.addOpenHandler(openHandler);
      }
    }

    confirmPanel.add(horizontalPanel, DockPanel.SOUTH);
    confirmPanel.setCellHorizontalAlignment(horizontalPanel, HasHorizontalAlignment.ALIGN_CENTER);

    dialogBox.add(confirmPanel);
    confirmPanel.getElement().getParentElement().setAttribute("align", "center");

    setStyleName(DEFAULT_STYLE_NAME);
  }
Example #20
0
  private Widget getSetterLabel() {
    HorizontalPanel horiz = new HorizontalPanel();

    if (model.state == ActionCallMethod.TYPE_UNDEFINED) {
      Image edit = DroolsGuvnorImages.INSTANCE.AddFieldToFact();
      edit.setAltText(Constants.INSTANCE.AddAnotherFieldToThisSoYouCanSetItsValue());
      edit.setTitle(Constants.INSTANCE.AddAnotherFieldToThisSoYouCanSetItsValue());
      edit.addClickHandler(
          new ClickHandler() {

            public void onClick(ClickEvent event) {
              Widget w = (Widget) event.getSource();
              showAddFieldPopup(w);
            }
          });
      horiz.add(
          new SmallLabel(
              HumanReadable.getActionDisplayName("call") + " [" + model.variable + "]")); // NON-NLS
      if (!this.readOnly) {
        horiz.add(edit);
      }
    } else {
      horiz.add(
          new SmallLabel(
              HumanReadable.getActionDisplayName("call")
                  + " ["
                  + model.variable
                  + "."
                  + model.methodName
                  + "]")); // NON-NLS
    }

    return horiz;
  }
Example #21
0
  /** Class Constructor */
  public ImportManager() {
    super();
    // initRPC
    rpc = (ImportRPCAsync) GWT.create(ImportRPC.class);
    ServiceDefTarget endpoint = (ServiceDefTarget) rpc;
    endpoint.setServiceEntryPoint(GWT.getModuleBaseURL() + "importRPC");

    initFileUploadPanel();
    add(fileUploadPanel);

    middlePanel.setSpacing(10);
    tableHelp =
        new Label(
            "Si desea actualizar los datos de click " + "en el boton etiquetado como 'refrescar'");
    middlePanel.add(tableHelp);
    refresh =
        new Button(
            "refrescar",
            new ClickListener() {
              public void onClick(Widget sender) {
                asynRefreshTableData();
              }
            });
    middlePanel.add(refresh);
    add(middlePanel);

    initSortableTable();
    asynRefreshTableData();
  }
  public CopyPlotToClipboardWebDialog(
      final ExportPlotOptions options,
      ExportPlotPreviewer previewer,
      final OperationWithInput<ExportPlotOptions> onClose) {
    super(options, previewer);

    setText("Copy Plot to Clipboard");

    ExportPlotResources resources = ExportPlotResources.INSTANCE;

    ThemedButton closeButton =
        new ThemedButton(
            "Close",
            new ClickHandler() {
              public void onClick(ClickEvent event) {
                // save options
                onClose.execute(getCurrentOptions(options));

                // close dialog
                closeDialog();
              }
            });
    addCancelButton(closeButton);

    HorizontalPanel infoPanel = new HorizontalPanel();

    Image rightMouseImage = new Image(resources.rightMouse());
    infoPanel.add(rightMouseImage);

    Label label = new Label("Right click on the plot image above to " + "copy to the clipboard.");
    label.setStylePrimaryName(resources.styles().rightClickCopyLabel());
    infoPanel.add(label);

    addLeftWidget(infoPanel);
  }
Example #23
0
  @PostConstruct
  public void init() {

    button.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent event) {
            String s = message.getText();
            remoteService
                .call(
                    new RemoteCallback<String>() {
                      @Override
                      public void callback(String s) {
                        responseLabel.setText("Message from Server: " + s);
                      }
                    })
                .myMethod(s);
          }
        });

    HorizontalPanel horizontalPanel = new HorizontalPanel();
    horizontalPanel.add(message);
    horizontalPanel.add(button);
    horizontalPanel.add(responseLabel);

    RootPanel.get().add(horizontalPanel);

    System.out.println("UI Constructed!");
  }
Example #24
0
 public <T extends ButtonBase> T addButton(T button, boolean closingButton) {
   buttonPanel.add(new Label(" "));
   buttonPanel.add(button);
   buttonPanel.add(new Label(" "));
   if (closingButton) button.addClickHandler(hideByClickHandler);
   return button;
 }
  private void showSetCellAlignmentDialog(final ListBox listBox, final IAlignment iAlignment) {
    final DialogBox origDialog = new DialogBox();
    DOM.setStyleAttribute(origDialog.getElement(), "zIndex", Integer.toString(Integer.MAX_VALUE));
    final VerticalPanel dialog = new VerticalPanel();
    origDialog.add(dialog);
    origDialog.setText("Cell Alignment Dialog");
    dialog.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);

    dialog.add(new Label("Please choose the Widget :"));
    final ListBox widgetIndexLb = new ListBox();
    for (Iterator<Widget> iterator = iterator(); iterator.hasNext(); ) {
      Widget next = iterator.next();
      widgetIndexLb.addItem(
          ((IVkWidget) next).getWidgetName() + " - at index - " + getWidgetIndex(next));
    }

    widgetIndexLb.setWidth("300px");
    dialog.add(widgetIndexLb);
    widgetIndexLb.addChangeHandler(
        new ChangeHandler() {
          @Override
          public void onChange(ChangeEvent event) {
            iAlignment.doAlignment(
                widgetIndexLb.getSelectedIndex(), listBox.getValue(listBox.getSelectedIndex()));
          }
        });
    dialog.add(new Label("Please choose Alignment"));
    dialog.add(listBox);
    listBox.addChangeHandler(
        new ChangeHandler() {
          @Override
          public void onChange(ChangeEvent event) {
            iAlignment.doAlignment(
                widgetIndexLb.getSelectedIndex(), listBox.getValue(listBox.getSelectedIndex()));
          }
        });
    HorizontalPanel buttonsPanel = new HorizontalPanel();
    dialog.add(buttonsPanel);
    Button saveButton = new Button("OK");
    buttonsPanel.add(saveButton);
    saveButton.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent event) {
            // iAlignment.doAlignment(widgetIndexLb.getSelectedIndex(),
            // listBox.getValue(listBox.getSelectedIndex()));
            origDialog.hide();
          }
        });
    Button cancelButton = new Button("Cancel");
    buttonsPanel.add(cancelButton);
    cancelButton.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent event) {
            origDialog.hide();
          }
        });
    origDialog.center();
  }
Example #26
0
  private void buildDialogInfo() {

    if (this._dialogInfo == null) {

      final String[] messages =
          new String[] {
            "Construire une archive zip ou jar contenant le projet GWT.",
            "Afin de réduire le temps de chargement, n'inclure que les fichiers *.gwt.xml.",
            "La taille du fichier archive ne doit pas dépasse 3Mo."
          };

      final HorizontalPanel hPanelSourceDir = new HorizontalPanel();
      hPanelSourceDir.setSpacing(Constantes.SPACING_MIN);
      hPanelSourceDir.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);

      this._tbSourceDirName.setWidth("100px");
      this._tbSourceDirName.setValue(this.getSourceDir());
      final Label label = new Label("répertoire racine des sources: ");
      hPanelSourceDir.add(label);
      hPanelSourceDir.add(this._tbSourceDirName);

      this._dialogInfo =
          WidgetUtils.buildDialogBox("Information", messages, hPanelSourceDir, false, null);
    }
  }
Example #27
0
  private void showAddNewComment() {
    newCommentLayout.clear();
    final TextArea comment = new TextArea();
    comment.setWidth("100%");
    newCommentLayout.add(comment);

    Button ok = new Button(constants.OK());
    Button cancel = new Button(constants.Cancel());

    ok.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent sender) {
            sendNewComment(comment.getText());
          }
        });

    cancel.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent sender) {
            showNewCommentButton();
          }
        });

    HorizontalPanel hp = new HorizontalPanel();
    hp.add(ok);
    hp.add(cancel);

    newCommentLayout.add(hp);

    comment.setFocus(true);
  }
 private Panel widgets(Widget left, Widget right) {
   HorizontalPanel panel = new HorizontalPanel();
   panel.add(left);
   panel.add(right);
   panel.setWidth("100%");
   return panel;
 }
  /**
   * This method is called when GWT loads the Notes application (as defined in the Notes.gwt.xml).
   */
  public void onModuleLoad() {

    final HorizontalPanel mainpanel = new HorizontalPanel();

    final HTML displayTitle = new HTML("Existing Notes");
    displayTitle.setStyleName("displayTitle");
    final HTML entryTitle = new HTML("Create A Note");
    entryTitle.setStyleName("entryTitle");

    final VerticalPanel displayPanel = new VerticalPanel();
    displayPanel.setVerticalAlignment(VerticalPanel.ALIGN_TOP);
    displayPanel.setStyleName("displayPanel");
    displayPanel.add(displayTitle);

    final VerticalPanel entryPanel = new VerticalPanel();
    entryPanel.setVerticalAlignment(VerticalPanel.ALIGN_TOP);
    entryPanel.setStyleName("entryPanel");
    entryPanel.add(entryTitle);

    displayPanel.add(notesPanel);

    final VerticalPanel form = createForm();
    entryPanel.add(form);

    mainpanel.add(displayPanel);
    mainpanel.add(entryPanel);

    RootPanel.get("notes").add(mainpanel);

    getNotes();
  }
  public InputWidgetTypingQwerty(
      PacketProblem problem,
      AnswerView answerView,
      QuestionPanel questionPanel,
      LetterType letterType,
      SessionData sessionData) {
    super(problem, answerView, questionPanel, sessionData);
    this.letterType = letterType;

    setHorizontalAlignment(ALIGN_LEFT);
    for (int row = 0; row < LETTERS.length; ++row) {
      HorizontalPanel panel = new HorizontalPanel();

      HTML space = new HTML();
      space.setPixelSize(row * 20, 1);
      panel.add(space);

      String letters = LETTERS[row];
      for (int column = 0; column < letters.length(); ++column) {
        Button button = new Button(letters.substring(column, column + 1), this);
        button.setStyleName(STYLE_NAME_LETTER);
        panel.add(button);
        buttons.add(button);
      }

      if (row + 1 == LETTERS.length) {
        panel.add(buttonDelete);
        panel.add(buttonOk);
        buttonDelete.setStyleName(STYLE_NAME_CONTROL);
        buttonOk.setStyleName(STYLE_NAME_CONTROL);
      }

      add(panel);
    }
  }