Package com.gwtext.client.widgets.event

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


            this.parent = parent;
            this.selectable = selectable;

            //setPaddings(15);

            Button selectButton = new Button("Select", new ButtonListenerAdapter() {
                @Override
                public void onClick(Button button, EventObject e) {
                    Collection<EntityData> selection = SelectionDialog.this.selectable.getSelection();
                    if (selection != null && selection.size() > 0) {
                        EntityData singleSelection = selection.iterator().next();
View Full Code Here


            }
        });
        searchStringTextField.setWidth(250);

        searchButton = new ToolbarButton(createLinkFont("Search in BioPortal", false));
        searchButton.addListener(new ButtonListenerAdapter() {
            @Override
            public void onClick(Button button, EventObject e) {
                reload();
            }
        });

        Toolbar topToolbar = new Toolbar();
        topToolbar.addText("&nbsp<i>Search for concept</i>:&nbsp&nbsp");
        topToolbar.addElement(searchStringTextField.getElement());
        topToolbar.addSpacer();
        topToolbar.addButton(searchButton);
        setTopToolbar(topToolbar);

        searchAllButton = new ToolbarButton(createLinkFont(BioPortalConstants.SHOW_ALL_BUTTON_TEXT, false));
        searchAllButton.setEnableToggle(true);
        searchAllButton.addListener(new ButtonListenerAdapter() {
            @Override
            public void onToggle(Button button, boolean pressed) {
                searchAll = pressed;
                if (!ignoreSearchAllPressed) {
                    reload();
                }
            }
        });

        createDNFRefButton = new ToolbarButton(createLinkFont(BioPortalConstants.DNF_BUTTON_TEXT, false));
        createDNFRefButton.addListener(new ButtonListenerAdapter() {
            @Override
            public void onClick(Button button, EventObject e) {
                onLeaveAComment();
            }
        });
View Full Code Here

    }

    protected void addToolbarButtons() {
        createButton = new Button("Create");
        createButton.setCls("toolbar-button");
        createButton.addListener(new ButtonListenerAdapter() {
            @Override
            public void onClick(Button button, EventObject e) {
                onCreateProperty();
            }
        });

        if (!getProject().hasWritePermission(Application.get().getUserId())) {
            createButton.setDisabled(true);
        }

        deleteButton = new Button("Delete");
        // deleteButton.setIconCls("protege-class-delete-icon");
        deleteButton.setCls("toolbar-button");
        deleteButton.addListener(new ButtonListenerAdapter() {
            @Override
            public void onClick(Button button, EventObject e) {
                onDeleteProperty();
            }
        });
View Full Code Here

                                  } );

        loadPackages();
        Toolbar tb = new Toolbar();
        final ToolbarButton restorePackage = new ToolbarButton();
        restorePackage.addListener( new ButtonListenerAdapter() {
            public void onClick(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(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(Button button,
                                EventObject e) {
                if ( grid.getSelectedRowUUIDs() == null ) {
                    Window.alert( constants.PleaseSelectAnItemToRestore() );
                    return;
                }
                RepositoryServiceFactory.getService().archiveAssets( grid.getSelectedRowUUIDs(),
                                                                     false,
                                                                     new GenericCallback<java.lang.Void>() {
                                                                         public void onSuccess(Void 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(Button button,
                                EventObject e) {
                if ( grid.getSelectedRowUUIDs() == null ) {
                    Window.alert( constants.PleaseSelectAnItemToPermanentlyDelete() );
                    return;
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 FormStylePopup form = new FormStylePopup( images.snapshot(), constants.EnterNewUserName() );
                final TextBox userName = new TextBox();
                form.addAttribute( constants.NewUserName(), userName );

                com.google.gwt.user.client.ui.Button create = new com.google.gwt.user.client.ui.Button( constants.OK() );
                form.addAttribute( "", create );
                create.addClickHandler( new ClickHandler() {
                    public void onClick(ClickEvent w) {
                        if ( userName.getText() != null && userName.getText().length() != 0 ) {
                            RepositoryServiceFactory.getService().createUser( userName.getText(), new GenericCallback<java.lang.Void>() {
                                public void onSuccess(Void a) {
                                    refresh();
                                    showEditor( userName.getText() );
                                }

                                public void onFailure(Throwable t) {
                                    super.onFailure( t );
                                }
                            } );
                            form.hide();
                        }
                    }
                } );

                form.show();
            }

        } );
        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<java.lang.Void>() {
                        public void onSuccess(Void a) {
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();
            }
        } );

        tb.addButton( reload );

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

        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 clear = new ToolbarButton( constants.Clear(),
                                                 new ButtonListenerAdapter() {
                                                     public void onClick(Button button,
                                                                         EventObject e) {
                                                         store.removeAll();
                                                         addNewField( recordDef,
                                                                      grid );
View Full Code Here

                    }
                };

                ToolbarButton refreshB = new ToolbarButton();
                refreshB.setText( constants.refreshList() );
                refreshB.addListener( new ButtonListenerAdapter() {
                    public void onClick(Button button, EventObject e) {
                        refresh.execute();
                    }
                } );

                tb.addButton( refreshB );

                ToolbarButton openSelected = new ToolbarButton();
                openSelected.setText( constants.openSelected() );
                openSelected.addListener( new ButtonListenerAdapter() {
                    public void onClick(Button button, EventObject e) {
                        Record[] selections = currentGrid.getSelectionModel().getSelections();
                        for ( Record record : selections ) {
                            String uuid = record.getAsString( "uuid" );
                            editEvent.open( uuid );
                        }
                    }
                } );
                tb.addButton( openSelected );
                ToolbarButton openSelectedToSingleTab = new ToolbarButton();
                openSelectedToSingleTab.setText( constants.openSelectedToSingleTab() );
                openSelectedToSingleTab.addListener( new ButtonListenerAdapter() {
                    public void onClick(Button button, EventObject e) {
                        Record[] selections = currentGrid.getSelectionModel().getSelections();
                        MultiViewRow[] rows = new MultiViewRow[selections.length];
                        for ( int i = 0; i < selections.length; i++ ) {
                            MultiViewRow row = new MultiViewRow();
View Full Code Here

        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;
                    int newPos = currentCursorPosition;
                    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 );
                    layout.clear();
View Full Code Here

                                     }
                                 };

                                 ToolbarButton refreshB = new ToolbarButton();
                                 refreshB.setText(constants.refreshList());
                                 refreshB.addListener( new ButtonListenerAdapter() {
                                     public void onClick(Button button,
                                                         EventObject e) {
                                         refresh.execute();
                                     }
                                 } );

                                 tb.addButton( refreshB );


                                 ToolbarButton openSelected = new ToolbarButton();
                                 openSelected.setText(constants.openSelected());
                                 openSelected.addListener( new ButtonListenerAdapter() {
                                     public void onClick(Button button,
                                                         EventObject e) {
                                                 String uuid = currentGrid.getSelectionModel().getSelected().getAsString( "uuid" );
                                                 editEvent.open( uuid );
                                     }
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.