public void inicializar() {
    super.inicializar();

    hdnCod = new Hidden("finRetornoId", "0");
    add(hdnCod);

    // campo
    txtArquivo = new TextField(OpenSigCore.i18n.txtArquivo(), "finRetornoArquivo", 200);
    txtArquivo.setAllowBlank(false);
    txtArquivo.setReadOnly(true);

    // botao
    btnArquivo = new ToolbarButton(OpenSigCore.i18n.txtArquivo());
    btnArquivo.setIconCls("icon-analisar");
    btnArquivo.setTooltip(OpenSigCore.i18n.msgAnalisar());
    btnArquivo.addListener(
        new ButtonListenerAdapter() {
          public void onClick(Button button, EventObject e) {
            abrirArquivo();
          }
        });

    MultiFieldPanel linha1 = new MultiFieldPanel();
    linha1.setBorder(false);
    linha1.addToRow(getConta(), 240);
    linha1.addToRow(txtArquivo, 230);
    add(linha1);

    // lista
    boletos = new ListagemBoletos();
    add(boletos);
  }
Exemple #2
2
 private void search() {
   if (win.getHeight() < RESULT_HEIGHT) {
     win.setHeight(RESULT_HEIGHT);
   }
   win.show();
   win.center();
   results.search(searchInput.getText());
 }
  public void mostrarDados() {
    Record rec = lista.getPanel().getSelectionModel().getSelected();
    if (rec != null) {
      getForm().loadRecord(rec);
    }
    txtNome.focus(true);

    if (duplicar) {
      hdnCod.setValue("0");
      duplicar = false;
    }
  }
 public boolean setDados() {
   classe.setPokerFormaId(Integer.valueOf(hdnCod.getValueAsString()));
   classe.setPokerFormaNome(txtNome.getValueAsString());
   classe.setPokerFormaRealizado(chkRealizado.getValue());
   classe.setPokerFormaJackpot(chkJackpot.getValue());
   return true;
 }
  public void inicializar() {
    hdnCod = new Hidden("pokerFormaId", "0");
    add(hdnCod);

    txtNome = new TextField(OpenSigCore.i18n.txtNome(), "pokerFormaNome", 200);
    txtNome.setAllowBlank(false);
    txtNome.setMaxLength(50);

    chkRealizado = new Checkbox(OpenSigCore.i18n.txtRealizado(), "pokerFormaRealizado");

    chkJackpot = new Checkbox(OpenSigCore.i18n.txtJackpot(), "pokerFormaJackpot");

    MultiFieldPanel linha1 = new MultiFieldPanel();
    linha1.setBorder(false);
    linha1.addToRow(txtNome, 220);
    linha1.addToRow(chkRealizado, 120);
    linha1.addToRow(chkJackpot, 120);
    add(linha1);

    super.inicializar();
  }
    public CreateUserDefinedTabForm(Window parent) {
      super();
      this.parent = parent;

      setWidth(400);
      setLabelWidth(150);
      setPaddings(15);

      labelTextField = new TextField("Tab Label", "label");
      labelTextField.setValue("New Tab");
      add(labelTextField);

      colNoTextField = new TextField("Number of columns", "noCols");
      colNoTextField.setValue("2");
      add(colNoTextField);
      colNoTextField.addListener(
          new TextFieldListenerAdapter() {
            @Override
            public void onChange(Field field, Object newVal, Object oldVal) {
              showColFields();
            }
          });

      showColFields();

      Button createButton =
          new Button(
              "Create",
              new ButtonListenerAdapter() {
                @Override
                public void onClick(Button button, EventObject e) {
                  AbstractTab tab = createTab();
                  addTab(tab);
                  CreateUserDefinedTabForm.this.parent.close();
                  activate(tab.getId());
                }
              });

      addButton(createButton);
    }
Exemple #7
0
  /**
   * Default constructor.
   *
   * @param resultsListView the instance of the results list view to use
   */
  public SearchForm(SearchResultsListView resultsListView) {
    super();
    setBorder(false);
    setHideLabels(true);

    // using an inner panel to customize the layout
    Panel innerPanel = new Panel();
    innerPanel.setBorder(false);
    innerPanel.setLayout(new HorizontalLayout(5));

    searchInput = new TextField();
    searchInput.setName(SearchLookupConfiguration.IN_QUERY);
    searchInput.setWidth(200); // width of search input box
    setFieldListeners(searchInput);
    innerPanel.add(searchInput);

    Button submitButton = makeStandardSubmitButton(UtilUi.MSG.search());
    innerPanel.add(submitButton);

    add(innerPanel);

    win = new Window(UtilUi.MSG.searchResults());
    win.setModal(false);
    win.setResizable(true);
    win.setMinHeight(RESULT_HEIGHT);
    win.setLayout(new FitLayout());
    win.setCloseAction(Window.HIDE);

    results = resultsListView;
    results.setFrame(false);
    results.setAutoHeight(false);
    results.setCollapsible(false);
    results.setHeader(false);
    results.setBorder(false);
    results.setWidth(RESULT_WIDTH);
    win.add(results);
  }
    private void showColFields() {
      removeExistingFields();
      String noOfColsStr = colNoTextField.getValueAsString();
      try {
        colNo = Integer.parseInt(noOfColsStr);
      } catch (NumberFormatException e) {
      }

      int defaultWidth = colNo == 0 ? 100 : 100 / colNo;
      String defaultWidthStr = new Integer(defaultWidth).toString();
      for (int i = 0; i < colNo; i++) {
        colTextFields[i] = new TextField("Width column " + i + " (%)", "col" + i);
        colTextFields[i].setValue(defaultWidthStr);
        add(colTextFields[i]);
      }
      doLayout();
    }
 private void onSearchChange(final boolean filteredOnly) {
   final String filter = searchField.getText();
   if (filter == null || filter.equals("")) {
     treeFilter.clear();
     treeFilter.filterBy(
         new TreeTraversalCallback() {
           public boolean execute(TreeNode node) {
             node.setText(Format.stripTags(node.getText()));
             return true;
           }
         });
   } else {
     treeFilter.filterBy(
         new TreeTraversalCallback() {
           public boolean execute(TreeNode node) {
             String text = Format.stripTags(node.getText());
             node.setText(text);
             if (text.toLowerCase().indexOf(filter.toLowerCase()) != -1) {
               node.setText("<b>" + text + "</b>");
               ((TreeNode) node.getParentNode()).expand();
               return true;
             } else {
               final List childMatches = new ArrayList();
               node.cascade(
                   new NodeTraversalCallback() {
                     public boolean execute(Node node) {
                       String childText = ((TreeNode) node).getText();
                       if (childText.toLowerCase().indexOf(filter.toLowerCase()) != -1) {
                         childMatches.add(new Object());
                       }
                       return true;
                     }
                   });
               return !filteredOnly || childMatches.size() != 0;
             }
           }
         });
   }
 }
 private TabConfiguration getUserDefinedTabConfiguration() {
   TabConfiguration tabConfiguration = new TabConfiguration();
   tabConfiguration.setLabel(labelTextField.getValueAsString().trim());
   List<TabColumnConfiguration> tabColConf = new ArrayList<TabColumnConfiguration>(colNo);
   // TabColumnConfiguration[] tabColConf = new
   // TabColumnConfiguration[colNo];
   for (int i = 0; i < colNo; i++) {
     TabColumnConfiguration tabCol = new TabColumnConfiguration();
     String widthStr = colTextFields[i].getValueAsString();
     int width = 0;
     try {
       width = Integer.parseInt(widthStr);
     } catch (NumberFormatException e) {
     }
     // tabColConf[i].setWidth(width == 0 ? 0 : 1/width);
     tabCol.setWidth(width == 0 ? 0 : (float) width / 100);
     tabColConf.add(tabCol);
   }
   tabConfiguration.setColumns(tabColConf);
   tabConfiguration.setName(UserDefinedTab.class.getName());
   return tabConfiguration;
 }
Exemple #11
0
  private Toolbar getFilterToolbar() {
    final Toolbar filterToolbar = new Toolbar();
    ToolbarButton funnelButton = new ToolbarButton();

    funnelButton.setTooltip(
        "Tree filtering is currently OFF<br>Click to turn Tree filtering <b>ON</b>");
    funnelButton.setCls("x-btn-icon filter-btn");
    funnelButton.setEnableToggle(true);
    funnelButton.addListener(
        new ButtonListenerAdapter() {
          public void onToggle(Button button, boolean pressed) {
            if (pressed) {
              DOM.setStyleAttribute(
                  button.getButtonElement(), "backgroundImage", "url(images/funnel_X.gif)");
              button.setTooltip(
                  "Tree filtering is currently ON<br>Click to turn Tree filtering <b>OFF</b>");
              onSearchChange(true);
            } else {
              DOM.setStyleAttribute(
                  button.getButtonElement(), "backgroundImage", "url(images/funnel_plus.gif)");
              button.setTooltip(
                  "Tree filtering is currently OFF<br>Click to turn Tree filtering <b>ON</b>");
              treeFilter.clear();
              onSearchChange(false);
            }
          }
        });
    filterToolbar.addButton(funnelButton);

    searchField = new TextField();
    searchField.setWidth(120);
    searchField.setMaxLength(40);
    searchField.setGrow(false);
    searchField.setSelectOnFocus(true);

    searchField.addListener(
        new TextFieldListenerAdapter() {
          public void onRender(Component component) {
            searchField
                .getEl()
                .addListener(
                    "keyup",
                    new EventCallback() {
                      public void execute(EventObject e) {
                        delayedTask.delay(
                            500,
                            new Function() {
                              public void execute() {
                                onSearchChange(false);
                              }
                            });
                      }
                    });
          }
        });

    filterToolbar.addField(searchField);
    filterToolbar.addFill();

    ToolbarButton expandButton = new ToolbarButton();
    expandButton.setCls("x-btn-icon expand-all-btn");
    expandButton.setTooltip("Expand All");
    expandButton.addListener(
        new ButtonListenerAdapter() {
          public void onClick(Button button, EventObject e) {
            treePanel.expandAll();
          }
        });
    filterToolbar.addButton(expandButton);

    ToolbarButton collapseButton = new ToolbarButton();
    collapseButton.setCls("x-btn-icon collapse-all-btn");
    collapseButton.setTooltip("Collapse All");
    collapseButton.addListener(
        new ButtonListenerAdapter() {
          public void onClick(Button button, EventObject e) {
            treePanel.collapseAll();
          }
        });

    filterToolbar.addButton(collapseButton);
    return filterToolbar;
  }