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

Examples of com.google.gwt.user.client.ui.MenuItem


  private boolean selectElementForCssEditButtonVisible = true;
 
  private StyleToolbar(){
    initWidget(new MenuBar(){
      public void onBrowserEvent(Event event) {
        MenuItem item = findItem(DOM.eventGetTarget(event));
            if (item != null && (item.getCommand() != null || item.getSubMenu() != null))
              super.onBrowserEvent(event);
      }
      private MenuItem findItem(Element hItem) {
          for (MenuItem item : getItems()) {
            if (DOM.isOrHasChild(item.getElement(), hItem)) {
              return item;
            }
          }
          return null;
        }
View Full Code Here


    styleDialogMenuItem.setVisible(styleDialogButtonVisible);
    toolBar.addItem(getSelectElementForCssEdit());
    selectElementForCssEdit.setVisible(selectElementForCssEditButtonVisible);
  }
  private MenuItem getSelectElementForCssEdit() {
    return selectElementForCssEdit = selectElementForCssEdit != null ? selectElementForCssEdit : new MenuItem("SE", new Command(){
      @Override
      public void execute() {
        selectElementClickHandlerRegistration = VkMainDrawingPanel.getInstance().addDomHandler(new ClickHandler() {
          @Override
          public void onClick(ClickEvent event) {
View Full Code Here

      }});
  }
  private MenuItem getFontChooserMenuItem() {
    if(fontChooserMenuItem == null) {
      MenuBar fontChooser = new MenuBar(true);
      fontChooserMenuItem = new MenuItem("Font", fontChooser);
      fontChooser.addItem("<span style='font-family:\"Arial\"'>Arial", true, new Command(){
        @Override
        public void execute() {
          DOM.setStyleAttribute(invokingElement, "fontFamily", "Arial, sans-serif");
        }
View Full Code Here

      });
    }
    return fontChooserMenuItem;
  }
  private MenuItem getDecreaseFontSizeMenuItem() {
    return decreaseFontSizeMenuItem = decreaseFontSizeMenuItem != null ? decreaseFontSizeMenuItem : new MenuItem("A-",new Command(){
      @Override
      public void execute() {
        final Element element = invokingElement;
        final int prior = VkDesignerUtil.getPixelValue(invokingElement, "font-size");
        UndoHelper.getInstance().doCommand(new Command(){
View Full Code Here

              DOM.setStyleAttribute(element, "fontSize", prior + "px");
            }});
      }});
  }
  private MenuItem getIncreaseFontSizeMenuItem() {
    return increaseFontSizeMenuItem = increaseFontSizeMenuItem != null ? increaseFontSizeMenuItem : new MenuItem("A+",new Command(){
      @Override
      public void execute() {
        final Element element = invokingElement;
        final int prior = VkDesignerUtil.getPixelValue(invokingElement, "font-size");
        UndoHelper.getInstance().doCommand(new Command(){
View Full Code Here

  private void editCss(String className, String attribute, String value) {
    if(!cssImpl.editRule("." + className, attribute, value))
      cssImpl.addRule("." + className, "{" + attribute + " : " + value + "}");
  }
  private MenuItem getRightIndentMenuItem() {
    return rightIndentMenuItem = rightIndentMenuItem != null ? rightIndentMenuItem : new MenuItem("<img src='images/right-indent.png' height=16 width=16'>"
    , true, new Command(){
      @Override
      public void execute() {
        final Element element = invokingElement;
        final String finalClassName = className;
View Full Code Here

              setAttribute(element, finalClassName, "paddingLeft", prior + "px");
            }});
      }});
  }
  private MenuItem getLeftIndentMenuItem() {
    return leftIndentMenuItem = leftIndentMenuItem != null ? leftIndentMenuItem : new MenuItem("<img src='images/left-indent.png' height=16 width=16'>"
        , true, new Command(){
          @Override
          public void execute() {
            final Element element = invokingElement;
            final String finalClassName = className;
View Full Code Here

      return 5;
    else
      return 0;
  }
  private MenuItem getTopIndentMenuItem() {
    return topIndentMenuItem = topIndentMenuItem != null ? topIndentMenuItem : new MenuItem("<img src='images/top-indent.png' height=16 width=16'>"
        , true, new Command(){
          @Override
          public void execute() {
            final Element element = invokingElement;
            final String finalClassName = className;
View Full Code Here

                    setAttribute(element, finalClassName, "paddingTop", prior + "px");
                  }});
          }});
  }
  private MenuItem getBottomIndentMenuItem() {
    return bottomIndentMenuItem = bottomIndentMenuItem != null ? bottomIndentMenuItem : new MenuItem("<img src='images/bottom-indent.png' height=16 width=16'>"
        , true, new Command(){
          @Override
          public void execute() {
            final Element element = invokingElement;
            final String finalClassName = className;
View Full Code Here

                    setAttribute(element, finalClassName, "paddingTop", prior + "px");
                  }});
          }});
  }
  private MenuItem getUnderLineMenuItem() {
    return underlineMenuItem = underlineMenuItem != null ? underlineMenuItem : new MenuItem("<span style='text-decoration: underline;'>U</span>", true, new Command(){
      @Override
      public void execute() {
        final Element element = invokingElement;
        final String finalClassName = className;
        final String prior = DOM.getStyleAttribute(invokingElement, "fontWeight");
View Full Code Here

TOP

Related Classes of com.google.gwt.user.client.ui.MenuItem

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.