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

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


    }
    return styleDialogMenuItem;
  }
  private MenuItem getBorderEdgePickerMenuItem() {
    if(borderEdgePickerMenuItem == null) {
      MenuBar borderEdgeMenu = new MenuBar(true);
      borderEdgePickerMenuItem = new MenuItem("BE", true, borderEdgeMenu);
      borderEdgeMenu.addItem("<div style='width: 10px; height: 10px; border-top: solid 1px black; border-left: solid 1px #DDDDDD; border-right: solid 1px #DDDDDD; border-bottom: solid 1px #DDDDDD;'></div>"
      , true, setBorderEdge("Top"));
      borderEdgeMenu.addItem("<div style='width: 10px; height: 10px; border-top: solid 1px #DDDDDD; border-left: solid 1px black; border-right: solid 1px #DDDDDD; border-bottom: solid 1px #DDDDDD;'></div>"
      , true, setBorderEdge("Left"));
      borderEdgeMenu.addItem("<div style='width: 10px; height: 10px; border-top: solid 1px #DDDDDD; border-left: solid 1px #DDDDDD; border-right: solid 1px black; border-bottom: solid 1px #DDDDDD;'></div>"
      , true, setBorderEdge("Right"));
      borderEdgeMenu.addItem("<div style='width: 10px; height: 10px; border-top: solid 1px #DDDDDD; border-left: solid 1px #DDDDDD; border-right: solid 1px #DDDDDD; border-bottom: solid 1px black;'></div>"
      , true, setBorderEdge("Bottom"));
      borderEdgeMenu.addItem("<div style='width: 10px; height: 10px; border: solid 1px #DDDDDD;'></div>", true, setBorderEdge(null));
      borderEdgeMenu.addItem("<div style='width: 10px; height: 10px; border: solid 1px black;'></div>", true, setBorderEdge(""));
    }
    return borderEdgePickerMenuItem;
  }
View Full Code Here


              }});
      }};
  }
  private MenuItem getBorderWidthPickerMenuItem() {
    if(borderWidthPickerMenuItem == null) {
      MenuBar borderWidthMenu = new MenuBar(true);
      borderWidthPickerMenuItem = new MenuItem("BW", true, borderWidthMenu);
      borderWidthMenu.addItem("<div style='width: 40px; border-top: solid 1px black'></div>", true, setBorderWidth(1));
      borderWidthMenu.addItem("<div style='width: 40px; border-top: solid 2px black'></div>", true, setBorderWidth(2));
      borderWidthMenu.addItem("<div style='width: 40px; border-top: solid 3px black'></div>", true, setBorderWidth(3));
      borderWidthMenu.addItem("<div style='width: 40px; border-top: solid 4px black'></div>", true, setBorderWidth(4));
      borderWidthMenu.addItem("<div style='width: 40px; border-top: solid 5px black'></div>", true, setBorderWidth(5));
      borderWidthMenu.addItem("<div style='width: 40px; border-top: solid 6px black'></div>", true, setBorderWidth(6));
      borderWidthMenu.addItem("<div style='width: 40px; border-top: solid 7px black'></div>", true, setBorderWidth(7));
      borderWidthMenu.addItem("<div style='width: 40px; border-top: solid 8px black'></div>", true, setBorderWidth(8));
      borderWidthMenu.addItem("<div style='width: 40px; border-top: solid 9px black'></div>", true, setBorderWidth(9));
      borderWidthMenu.addItem("<div style='width: 40px; border-top: solid 10px black'></div>", true, setBorderWidth(10));
    }
    return borderWidthPickerMenuItem;
  }
View Full Code Here

    operationsMenu.addItem(IEngine.CLEAR, getClearCommand());
    addPreviewMenuItem(operationsMenu);
    return operationsMenu;
 
  private MenuBar getEditItems(List<String> operationsList) {
    MenuBar editMenu = new MenuBar(true);
    DOM.setStyleAttribute(editMenu.getElement(), "zIndex", Integer.toString(Integer.MAX_VALUE));
    editMenu.setFocusOnHoverEnabled(false);
    editMenu.setStyleName("vkgwtdesigner-vertical-menu");
    undoItem = editMenu.addItem("Undo(Ctrl+Z)", getUndoCommand());
    redoItem = editMenu.addItem("Redo(Ctrl+Y)", getRedoCommand());
    refreshUndoRedo();
    editMenu.addItem(IEngine.CUT + "(Ctrl+X)", getCutCommand()).setEnabled(operationsList.indexOf(IEngine.CUT) > -1);
    editMenu.addItem(IEngine.COPY + "(Ctrl+C)", getCopyCommand()).setEnabled(operationsList.indexOf(IEngine.COPY) > -1);
    editMenu.addItem(IEngine.PASTE + "(Ctrl+V)", getPasteCommand()).setEnabled(operationsList.indexOf(IEngine.PASTE) > -1 && VkStateHelper.getInstance().getClipBoardHelper().isPasteWidgetPossible());
    editMenu.addItem(IEngine.COPY_STYLE + "(Ctrl+Shift+C)", getCopyStyleCommand()).setEnabled(operationsList.indexOf(IEngine.COPY_STYLE) > -1);;
    editMenu.addItem(IEngine.PASTE_STYLE + "(Ctrl+Shift+V)", getPasteStyleCommand()).setEnabled(operationsList.indexOf(IEngine.PASTE_STYLE) > -1
      && VkStateHelper.getInstance().getClipBoardHelper().isPasteStylePossible());
    boolean isMoveEnabled = operationsList.indexOf(IEngine.MOVE) > -1;
    editMenu.addItem(IEngine.MOVE, getMoveCommand()).setEnabled(isMoveEnabled);
    /*editMenu.addItem(IEngine.MOVE + "-Right(Right arrow)", getMoveRightCommand()).setEnabled(isMoveEnabled);
    editMenu.addItem(IEngine.MOVE + "-Left(Left arrow)", getMoveLeftCommand()).setEnabled(isMoveEnabled);
    editMenu.addItem(IEngine.MOVE + "-Up(Up arrow)", getMoveUpCommand()).setEnabled(isMoveEnabled);
    editMenu.addItem(IEngine.MOVE + "-Down(Down arrow)", getMoveDownCommand()).setEnabled(isMoveEnabled);*/
    boolean isResizeEnabled = operationsList.indexOf(IEngine.RESIZE) > -1;   
    editMenu.addItem(IEngine.RESIZE , getResizeCommand()).setEnabled(isResizeEnabled);
    /*editMenu.addItem(IEngine.RESIZE + "-Right(Ctrl + Right arrow)", getResizeRightCommand()).setEnabled(isResizeEnabled);
    editMenu.addItem(IEngine.RESIZE + "-Left(Ctrl + Left arrow)", getResizeLeftCommand()).setEnabled(isResizeEnabled);
    editMenu.addItem(IEngine.RESIZE + "-Up(Ctrl + Up arrow)", getResizeUpCommand()).setEnabled(isResizeEnabled);
    editMenu.addItem(IEngine.RESIZE + "-Down(Ctrl + Down arrow)", getResizeDownCommand()).setEnabled(isResizeEnabled);*/
    MenuItem item = editMenu.addItem(IEngine.DELETE + "(Del)", getRemoveCommand());
    item.setEnabled(operationsList.indexOf(IEngine.DELETE) > -1);
    return editMenu;
 
View Full Code Here

        VkStateHelper.getInstance().getLoadSaveHelper().clearApplication();
      }
    };
  }
  protected MenuBar getSaveAsMenu() {
    MenuBar saveMenuBar = new MenuBar(true);
    saveMenuBar.setStyleName("vkgwtdesigner-vertical-menu");
    saveMenuBar.addItem(IEngine.FILE, getDownloadCommand());
    saveMenuBar.addItem(IEngine.STRING, getSaveCommand());
    return saveMenuBar;
  }
View Full Code Here

    saveMenuBar.addItem(IEngine.FILE, getDownloadCommand());
    saveMenuBar.addItem(IEngine.STRING, getSaveCommand());
    return saveMenuBar;
  }
  protected MenuBar getOpenMenu() {
    MenuBar loadMenuBar = new MenuBar(true);
    loadMenuBar.setStyleName("vkgwtdesigner-vertical-menu");
    loadMenuBar.addItem(IEngine.FILE, getOpenUsingFileCommand());
    loadMenuBar.addItem(IEngine.STRING, getOpenUsingStringCommand());
    return loadMenuBar;
  }
View Full Code Here

    this(false);
  }
  private VkMenu(boolean isMenu) {
    menuBarPanel.clear();
    initWidget(menuBarPanel);
    menuBar = new MenuBar(isMenu);
    menuBarPanel.add(menuBar);
    menuBar.setAnimationEnabled(true);
    menuBar.sinkEvents(Event.ONCLICK | Event.ONMOUSEOVER | Event.ONMOUSEOUT | Event.ONFOCUS | Event.ONKEYDOWN | Event.ONBLUR);
    menuBar.setStyleName("vkgwtdesigner-vertical-menu");
    DOM.setStyleAttribute(menuBar.getElement(), "padding", "3px 0 3px 0");
    //menuBar.getElement().getStyle().setFloat(Float.LEFT);//not working if done as DOM.setStyleAttribute
    menuBarPanel.add(StyleToolbar.getInstance());
    ancestorMeuBar = new MenuBar();
    ancestorMeuBar.setHeight("16px");
    menuBarPanel.add(ancestorMeuBar);
    ancestorMeuBar.setStyleName("vkgwtdesigner-vertical-menu");
  }
View Full Code Here

      initializeMenu(invokingWidget);
      menuBar.clearItems();
      menuBar.addItem("File", getFileItems());
      menuBar.addItem("Edit", getEditItems(widgetEngine.getOperationsList((Widget) invokingWidget)));
      List<String> widgetsList = VkStateHelper.getInstance().getEngine().getWidgetsList((Widget) invokingWidget);
      MenuBar widgetsMenu = getWidgetsList(widgetsList);
      menuBar.addItem("Widgets", widgetsMenu).setEnabled(widgetsList != null && !widgetsList.isEmpty());
      List<String> panelsList = VkStateHelper.getInstance().getEngine().getPanelsList(invokingWidget);
      MenuBar panelsMenu = getPanelsList(panelsList);
      menuBar.addItem("Panels", panelsMenu).setEnabled(panelsList != null && !panelsList.isEmpty());
      List<String> attributeList = VkStateHelper.getInstance().getWidgetEngineMapping().getEngineMap().get(invokingWidget.getWidgetName()).getAttributesList((Widget) invokingWidget);
      if(attributeList != null)
        menuBar.addItem("Attributes", getAttributesMenu(attributeList));
      else
View Full Code Here

        UndoHelper.getInstance().undo();
        refreshUndoRedo();
      }};
  }
  private MenuBar getAttributesMenu(List<String> attributeList) {
      MenuBar attributesMenu = new MenuBar(true){
        @Override
        public void selectItem(MenuItem item) {
          super.selectItem(item);
          selectedMenuItem = item;
        }
      };
      attributesMenu.setStyleName("vkgwtdesigner-vertical-menu");
      attributesMenu.setFocusOnHoverEnabled(false);
      Command attributeClickedCommand = new Command() {
        @Override
        public void execute() {
        //prepareMenu(widget);
          widgetEngine.applyAttribute(selectedMenuItem.getText(), invokingWidget);
        }
      };
      for (String attribute : attributeList)
        attributesMenu.addItem(attribute, attributeClickedCommand);
    return attributesMenu;
  }
View Full Code Here

      for (String attribute : attributeList)
        attributesMenu.addItem(attribute, attributeClickedCommand);
    return attributesMenu;
  }
  private MenuBar getWidgetsList(List<String> widgetsList) {
    MenuBar widgetsMenu = new MenuBar(true) {
      private TableSizeChooserMenuItem tableSizeChooserMenuItem;
      @Override
      public void selectItem(MenuItem item) {
        super.selectItem(item);
        selectedMenuItem = item;
      }
      private MenuItem findItem(com.google.gwt.user.client.Element hItem) {
          for (MenuItem item : super.getItems()) {
            if (DOM.isOrHasChild(item.getElement(), hItem)) {
              return item;
            }
          }
          return null;
      }
      @Override
      public void onDetach(){
        super.onDetach();
        if(tableSizeChooserMenuItem != null)
          tableSizeChooserMenuItem.hide();
      }
      @Override
      public void onBrowserEvent(Event event) {
        MenuItem item = findItem(DOM.eventGetTarget(event));
        switch (DOM.eventGetType(event)) {
          case Event.ONMOUSEOVER: {
            if (item != null) {
              if(tableSizeChooserMenuItem != null && !item.equals(tableSizeChooserMenuItem)) {
                tableSizeChooserMenuItem.hide();
                    super.closeAllChildren(true);
                    tableSizeChooserMenuItem = null;
                  }
                  if (item instanceof TableSizeChooserMenuItem) {
                    tableSizeChooserMenuItem = (TableSizeChooserMenuItem)item;
                    super.selectItem(item);
                    tableSizeChooserMenuItem.show();
                  }
                  super.onBrowserEvent(event);
            }
                break;
            }
          default :
            super.onBrowserEvent(event);
          }
      }
    };
    if(widgetsList != null && widgetsList.size() > 0) {
      widgetsMenu.setStyleName("vkgwtdesigner-vertical-menu");
      widgetsMenu.setFocusOnHoverEnabled(false);
      String tables = VkGrid.NAME +  "|" + VkFlexTable.NAME;
      for (String widgetName : widgetsList) {
        if(widgetName.matches(tables))
          widgetsMenu.addItem(getTableSizeChooser(widgetName));
        else
          widgetsMenu.addItem(widgetName, getWidgetClickedCommand());
      }
    }
    return widgetsMenu;
  }
View Full Code Here

          }}.schedule(100);
      }
    });
  }
  private MenuBar getPanelsList(List<String> panelsList) {
    MenuBar panelsMenu = new MenuBar(true){
      @Override
      public void selectItem(MenuItem item) {
        super.selectItem(item);
        selectedMenuItem = item;
      }
    };
    if(panelsList != null && !panelsList.isEmpty()) {
      panelsMenu.setStyleName("vkgwtdesigner-vertical-menu");
      panelsMenu.setFocusOnHoverEnabled(false);
      for (String widgetName : panelsList)
        panelsMenu.addItem(widgetName, getWidgetClickedCommand());
    }
    return panelsMenu;
  }
View Full Code Here

TOP

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

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.