Package com.gwtext.client.widgets.menu.event

Examples of com.gwtext.client.widgets.menu.event.BaseItemListenerAdapter


        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();
                                        }
View Full Code Here


        Menu addPortletMenu = new Menu();
        for (String portletName : shortToLongPortletNameMap.keySet()) {
            Item item = new Item(portletName);
            addPortletMenu.addItem(item);
            item.addListener(new BaseItemListenerAdapter() {
                @Override
                public void onClick(BaseItem item, EventObject e) {
                    String javaClassName = shortToLongPortletNameMap.get(((Item) item).getText());
                    onPortletAdded(javaClassName);
                }
View Full Code Here

        // Add the "Add user defined tab"
        addTabMenu.addSeparator();
        Item item = new Item("Add your own tab");
        addTabMenu.addItem(item);
        item.addListener(new BaseItemListenerAdapter() {
            @Override
            public void onClick(BaseItem item, EventObject e) {
                onUserDefinedTabAdded();
            }
        });
View Full Code Here

                    Menu contextMenu = new Menu();
                    contextMenu.setWidth("140px");

                    MenuItem menuShowInternalID = new MenuItem();
                    menuShowInternalID.setText("Show internal ID");
                    menuShowInternalID.addListener(new BaseItemListenerAdapter() {
                        @Override
                        public void onClick(BaseItem item, EventObject event) {
                            super.onClick(item, event);
                            showInternalID((EntityData) node.getUserObject());
                        }
                    });
                    contextMenu.addItem(menuShowInternalID);

                    MenuItem menuShowDirectLink = new MenuItem();
                    menuShowDirectLink.setText("Show direct link");
                    menuShowDirectLink.setIcon("images/link.png");
                    menuShowDirectLink.addListener(new BaseItemListenerAdapter() {
                        @Override
                        public void onClick(BaseItem item, EventObject event) {
                            super.onClick(item, event);
                            showDirectLink((EntityData) node.getUserObject());
                        }
View Full Code Here

            public boolean doBeforeCheckChange(CheckItem item, boolean checked) {
                return false;
            }
        };

        BaseItemListener baseItemListener = new BaseItemListenerAdapter() {
            @Override
            public void onClick(BaseItem item, EventObject e) {
                CheckItem activeItem = (CheckItem) item;
                watchButton.setActiveItem(activeItem);
                if (activeItem != unwatchBranchItem) {
View Full Code Here

    final class DeleteContextMenu extends Menu{
        public DeleteContextMenu(String menuText, String menuIcon, final Record record, final int colindex, final ValueType valueType) {
            MenuItem item = new MenuItem();
            item.setText(menuText);
            item.setIcon(menuIcon);
            item.addListener(new BaseItemListenerAdapter() {
                @Override
                public void onClick(BaseItem item, EventObject e) {
                    super.onClick(item, e);
                    String field = record.getFields()[colindex];
                    record.set(field, (String)null);
View Full Code Here

        Toolbar tb = new Toolbar();
        Menu menu = new Menu();

        menu.addItem( new Item( constants.AddRow(),
                                new BaseItemListenerAdapter() {
                                    public void onClick(BaseItem item,
                                                        EventObject e) {
                                        String[] rowData = new String[recordDef.getFields().length];
                                        for ( int i = 0; i < rowData.length; i++ ) {
                                            rowData[i] = "";
                                        }
                                        Record newRecord = recordDef.createRecord( rowData );
                                        store.add( newRecord );
                                        model.addRow( newRecord.getId(),
                                                      rowData );
                                    }
                                } ) );

        menu.addItem( new Item( constants.RemoveSelectedRowS(),
                                new BaseItemListenerAdapter() {
                                    public void onClick(BaseItem item,
                                                        EventObject e) {
                                        removeSelectedRows( grid );
                                    }
                                } ) );
View Full Code Here

    private static Constants constants = ((Constants) GWT.create(Constants.class));

    public static Menu getMenu(final GenericPanel manager) {
        Menu m = new Menu();

        m.addItem(new Item(constants.BusinessRuleGuidedEditor(), new BaseItemListenerAdapter() {
            public void onClick(BaseItem item, EventObject e) {
                manager.launchWizard(AssetFormats.BUSINESS_RULE, constants.NewBusinessRuleGuidedEditor(), true);
            }
        }, "images/business_rule.gif"));                                     //NON-NLS


        m.addItem(new Item(constants.DSLBusinessRuleTextEditor(), new BaseItemListenerAdapter() {
            public void onClick(BaseItem item, EventObject e) {
                manager.launchWizard(AssetFormats.DSL_TEMPLATE_RULE, constants.NewRuleUsingDSL(), true);
            }
        }, "images/business_rule.gif"));                               //NON-NLS


        m.addItem(new Item(constants.DRLRuleTechnicalRuleTextEditor(), new BaseItemListenerAdapter() {
            public void onClick(BaseItem item, EventObject e) {
                manager.launchWizard(AssetFormats.DRL, constants.NewDRL(), true);
            }
        }, "images/rule_asset.gif"));                    //NON-NLS

        m.addItem(new Item(constants.DecisionTableSpreadsheet(), new BaseItemListenerAdapter() {
            public void onClick(BaseItem item, EventObject e) {
                manager.launchWizard(AssetFormats.DECISION_SPREADSHEET_XLS, constants.NewDecisionTableSpreadsheet(), true);
            }
        }, "images/spreadsheet_small.gif"));                                   //NON-NLS

        m.addItem(new Item(constants.DecisionTableWebGuidedEditor(), new BaseItemListenerAdapter() {
            public void onClick(BaseItem item, EventObject e) {
                manager.launchWizard(AssetFormats.DECISION_TABLE_GUIDED, constants.NewDecisionTableGuidedEditor(), true);
            }
        }, "images/gdst.gif")); //NON-NLS

        m.addItem(new Item(constants.TestScenario(), new BaseItemListenerAdapter() {
            public void onClick(BaseItem item, EventObject e) {
                manager.launchWizard(AssetFormats.TEST_SCENARIO,
                        constants.CreateATestScenario(), false);
            }
        }, "images/test_manager.gif")); //NON-NLS
View Full Code Here

    }

    private Menu deploymentMenu() {
        Menu m = new Menu();

        Item nds = new Item(constants.NewDeploymentSnapshot(), new BaseItemListenerAdapter() {
            public void onClick(BaseItem item, EventObject e) {
                SnapshotView.showNewSnapshot();
            }
        });
        nds.setIcon("images/snapshot_small.gif"); //NON-NLS
        m.addItem(nds);

        Item rebuild = new Item(constants.RebuildAllSnapshotBinaries(), new BaseItemListenerAdapter() {
            public void onClick(BaseItem item, EventObject e) {
                SnapshotView.rebuildBinaries();
            }
        });
        rebuild.setIcon("images/refresh.gif");             //NON-NLS
View Full Code Here

          }
        });

        Toolbar tb = new Toolbar();
        Menu menu = new Menu();
        menu.addItem(new Item(constants.AddRow(), new BaseItemListenerAdapter() {
          public void onClick(BaseItem item, EventObject e) {
            Record r = recordDef.createRecord(new Object[recordDef.getFields().length]);
            r.set("num", store.getRecords().length + 1); //NON-NLS

            store.add(r);
          }
        }));
        menu.addItem(new Item(constants.RemoveSelectedRowS(), new BaseItemListenerAdapter() {
          public void onClick(BaseItem item, EventObject e) {
            Record[] selected = grid.getSelectionModel().getSelections();
            if (com.google.gwt.user.client.Window.confirm(constants.AreYouSureYouWantToDeleteTheSelectedRowS())) {
              for (int i = 0; i < selected.length; i++) {
                store.remove(selected[i]);
          }
              renumber(store.getRecords());
            }
          }
        }));
        menu.addItem(new Item(constants.CopySelectedRowS(), new BaseItemListenerAdapter() {
          public void onClick(BaseItem item, EventObject e) {
            Record[] selected = grid.getSelectionModel().getSelections();
          for (int i = 0; i < selected.length; i++) {
            Record r = recordDef.createRecord(new Object[recordDef.getFields().length]);
            Record orig = selected[i];
View Full Code Here

TOP

Related Classes of com.gwtext.client.widgets.menu.event.BaseItemListenerAdapter

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.