Package com.gwtext.client.widgets.event

Examples of com.gwtext.client.widgets.event.ButtonListenerAdapter


        ToolbarButton b = new ToolbarButton();
        b.setText( (forward) ? constants.Next() : constants.Previous());

        tb.addButton( b );

        b.addListener( new ButtonListenerAdapter() {
            public void onClick(Button button,
                                EventObject e) {
                if ( forward ) {
                    int newPos = currentCursorPosition - 2;
                    if ( newPos > 0 ) {
                        cursorPositions.push( newPos );
                    }
                } else {
                    cursorPositions.pop();
                }
                layout.clear();
                g.destroy();
                doGrid( source,
                        cm,
                        rd,
                        pageSize );
            }
        } );

        if ( !forward ) {
            ToolbarButton first = new ToolbarButton(constants.goToFirst());
            tb.addButton( first );
            first.addListener( new ButtonListenerAdapter() {
                @Override
                public void onClick(Button button,
                                    EventObject e) {
                    cursorPositions.clear();
                    cursorPositions.push( 0 );
View Full Code Here


       
  }

  private void addCloseAllButton() {
    closeAllButton = new Button(constants.CloseAllItems());
        closeAllButton.addListener(new ButtonListenerAdapter() {
          @Override
          public void onClick(Button button, EventObject e) {
            if (Window.confirm(constants.AreYouSureYouWantToCloseOpenItems())) {
              tp.clear();
              openedAssetEditors.clear();
View Full Code Here

    private void controls() {

        ToolbarButton save = new ToolbarButton();
        save.setText(constants.SaveChanges());
      save.setTooltip(getTip(constants.CommitAnyChangesForThisAsset()));
      save.addListener(new ButtonListenerAdapter() {
                  public void onClick(
                      com.gwtext.client.widgets.Button button,
                      EventObject e) {
                              doCheckinConfirm(button);
                  }
                  });
      toolbar.addButton(save);

        toolbar.addFill();
        toolbar.addSeparator();

    ToolbarButton copy = new ToolbarButton();
    copy.setText(constants.Copy());
    copy.setTooltip(constants.CopyThisAsset());
    copy.addListener(new ButtonListenerAdapter() {
      public void onClick(
          com.gwtext.client.widgets.Button button,
          EventObject e) {
                  doCopyDialog(button);
      }
      });
    toolbar.addButton(copy);


    ToolbarButton archive = new ToolbarButton();
    archive.setText(constants.Archive());
    archive.setTooltip(getTip(constants.ArchiveThisAssetThisWillNotPermanentlyDeleteIt()));
    archive.addListener(new ButtonListenerAdapter() {
      public void onClick(
          com.gwtext.client.widgets.Button button,
          EventObject e) {
                        if (Window.confirm(constants.AreYouSureYouWantToArchiveThisItem())) {
                            archiveAction.doCheckin(constants.ArchivedItemOn() + new java.util.Date().toString());
                        }
      }
      });
    toolbar.addButton(archive);




        if (notCheckedInYet()) {

          final ToolbarButton delete = new ToolbarButton();
          delete.setText(constants.Delete());
        delete.setTooltip(getTip(constants.DeleteAssetTooltip()));
        delete.addListener(new ButtonListenerAdapter() {
          public void onClick(
              com.gwtext.client.widgets.Button button,
              EventObject e) {
                            if (Window.confirm(constants.DeleteAreYouSure()) ) {
                                deleteAction.execute();
                            }
        }
          });
        toolbar.addButton(delete);

        this.afterCheckinEvent = new Command() {

        public void execute() {
          delete.setVisible(false);
        }

        };

        }





        ToolbarButton stateChange = new ToolbarButton();
        stateChange.setText(constants.ChangeStatus());
    stateChange.setTooltip(getTip(constants.ChangeStatusTip()));
    stateChange.addListener(new ButtonListenerAdapter() {
      public void onClick(
          com.gwtext.client.widgets.Button button,
          EventObject e) {
        showStatusChanger(button);
      }
View Full Code Here

            if ( ruleFlowViewer != null && parameterPanel != null ) {
                Toolbar tb = new Toolbar();

                ToolbarButton viewSource = new ToolbarButton();
                viewSource.setText( "View diagram" );
                viewSource.addListener( new ButtonListenerAdapter() {
                    public void onClick(com.gwtext.client.widgets.Button button,
                                        EventObject e) {
                        doViewDiagram();

                        ruleFlowViewer.update();
View Full Code Here

    tb.addItem(new ToolbarTextItem(constants.CurrentlyConfiguredUsers()));
    tb.addItem(new ToolbarSeparator());

    layout.add(grid);
    ToolbarButton reload = new ToolbarButton(constants.Reload1());
    reload.addListener(new ButtonListenerAdapter() {
          public void onClick(Button button, EventObject e) {
            refresh();
          }
        });
    tb.addButton(reload);


    grid.addGridRowListener(new GridRowListenerAdapter() {
      @Override
      public void onRowDblClick(GridPanel grid, int rowIndex,
          EventObject e) {
        String userName = grid.getSelectionModel().getSelected().getAsString("userName")//NON-NLS
        showEditor(userName);
      }
    });

    ToolbarButton create = new ToolbarButton(constants.CreateNewUserMapping());
    create.addListener(new ButtonListenerAdapter() {
          public void onClick(Button button, EventObject e) {
            final String userName = Window.prompt(constants.EnterNewUserName(), constants.NewUserName());

            if (userName != null) {
              RepositoryServiceFactory.getService().updateUserPermissions(userName, new HashMap(), new GenericCallback() {
                public void onSuccess(Object a) {
                  refresh();
                  showEditor(userName);
                }
              });

            }
          }
        });
    tb.addButton(create);

    ToolbarButton delete = new ToolbarButton(constants.DeleteSelectedUser());
    delete.addListener(new ButtonListenerAdapter() {
          public void onClick(Button button, EventObject e) {
            final String userName = grid.getSelectionModel().getSelected().getAsString("userName"); //NON-NLS
                        if (userName != null && Window.confirm(Format.format(constants.AreYouSureYouWantToDeleteUser0(), userName))) {
              RepositoryServiceFactory.getService().deleteUser(userName, new GenericCallback() {
                public void onSuccess(Object a) {
View Full Code Here

        }

        final SimplePanel detailPanel = new SimplePanel();
        if (longMessage != null && !"".equals(longMessage)) {
          Button showD = new Button(constants.ShowDetail());
          showD.addListener(new ButtonListenerAdapter() {
        public void onClick(Button button, EventObject e) {
          detailPanel.clear();
          detailPanel.add(new SmallLabel(longMessage));

        }
View Full Code Here

        layout.setCellHeight(editor, "95%");
        layout.add(tb);

        ToolbarButton viewSource = new ToolbarButton();
        viewSource.setText(constants.ViewSource());
        viewSource.addListener(new ButtonListenerAdapter()  {
      public void onClick(
          com.gwtext.client.widgets.Button button,
          EventObject e) {
                doViewsource();
      }
    });

        //only show this for advanced users
        if (ExplorerLayoutManager.shouldShow(Capabilities.SHOW_PACKAGE_VIEW)) {
            tb.addButton(viewSource);
            tb.addSeparator();
        }

        ToolbarButton validate = new ToolbarButton();
        validate.setText(constants.Validate());
        validate.addListener(new ButtonListenerAdapter()  {
              public void onClick(
                  com.gwtext.client.widgets.Button button,
                  EventObject e) {
                doValidate();
              }
View Full Code Here

    tb.addItem(new ToolbarSeparator());

    layout.add(g);

    ToolbarButton reload = new ToolbarButton(constants.Reload());
    reload.addListener(new ButtonListenerAdapter() {
      public void onClick(Button button, EventObject e) {
        layout.remove(g);
        refresh();
      }
    });
View Full Code Here


        loadPackages();
        Toolbar tb = new Toolbar();
        final ToolbarButton restorePackage = new ToolbarButton();
        restorePackage.addListener(new ButtonListenerAdapter() {
              public void onClick(
                  com.gwtext.client.widgets.Button button,
                  EventObject e) {
                restorePackage(packages.getValue(packages.getSelectedIndex()));
              }

            });
        restorePackage.setText(constants.RestoreSelectedPackage());
        tb.addButton(restorePackage);




        final ToolbarButton delPackage = new ToolbarButton();
        delPackage.setText(constants.PermanentlyDeletePackage());
        delPackage.addListener(new ButtonListenerAdapter() {
              public void onClick(
                  com.gwtext.client.widgets.Button button,
                  EventObject e) {
                if (Window.confirm(constants.AreYouSurePackageDelete())) {
                  deletePackage(packages.getValue(packages.getSelectedIndex()));
                }
              }
        });
        tb.addButton(delPackage);



        pf.startSection(constants.ArchivedPackagesList());

        pf.addRow(tb);
        pf.addRow(packages);


        pf.endSection();

        tb = new Toolbar();
        final ToolbarButton restoreAsset = new ToolbarButton();
        restoreAsset.setText(constants.RestoreSelectedAsset());
        tb.addButton(restoreAsset);
        restoreAsset.addListener(new ButtonListenerAdapter() {
              public void onClick(com.gwtext.client.widgets.Button button, EventObject e) {
                      if (grid.getSelectedRowUUID() == null) {
                        Window.alert(constants.PleaseSelectAnItemToRestore());
                        return;
                      }
                        RepositoryServiceFactory.getService().archiveAsset( grid.getSelectedRowUUID(), false, new GenericCallback() {
                            public void onSuccess(Object arg0) {
                                Window.alert(constants.ItemRestored());
                                grid.refreshGrid();
                            }
                        });
              };
        });


        final ToolbarButton deleteAsset = new ToolbarButton();
        deleteAsset.setText(constants.DeleteSelectedAsset());
        tb.addButton(deleteAsset);

        deleteAsset.addListener(
            new ButtonListenerAdapter() {
              public void onClick(
                  com.gwtext.client.widgets.Button button,
                  EventObject e) {
                      if (grid.getSelectedRowUUID() == null) {
                        Window.alert(constants.PleaseSelectAnItemToPermanentlyDelete());
View Full Code Here

        columnModel.setDefaultSortable(true);

        final EditorGridPanel grid = new EditorGridPanel();

        Toolbar toolbar = new Toolbar();
        ToolbarButton add = new ToolbarButton(constants.Add(), new ButtonListenerAdapter() {
            public void onClick(Button button, EventObject e) {
                addNewField(recordDef, grid);
            }
        });

        toolbar.addButton(add);

        /*ToolbarButton delete = new ToolbarButton("Delete", new ButtonListenerAdapter() {
            public void onClick(Button button, EventObject e) {
                store.remove(store.getRecordAt(grid.getPosition()[1]));
                if(store.getTotalCount() == 0){
                    addNewField(recordDef, grid);
                }
            }
        });

        toolbar.addButton(delete);*/

        ToolbarButton clear = new ToolbarButton(constants.Clear(), new ButtonListenerAdapter() {
            public void onClick(Button button, EventObject e) {
                store.removeAll();
                addNewField(recordDef, grid);
            }
        });
View Full Code Here

TOP

Related Classes of com.gwtext.client.widgets.event.ButtonListenerAdapter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.