Ejemplo n.º 1
0
 /** Method called by grid component each time a row is selected. */
 public void setLastRow(boolean isLastRecord) {
   lastButton.setEnabled(!isLastRecord);
   nextButton.setEnabled(!isLastRecord);
   nextPgButton.setEnabled(!isLastRecord);
   controlPageNr.setEnabled(true);
   //    controlPageNr.setEnabled(resultSetController.getTotalResultSetLength()!=-1);
 }
Ejemplo n.º 2
0
 /** Method called by grid component each time a row is selected. */
 public void setFirstRow(boolean isFirstRecord) {
   firstButton.setEnabled(!isFirstRecord);
   prevPgButton.setEnabled(!isFirstRecord);
   prevButton.setEnabled(!isFirstRecord);
   controlPageNr.setEnabled(true);
   //    controlPageNr.setEnabled(resultSetController.getTotalResultSetLength()!=-1);
 }
Ejemplo n.º 3
0
  private void jbInit() throws Exception {
    pageNrPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
    firstButton.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            firstButton_actionPerformed(e);
          }
        });
    prevButton.setActionCommand(PREV_BUTTON);
    prevButton.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            prevButton_actionPerformed(e);
          }
        });
    prevPgButton.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            prevPgButton_actionPerformed(e);
          }
        });
    nextPgButton.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            nextPgButton_actionPerformed(e);
          }
        });
    nextButton.setActionCommand(NEXT_BUTTON);
    nextButton.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            nextButton_actionPerformed(e);
          }
        });
    lastButton.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            lastButton_actionPerformed(e);
          }
        });

    this.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
    this.add(firstButton, null);
    if (showPaginationButtons) this.add(prevPgButton, null);
    this.add(prevButton, null);
    this.add(pageNrPanel, null);
    this.add(nextButton, null);
    if (showPaginationButtons) this.add(nextPgButton, null);
    this.add(lastButton, null);
  }
Ejemplo n.º 4
0
 public void setEnabled(boolean enabled) {
   controlPageNr.setEnabled(enabled);
   //    if (!enabled)
   //      controlPageNr.setEnabled(false);
   //    else
   //      controlPageNr.setEnabled(resultSetController.getTotalResultSetLength()!=-1);
   firstButton.setEnabled(enabled);
   prevPgButton.setEnabled(enabled);
   prevButton.setEnabled(enabled);
   nextButton.setEnabled(enabled);
   nextPgButton.setEnabled(enabled);
   lastButton.setEnabled(enabled);
 }
Ejemplo n.º 5
0
 public boolean isLastButtonEnabled() {
   return lastButton.isEnabled();
 }
Ejemplo n.º 6
0
 public boolean isNextButtonEnabled() {
   return nextButton.isEnabled();
 }
Ejemplo n.º 7
0
 public boolean isPrevButtonEnabled() {
   return prevButton.isEnabled();
 }
Ejemplo n.º 8
0
 public boolean isFirstButtonEnabled() {
   return firstButton.isEnabled();
 }
Ejemplo n.º 9
0
  public NavigatorBar() {
    try {
      jbInit();
      controlPageNr.setColumns(3);
      controlPageNr.setValue(new Integer(1));
      controlPageNr.addActionListener(
          new ActionListener() {
            public void actionPerformed(ActionEvent e) {
              if (controlPageNr.getDouble() == null) controlPageNr.setValue(new Integer(1));
              if (!checkValidPage()) return;
              currentPageNr = controlPageNr.getDouble().intValue();
              gotoPage();
            }
          });
      controlPageNr.addFocusListener(
          new FocusAdapter() {

            public void focusGained(FocusEvent e) {
              if (controlPageNr.getDouble() == null) controlPageNr.setValue(new Integer(1));
              currentPageNr = controlPageNr.getDouble().intValue();
            }

            public void focusLost(FocusEvent e) {
              if (controlPageNr.getDouble() == null) controlPageNr.setValue(new Integer(1));
              if (!checkValidPage()) return;
              int lastValue = currentPageNr;
              currentPageNr = controlPageNr.getDouble().intValue();
              if (lastValue != currentPageNr) gotoPage();
            }
          });

      firstButton.setToolTipText(
          ClientSettings.getInstance()
              .getResources()
              .getResource("Load the first block of records"));
      firstButton.setPreferredSize(new Dimension(32, 32));
      prevPgButton.setToolTipText(
          ClientSettings.getInstance()
              .getResources()
              .getResource("Load the previous block of records"));
      prevPgButton.setPreferredSize(new Dimension(32, 32));
      prevButton.setToolTipText(
          ClientSettings.getInstance()
              .getResources()
              .getResource("Select the previous row in grid"));
      prevButton.setPreferredSize(new Dimension(32, 32));
      nextButton.setToolTipText(
          ClientSettings.getInstance().getResources().getResource("Select the next row in grid"));
      nextButton.setPreferredSize(new Dimension(32, 32));
      nextPgButton.setToolTipText(
          ClientSettings.getInstance()
              .getResources()
              .getResource("Load the next block of records"));
      nextPgButton.setPreferredSize(new Dimension(32, 32));
      lastButton.setToolTipText(
          ClientSettings.getInstance()
              .getResources()
              .getResource("Load the last block of records"));
      lastButton.setPreferredSize(new Dimension(32, 32));
    } catch (Exception e) {
      e.printStackTrace();
    }
  }