Package com.google.gwt.user.client.ui

Examples of com.google.gwt.user.client.ui.MenuBar$Resources


  public void showPopupMenu(Event event) {
    m_Label.addStyleName("popped");
    final PopupPanel popupPanel = new PopupPanel(true);
    popupPanel.setAnimationEnabled(true);
    MenuBar popupMenuBar = new MenuBar(true);

    MenuItem editItem = new MenuItem("Edit Album", true, new Command() {

      @Override
      public void execute() {
        m_Container.doDialog("index.php/form/edit/albums/" + m_ID,
            new HttpDialogHandler() {
              @Override
              public void success(String aResult) {
                refresh();

              }
            });
        popupPanel.hide();

      }
    });

    MenuItem addAlbum = new MenuItem("Add Album", true, new Command() {

      @Override
      public void execute() {
        m_Container.doDialog("index.php/form/add/albums/" + m_ID
            + "?type=album", new HttpDialogHandler() {
          @Override
          public void success(String aResult) {
            expand();
            m_View.getCurrentAlbum().select();
          }
        });

        popupPanel.hide();

      }
    });

    MenuItem userPermissions = new MenuItem("User Permissions", true,
        new Command() {
          @Override
          public void execute() {
            m_Container.doDialog("index.php/permissions/browse/"
                + m_ID, new HttpDialogHandler() {
              @Override
              public void success(String aResult) {
              }
            });

            popupPanel.hide();

          }
        });

    popupPanel.setStyleName("popup");
    editItem.addStyleName("popup-item");
    addAlbum.addStyleName("popup-item");
    userPermissions.addStyleName("popup-item");

    if (m_Container.isUploadEnabled()) {
      MenuItem uploadPhotos = new MenuItem("Upload Photos", true,
          new Command() {

            @Override
            public void execute() {
              uploadFiles();
              popupPanel.hide();

            }
          });
      uploadPhotos.addStyleName("popup-item");
      popupMenuBar.addItem(uploadPhotos);
    }

    popupMenuBar.addItem(editItem);
    popupMenuBar.addItem(addAlbum);
    popupMenuBar.addItem(userPermissions);
   
    popupMenuBar.setVisible(true);
    popupPanel.add(popupMenuBar);

    int x = DOM.eventGetClientX(event);
    int y = DOM.eventGetClientY(event);
    popupPanel.setPopupPosition(x, y);
View Full Code Here


 
  public void showPopupMenu(ContextMenuEvent event){
    final PopupPanel popupPanel = new PopupPanel(true);   
    popupPanel.setAnimationEnabled(true);
    popupPanel.setStyleName("popup");
    MenuBar popupMenuBar = new MenuBar(true);
   
    MenuItem deleteItem = new MenuItem("Delete Selected Items", true, new Command() {
     
      @Override
      public void execute() {
        popupPanel.hide();
       
        m_Container.doConfirm("Are you sure you wish to delete selected items?", new ConfirmDialogBox.ConfirmCallBack() {
         
          public void ok() {
            JSONArray jsa = Utils.extractIds(m_Container.getDragController().getDragContext());
           
            m_Container.doJSONRequest(G3Viewer.DELETE_ALL_URL + "?sourceids=" + jsa.toString() , new HttpSuccessHandler() {
              public void success(JSONValue aValue) {
                final List<Widget> widgets = m_Container.getDragController().getSelectedWidgets();
                Item i;
                for (Widget widget: widgets){
                  i = (Item)widget;
                  removeFromView(i);
                  i.removeLinkedAlbum();
                }
               
              }}, true, true);
          }
        });
       
      }
    });
    deleteItem.addStyleName("popup-item");
    popupMenuBar.addItem(deleteItem);
   
    popupMenuBar.setVisible(true);
    popupPanel.add(popupMenuBar);
   
      MenuItem rotateAllCW = new MenuItem("Rotate All Clockwise", true, new Command() {
        @Override
        public void execute() {
          // change all thumbs into loading
          final List<Widget> widgets = m_Container.getDragController().getSelectedWidgets();
         
          for (Widget widget: widgets){
            final Item i = ((Item)widget);
            if (i.isPhoto())
            {
              i.setLoadingThumb();
            }
         
            m_Container.doJSONRequest(G3Viewer.ROTATE_URL + i.getID() + "/cw",
              new HttpSuccessHandler() {
           
              public void success(JSONValue aValue) {
                i.updateImages(aValue);
              }
            },false,true);
          }
          popupPanel.hide();
        }
      });
   
      rotateAllCW.addStyleName("popup-item");
      popupMenuBar.addItem(rotateAllCW);

     
      MenuItem rotateAllCCW = new MenuItem("Rotate All Counter-Clockwise", true, new Command() {
        @Override
        public void execute() {
          // change all thumbs into loading
          final List<Widget> widgets = m_Container.getDragController().getSelectedWidgets();
         
          for (Widget widget: widgets){
            final Item i = ((Item)widget);
            if (i.isPhoto())
            {
              i.setLoadingThumb();
            }
            m_Container.doJSONRequest(G3Viewer.ROTATE_URL + i.getID() + "/cw",
              new HttpSuccessHandler() {
           
              public void success(JSONValue aValue) {
                i.updateImages(aValue);
              }
            },false,true);
          }
          popupPanel.hide();
        }
      });
   
      rotateAllCW.addStyleName("popup-item");
      popupMenuBar.addItem(rotateAllCCW);
     
    int x = DOM.eventGetClientX((Event)event.getNativeEvent());
    int y = DOM.eventGetClientY((Event)event.getNativeEvent());
    popupPanel.setPopupPosition(x, y);
   
View Full Code Here

   
    this.addStyleName("popped");
    final PopupPanel popupPanel = new PopupPanel(true);   
    popupPanel.setAnimationEnabled(true);
    popupPanel.setStyleName("popup");
    MenuBar popupMenuBar = new MenuBar(true);
   
    MenuItem deleteItem = new MenuItem("Delete " + m_Type, true, new Command() {
     
      @Override
      public void execute() {
        m_Container.doDialog("index.php/quick/form_delete/" + m_ID, new HttpDialogHandler() {
          public void success(String aResult) {
            m_View.removeFromView(Item.this);
            if (m_LinkedAlbum != null){
              m_LinkedAlbum.remove();
            }
          }
        });
        popupPanel.hide();
       
      }
    });
    deleteItem.addStyleName("popup-item");
    popupMenuBar.addItem(deleteItem);
   
    MenuItem editItem = new MenuItem("Edit " + m_Type, true, new Command() {
     
      @Override
      public void execute() {
        m_Container.doDialog("index.php/form/edit/" + m_Type + "s/" + m_ID,
          new HttpDialogHandler() {
            public void success(String aResult) {
              refresh();
            }
          });
        popupPanel.hide();
       
      }
    });
    editItem.addStyleName("popup-item");
    popupMenuBar.addItem(editItem);
    
    MenuItem albumCover = new MenuItem("Make Album Cover", true, new Command() {
     
      @Override
      public void execute() {
        m_Container.doJSONRequest(G3Viewer.MAKE_ALBUM_COVER_URL + m_ID, new HttpSuccessHandler() {
         
          public void success(JSONValue aValue) {
            // nothing to do
          }
        },false,true);
        popupPanel.hide();
      }
    });
    albumCover.addStyleName("popup-item");
    popupMenuBar.addItem(albumCover);

    if (isPhoto())
    {
      MenuItem rotateCW = new MenuItem("Rotate Clockwise", true, new Command() {
        @Override
        public void execute() {
          setLoadingThumb();
          m_Container.doJSONRequest(G3Viewer.ROTATE_URL + m_ID + "/cw", new HttpSuccessHandler() {
           
            public void success(JSONValue aValue) {
              updateImages(aValue);
            }
          },false,true);
          popupPanel.hide();
        }
      });
      rotateCW.addStyleName("popup-item");
      popupMenuBar.addItem(rotateCW);
 
      MenuItem rotateCCW = new MenuItem("Rotate Couter-Clockwise", true, new Command() {
        @Override
        public void execute() {
          setLoadingThumb();
          m_Container.doJSONRequest(G3Viewer.ROTATE_URL + m_ID + "/ccw", new HttpSuccessHandler() {
           
            public void success(JSONValue aValue) {
              updateImages(aValue);
            }
          },false,true);
          popupPanel.hide();
        }
      });
      rotateCCW.addStyleName("popup-item");
      popupMenuBar.addItem(rotateCCW);
    }
   
   
    
    
    popupMenuBar.setVisible(true);
    popupPanel.add(popupMenuBar);
   
    int x = DOM.eventGetClientX((Event)event.getNativeEvent());
    int y = DOM.eventGetClientY((Event)event.getNativeEvent());
    popupPanel.setPopupPosition(x, y);
View Full Code Here

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

    public static MenuBar getMenu(final AbstractTree manager) {

        MenuBar createNewMenu = new MenuBar( true );

        createNewMenu.addItem( Util.getHeader( images.snapshotSmall(),
                                               constants.NewDeploymentSnapshot() ),
                               true,
                               new Command() {
                                   public void execute() {
                                       SnapshotView.showNewSnapshot( new Command() {
                                           public void execute() {
                                               //we have to refresh the whole tree when a snapshot was added to previously empty package.
                                               manager.refreshTree();
                                           }
                                       } );
                                   }
                               } );

        createNewMenu.addItem( Util.getHeader( images.refresh(),
                                               constants.RebuildAllSnapshotBinaries() ),
                               true,
                               new Command() {
                                   public void execute() {
                                       SnapshotView.rebuildBinaries();
                                   }
                               } );

        MenuBar rootMenuBar = new MenuBar( true );
        rootMenuBar.setAutoOpen( false );
        rootMenuBar.setAnimationEnabled( false );

        rootMenuBar.addItem( new MenuItem( constants.CreateNew(),
                                           createNewMenu ) );

        return rootMenuBar;
    }
View Full Code Here

 
    this.verticalPanel = new VerticalPanel();
    initWidget(this.verticalPanel);
    this.verticalPanel.setHeight("37px");
   
    this.menuBar = new MenuBar(false);
    this.verticalPanel.add(this.menuBar);
    MenuBar menuBar_1 = new MenuBar(true);
   
    this.fichier = new MenuItem("Fichier", false, menuBar_1);
   
    this.fermer = new MenuItem("Fermer", false, (Command) null);
    this.fermer.setHTML("Fermer");
    menuBar_1.addItem(this.fermer);
    this.menuBar.addItem(this.fichier);
   
    this.authentication = new MenuItem("Authentication", false, new Command() {
      public void execute() {
      }
View Full Code Here

 
    this.verticalPanel = new VerticalPanel();
    initWidget(this.verticalPanel);
    this.verticalPanel.setSize("100%", "37px");
   
    this.menuBar = new MenuBar(false);
    this.verticalPanel.add(this.menuBar);
    this.menuBar.setWidth("100%");
    MenuBar menuBar_1 = new MenuBar(true);
   
    this.fichier = new MenuItem("Fichier", false, menuBar_1);
   
    this.fermer = new MenuItem("Fermer", false, new Command() {
      public void execute() {
       
      }
    });
    this.fermer.setHTML("Fermer");
    menuBar_1.addItem(this.fermer);
    this.menuBar.addItem(this.fichier);
   
    this.authentication = new MenuItem("Authentication", false, new Command() {
      public void execute() {
      }
View Full Code Here

 
    this.verticalPanel = new VerticalPanel();
    initWidget(this.verticalPanel);
    this.verticalPanel.setHeight("37px");
   
    this.menuBar = new MenuBar(false);
    this.verticalPanel.add(this.menuBar);
    MenuBar menuBar_1 = new MenuBar(true);
   
    this.fichier = new MenuItem("Fichier", false, menuBar_1);
   
    this.fermer = new MenuItem("Fermer", false, (Command) null);
    this.fermer.setHTML("Fermer");
    menuBar_1.addItem(this.fermer);
    this.menuBar.addItem(this.fichier);
   
    this.authentication = new MenuItem("Authentication", false, (Command) null);
    this.authentication.setHTML("Authentication");
    this.menuBar.addItem(this.authentication);
View Full Code Here

public class DefaultMultiViewEditorMenuBarCreator implements MultiViewEditorMenuBarCreator {

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

    public MenuBar createMenuBar(final MultiViewEditor editor) {
        MenuBar toolbar = new MenuBar();

        toolbar.addItem(constants.SaveAllChanges(),
                new Command() {

                    public void execute() {
                        editor.checkin(false);
                    }
                });
        toolbar.addItem(constants.SaveAndCloseAll(),
                new Command() {

                    public void execute() {
                        editor.checkin(true);
                    }
View Full Code Here

public class RulesNewMenu {
    private static Constants constants = ((Constants) GWT.create(Constants.class));
    private static Images images = (Images) GWT.create(Images.class);

    public static MenuBar getMenu(final AbstractTree manager) {
        MenuBar createNewMenu = new MenuBar(true);

        createNewMenu.addItem(Util.getHeader(images.businessRule(), constants.BusinessRuleGuidedEditor()),
                true,
                new Command() {
            public void execute() {
                manager.launchWizard(AssetFormats.BUSINESS_RULE, constants.NewBusinessRuleGuidedEditor(), true);
            }
        });

        createNewMenu.addItem(Util.getHeader(images.ruleAsset(), constants.DSLBusinessRuleTextEditor()),
                true,
                new Command() {
            public void execute() {
                manager.launchWizard(AssetFormats.DSL_TEMPLATE_RULE, constants.NewRuleUsingDSL(), true);
            }
        });
       
        createNewMenu.addItem(Util.getHeader(images.ruleAsset(), constants.DRLRuleTechnicalRuleTextEditor()),
                true,
                new Command() {
            public void execute() {
                manager.launchWizard(AssetFormats.DRL, constants.NewDRL(), true);
            }
        });
       
        createNewMenu.addItem(Util.getHeader(images.spreadsheetSmall(), constants.DecisionTableSpreadsheet()),
                true,
                new Command() {
            public void execute() {
                manager.launchWizard(AssetFormats.DECISION_SPREADSHEET_XLS, constants.NewDecisionTableSpreadsheet(), true);
            }
        });

        createNewMenu.addItem(Util.getHeader(images.gdst(), constants.DecisionTableWebGuidedEditor()),
                true,
                new Command() {
            public void execute() {
                manager.launchWizard(AssetFormats.DECISION_TABLE_GUIDED, constants.NewDecisionTableGuidedEditor(), true);
            }
        });
       
        createNewMenu.addItem(Util.getHeader(images.testManager(), constants.TestScenario()),
                true,
                new Command() {
            public void execute() {
                manager.launchWizard(AssetFormats.TEST_SCENARIO,
                        constants.CreateATestScenario(), false);
            }
        });

        MenuBar rootMenuBar = new MenuBar(true);
        rootMenuBar.setAutoOpen(false);
        rootMenuBar.setAnimationEnabled(false);
       
        rootMenuBar.addItem(new MenuItem(constants.CreateNew(), createNewMenu));

        return rootMenuBar;
    }
View Full Code Here

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

    public static MenuBar getMenu(final AbstractTree manager) {

        MenuBar createNewMenu = new MenuBar(true);

        createNewMenu.addItem(Util.getHeader(images.newPackage(), constants.NewPackage1()),
                true,
                new Command() {
            public void execute() {
                NewPackageWizard wiz = new NewPackageWizard(new Command() {
                    public void execute() {
                        manager.refreshTree();
                    }
                });
                wiz.show();            }
        });

        createNewMenu.addItem(Util.getHeader(images.newEnumeration(), constants.NewSpringContext()),
                true,
                new Command() {
            public void execute() {
                manager.launchWizard(AssetFormats.SPRING_CONTEXT, constants.NewSpringContext(), false);
            }
        });

        createNewMenu.addItem(Util.getHeader(images.workingset(), constants.NewWorkingSet()),
                true,
                new Command() {
            public void execute() {
                manager.launchWizard(AssetFormats.WORKING_SET, constants.NewWorkingSet(), false);
            }
        });

        createNewMenu.addItem(Util.getHeader(images.ruleAsset(), constants.NewRule()),
                true,
                new Command() {
            public void execute() {
                manager.launchWizard(null, constants.NewRule(), true);
            }
        });

        createNewMenu.addItem(Util.getHeader(images.newTemplate(), constants.NewRuleTemplate()),
                true,
                new Command() {
            public void execute() {
                manager.launchWizard(AssetFormats.RULE_TEMPLATE, constants.NewRuleTemplate(), true);
           }
        });
       
        createNewMenu.addItem(Util.getHeader(images.modelAsset(), constants.UploadPOJOModelJar()),
                true,
                new Command() {
            public void execute() {
                manager.launchWizard(AssetFormats.MODEL, constants.NewModelArchiveJar(), false);
            }
        });

        createNewMenu.addItem(Util.getHeader(images.modelAsset(), constants.NewDeclarativeModel()),
                true,
                new Command() {
            public void execute() {
                manager.launchWizard(AssetFormats.DRL_MODEL, constants.NewDeclarativeModelUsingGuidedEditor(), false);
            }
        });

        if (Preferences.getBooleanPref("flex-bpel-editor")) {
            createNewMenu.addItem(Util.getHeader(images.modelAsset(), constants.NewBPELPackage()),
                    true,
                    new Command() {
                        public void execute() {
                            manager.launchWizard(AssetFormats.BPEL_PACKAGE, constants
                                .CreateANewBPELPackage(), false);
                }
            });
        }

        createNewMenu.addItem(Util.getHeader(images.functionAssets(), constants.NewFunction()),
                true,
                new Command() {
            public void execute() {
                manager.launchWizard(AssetFormats.FUNCTION, constants.CreateANewFunction(), false);
            }
        });

        createNewMenu.addItem(Util.getHeader(images.dsl(), constants.NewDSL()),
                true,
                new Command() {
            public void execute() {
                manager.launchWizard(AssetFormats.DSL, constants.CreateANewDSLConfiguration(), false);
            }
        });

        createNewMenu.addItem(Util.getHeader(images.ruleflowSmall(), constants.NewRuleFlow()),
                true,
                new Command() {
            public void execute() {
                manager.launchWizard(AssetFormats.RULE_FLOW_RF, constants.CreateANewRuleFlow(), false);
            }
        });

        createNewMenu.addItem(Util.getHeader(images.ruleflowSmall(), constants.NewBPMN2Process()),
                true,
                new Command() {
            public void execute() {
                manager.launchWizard(AssetFormats.BPMN2_PROCESS, constants.CreateANewBPMN2Process(), false);
            }
        });

        createNewMenu.addItem(Util.getHeader(images.newEnumeration(), constants.NewEnumeration()),
                true,
                new Command() {
            public void execute() {
                manager.launchWizard(AssetFormats.ENUMERATION, constants.CreateANewEnumerationDropDownMapping(), false);
            }
        });

        createNewMenu.addItem(Util.getHeader(images.testManager(), constants.NewTestScenario()),
                true,
                new Command() {
            public void execute() {
                manager.launchWizard(AssetFormats.TEST_SCENARIO, constants.CreateATestScenario(), false);
           }
        });

        createNewMenu.addItem(Util.getHeader(images.newFile(), constants.CreateAFile()),
                true,
                new Command() {
            public void execute() {
                manager.launchWizard("*", constants.CreateAFile(), false);
           }
        });

        createNewMenu.addItem(Util.getHeader(images.refresh(), constants.RebuildAllPackageBinariesQ()),
                true,
                new Command() {
            public void execute() {
                if (Window.confirm(constants.RebuildConfirmWarning())) {
                    LoadingPopup.showMessage(constants.RebuildingPackageBinaries());
                    RepositoryServiceFactory.getPackageService().rebuildPackages(new GenericCallback<Void>() {
                        public void onSuccess(Void data) {
                            LoadingPopup.close();
                        }
                    });
                }
            }
        });


        MenuBar rootMenuBar = new MenuBar(true);
        rootMenuBar.setAutoOpen(false);
        rootMenuBar.setAnimationEnabled(false);
       
        rootMenuBar.addItem(new MenuItem(constants.CreateNew(), createNewMenu));

        return rootMenuBar;
     }
View Full Code Here

TOP

Related Classes of com.google.gwt.user.client.ui.MenuBar$Resources

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.