Package com.gwtext.client.widgets.menu

Examples of com.gwtext.client.widgets.menu.Item


        } else if (xtype.equalsIgnoreCase("tbbutton")) {
            return new ToolbarButton(jsObj);
        }
        //menu items
        else if (xtype.equalsIgnoreCase("menu-item")) {
            return new Item(jsObj);
        }
        //form components
        else if (xtype.equalsIgnoreCase("checkbox")) {
            return new Checkbox(jsObj);
        } else if (xtype.equalsIgnoreCase("combo")) {
View Full Code Here


        else if (xtype.equalsIgnoreCase("toolbar")) {
            return new Toolbar(jsObj);
        }
        //menu items
        else if (xtype.equalsIgnoreCase("menu-item")) {
            return new Item(jsObj);
        }
        //form components
        else if (xtype.equalsIgnoreCase("checkbox")) {
            return new Checkbox(jsObj);
        } else if (xtype.equalsIgnoreCase("combo")) {
View Full Code Here

    }

    //TODO: move it to separate class
    private Menu packageNewMenu() {
        Menu m = new Menu();
        m.addItem(new Item(constants.NewPackage1(), new BaseItemListenerAdapter() {
            public void onClick(BaseItem item, EventObject e) {
                NewPackageWizard wiz = new NewPackageWizard(new Command() {
                    public void execute() {
                        refreshPackageTree();
                    }
                });
                wiz.show();
            }
        }, "images/new_package.gif")); //NON-NLS

        //SubPackage are currently not used.
//        m.addItem(new Item(constants.NewSubPackage(), new BaseItemListenerAdapter() {
//            public void onClick(BaseItem item, EventObject e) {
//                NewSubPackageWizard wiz = new NewSubPackageWizard(new Command() {
//                    public void execute() {
//                        refreshPackageTree();
//                    }
//                });
//                wiz.show();
//            }
//        }, "images/new_package.gif")); //NON-NLS
       
        m.addItem(new Item(constants.NewWorkingSet(), new BaseItemListenerAdapter() {
            public void onClick(BaseItem item, EventObject e) {
                launchWizard(AssetFormats.WORKING_SET, constants.NewWorkingSet(), false);
            }
        }, "images/new_package.gif"));          //NON-NLS
       
        m.addItem(new Item(constants.NewRule(), new BaseItemListenerAdapter() {
            public void onClick(BaseItem item, EventObject e) {
                launchWizard(null, constants.NewRule(), true);
            }
        }, "images/rule_asset.gif"));          //NON-NLS

        m.addItem(new Item(constants.UploadPOJOModelJar(), new BaseItemListenerAdapter() {
            public void onClick(BaseItem item, EventObject e) {
                launchWizard(AssetFormats.MODEL, constants.NewModelArchiveJar(), false);
            }
        }, "images/model_asset.gif"));              //NON-NLS

        m.addItem(new Item(constants.NewDeclarativeModel(), new BaseItemListenerAdapter() {
            public void onClick(BaseItem item, EventObject e) {
                launchWizard(AssetFormats.DRL_MODEL, constants.NewDeclarativeModelUsingGuidedEditor(), false);
            }
        }, "images/model_asset.gif")); //NON-NLS

        if (Preferences.getBooleanPref("flex-bpel-editor")) {
      m.addItem(new Item(constants.NewBPELPackage(),
          new BaseItemListenerAdapter() {
            public void onClick(BaseItem item, EventObject e) {
              launchWizard(AssetFormats.BPEL_PACKAGE, constants
                  .CreateANewBPELPackage(), false);
            }
          }, "images/model_asset.gif")); // NON-NLS
    }

        m.addItem(new Item(constants.NewFunction(), new BaseItemListenerAdapter() {
            public void onClick(BaseItem item, EventObject e) {
                launchWizard(AssetFormats.FUNCTION, constants.CreateANewFunction(), false);
            }
        }, "images/function_assets.gif")); //NON-NLS


        m.addItem(new Item(constants.NewDSL(), new BaseItemListenerAdapter() {
            public void onClick(BaseItem item, EventObject e) {
                launchWizard(AssetFormats.DSL, constants.CreateANewDSLConfiguration(), false);
            }
        }, "images/dsl.gif"));   //NON-NLS


        m.addItem(new Item(constants.NewRuleFlow(), new BaseItemListenerAdapter() {
            public void onClick(BaseItem item, EventObject e) {
                launchWizard(AssetFormats.RULE_FLOW_RF, constants.CreateANewRuleFlow(), false);
            }
        }, "images/ruleflow_small.gif")); //NON-NLS
       
        m.addItem(new Item(constants.NewEnumeration(), new BaseItemListenerAdapter() {
            public void onClick(BaseItem item, EventObject e) {
                launchWizard(AssetFormats.ENUMERATION, constants.CreateANewEnumerationDropDownMapping(), false);
            }
        }, "images/new_enumeration.gif")); //NON-NLS

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

        m.addItem(new Item(constants.NewFile(), new BaseItemListenerAdapter() {
            public void onClick(BaseItem item, EventObject e) {
                launchWizard("*", constants.CreateAFile(), false);
            }
        }, "images/new_file.gif")); //NON-NLS


        m.addItem(new Item(constants.RebuildAllPackageBinariesQ(), new BaseItemListenerAdapter() {
            public void onClick(BaseItem item, EventObject e) {
                if (Window.confirm(constants.RebuildConfirmWarning())) {
                    LoadingPopup.showMessage(constants.RebuildingPackageBinaries());
                    RepositoryServiceFactory.getService().rebuildPackages(new GenericCallback<Void>() {
                        public void onSuccess(Void data) {
                            LoadingPopup.close();
                        }
                    });
                }

            }
        }, "images/refresh.gif")); //NON-NLS

        m.addItem(new Item(constants.NewRuleTemplate(), new BaseItemListenerAdapter() {
            @Override
            public void onClick(BaseItem item, EventObject e) {
                launchWizard(AssetFormats.RULE_TEMPLATE, constants.NewRuleTemplate(), true);
            }
        }, "images/new_template.gif")); //NON-NLS
View Full Code Here

    grid.setAutoHeight(true);

    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 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
        m.addItem(rebuild);

        return m;
    }
View Full Code Here

        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

            }
        } );

        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.AddRowBeforeSelectedRow(),
                                new BaseItemListenerAdapter() {
                                    public void onClick(BaseItem item,
                                                        EventObject e) {

                                        Record[] selectedRows = grid.getSelectionModel().getSelections();
                                        if ( selectedRows.length == 1 ) {
                                            int selected = selectedRows[0].getAsInteger( "num" );

                                            Record newRecord = recordDef.createRecord( new Object[recordDef.getFields().length] );

                                            Record[] records = store.getRecords();

                                            for ( int i = 0; i < records.length; i++ ) {
                                                Record temp = records[i];
                                                int num = temp.getAsInteger( "num" );
                                                if ( num == selected ) {
                                                    newRecord.set( "num",
                                                                   num ); //NON-NLS
                                                    temp.set( "num",
                                                              num + 1 ); //NON-NLS

                                                    store.addSorted( newRecord );

                                                } else if ( num > selected ) {
                                                    temp.set( "num",
                                                              num + 1 ); //NON-NLS
                                                }
                                            }
                                        } else {
                                            ErrorPopup.showMessage( constants.PleaseSelectARow() );
                                        }
                                    }
                                } ) );
       
        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++ ) {
View Full Code Here

    grid.setAutoHeight(true);

    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 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
        m.addItem(rebuild);

        return m;
    }
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

TOP

Related Classes of com.gwtext.client.widgets.menu.Item

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.