Esempio n. 1
0
  public PermissionsPanel(final JSONObject entityJsonObject) {

    //	this.center();
    this.setAutoHideEnabled(true);

    VerticalPanel vp = new VerticalPanel();
    vp.setSpacing(30);
    vp.setWidth("300px");

    vp.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);

    vp.add(new CloseButton(this));

    vp.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);

    vp.add(new Label("Permissions to Edit this information:"));

    vp.add(listPermissions(entityJsonObject));

    permissionName.setValue(null);
    permissionName.setWidth("200px");
    vp.add(permissionName);

    vp.add(new ButtonAddPermission(entityJsonObject, this));

    this.setWidget(vp);
  }
Esempio n. 2
0
  private void registrationCompleted(
      MyDialog registrationPopup, final RegisterOntologyResult uploadOntologyResult) {

    registrationPopup.hide();

    String error = uploadOntologyResult.getError();

    StringBuffer sb = new StringBuffer();

    VerticalPanel vp = new VerticalPanel();
    vp.setSpacing(6);

    if (error == null) {

      String uri = uploadOntologyResult.getUri();

      vp.add(
          new HTML(
              "<font color=\"green\">Congratulations!</font> "
                  + "Your ontology is now registered."));

      vp.add(
          new HTML(
              "<br/>The URI of the ontology is: "
                  //					+ "<a href=\"" +uri+ "\">"
                  + uri
              //					+ "</a>"
              ));

      vp.add(new HTML("<br/>For diagnostics, this is the response from the back-end server:"));

      sb.append(uploadOntologyResult.getInfo());

      // and, disable all editing fields/buttons:
      // (user will have to start from the "load" step)
      //			enable(false);
    } else {
      sb.append(error);
    }

    String msg = sb.toString();
    Orr.log(CLASS_NAME + ": Registration result: " + msg);

    final MyDialog popup = new MyDialog(null);
    popup.setCloseButtonText("Return to ontology list");
    popup.setText(error == null ? "Registration completed sucessfully" : "Error");
    popup.addTextArea(null).setText(msg);
    popup.getTextArea().setSize("600", "150");

    popup.getDockPanel().add(vp, DockPanel.NORTH);
    popup.center();

    popup.addPopupListener(
        new PopupListener() {
          public void onPopupClosed(PopupPanel sender, boolean autoClosed) {
            PortalControl.getInstance().completedRegisterOntologyResult(uploadOntologyResult);
          }
        });
    popup.show();
  }
  /**
   * Creates an empty dialog box specifying its "auto-hide" property. It should not be shown until
   * its child widget has been added using {@link #add(Widget)}.
   *
   * @param autoHide <code>true</code> if the dialog should be automatically hidden when the user
   *     clicks outside of it
   * @param modal <code>true</code> if keyboard and mouse events for widgets not contained by the
   *     dialog should be ignored
   */
  public MyDialogBox(boolean autoHide, boolean modal) {
    super(autoHide, modal);
    dock = new HorizontalPanel();
    dock.add(caption);
    HorizontalPanel hp = new HorizontalPanel();
    hp.setSpacing(0);
    dock.setHorizontalAlignment(HorizontalPanel.ALIGN_RIGHT);

    listener = new DialogListener(this);
    minimiseBtn.addClickListener(listener);
    maximiseBtn.addClickListener(listener);
    closeBtn.addClickListener(listener);

    hp.add(minimiseBtn);
    hp.add(maximiseBtn);
    hp.add(closeBtn);
    dock.add(hp);
    panel.add(dock);

    panel.setHeight("100%");
    panel.setSpacing(0);

    sp = new ScrollPanel();
    panel.add(sp);
    super.setWidget(panel);

    setStyleName("gwt-DialogBox");
    dock.setStyleName("Caption");
    caption.addMouseListener(this);
  }
Esempio n. 4
0
  public ConsoleDialog(ConsoleDialogListener listener) {
    super(false, true);
    this.listener = listener;

    VerticalPanel dialogContents = new VerticalPanel();
    dialogContents.setSpacing(4);
    setWidget(dialogContents);

    console = new TextArea();
    console.setReadOnly(true);
    int width = Window.getClientWidth();
    int height = Window.getClientHeight();
    console.setSize(width * 2 / 3 + "px", height * 2 / 3 + "px");
    console.addStyleName(Utils.sandboxStyle.consoleArea());
    okButton = new Button("Ok");
    addButton(okButton);

    dialogContents.add(console);

    okButton.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent event) {
            hide();
            if (ConsoleDialog.this.listener != null) {
              ConsoleDialog.this.listener.onOk(success);
            }
          }
        });
    okButton.setEnabled(false);
  }
  public PopupFusionViewImpl() {
    super(popupConstants.titrePopup(), false, false, true);
    this.addStyleName(SquareResources.INSTANCE.css().popupFusion());

    final VerticalPanel pConteneur = new VerticalPanel();
    pConteneur.setWidth(PopupFusionConstants.LARGEUR_POPUP);
    pConteneur.setSpacing(5);

    pConteneurComposantFusion = new VerticalPanel();
    pConteneurComposantFusion.setWidth(AppControllerConstants.POURCENT_100);

    btnFermer = new DecoratedButton(popupConstants.btnFermer());
    btnReduire = new DecoratedButton(popupConstants.reduire());

    final HorizontalPanel conteneurBoutons = new HorizontalPanel();
    conteneurBoutons.add(btnReduire);
    conteneurBoutons.add(btnFermer);
    conteneurBoutons.setSpacing(5);

    pConteneur.add(pConteneurComposantFusion);
    pConteneur.add(conteneurBoutons);
    pConteneur.setCellHorizontalAlignment(conteneurBoutons, HasAlignment.ALIGN_CENTER);

    this.setWidget(pConteneur, 0);

    // on en fait une popup minimisable
    minimizablePopup = new PopupMinimizable(this, popupConstants.titrePopup(), btnReduire);
  }
Esempio n. 6
0
  private void reviewCompleted(
      final MyDialog popup, final CreateOntologyResult createOntologyResult) {
    String error = createOntologyResult.getError();

    //  Issue 211: Remove unnecesary registration confirmation dialogs
    if (error == null) {
      doRegister(popup, createOntologyResult);
      return;
    }

    StringBuffer sb = new StringBuffer();

    VerticalPanel vp = new VerticalPanel();
    vp.setSpacing(4);
    sb.append(error);

    String msg = sb.toString();

    popup.getTextArea().setText(msg);
    popup.getDockPanel().add(vp, DockPanel.NORTH);
    popup.setText(error == null ? "Ontology ready to be registered" : "Error");
    popup.center();

    Orr.log(CLASS_NAME + ": Review result: " + msg);
  }
Esempio n. 7
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;
  }
Esempio n. 8
0
    public void initLayout() {
      lang = new ListBox();
      lang =
          Convert.makeSelectedLanguageListBox(
              (ArrayList<String[]>) MainApp.getLanguage(), tObj.getLang());
      lang.setWidth("100%");
      lang.setEnabled(false);

      term = new TextBox();
      term.setText(tObj.getLabel());
      term.setWidth("100%");

      main = new CheckBox(constants.conceptPreferredTerm());
      if (tObj.isMainLabel()) {
        main.setValue(tObj.isMainLabel());
        // main.setEnabled(false);
      }

      Grid table = new Grid(2, 2);
      table.setWidget(0, 0, new HTML(constants.conceptTerm()));
      table.setWidget(1, 0, new HTML(constants.conceptLanguage()));
      table.setWidget(0, 1, term);
      table.setWidget(1, 1, lang);
      table.setWidth("100%");
      table.getColumnFormatter().setWidth(1, "80%");

      VerticalPanel vp = new VerticalPanel();
      vp.add(GridStyle.setTableConceptDetailStyleleft(table, "gslRow1", "gslCol1", "gslPanel1"));
      vp.add(main);
      vp.setSpacing(0);
      vp.setWidth("100%");
      vp.setCellHorizontalAlignment(main, HasHorizontalAlignment.ALIGN_RIGHT);

      addWidget(vp);
    }
  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;
  }
Esempio n. 10
0
  private void showLogonDialog() {
    final DialogBox dialogBox = new DialogBox();
    dialogBox.setText("Login");
    dialogBox.setGlassEnabled(true);
    dialogBox.setAnimationEnabled(true);

    VerticalPanel verticalPanel = new VerticalPanel();
    verticalPanel.setSpacing(4);
    dialogBox.setWidget(verticalPanel);

    final TextBox username = new TextBox();
    verticalPanel.add(new HTML("Username:"******"Logon",
            new ClickHandler() {
              public void onClick(ClickEvent event) {
                dialogBox.hide();
                login(username.getValue());
              }
            });
    verticalPanel.add(closeButton);

    dialogBox.center();
    dialogBox.show();
  }
Esempio n. 11
0
  @Override
  protected void buildContentPanel(Orientation style) {
    super.buildContentPanel(style);

    displayPanel.addStyleName("SIS_oneToMany_sideBar");
    ((VerticalPanel) displayPanel).setSpacing(10);
  }
Esempio n. 12
0
  public MyDialog(String title, String msg) {
    // Set the dialog box's caption.
    setText(title);

    // Enable animation.
    setAnimationEnabled(true);

    // Enable glass background.
    setGlassEnabled(true);

    this.center();

    // Create a table to layout the content
    VerticalPanel dialogContents = new VerticalPanel();
    dialogContents.setSpacing(15);
    this.setWidget(dialogContents);

    // Add some text to the top of the dialog
    HTML details = new HTML(msg);
    dialogContents.add(details);
    dialogContents.setCellHorizontalAlignment(details, HasHorizontalAlignment.ALIGN_CENTER);

    // DialogBox is a SimplePanel, so you have to set its widget property to
    // whatever you want its contents to be.
    Button ok = new Button("OK");
    ok.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            MyDialog.this.hide();
          }
        });

    dialogContents.add(ok);
    dialogContents.setCellHorizontalAlignment(ok, HasHorizontalAlignment.ALIGN_CENTER);
  }
Esempio n. 13
0
  public SubGoalDialogBox(
      final Command riksPane,
      List<GwtSubGoal> allSubGoals,
      List<GwtSubGoal> curretSelectedSubGoals) {

    // Set the dialog box's caption.
    setText(messages.associateGoals());

    this.allSubGoals = allSubGoals;
    this.oldSelectedSubGoals = curretSelectedSubGoals;

    final VerticalPanel checkBoxContainer = new VerticalPanel();
    checkBoxContainer.setSpacing(10);
    for (GwtSubGoal a : allSubGoals) {

      SubGoalCheckBox checkBox = new SubGoalCheckBox();
      checkBox.setText(a.getDescription());
      checkBox.setSubGoalID(a.getId());
      if (isCurrentSubGoalSelected(a.getId())) {
        checkBox.setValue(true);
      }
      checkBoxContainer.add(checkBox);
    }

    Button ok = new Button(messages.ok());
    Button cancel = new Button(messages.cancel());
    cancel.setWidth("60px");
    ok.setWidth("60px");

    FlexTable buttonsTable = new FlexTable();
    buttonsTable.setWidth("100%");
    buttonsTable.setCellPadding(3);
    buttonsTable.setWidget(0, 0, ok);
    buttonsTable.setWidget(0, 1, cancel);
    buttonsTable
        .getCellFormatter()
        .setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_RIGHT);
    buttonsTable.getCellFormatter().setHorizontalAlignment(0, 1, HasHorizontalAlignment.ALIGN_LEFT);

    ok.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            loadSelectedSubGoals(checkBoxContainer);
            riksPane.execute();
            SubGoalDialogBox.this.hide();
          }
        });

    cancel.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {

            SubGoalDialogBox.this.hide();
          }
        });

    checkBoxContainer.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    checkBoxContainer.add(buttonsTable);
    setWidget(checkBoxContainer);
  }
Esempio n. 14
0
 private VerticalPanel createEstatesItems() {
   VerticalPanel panel = new VerticalPanel();
   panel.setSpacing(4);
   panel.add(
       createHyperlinkToUserPanel(
           DashboardMessages.MSG.menuEstates(), EstatesPresenter.PRESENTER_ID));
   return panel;
 }
 public Widget asWidget() {
   if (vp == null) {
     vp = new VerticalPanel();
     vp.setSpacing(5);
     initKomponen();
   }
   return vp;
 }
Esempio n. 16
0
    public DetailsDialog(JSOModel details) {
      // setWidth("500px");
      // Use this opportunity to set the dialog's caption.
      setText("Awaaz.De Administration");

      // Create a VerticalPanel to contain the 'about' label and the 'OK' button.
      VerticalPanel outer = new VerticalPanel();
      outer.setWidth("100%");
      outer.setSpacing(10);

      // Create the 'about' text and set a style name so we can style it with CSS.
      String startdate = details.get("startdate");
      String completed = details.get("completed");
      String pending = details.get("pending");

      String surveyDetails = "<b>Start: </b> " + startdate + "<br><br>";
      int numrecipients = completed.split(", ").length + pending.split(", ").length;
      // For some reason, the above line creates an array of length one if
      // one of the strings is empty
      // Assumes that completed and pending cannot both be empty
      if (completed.equals("") || pending.equals("")) {
        numrecipients -= 1;
      }
      surveyDetails += "<b>Num Recipients: </b>" + String.valueOf(numrecipients);

      surveyDetails += "<br><br><b>Pending:</b>";
      HTML pendingHTML = new HTML(surveyDetails);
      pendingHTML.setStyleName("mail-AboutText");
      outer.add(pendingHTML);

      Label pendingLbl = new Label(pending, true);
      pendingLbl.setWordWrap(true);
      pendingLbl.setStyleName("dialog-NumsText");
      outer.add(pendingLbl);

      HTML compHTML = new HTML("<br><b>Completed:</b>");
      compHTML.setStyleName("mail-AboutText");
      outer.add(compHTML);

      Label completedLbl = new Label(completed, true);
      completedLbl.setWordWrap(true);
      completedLbl.setStyleName("dialog-NumsText");
      outer.add(completedLbl);

      // Create the 'OK' button, along with a handler that hides the dialog
      // when the button is clicked.
      outer.add(
          new Button(
              "Close",
              new ClickHandler() {
                public void onClick(ClickEvent event) {
                  hide();
                }
              }));

      setWidget(outer);
    }
Esempio n. 17
0
  private VerticalPanel createSetupsItems() {
    VerticalPanel panel = new VerticalPanel();
    panel.setSpacing(4);
    panel.add(createHyperlinkToUserPanel(DashboardMessages.MSG.menuSetupsMyProfile(), ""));
    // panel.add(createHyperlinkToUserPanel(DashboardMessages.MSG.menuMailTemplates(),
    // MailTemplatePresenter.PRESENTER_ID));

    return panel;
  }
Esempio n. 18
0
 @Override
 protected Widget createMainWidget() {
   VerticalPanel verticalPanel = new VerticalPanel();
   verticalPanel.setSpacing(6);
   verticalPanel.setWidth(width_ + "px");
   verticalPanel.add(captionLabel_);
   verticalPanel.add(textBox_);
   return verticalPanel;
 }
Esempio n. 19
0
 /**
  * Create the list of filters for the Filters item.
  *
  * @return the list of filters
  */
 @ShowcaseSource
 private VerticalPanel createFiltersItem() {
   VerticalPanel filtersPanel = new VerticalPanel();
   filtersPanel.setSpacing(4);
   for (String filter : constants.cwStackPanelFilters()) {
     filtersPanel.add(new CheckBox(filter));
   }
   return filtersPanel;
 }
  public RegisterResultPanel() {
    ServiceManager.getInstance().addLeagueUpdateListener(this);
    ServiceManager.getInstance().addLoginListener(this);

    mainPanel = new VerticalPanel();
    mainPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    mainPanel.setSpacing(Spelstegen.VERTICAL_SPACING);
    panelIsVisible = false;
    initWidget(mainPanel);
  }
  /** Construit le contenu. */
  private void construireBlocContenu(GarantiePersonneMoraleModel garantie) {
    conteneurGlobal = new VerticalPanel();
    conteneurGlobal.setWidth(ComposantContratPersonneMoraleConstants.POURCENT_100);
    conteneurGlobal.setSpacing(5);

    conteneurIconePdf = new VerticalPanel();
    conteneurGlobal.add(conteneurIconePdf);

    construireTableauGarantie(garantie);
  }
Esempio n. 22
0
  @Override
  public void onModuleLoad() {
    class Handler implements FocusHandler, BlurHandler {

      @Override
      public void onBlur(BlurEvent event) {
        System.out.println("blur");
      }

      @Override
      public void onFocus(FocusEvent event) {
        System.out.println("focus");
      }
    }

    TextField field = new TextField();
    field.setName("thename");
    field.setEmptyText("sdfsdf");
    field.addValidator(new EmptyValidator<String>());

    Handler h = new Handler();
    field.addFocusHandler(h);
    field.addBlurHandler(h);

    NumberField<Double> number = new NumberField<Double>(new DoublePropertyEditor());
    number.setEmptyText("sdfdsfsf");
    h = new Handler();
    number.addFocusHandler(h);
    number.addBlurHandler(h);

    DateField date = new DateField();
    h = new Handler();
    date.addFocusHandler(h);
    date.addBlurHandler(h);
    date.setEmptyText("empty texxxt");
    // field.setFieldLabel("Name");
    // field.markInvalid("error", null);

    TextArea area = new TextArea();
    area.setEmptyText("sdfdsfsdf");

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

    vp.add(field);
    vp.add(number);
    vp.add(date);
    vp.add(area);

    RootPanel.get().add(vp);

    date.redraw();
    field.redraw();
    number.redraw();
  }
Esempio n. 23
0
 private VerticalPanel createItems(ArrayList<MenuItem> items) {
   VerticalPanel panel = new VerticalPanel();
   panel.setWidth("100%");
   panel.setSpacing(4);
   if (items != null) {
     for (MenuItem item : items) {
       panel.add(createHyperlinkToUserPanel(item.getTitle(), item.getEvent()));
     }
   }
   return panel;
 }
Esempio n. 24
0
 private VerticalPanel createClientsItems() {
   VerticalPanel panel = new VerticalPanel();
   panel.setSpacing(4);
   panel.add(
       createHyperlinkToUserPanel(
           DashboardMessages.MSG.menuClients(), ClientsPresenter.PRESENTER_ID));
   panel.add(
       createHyperlinkToUserPanel(
           DashboardMessages.MSG.menuAddClient(), EditClientPresenter.PRESENTER_ID));
   return panel;
 }
Esempio n. 25
0
  public InputsPanel(InputsListPanel parent, Input2 input) {
    this.input = input;
    this.parent = parent;
    mainPanel = new VerticalPanel();
    mainPanel.setStyleName("inputsBordered");
    mainPanel.setSpacing(2);
    mainPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    initWidget(mainPanel);
    mainPanel.setWidth("258px");

    createLayout();
  }
  private void setupWidgets() {
    horizontalPanel.setSpacing(HORIZONTAL_SPACING);
    columnPanel.setSpacing(VERTICAL_SPACING);
    sortPanel.setSpacing(VERTICAL_SPACING);

    horizontalPanel.add(columnPanel);
    horizontalPanel.add(sortPanel);

    columnPanel.add(new Label("Query Columns")); // LocaleText.get("????")
    columnPanel.add(addColumnLink);

    sortPanel.add(new Label("Column Sorting Order")); // LocaleText.get("????")

    initWidget(horizontalPanel);

    addColumnLink.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            addColumn((Widget) event.getSource());
          }
        });
  }
Esempio n. 27
0
  /** Constructor. */
  public AddNewModuleView() {
    super();
    initWidget(BINDER.createAndBindUi(this));

    saveButton.setText(AdminConstants.SAVE_BUTTON);
    cancelButton.setText(AdminConstants.CANCEL_BUTTON);
    saveButton.setHeight(AdminConstants.BUTTON_HEIGHT);
    cancelButton.setHeight(AdminConstants.BUTTON_HEIGHT);
    dialogBox = new DialogBox();
    name.setReadOnly(false);
    validateNameTextBox = new ValidatableWidget<TextBox>(name);

    validateNameTextBox
        .getWidget()
        .addValueChangeHandler(
            new ValueChangeHandler<String>() {

              @Override
              public void onValueChange(ValueChangeEvent<String> arg0) {
                validateNameTextBox.toggleValidDateBox();
              }
            });
    validateNameTextBox.addValidator(new EmptyStringValidator(name));
    validateDescTextBox = new ValidatableWidget<TextBox>(description);
    validateDescTextBox
        .getWidget()
        .addValueChangeHandler(
            new ValueChangeHandler<String>() {

              @Override
              public void onValueChange(ValueChangeEvent<String> event) {
                validateDescTextBox.toggleValidDateBox();
              }
            });
    validateDescTextBox.addValidator(new EmptyStringValidator(description));

    addNewModuleViewPanel.setSpacing(BatchClassManagementConstants.FIVE);

    nameLabel.setText(AdminConstants.NAME);
    descLabel.setText(AdminConstants.DESCRIPTION);

    descStar.setText(AdminConstants.STAR);
    nameStar.setText(AdminConstants.STAR);

    nameLabel.setStyleName(AdminConstants.BOLD_TEXT_STYLE);
    descLabel.setStyleName(AdminConstants.BOLD_TEXT_STYLE);

    descStar.setStyleName(AdminConstants.FONT_RED_STYLE);
    nameStar.setStyleName(AdminConstants.FONT_RED_STYLE);
    addNewModuleViewButtonsPanel.setSpacing(BatchClassManagementConstants.TEN);
  }
  /** Default constructor */
  public DeleteConfiguration() {
    super();

    initService();

    initWidget(mainPanel);

    mainPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    mainPanel.setSpacing(10);

    DecoratorPanel dp = new DecoratorPanel();
    mainPanel.add(dp);
    mainPanel.setCellHorizontalAlignment(dp, HasHorizontalAlignment.ALIGN_CENTER);

    mainPanel.setWidth(DOCK_PANEL_WIDTH);

    upperPanel.setWidth(PERCENT_100);
    upperPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    upperPanel.setSpacing(10);

    // Sub-Title
    Label subTitleLabel = new Label(SUB_TITLE);
    subTitleLabel.addStyleDependentName(SUB_TITLE_LABEL_STYLE);
    upperPanel.add(subTitleLabel);
    upperPanel.setCellHorizontalAlignment(subTitleLabel, HasHorizontalAlignment.ALIGN_CENTER);

    wbConfigTextBox.addChangeHandler(this);
    LabeledWidget workbookIdBox = new LabeledWidget(wbConfigTextBox);
    workbookIdBox.setLabelText(CONFIG_ID_COLON);
    workbookIdBox.setPanelWidth(RESULTS_DATA_WIDTH);
    upperPanel.add(workbookIdBox);

    submitButton.addClickHandler(this);
    submitButton.setEnabled(false);
    upperPanel.add(submitButton);

    dp.add(upperPanel);
  }
Esempio n. 29
0
  public void onModuleLoad() {
    message = new Label();

    VerticalPanel panel = new VerticalPanel();
    panel.setSpacing(10);
    // HorizontalPanel panel = new HorizontalPanel();

    InputPanel innerPanel = new InputPanel(this);

    panel.add(innerPanel);
    panel.add(message);

    RootPanel.get().add(panel);
  }
Esempio n. 30
0
  /** Inits the fileUpload Widget and the help text besaides the uploadForm */
  private void initFileUploadPanel() {
    this.setSpacing(10);

    // upload widget
    uploadForm = new FormPanel();
    uploadForm.setAction(GWT.getModuleBaseURL() + "uploadImportFile");

    uploadForm.setEncoding(FormPanel.ENCODING_MULTIPART);
    uploadForm.setMethod(FormPanel.METHOD_POST);

    upload = new VerticalPanel();
    upload.setSpacing(10);
    uploadForm.setWidget(upload);

    // Create a FileUpload widget.
    uploadWidget = new FileUpload();
    uploadWidget.setName("uploadFormElement");
    upload.add(uploadWidget);
    fileUploadPanel.add(uploadForm);

    // Add a 'upload' button.
    uploadButton =
        new Button(
            "subir",
            new ClickListener() {
              public void onClick(Widget sender) {
                if (LoginManager.isUserLogged()) {
                  usernameImportOwner = LoginManager.getUserName();
                  uploadForm.submit();
                } else {
                  Window.alert("Debe iniciar sesion en el sistema.");
                }
              }
            });
    upload.add(uploadButton);

    // uploadForm.addFormHandler(this);
    uploadForm.addFormHandler(this);

    // uploadhelp label
    uploadHelp =
        new Label(
            "Busque el archivo de importación y de click en 'subir', "
                + "seguidamente el archivo se cargara en el serrvidor y la "
                + "importación comenzará una vez el archivo se haya subido "
                + "correctamente");
    fileUploadPanel.add(uploadHelp);
  }