private void checkVisibility() {
   if (compList.getSelectedIndex() == 0) {
     srcLangList.setVisible(false);
     trgLangList.setVisible(false);
     srcLangLabel.setVisible(false);
     trgLangLabel.setVisible(false);
     settingsPanel.setWidth("180px");
   } else {
     srcLangList.setVisible(true);
     trgLangList.setVisible(true);
     srcLangLabel.setVisible(true);
     trgLangLabel.setVisible(true);
     settingsPanel.setWidth("450px");
   }
 }
Exemple #2
0
  /**
   * Skeleton of toolbar creation
   *
   * @return
   */
  protected Widget buildStepBar() {
    HorizontalPanel uiToolbar = new HorizontalPanel();
    uiToolbar.setStylePrimaryName("blockSteps");
    uiToolbar.setWidth("100%");
    uiToolbar.setHorizontalAlignment(ALIGN_RIGHT);
    uiToolbar.setVerticalAlignment(ALIGN_MIDDLE);

    // Build stepBar
    int nbSteps = controller.getNbViews();

    Grid table = new Grid(1, nbSteps);
    table.setCellSpacing(3);
    Image currentImg = null;
    for (int i = 0; i < nbSteps; i++) {
      if (i == stepNumber) {
        currentImg = new Image("img/red_round_button.jpg");
      } else if (i < stepNumber) {
        currentImg = new Image("img/green_round_tick.jpg");
      } else {
        currentImg = new Image("img/green_round_button.jpg");
      }
      table.setWidget(0, i, currentImg);
    }

    uiToolbar.add(table);
    return uiToolbar;
  }
 private Panel widgets(Widget left, Widget right) {
   HorizontalPanel panel = new HorizontalPanel();
   panel.add(left);
   panel.add(right);
   panel.setWidth("100%");
   return panel;
 }
  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);
  }
Exemple #5
0
  public OrderDetails() {
    main = new HorizontalPanel();
    initWidget(main);
    main.setWidth("100%");

    parent = null;
  }
  public MainPanel() {
    super(Unit.PX);

    Image logoUfcg = new Image(Adicionais.RESOURCES.logoUfcg());
    Image logoAdicionais = new Image(Adicionais.RESOURCES.logoAdicionais());
    HorizontalPanel header = new HorizontalPanel();
    header.add(logoUfcg);
    header.setCellVerticalAlignment(logoUfcg, HasVerticalAlignment.ALIGN_MIDDLE);
    header.add(logoAdicionais);
    header.setCellHorizontalAlignment(logoAdicionais, HasHorizontalAlignment.ALIGN_RIGHT);
    header.setWidth("100%");
    header.setStyleName(Adicionais.RESOURCES.css().header());
    this.addNorth(header, 88);

    VerticalPanel footer = new VerticalPanel();
    Label developersLabel =
        new Label("Desenvolvido por Cleber Gonçalves de Sousa e Vitor Morato Almeida");
    developersLabel.setStyleName(Adicionais.RESOURCES.css().developers());
    footer.add(developersLabel);

    this.addSouth(footer, 23);
    footer.setWidth("100%");
    footer.setStyleName(Adicionais.RESOURCES.css().footer());

    this.contentArea = new SimplePanel();
    this.contentArea.setStyleName(Adicionais.RESOURCES.css().content());
    this.add(this.contentArea);
  }
 /**
  * Sets the width of the window (used by minimise and maximise buttons). If store is true, store
  * this setting as the proper size. If false, the window is being minimised or maximised, so the
  * old dimensions should be saved to undo it later on.
  *
  * @param w Width
  * @param store If true, store the new height setting
  */
 public void setWidth(int w, boolean store) {
   if (store) width = w;
   String str = Integer.toString(w) + "px";
   setWidth(str);
   sp.setWidth(str);
   dock.setWidth(Integer.toString(w - 5) + "px");
 }
Exemple #8
0
    private HorizontalPanel getConceptBrowseButton() {
      destConcept = new LabelAOS("--None--", null);

      browse = new Image("images/browseButton3-grey.gif");
      browse.addClickHandler(
          new ClickHandler() {

            public void onClick(ClickEvent event) {
              destConcept.setText("--None--");
              final ConceptBrowser cb = ((MainApp) RootPanel.get().getWidget(0)).conceptBrowser;
              cb.showBrowser();
              cb.addSubmitClickHandler(
                  new ClickHandler() {
                    public void onClick(ClickEvent event) {
                      destConcept.setValue(cb.getSelectedItem(), cb.getTreeObject().getUri());
                    }
                  });
            }
          });
      browse.setStyleName(Style.Link);

      HorizontalPanel hp = new HorizontalPanel();
      hp.add(new HTML(constants.conceptDestination()));
      hp.add(destConcept);
      hp.add(browse);
      hp.setWidth("100%");
      hp.setCellHorizontalAlignment(destConcept, HasHorizontalAlignment.ALIGN_LEFT);
      hp.setCellHorizontalAlignment(browse, HasHorizontalAlignment.ALIGN_RIGHT);

      return hp;
    }
Exemple #9
0
 /** Constructs a Toolbar part. */
 public Toolbar() {
   resources = GWT.create(MyResources.class);
   buttons = new ArrayList<Widget>();
   toolBar = new HorizontalPanel();
   toolBar.setHeight("30px");
   toolBar.setWidth("100%");
   toolBar.setStylePrimaryName("lab-Tools-Panel");
   toolBar.add(buildToolBar());
   initWidget(toolBar);
 }
Exemple #10
0
 /**
  * Skeleton of toolbar creation
  *
  * @return
  */
 protected Widget buildToolbar() {
   HorizontalPanel uiToolbar = new HorizontalPanel();
   uiToolbar.setStylePrimaryName("blockAction");
   uiToolbar.setWidth("100%");
   uiToolbar.setHorizontalAlignment(ALIGN_RIGHT);
   uiToolbar.setVerticalAlignment(ALIGN_MIDDLE);
   uiToolbar.setSpacing(10);
   uiToolbar.setHeight("60px");
   uiToolbar.add(buildStepToolbar());
   return uiToolbar;
 }
  @Override
  protected Widget createMainWidget() {
    VerticalPanel panel = new VerticalPanel();
    panel.setStyleName(ThemeStyles.INSTANCE.fileUploadPanel());

    // directory panel
    HorizontalPanel directoryPanel = new HorizontalPanel();
    directoryPanel.setWidth("100%");
    directoryPanel.setStyleName(ThemeStyles.INSTANCE.fileUploadField());

    // directory name (informational field)
    panel.add(new Label("Target directory:"));
    directoryNameWidget_ = new DirectoryNameWidget();
    directoryNameWidget_.setDirectory(targetDirectory_);
    directoryPanel.add(directoryNameWidget_);

    // browse directory button
    // JJA: removed browse button (was causing confusion for users who
    // thought it was what they should press to browse local files)
    /*
    Button browseButton = new Button("Browse...",
                                     new BrowseDirectoryClickHandler());
    browseButton.getElement().getStyle().setMarginRight(5, Unit.PX);
    directoryPanel.add(browseButton);
    directoryPanel.setCellHorizontalAlignment(
                                        browseButton,
                                        HasHorizontalAlignment.ALIGN_RIGHT);
    */
    panel.add(directoryPanel);

    // filename field
    panel.add(new Label("File to upload:"));
    fileUpload_ = new FileUpload();
    fileUpload_.setStyleName(ThemeStyles.INSTANCE.fileUploadField());
    fileUpload_.setName("file");
    panel.add(fileUpload_);

    // zip file tip field
    HTML tip =
        new HTML(
            "<b>TIP</b>: To upload multiple files or a "
                + "directory, create a zip file. The zip file will "
                + "be automatically expanded after upload.");
    tip.addStyleName(ThemeStyles.INSTANCE.fileUploadField());
    tip.addStyleName(ThemeStyles.INSTANCE.fileUploadTipLabel());
    panel.add(tip);

    // target directory hidden field
    targetDirectoryHidden_ = new Hidden("targetDirectory", targetDirectory_.getPath());
    panel.add(targetDirectoryHidden_);

    return panel;
  }
Exemple #12
0
  // GWT module entry point method.
  public void onModuleLoad() {
    /*
     * Asynchronously loads the Maps API.
     *
     * The first parameter should be a valid Maps API Key to deploy this
     * application on a public server, but a blank key will work for an
     * application served from localhost.
     */
    //   Maps.loadMapsApi("AIzaSyBjDoqh_8ZFoxVvvW4ETGdJvADLzTX6-sI", "2", false, new Runnable() {
    //      public void run() {
    //        buildUi();
    //      }
    //    });
    //

    //   Maps.loadMapsApi("", "2", false, new Runnable() {
    //	      public void run() {
    //	        buildUi();
    //	        findLocation(map, "whistler");
    //	      }
    //	    });

    propertyMap theMap = new propertyMap();
    theMap.buildUi();
    // Add map to the container
    // mapContainerPanel.add(theMap.getMap());

    // build streetview map

    // Add street view map to the container
    // streetViewContainerPanel.add(streetMap.getMap());

    // assemble map panel
    // mapsPanel.add(mapContainerPanel);
    // mapsPanel.add(streetViewContainerPanel);

    Button theButton = new Button();
    theButton.setText("test");
    HorizontalPanel panel = new HorizontalPanel();
    // panel.setSize("100%","500px");
    // SimplePanel sp = new SimplePanel();
    // sp.setSize("100%", "100%");
    panel.add(theMap.getMap());
    // panel.add(sp);
    panel.add(theButton);
    panel.setCellWidth(theMap.getMap(), "500px");
    panel.setCellHeight(theMap.getMap(), "500px");
    panel.setCellHorizontalAlignment(theMap.getMap(), HorizontalPanel.ALIGN_LEFT);
    panel.setCellHorizontalAlignment(theButton, HorizontalPanel.ALIGN_RIGHT);

    panel.setWidth("100%");
    RootPanel.get().add(panel);
  }
Exemple #13
0
  private HorizontalPanel getConcept() {
    HorizontalPanel conceptHp = new HorizontalPanel();
    conceptHp.add(conceptLabel);
    conceptLabel.addStyleName("gwt-Textbox");
    conceptBrowse = new Image("images/browseButton3-grey.gif");
    conceptBrowse.setStyleName(Style.Link);
    conceptBrowse.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            final ConceptBrowser cb = ((MainApp) RootPanel.get().getWidget(0)).conceptBrowser;
            cb.showBrowser();
            cb.addSubmitClickHandler(
                new ClickHandler() {
                  public void onClick(ClickEvent event) {
                    conceptLabel.setValue(cb.getSelectedItem(), cb.getTreeObject());
                    exp.setConceptURI(cb.getTreeObject().getUri());
                  }
                });
          }
        });
    conceptHp.add(conceptBrowse);

    conceptClear = new Image("images/trash-grey.gif");
    conceptClear.setTitle(constants.buttonClear());
    conceptClear.setStyleName(Style.Link);
    conceptClear.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            conceptLabel.setText("");
            exp.setConceptURI(null);
          }
        });
    conceptHp.add(conceptClear);

    conceptChildren = new CheckBox(constants.exportIncludeChildren(), true);
    conceptChildren.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            exp.setIncludeChildren(((CheckBox) event.getSource()).getValue());
          }
        });
    conceptHp.add(conceptChildren);
    conceptHp.setSpacing(3);
    conceptHp.setWidth("100%");
    conceptHp.setCellHorizontalAlignment(conceptLabel, HasHorizontalAlignment.ALIGN_LEFT);
    conceptHp.setCellHorizontalAlignment(conceptBrowse, HasHorizontalAlignment.ALIGN_RIGHT);
    conceptHp.setCellHorizontalAlignment(conceptChildren, HasHorizontalAlignment.ALIGN_LEFT);
    conceptHp.setCellWidth(conceptLabel, "80%");
    return conceptHp;
  }
Exemple #14
0
  private void createRepeatWeeklyPanel(VerticalPanel verticalPanel) {
    HorizontalPanel horizontalPanel = new HorizontalPanel();
    verticalPanel.add(horizontalPanel);
    horizontalPanel.setWidth("239px");
    Label lblRepeatOn = new Label(myConstants.repeatOn() + ":");
    lblRepeatOn.setStyleName("gwt-Label-Header");
    horizontalPanel.add(lblRepeatOn);
    horizontalPanel.setCellVerticalAlignment(lblRepeatOn, HasVerticalAlignment.ALIGN_MIDDLE);
    lblRepeatOn.setSize("82px", "19px");

    WeekDayPanel weekDay = new WeekDayPanel(true, schedule);
    horizontalPanel.add(weekDay);
    horizontalPanel.setCellVerticalAlignment(weekDay, HasVerticalAlignment.ALIGN_MIDDLE);
  }
  @Inject
  public LOBSelectionPanel300x250(LineOfBusinessConfiguration config) {
    super(config);
    panelMaker = new LineOfBusinessPanels300x250();
    AbsolutePanel panel = new AbsolutePanel();
    try {
      panel.add(getSelector(), 165, 0);
    } catch (Exception e) {
      System.err.println("You must implement a Selector for this size!");
    }
    panel.setPixelSize(260, 220);

    if (config.getLinesOfBusiness().size() <= 0) {
      System.err.println("Cant build a search form with no LOBs!");
    } else {

      Iterator<LOBEnum> lobIter = config.getLinesOfBusiness().iterator();
      while (lobIter.hasNext()) {
        try {

          LOB lob = lobIter.next().getLineOfBusinessPanel(panelMaker);
          addLOBPanel(lob);
          if (!config.getDefaultLOB().equals(lob.getEnumName())) {
            lob.setVisible(false);
          }
          panel.insert(lob, 3, 60, 0);
        } catch (Exception e) {
          System.err.println(
              "Check that you are instantiating the right size of LOBSelection Panel for your Widget size.");
        }
      }
    }

    SearchFormSearchButton searchButton = new SearchFormSearchButton(config, 92, 33);

    HorizontalPanel searchPanel = new HorizontalPanel();
    searchPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    searchPanel.setWidth("258px");

    getSearchFocusPanel().add(searchButton);
    searchPanel.add(getSearchFocusPanel());
    panel.add(searchPanel, 0, 178);
    initWidget(panel);
  }
Exemple #16
0
    public TermDetail(ConceptObject conceptObject, TermObject termObject) {
      String text = termObject.getLabel();
      if (text.length() > 100) text = text.substring(0, 70) + "...";
      this.setHTML(
          constants.conceptInformationFor()
              + " <i>"
              + text
              + " ("
              + termObject.getLang()
              + ")</i>&nbsp;["
              + (termObject.isMainLabel()
                  ? constants.conceptPreferredTerm()
                  : constants.conceptNonPreferredTerm())
              + "]");
      TermDetailTabPanel termDetail =
          new TermDetailTabPanel(permissionTable, initData, TermDetail.this);
      termDetail.setURI(termObject, conceptObject);

      VerticalPanel vp = new VerticalPanel();
      vp.setSize("100%", "100%");
      vp.add(termDetail);

      panel.add(vp);
      panel.setCellHeight(vp, "100%");
      panel.setCellWidth(vp, "100%");

      HorizontalPanel buttonPanel = new HorizontalPanel();
      buttonPanel.setSpacing(5);
      buttonPanel.add(cancel);

      HorizontalPanel hp = new HorizontalPanel();
      hp.setSpacing(0);
      hp.setWidth("100%");
      hp.setStyleName("bottombar");
      hp.add(buttonPanel);
      hp.setCellHorizontalAlignment(buttonPanel, HasHorizontalAlignment.ALIGN_RIGHT);

      panel.add(hp);
      cancel.addClickHandler(this);
      panel.setCellHorizontalAlignment(cancel, HasHorizontalAlignment.ALIGN_RIGHT);
      panel.setSize("100%", "100%");
      setWidget(panel);
    }
Exemple #17
0
 public ManagePanel(StockServiceAsync stockSvc) {
   lastModified.addStyleName("small-label");
   hp.setWidth("100%");
   rankGrid = new Grid(1, HEADERS.length);
   setSpacing(4);
   this.stockSvc = stockSvc;
   hp.add(refreshBtn);
   this.add(hp);
   this.add(rankGrid);
   refreshBtn.addClickHandler(
       new ClickHandler() {
         public void onClick(ClickEvent event) {
           removeGrids();
           refreshBtn.setEnabled(false);
           loadData();
         }
       });
   Util.createGridHeader(rankGrid, HEADERS);
 }
  /** Initializes and assembles all commands into buttons in the toolbar. */
  public Toolbar() {
    buttonMap = new HashMap<String, TextButton>();
    dropDownButtonMap = new HashMap<String, DropDownButton>();

    leftButtons = new HorizontalPanel();
    leftButtons.setSpacing(4);

    rightButtons = new HorizontalPanel();
    rightButtons.setSpacing(4);
    rightButtons.setHorizontalAlignment(HorizontalPanel.ALIGN_RIGHT);

    HorizontalPanel toolbar = new HorizontalPanel();
    toolbar.add(leftButtons); // this nesting keeps buttons left aligned
    toolbar.add(rightButtons);
    toolbar.setCellHorizontalAlignment(rightButtons, HorizontalPanel.ALIGN_RIGHT);
    toolbar.setWidth("100%");
    toolbar.setStylePrimaryName("ya-Toolbar");

    initWidget(toolbar);
  }
Exemple #19
0
  @SuppressWarnings("unused")
  private HorizontalPanel getTermCode() {

    termCodeBox.addValueChangeHandler(
        new ValueChangeHandler<String>() {
          public void onValueChange(ValueChangeEvent<String> event) {
            String value = ((TextBox) (event.getSource())).getValue();
            exp.setTermCode(value.equals("") ? null : value);
          }
        });

    HorizontalPanel conceptHp = new HorizontalPanel();
    conceptHp.add(termCodeBox);
    conceptHp.setSpacing(3);
    conceptHp.setWidth("100%");
    conceptHp.setCellHorizontalAlignment(conceptBrowse, HasHorizontalAlignment.ALIGN_RIGHT);
    conceptHp.setCellHorizontalAlignment(termCodeBox, HasHorizontalAlignment.ALIGN_LEFT);
    conceptHp.setCellWidth(termCodeBox, "100%");
    return conceptHp;
  }
Exemple #20
0
  private HorizontalPanel getExportFormat() {
    // format.addItem("--None--", "--None--");
    format.addItem(ExportFormat.SKOSXL, ExportFormat.SKOSXL);
    format.addItem(ExportFormat.SKOS, ExportFormat.SKOS);
    // format.addItem(constants.exportSQL(), ExportFormat.RDBMS_SQL_FORMAT);
    format.setWidth("100%");
    format.addChangeHandler(
        new ChangeHandler() {
          public void onChange(ChangeEvent event) {
            if (!format.getValue((format.getSelectedIndex())).equals("")
                && !format.getValue(format.getSelectedIndex()).equals("--None--")) {
              exp.setFormat(format.getValue(format.getSelectedIndex()));
            } else {
              exp.setFormat(null);
            }
          }
        });

    includeLabelsOfRelatedConcepts =
        new CheckBox(constants.exportIncludeLabelsOfRelatedConcepts(), true);
    includeLabelsOfRelatedConcepts.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            exp.setIncludeLabelsOfRelatedConcepts(((CheckBox) event.getSource()).getValue());
          }
        });

    HorizontalPanel conceptHp = new HorizontalPanel();

    conceptHp.add(format);
    conceptHp.add(includeLabelsOfRelatedConcepts);
    conceptHp.setSpacing(3);
    conceptHp.setWidth("100%");
    conceptHp.setCellHorizontalAlignment(format, HasHorizontalAlignment.ALIGN_LEFT);
    conceptHp.setCellHorizontalAlignment(
        includeLabelsOfRelatedConcepts, HasHorizontalAlignment.ALIGN_RIGHT);
    conceptHp.setCellWidth(format, "80%");
    return conceptHp;
  }
Exemple #21
0
  public VersionBrowser(
      ClientFactory clientFactory, EventBus eventBus, String uuid, boolean isPackage) {
    this.clientFactory = clientFactory;
    this.eventBus = eventBus;
    this.uuid = uuid;
    this.isPackage = isPackage;

    HorizontalPanel wrapper = new HorizontalPanel();

    ClickHandler clickHandler =
        new ClickHandler() {

          public void onClick(ClickEvent event) {
            clickLoadHistory();
          }
        };
    layout = new FlexTable();
    ClickableLabel vh = new ClickableLabel(constants.VersionHistory1(), clickHandler);
    layout.setWidget(0, 0, vh);
    layout.getCellFormatter().setStyleName(0, 0, "metadata-Widget"); // NON-NLS
    FlexCellFormatter formatter = layout.getFlexCellFormatter();
    formatter.setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_LEFT);

    refresh = new ImageButton(images.refresh());

    refresh.addClickHandler(clickHandler);

    layout.setWidget(0, 1, refresh);
    formatter.setHorizontalAlignment(0, 1, HasHorizontalAlignment.ALIGN_RIGHT);

    wrapper.setStyleName("version-browser-Border");

    wrapper.add(layout);

    layout.setWidth("100%");
    wrapper.setWidth("100%");

    initWidget(wrapper);
  }
  private Widget getButtonPanel() {
    HorizontalPanel bar = new HorizontalPanel();
    bar.setHeight("50px");
    bar.setSpacing(10);
    bar.setWidth("350px");

    Button addButton = new Button("Add");
    Button cancelButton = new Button("Cancel");

    bar.add(addButton);
    bar.add(cancelButton);

    bar.setCellHorizontalAlignment(addButton, HasHorizontalAlignment.ALIGN_RIGHT);
    bar.setCellHorizontalAlignment(cancelButton, HasHorizontalAlignment.ALIGN_LEFT);

    addButton.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent event) {
            itemAdded = true;
            dialogBox.hide(true);
          }
        });

    cancelButton.addClickHandler(
        new ClickHandler() {

          @Override
          public void onClick(ClickEvent event) {
            itemAdded = false;
            enumValue.setText("");
            dialogBox.hide(true);
          }
        });

    return bar.asWidget();
  }
Exemple #23
0
  private Widget getDetailSection() {
    HorizontalPanel panel = new HorizontalPanel();
    panel.setWidth("100%");
    panel.setStyleName("studio-Bottom-Panel");

    VerticalPanel ruleDefPanel = new VerticalPanel();
    ruleDefPanel.setWidth("95%");

    Label lbl = new Label();
    lbl.setText("Rule Definition");
    lbl.setStyleName("studio-Label-Small");

    ruleDef = new TextArea();
    ruleDef.setWidth("100%");
    ruleDef.setVisibleLines(5);
    ruleDef.setReadOnly(true);

    ruleDefPanel.add(lbl);
    ruleDefPanel.add(ruleDef);

    panel.add(ruleDefPanel);

    return panel.asWidget();
  }
  private void drawLoginInputs() {

    // default
    tbConsumerSecret.setVisible(true);
    tbConsumerSecretPass.setVisible(false);

    // reset ui
    pUi.clear();

    cbRemberMe.setText("Remember Me");

    hAccountCreate = new Hyperlink("Create Account", "account_Create");

    tbConsumerKey.setTitle(inputLabel_ConsumerKey);
    tbConsumerSecret.setTitle(inputLabel_consumerSecret);
    tbConsumerSecretPass.setTitle(inputLabel_consumerSecret);

    // hide loading by default
    hideLoading();

    // main login inputs
    HorizontalPanel ploginItems = new HorizontalPanel();
    ploginItems.setWidth("100%");
    ploginItems.add(tbConsumerKey);
    ploginItems.add(tbConsumerSecret);
    ploginItems.add(tbConsumerSecretPass);
    ploginItems.add(bLogin);

    // login options
    HorizontalPanel pOptions = new HorizontalPanel();
    // pOptions.setSpacing(4);
    pOptions.add(cbRemberMe);
    pOptions.add(hForgotPassword);
    pOptions.add(hAccountCreate);

    VerticalPanel vp = new VerticalPanel();
    vp.setWidth("100%");
    vp.add(ploginItems);
    vp.add(pOptions);

    // TODO - move this to a floating overlay
    vp.add(pError);

    pUi.add(vp);

    drawInputLabel_key();
    drawInputLabel_secret();

    tbConsumerKey.addStyleName("login-Ui-InputConsumerKey");
    tbConsumerSecret.addStyleName("login-Ui-InputConsumerSecret");
    tbConsumerSecretPass.addStyleName("login-Ui-InputConsumerSecret");
    pOptions.setCellHorizontalAlignment(hForgotPassword, HorizontalPanel.ALIGN_RIGHT);
    pOptions.setCellHorizontalAlignment(hAccountCreate, HorizontalPanel.ALIGN_RIGHT);
    pOptions.setCellVerticalAlignment(hForgotPassword, VerticalPanel.ALIGN_BOTTOM);
    pOptions.setCellVerticalAlignment(hAccountCreate, VerticalPanel.ALIGN_BOTTOM);
    pOptions.addStyleName("login-Ui-InputOptions");
    pOptions.setWidth("100%");

    // vp.addStyleName("test1");
    // pOptions.addStyleName("test2");
  }
  public DialogListaPontoEncontro(
      final InfoCaronaServerAsync controller, final String idSessao, final String idCarona) {
    novosPontos = "";
    listaNovosPontosEncontros = new ArrayList<InfoPontoEncontro>();
    this.idCarona = idCarona;
    this.controller = controller;

    setText("Pontos de Encontro - ID: " + idCarona);
    setAnimationEnabled(true);
    setGlassEnabled(true);
    center();

    VerticalPanel panelListaPontoEncontro = new VerticalPanel();
    tabelaPontoEncontro = new CellTable<InfoPontoEncontro>();
    tabelaPontoEncontro.setWidth("400px");
    dataProvider = new ListDataProvider<InfoPontoEncontro>();

    SimplePager.Resources pagerResources = GWT.create(SimplePager.Resources.class);
    SimplePager pager = new SimplePager(TextLocation.CENTER, pagerResources, false, 0, true);
    pager.setDisplay(tabelaPontoEncontro);
    pager.setPageSize(5);

    TextColumn<InfoPontoEncontro> colunaIdPontoEncontro =
        new TextColumn<InfoPontoEncontro>() {
          @Override
          public String getValue(InfoPontoEncontro pontoEncontro) {
            return pontoEncontro.getIdPontoEncontro();
          }
        };

    TextColumn<InfoPontoEncontro> colunaPontosEncontro =
        new TextColumn<InfoPontoEncontro>() {
          @Override
          public String getValue(InfoPontoEncontro pontoEncontro) {
            return pontoEncontro.getPontoEncontro();
          }
        };

    tabelaPontoEncontro.addColumn(colunaPontosEncontro, "Pontos de Encontro");
    listaPontoEncontros = new ArrayList<InfoPontoEncontro>();
    populaTabela();

    HorizontalPanel hPanel01 = new HorizontalPanel();
    final TextBox boxNovoPontoEncontro = new TextBox();
    boxNovoPontoEncontro.setWidth("200px");
    boxNovoPontoEncontro.setStyleName("boxModificada");

    Button buttonAdicionarOutroPontoEncontro = new Button();
    buttonAdicionarOutroPontoEncontro.setStyleName("botaoModificado");
    buttonAdicionarOutroPontoEncontro.setTitle("Adicionar Sugestão");
    buttonAdicionarOutroPontoEncontro.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent event) {
            if (boxNovoPontoEncontro.getText().trim().equals("")) {
              DialogMensagemUsuario dialogErro =
                  new DialogMensagemUsuario("Falhou", "Ponto de Encontro Inválido");
              dialogErro.show();
            } else {
              novosPontos += boxNovoPontoEncontro.getText().trim() + ";";
              InfoPontoEncontro novoPontoEncontro =
                  new InfoPontoEncontro("00", boxNovoPontoEncontro.getText().trim());
              boxNovoPontoEncontro.setText("");

              listaNovosPontosEncontros.add(novoPontoEncontro);
              listaPontoEncontros = new ArrayList<InfoPontoEncontro>();

              for (InfoPontoEncontro novoPonto : listaNovosPontosEncontros) {
                listaPontoEncontros.add(novoPonto);
              }

              populaTabela();
            }
          }
        });

    Image imageFiltro = new Image("imagens/adicionar.png");
    imageFiltro.setSize("15px", "15px");
    buttonAdicionarOutroPontoEncontro.getElement().appendChild(imageFiltro.getElement());

    Button buttonSalvarNovosPontos = new Button("Salvar");
    buttonSalvarNovosPontos.setStyleName("botaoModificado");
    buttonSalvarNovosPontos.addClickHandler(
        new ClickHandler() {

          @Override
          public void onClick(ClickEvent event) {
            controller.cadastrarNovosPontosEncontro(
                idSessao,
                idCarona,
                novosPontos,
                new AsyncCallback<String>() {

                  @Override
                  public void onFailure(Throwable caught) {
                    DialogMensagemUsuario dialogSucess =
                        new DialogMensagemUsuario("Erro", caught.getMessage());
                    dialogSucess.show();
                  }

                  @Override
                  public void onSuccess(String result) {
                    DialogMensagemUsuario dialogSucess =
                        new DialogMensagemUsuario(
                            "ID: " + result, "Pontos de Encontro Cadastrados com Sucesso!");
                    dialogSucess.show();
                    hide();
                  }
                });
          }
        });

    Button buttonFechar = new Button("Fechar");
    buttonFechar.setStyleName("botaoModificado");

    buttonFechar.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent event) {
            hide();
          }
        });

    colunaPontosEncontro.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);

    hPanel01.setCellVerticalAlignment(boxNovoPontoEncontro, HasVerticalAlignment.ALIGN_BOTTOM);
    hPanel01.setCellVerticalAlignment(buttonSalvarNovosPontos, HasVerticalAlignment.ALIGN_TOP);
    hPanel01.setCellVerticalAlignment(
        buttonAdicionarOutroPontoEncontro, HasVerticalAlignment.ALIGN_TOP);
    hPanel01.setCellVerticalAlignment(buttonFechar, HasVerticalAlignment.ALIGN_TOP);
    hPanel01.setCellHorizontalAlignment(boxNovoPontoEncontro, HasHorizontalAlignment.ALIGN_CENTER);
    hPanel01.setCellHorizontalAlignment(
        buttonSalvarNovosPontos, HasHorizontalAlignment.ALIGN_CENTER);
    hPanel01.setCellHorizontalAlignment(
        buttonAdicionarOutroPontoEncontro, HasHorizontalAlignment.ALIGN_CENTER);
    hPanel01.setCellHorizontalAlignment(buttonFechar, HasHorizontalAlignment.ALIGN_CENTER);
    hPanel01.setWidth("100%");
    hPanel01.setSpacing(6);

    hPanel01.add(boxNovoPontoEncontro);
    hPanel01.add(buttonAdicionarOutroPontoEncontro);
    hPanel01.add(buttonSalvarNovosPontos);
    hPanel01.add(buttonFechar);

    panelListaPontoEncontro.add(tabelaPontoEncontro);
    panelListaPontoEncontro.add(pager);
    panelListaPontoEncontro.add(hPanel01);

    panelListaPontoEncontro.setCellVerticalAlignment(
        tabelaPontoEncontro, HasVerticalAlignment.ALIGN_MIDDLE);
    panelListaPontoEncontro.setCellVerticalAlignment(pager, HasVerticalAlignment.ALIGN_MIDDLE);

    panelListaPontoEncontro.setCellHorizontalAlignment(
        tabelaPontoEncontro, HasHorizontalAlignment.ALIGN_CENTER);
    panelListaPontoEncontro.setCellHorizontalAlignment(pager, HasHorizontalAlignment.ALIGN_CENTER);
    panelListaPontoEncontro.setSpacing(8);

    setWidget(panelListaPontoEncontro);
  }
Exemple #26
0
  /** Creates the gui. */
  private void createGUI() {

    if (editlogin == null) {
      setText(M.users.menuAddUser());
    } else {
      setText(M.users.titleEditUser());
    }
    setAnimationEnabled(true);
    setGlassEnabled(true);

    String addText = M.users.btnAdd();
    if (editlogin != null) {
      addText = M.users.btnUpdate();
    }
    Button btnAdd = new Button(addText);

    btnAdd.addClickHandler(
        new ClickHandler() {

          @Override
          public void onClick(ClickEvent event) {
            if (editlogin == null) {
              createUser();
            } else {
              updateUser();
            }
          }
        });

    Button btnCancel = new Button(M.users.btnCancel());
    btnCancel.addClickHandler(
        new ClickHandler() {

          @Override
          public void onClick(ClickEvent event) {
            EditUserDialog.this.hide();
          }
        });

    VerticalPanel vpanel = new VerticalPanel();
    // vpanel.setWidth("400px");

    FlexTable layout = new FlexTable();
    layout.setCellSpacing(6);

    layout.setHTML(0, 0, M.users.fullName());
    name = new TextBox();
    name.setText(user.getUsername());
    layout.setWidget(0, 1, name);

    layout.setHTML(1, 0, M.users.login());
    login = new TextBox();
    login.setText(user.getLogin());
    if (editlogin != null) {
      login.setReadOnly(true);
    }
    layout.setWidget(1, 1, login);

    layout.setHTML(2, 0, M.users.password());
    password = new TextBox();
    password.setText("");
    layout.setWidget(2, 1, password);

    layout.setHTML(3, 0, M.users.isactive());
    isactive = new CheckBox();
    isactive.setValue(user.isActive());
    layout.setWidget(3, 1, isactive);

    layout.setHTML(4, 0, M.users.access());

    UserRole role = user.getUserrole();

    FlexTable access = new FlexTable();
    access.setCellSpacing(6);

    access.setHTML(0, 0, M.users.isadmin());
    isadmin = new CheckBox();
    isadmin.setValue(role.isAdmin());
    access.setWidget(0, 1, isadmin);

    access.setHTML(1, 0, M.users.isdocuments());
    isdocuments = new CheckBox();
    isdocuments.setValue(role.isDocuments());
    access.setWidget(1, 1, isdocuments);

    access.setHTML(2, 0, M.users.isfinances());
    isfinances = new CheckBox();
    isfinances.setValue(role.isFinances());
    access.setWidget(2, 1, isfinances);

    access.setHTML(3, 0, M.users.ismanager());
    ismanager = new CheckBox();
    ismanager.setValue(role.isManager());
    access.setWidget(3, 1, ismanager);

    layout.setWidget(4, 1, access);

    vpanel.add(layout);

    HorizontalPanel buttons = new HorizontalPanel();
    buttons.setWidth("100%");
    buttons.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);

    HorizontalPanel bcontainer = new HorizontalPanel();
    bcontainer.add(btnAdd);
    bcontainer.add(btnCancel);
    bcontainer.setSpacing(5);
    buttons.add(bcontainer);

    vpanel.add(buttons);

    setWidget(vpanel);
    /*
     * setPopupPosition( (Ballance_autosauler_net.mainpanel.getOffsetWidth()
     * / 2 - 200), 100);
     */
    show();
  }
  private void showAddItemAttributeDialog(final VkMenuBarHorizontal menuBar) {
    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("Provide html for item name and JS to execute on its click");
    dialog.setWidth("100%");
    dialog.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);
    DOM.setStyleAttribute(origDialog.getElement(), "zIndex", Integer.MAX_VALUE + "");

    HorizontalPanel nameHp = new HorizontalPanel();
    nameHp.setWidth("100%");
    dialog.add(nameHp);
    nameHp.setHorizontalAlignment(HorizontalPanel.ALIGN_RIGHT);
    nameHp.add(new Label("Name HTML:"));
    nameHp.setHorizontalAlignment(HorizontalPanel.ALIGN_LEFT);
    nameHp.setCellWidth(nameHp.getWidget(0), "35%");
    final TextArea nameTextArea = new TextArea();
    nameHp.add(nameTextArea);
    nameTextArea.setSize("300px", "100px");
    Timer t =
        new Timer() {
          @Override
          public void run() {
            VkDesignerUtil.centerDialog(dialog);
            nameTextArea.setFocus(true);
          }
        };
    t.schedule(100);
    HorizontalPanel jsHp = new HorizontalPanel();
    jsHp.setWidth("100%");
    dialog.add(jsHp);
    jsHp.setHorizontalAlignment(HorizontalPanel.ALIGN_RIGHT);
    jsHp.add(new Label("Command Js:"));
    jsHp.setHorizontalAlignment(HorizontalPanel.ALIGN_LEFT);
    jsHp.setCellWidth(jsHp.getWidget(0), "35%");
    final VkEventTextArea jsTextArea = new VkEventTextArea();
    jsTextArea.setSize("300px", "100px");
    jsHp.add(jsTextArea);
    HorizontalPanel buttonsPanel = new HorizontalPanel();
    dialog.add(buttonsPanel);
    Button saveButton = new Button("Save");
    buttonsPanel.add(saveButton);
    saveButton.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent event) {
            menuBar.getCommandJs().put(menuBar.getItemCount(), jsTextArea.getText());
            addMenuItem(menuBar, nameTextArea.getText(), jsTextArea.getText());
            origDialog.hide();
          }
        });
    Button cancelButton = new Button("Cancel");
    buttonsPanel.add(cancelButton);
    cancelButton.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent event) {
            origDialog.hide();
          }
        });
    origDialog.center();
    origDialog.setPopupPosition(origDialog.getPopupLeft() + 1, origDialog.getPopupTop());
  }
  // Popup pour les messages
  public DialogBox createDialogBoxConfirmationFormulaire(
      String msg,
      final JSONObject formAsJSONObjectAjoutDupliquer,
      final JSONObject formAsJSONObjectAjoutEcraser) {
    final DialogBox dialogBox = new DialogBox();
    dialogBox.setText("Confirmation");
    dialogBox.setAnimationEnabled(true);

    Button ouiButton = new Button("Oui");
    ouiButton.getElement().setId("ouiButton");

    Button nonButton = new Button("Non");
    nonButton.getElement().setId("nonButton");

    VerticalPanel dialogVPanel = new VerticalPanel();
    HorizontalPanel dialogHPanel = new HorizontalPanel();
    dialogHPanel.setWidth("80px");
    dialogVPanel.setWidth("300px");
    dialogVPanel.add(new HTML("<b>" + msg + "</b>"));
    dialogVPanel.setHorizontalAlignment(VerticalPanel.ALIGN_RIGHT);
    dialogHPanel.add(ouiButton);
    dialogHPanel.add(nonButton);
    dialogVPanel.add(dialogHPanel);
    dialogBox.setWidget(dialogVPanel);
    dialogBox.setPopupPosition(450, 450);

    /** * Action de clique sur le button de valisation ** */
    ouiButton.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            formAsJSONObjectBis = formAsJSONObjectAjoutEcraser;
            ajoutFormulaireDirect();

            // Supprimer le formulaire
            RequestBuilder builder =
                new RequestBuilder(
                    RequestBuilder.PUT, FORMULAIRE_URL + "supprimer/" + formulaire_id);
            builder.setHeader("Content-Type", "application/json");
            try {
              builder.sendRequest(
                  null,
                  new RequestCallback() {
                    public void onError(Request request, Throwable exception) {}

                    public void onResponseReceived(Request request, Response response) {}
                  });
            } catch (RequestException e) {
              System.out.println("RequestException");
            }

            dialogBox.hide();
          }
        });

    /** * Action de clique sur le button de valisation ** */
    nonButton.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            formAsJSONObjectBis = formAsJSONObjectAjoutDupliquer;
            ajoutFormulaireDirect();

            dialogBox.hide();
          }
        });

    return dialogBox;
  }
  public ResizableDialogBox(
      final String headerText,
      String okText,
      String cancelText,
      final Widget content,
      final boolean modal) {
    this.content = content;
    boundaryPanel =
        new AbsolutePanel() {
          public void onBrowserEvent(Event event) {
            super.onBrowserEvent(event);
            if (!modal && event.getTypeInt() == Event.ONCLICK) {
              hide();
            }
          }
        };
    boundaryPanel.setSize(
        "100%",
        Window.getClientHeight() + Window.getScrollTop() + "px"); // $NON-NLS-1$ //$NON-NLS-2$
    boundaryPanel.setVisible(true);
    RootPanel.get().add(boundaryPanel, 0, 0);
    boundaryPanel.sinkEvents(Event.ONCLICK);
    boundaryPanel
        .getElement()
        .getStyle()
        .setProperty("cursor", "wait"); // $NON-NLS-1$ //$NON-NLS-2$

    // initialize window controller which provides drag and resize windows
    WindowController windowController = new WindowController(boundaryPanel);

    // content wrapper
    Button ok = new Button(okText);
    ok.setStylePrimaryName("pentaho-button");
    ok.getElement().setAttribute("id", "okButton"); // $NON-NLS-1$ //$NON-NLS-2$
    ok.addClickHandler(
        new ClickHandler() {

          @Override
          public void onClick(ClickEvent event) {
            if (validatorCallback == null
                || (validatorCallback != null && validatorCallback.validate())) {
              try {
                if (callback != null) {
                  callback.okPressed();
                }
              } catch (Throwable dontCare) {
              }
              hide();
            }
          }
        });
    final HorizontalPanel dialogButtonPanel = new HorizontalPanel();
    dialogButtonPanel.setSpacing(2);
    dialogButtonPanel.add(ok);
    if (cancelText != null) {
      Button cancel = new Button(cancelText);
      cancel.setStylePrimaryName("pentaho-button");
      cancel.getElement().setAttribute("id", "cancelButton"); // $NON-NLS-1$ //$NON-NLS-2$
      cancel.addClickHandler(
          new ClickHandler() {

            public void onClick(ClickEvent event) {
              try {
                if (callback != null) {
                  callback.cancelPressed();
                }
              } catch (Throwable dontCare) {
              }
              hide();
            }
          });
      dialogButtonPanel.add(cancel);
    }
    HorizontalPanel dialogButtonPanelWrapper = new HorizontalPanel();
    if (okText != null && cancelText != null) {
      dialogButtonPanelWrapper.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
    } else {
      dialogButtonPanelWrapper.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    }
    dialogButtonPanelWrapper.setStyleName("dialogButtonPanel"); // $NON-NLS-1$
    dialogButtonPanelWrapper.setWidth("100%"); // $NON-NLS-1$
    dialogButtonPanelWrapper.add(dialogButtonPanel);

    Grid dialogContent = new Grid(2, 1);
    dialogContent.setCellPadding(0);
    dialogContent.setCellSpacing(0);
    dialogContent.getCellFormatter().setVerticalAlignment(1, 0, HasVerticalAlignment.ALIGN_TOP);
    dialogContent
        .getCellFormatter()
        .setHorizontalAlignment(1, 0, HasHorizontalAlignment.ALIGN_LEFT);
    // add content
    dialogContent.setWidget(0, 0, content);
    dialogContent.getCellFormatter().setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_TOP);
    // add button panel
    dialogContent.setWidget(1, 0, dialogButtonPanelWrapper);
    dialogContent.getCellFormatter().setVerticalAlignment(1, 0, HasVerticalAlignment.ALIGN_BOTTOM);
    dialogContent.setWidth("100%"); // $NON-NLS-1$
    dialogContent.setHeight("100%"); // $NON-NLS-1$

    windowPanel = new WindowPanel(windowController, headerText, dialogContent, true);
  }
  public TextEditor(TextEntry1Space parentWidget, int userNo, int nbTextEntry) {
    super();
    parent = parentWidget;
    logVector = new Vector<String>();
    this.userNo = userNo;
    this.nbTextEntry = nbTextEntry;
    if (parentWidget instanceof AbsolutePanel) isAPanel = true;

    if (nbTextEntry == 1) // if it's training
    {
      wordlist = traininglist;
    }

    text = new Label(wordlist[0]);
    text.getElement().getStyle().setColor("#fff");
    text.getElement().getStyle().setFontSize(20, Unit.PT);
    text.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    hPanel.setWidth("100%");
    hPanel.add(text);
    this.add(hPanel);

    MultiFocus.setVisible(true);
    MultiFocus.setWidth("100%");
    MultiFocus.setHeight("100px");
    MultiFocus.setWidth("250px");

    MultiFocus.getElement().getStyle().setBackgroundColor("#fff");

    // this.add(ta);
    this.add(MultiFocus);
    this.setBorderWidth(1);

    MultiFocus.addDomHandler(
        new KeyPressHandler() { // Listen for KeyPress events on MultiFocusTextBox
          @Override
          public void onKeyPress(KeyPressEvent event) {

            if (!isStarted) {
              startTime = System.currentTimeMillis();

              if (!isSetStarted) {
                setStartTime = startTime; // set experiment start time
                isSetStarted = true;
              }

              isStarted = true;
            }
            typedText = typedText + event.getCharCode();
          }
        },
        KeyPressEvent.getType());

    MultiFocus.addDomHandler(
        new KeyUpHandler() {

          @Override
          public void onKeyUp(KeyUpEvent event) {

            if (event.getNativeEvent().getKeyCode() == 13) {

              if (isSetFinished && !isLast) { // for the second set

                log(typedText, ta.getText());
                parent.setLoggedData(logVector, false, true); // done with experiment

                iteration++;
                text.setText(secondwordlist[iteration]);

                typedText = "";
                isStarted = false;
              }

              if (isLast) {
                log(typedText, ta.getText());
                parent.setLoggedData(logVector, true, true); // done with experiment

                text.setText(secondwordlist[0]);
                typedText = "";
                isStarted = false;

                iteration = 0;
                isLast = false;
              }

              if (!isSetFinished) {

                if (!isLast) {
                  iteration++;
                  text.setText(wordlist[iteration]);

                  log(typedText, ta.getText()); // log for wordlist[iteration-1]
                  typedText = "";
                  isStarted = false;

                  if ((iteration == (wordlist.length - 1))) { // last element
                    isSetFinished = true;
                    isLast = true;
                  }
                }
              }
            }

            if (event.getNativeEvent().getKeyCode() == KeyCodes.KEY_BACKSPACE) {

              typedText = typedText + "~";
            }
          }
        },
        KeyUpEvent.getType());
  }