Package com.gwtext.client.widgets.event

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


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

        ToolbarButton viewSource = new ToolbarButton();
        viewSource.setText(constants.OpenEditorInNewWindow());
        viewSource.addListener(new ButtonListenerAdapter() {
          public void onClick(
              com.gwtext.client.widgets.Button button,
              EventObject e) {
            doViewDiagram();
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.getSelectedRowUUIDs() == null) {
                        Window.alert(constants.PleaseSelectAnItemToRestore());
                        return;
                      }
                        RepositoryServiceFactory.getService().archiveAssets( grid.getSelectedRowUUIDs(), 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.getSelectedRowUUIDs() == null) {
                        Window.alert(constants.PleaseSelectAnItemToPermanentlyDelete());
View Full Code Here

    private Toolbar createToolbar() {
        Toolbar toolbar = new Toolbar();

        ToolbarButton checkinAll = new ToolbarButton( constants.SaveAllChanges() );
        checkinAll.addListener( new ButtonListenerAdapter() {
            public void onClick(com.gwtext.client.widgets.Button button,
                                EventObject e) {
                checkin( false );
            }
        } );
        toolbar.addButton( checkinAll );
        ToolbarButton checkinAndCloseAll = new ToolbarButton( constants.SaveAndCloseAll() );
        toolbar.addButton( checkinAndCloseAll );
        checkinAndCloseAll.addListener( new ButtonListenerAdapter() {
            public void onClick(com.gwtext.client.widgets.Button button,
                                EventObject e) {
                checkin( true );
            }
        } );
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

    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) {
                verifyAndDoCheckinConfirm( button,
                                           false );
            }
        } );
        toolbar.addButton( save );

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

        savedOK = new SmallLabel( "<font color='green'>" + constants.SavedOK() + "</font>" );
        savedOK.setVisible( false );
        toolbar.addElement( savedOK.getElement() );

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

        Menu moreMenu = new Menu();
        moreMenu.addItem( new Item( constants.Copy(),
                                    new BaseItemListenerAdapter() {
                                        @Override
                                        public void onClick(BaseItem baseItem,
                                                            EventObject eventObject) {
                                            copyCommand.execute();
                                        }
                                    } ) );
        moreMenu.addItem( new Item( constants.PromoteToGlobal(),
                                    new BaseItemListenerAdapter() {
                                        @Override
                                        public void onClick(BaseItem baseItem,
                                                            EventObject eventObject) {
                                            promptCommand.execute();
                                        }
                                    } ) );
        moreMenu.addItem( new Item( constants.Archive(),
                                    new BaseItemListenerAdapter() {
                                        @Override
                                        public void onClick(BaseItem baseItem,
                                                            EventObject eventObject) {
                                            if ( Window.confirm( constants.AreYouSureYouWantToArchiveThisItem() + "\n" + constants.ArchiveThisAssetThisWillNotPermanentlyDeleteIt() ) ) {
                                                archiveAction.execute();
                                            }
                                        }
                                    } ) );

        final Item deleteItem = new Item( constants.Delete(),
                                          new BaseItemListenerAdapter() {
                                              @Override
                                              public void onClick(BaseItem baseItem,
                                                                  EventObject eventObject) {
                                                  if ( Window.confirm( constants.DeleteAreYouSure() ) ) {
                                                      deleteAction.execute();
                                                  }
                                              }
                                          } );
        moreMenu.addItem( deleteItem );
        deleteItem.setTitle( constants.DeleteAssetTooltip() );
        this.afterCheckinEvent = new Command() {
            public void execute() {
                deleteItem.setDisabled( true );
            }
        };

        if ( !notCheckedInYet() ) {
            deleteItem.setDisabled( true );
        }

        moreMenu.addItem( new Item( constants.ChangeStatus(),
                                    new BaseItemListenerAdapter() {
                                        @Override
                                        public void onClick(BaseItem baseItem,
                                                            EventObject eventObject) {
                                            showStatusChanger();
                                        }
                                    } ) );

        ToolbarMenuButton more = new ToolbarMenuButton( constants.Actions(),
                                                        moreMenu );

        if ( isValidatorTypeAsset() ) {

            if ( editor instanceof RuleModelEditor ) {
                ToolbarButton workingSets = new ToolbarButton();
                workingSets.setText( constants.SelectWorkingSets() );
                workingSets.addListener( new ButtonListenerAdapter() {
                    public void onClick(com.gwtext.client.widgets.Button button,
                                        EventObject e) {
                        showWorkingSetsSelection( ((RuleModelEditor) editor).getRuleModeller() );
                    }
                } );
                toolbar.addButton( workingSets );
            }

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

            if ( isVerificationTypeAsset() ) {
                ToolbarButton verify = new ToolbarButton();
                verify.setText( constants.Verify() );
                verify.addListener( new ButtonListenerAdapter() {
                    public void onClick(com.gwtext.client.widgets.Button button,
                                        EventObject e) {
                        doVerify();
                    }
                } );
                toolbar.addButton( verify );

            }

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

    this.identitiesPanel = new IdentitiesPanel();
    this.tabPanel.add( this.identitiesPanel );

    Button saveButton = new Button( TextProvider.get().common_button_save() );
    saveButton.addListener( new ButtonListenerAdapter() {

      @Override
      public void onClick( Button button, EventObject e ) {

        identitiesPanel.resumeIdentities();
        preferencesPanel.updateModel();

        ServiceProvider.getUserAccountService().saveUserAccount( userAccountCopy,
            new AsyncCallbackAdapter<UserAccount>() {

              @Override
              public void onSuccess( UserAccount result ) {

                userAccountCopy = result;
                postValidateChanges();
              }
            } );
      }
    } );
    addButton( saveButton );

    Button cancelButton = new Button( TextProvider.get().common_button_cancel() );
    cancelButton.addListener( new ButtonListenerAdapter() {

      @Override
      public void onClick( Button button, EventObject e ) {

        closeWindow();
View Full Code Here

    this.identityStore = new IdentityStore();
    this.gridPanel = new GridPanel(this.identityStore, columnModel);

    Toolbar toolbar = new Toolbar();
    toolbar.addButton(new ToolbarButton(TextProvider.get().identities_panel_new_identity(),
        new ButtonListenerAdapter() {

          @Override
          public void onClick( Button button, EventObject e ) {

            Identity newIdentity = new Identity();
            newIdentity.setEmail(GWTSessionManager.get().getMailbox().getEmailAddress());
            newIdentity.setUserAccount(GWTSessionManager.get().getUserAccount());
            Record record = identityStore.createRecord(newIdentity);

            identityStore.add(record);
            gridPanel.getSelectionModel().selectRecords(record);
            userAccount.getIdentities().add(newIdentity);
          }
        }, ImageProvider.IDENTITY_ADD));

    toolbar.addButton(new ToolbarButton(TextProvider.get().identities_panel_delete_identity(),
        new ButtonListenerAdapter() {

          @Override
          public void onClick( Button button, EventObject e ) {

            Record record = gridPanel.getSelectionModel().getSelected();
            if (record != null) {
              Identity identity = (Identity) record
                  .getAsObject(IdentityListFields.IDENTITY_OBJECT.name());

              if (!identity.isStandard()) {
                userAccount.getIdentities().remove(identity);
                identityStore.remove(record);
              } else {
                MessageBox.alert(TextProvider.get().identities_panel_altert_delete());
              }
            }
          }
        }, ImageProvider.IDENTITY_DELETE));
    this.gridPanel.setTopToolbar(toolbar);

    this.gridPanel.setBorder(false);
    this.gridPanel.setFrame(false);
    this.gridPanel.setStripeRows(true);
    this.gridPanel.setEnableDragDrop(false);
    this.gridPanel.getView().setAutoFill(true);
    this.gridPanel.getView().setForceFit(true);
    this.gridPanel.setAutoHeight(false);
    this.gridPanel.setHeight(200);
    this.gridPanel.setSelectionModel(new RowSelectionModel(true)); // single
    // select
    this.gridPanel.getSelectionModel().addListener(new IdentityRowSelectionListener());
    this.gridPanel.addGridCellListener(new GridCellListenerAdapter() {

      public void onCellClick( GridPanel grid, int rowIndex, int colIndex, EventObject e ) {

        // if already selected, don't deselect
        if (grid.getColumnModel().getDataIndex(colIndex).equals(IdentityListFields.STANDARD.name())
            && e.getTarget(".checkbox", 1) != null) {
          Record record = grid.getStore().getAt(rowIndex);
          boolean isSelected = record.getAsBoolean(IdentityListFields.STANDARD.name());
          if (!isSelected) {
            Record[] records = grid.getStore().getRecords();
            Identity identity = null;
            for (int i = 0; i < records.length; i++) {
              records[i].set(IdentityListFields.STANDARD.name(), false);
              identity = (Identity) records[i].getAsObject(IdentityListFields.IDENTITY_OBJECT.name());
              identity.setStandard(false);
            }
            record.set(IdentityListFields.STANDARD.name(), true);
            identity = (Identity) record.getAsObject(IdentityListFields.IDENTITY_OBJECT.name());
            identity.setStandard(true);
            detailsFormPanel.updateForm();
          }
        }
      }
    });

    add(this.gridPanel, new BorderLayoutData(RegionPosition.CENTER));

    // Identity details
    this.detailsFormPanel = new ModelFormPanel<Identity>();
    this.detailsFormPanel.setFrame(true);
    this.detailsFormPanel.setBorder(false);
    this.detailsFormPanel.setLabelAlign(Position.RIGHT);
    this.detailsFormPanel.setLabelWidth(110);
    this.detailsFormPanel.setButtonAlign(Position.RIGHT);
    this.detailsFormPanel.setAutoHeight(true);

    Checkbox standardCheckbox = new Checkbox(TextProvider.get().identities_panel_label_standard(), "standard");
    standardCheckbox.setDisabled(true);
    this.detailsFormPanel.add(standardCheckbox);

    TextField textfield = null;
    KeyListener keyListener = new KeyListener() {

      public void onKey( int key, EventObject e ) {

        if (key == KeyboardListener.KEY_ENTER) {
          resumeIdentities();
        }
      }
    };

    this.formFields = new ArrayList<Component>();

    this.detailsFormPanel.add(textfield = new TextField(TextProvider.get().identities_panel_label_name(),
        "displayName"), new AnchorLayoutData("80%"));
    textfield.addKeyListener(KeyboardListener.KEY_ENTER, keyListener);
    this.formFields.add(textfield);

    this.detailsFormPanel.add(
        textfield = new TextField(TextProvider.get().identities_panel_label_email(), "email"),
        new AnchorLayoutData("80%"));
    textfield.addKeyListener(KeyboardListener.KEY_ENTER, keyListener);
    this.formFields.add(textfield);

    this.detailsFormPanel.add(textfield = new TextField(TextProvider.get().identities_panel_label_organisation(),
        "organisation"), new AnchorLayoutData("80%"));
    textfield.addKeyListener(KeyboardListener.KEY_ENTER, keyListener);
    this.formFields.add(textfield);

    this.detailsFormPanel.add(textfield = new TextField(TextProvider.get().identities_panel_label_reply(),
        "replyTo"), new AnchorLayoutData("80%"));
    textfield.addKeyListener(KeyboardListener.KEY_ENTER, keyListener);
    this.formFields.add(textfield);

    this.detailsFormPanel.add(textfield = new TextField(TextProvider.get().identities_panel_label_bcc(), "bcc"),
        new AnchorLayoutData("80%"));
    textfield.addKeyListener(KeyboardListener.KEY_ENTER, keyListener);
    this.formFields.add(textfield);

    this.detailsFormPanel.add(textfield = new TextArea(TextProvider.get().identities_panel_label_signature(),
        "signature"), new AnchorLayoutData("60%"));
    this.formFields.add(textfield);

    // Checkbox checkbox = new Checkbox(
    // TextProvider.get().identities_panel_label_htmlsignature(),
    // "htmlSignature" );
    // this.detailsFormPanel.add( checkbox );
    // this.formFields.add( checkbox );

    Button button = new Button(TextProvider.get().common_button_apply(), new ButtonListenerAdapter() {

      @Override
      public void onClick( Button button, EventObject e ) {

        resumeIdentities();
View Full Code Here

    add( this.treePanel );

    this.okButton = new Button( TextProvider.get().common_button_ok() );
    addButton( this.okButton );

    this.canelButton = new Button( TextProvider.get().common_button_cancel(), new ButtonListenerAdapter() {

      public void onClick( Button button, EventObject e ) {

        hide();
      }
View Full Code Here

    add( this.formPanel, new BorderLayoutData( RegionPosition.NORTH ) );
    add( this.textPanelWrapper, new BorderLayoutData( RegionPosition.CENTER ) );

    WindowRegistry.CONTACT_LIST_WINDOW.get( ContactListWindow.class ).addOkButtonListener(
        new ButtonListenerAdapter() {

          @Override
          public void onClick( Button button, EventObject e ) {

            ContactListWindow window = WindowRegistry.CONTACT_LIST_WINDOW.get( ContactListWindow.class );
View Full Code Here

    Button addressBtton = new Button( textField.getFieldLabel() );
    addressBtton.setMinWidth( LABEL_WIDTH );
    result.addToRow( addressBtton, LABEL_WIDTH + 5 );
    result.addToRow( textField, new ColumnLayoutData( 1.0 ) );

    addressBtton.addListener( new ButtonListenerAdapter() {

      @Override
      public void onClick( Button button, EventObject e ) {

        ContactListWindow window = WindowRegistry.CONTACT_LIST_WINDOW.get( ContactListWindow.class );
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.