예제 #1
0
  @Override
  public void toggleMenu() {

    if (!this.menuShowing) {
      this.menuShowing = true;
      boolean needsUpdate = menuInited;
      if (!menuInited) {
        frame.getMenuBar(this).init(this);
        this.menuInited = true;
      }
      this.splitPanelWrapper.add(frame.getMenuBar(this));
      this.oldSplitLayoutPanel.setPixelSize(
          this.oldSplitLayoutPanel.getOffsetWidth() - GLookAndFeel.MENUBAR_WIDTH,
          this.oldSplitLayoutPanel.getOffsetHeight());
      frame
          .getMenuBar(this)
          .setPixelSize(GLookAndFeel.MENUBAR_WIDTH, this.oldSplitLayoutPanel.getOffsetHeight());
      if (needsUpdate) {
        frame.getMenuBar(this).getMenubar().updateMenubar();
      }
      this.getGuiManager().refreshDraggingViews();
      oldSplitLayoutPanel.getElement().getStyle().setOverflow(Overflow.HIDDEN);
      getGuiManager().updateStyleBarPositions(true);
      frame.getMenuBar(this).getMenubar().dispatchOpenEvent();
    } else {
      hideMenu();
    }
  }
예제 #2
0
  private void attachSplitLayoutPanel() {
    boolean oldSLPanelChanged = oldSplitLayoutPanel == getSplitLayoutPanel() ? false : true;
    oldSplitLayoutPanel = getSplitLayoutPanel();

    if (oldSplitLayoutPanel != null) {
      if (getArticleElement().getDataParamShowMenuBar(false)) {
        this.splitPanelWrapper = new HorizontalPanel();
        // TODO
        splitPanelWrapper.add(oldSplitLayoutPanel);
        if (this.menuShowing) {
          splitPanelWrapper.add(frame.getMenuBar(this));
        }
        frame.add(splitPanelWrapper);

      } else {
        frame.add(oldSplitLayoutPanel);
      }
      Browser.removeDefaultContextMenu(getSplitLayoutPanel().getElement());

      if (has(Feature.FIX_KEYBOARD_POSITION) && !oldSLPanelChanged) {
        return;
      }

      ClickStartHandler.init(
          oldSplitLayoutPanel,
          new ClickStartHandler() {
            @Override
            public void onClickStart(int x, int y, final PointerEventType type) {
              updateAVStylebar();

              if (!CancelEventTimer.cancelKeyboardHide()) {
                Timer timer =
                    new Timer() {
                      @Override
                      public void run() {
                        getAppletFrame().keyBoardNeeded(false, null);
                      }
                    };
                timer.schedule(0);
              }
            }
          });
    }
  }
예제 #3
0
  @Override
  public void hideMenu() {
    if (!menuInited || !menuShowing) {
      if (this.getGuiManager() != null) {
        this.getGuiManager().updateStyleBarPositions(false);
      }
      return;
    }
    this.menuShowing = false;
    this.oldSplitLayoutPanel.setPixelSize(
        this.oldSplitLayoutPanel.getOffsetWidth() + GLookAndFeel.MENUBAR_WIDTH,
        this.oldSplitLayoutPanel.getOffsetHeight());

    this.splitPanelWrapper.remove(frame.getMenuBar(this));
    oldSplitLayoutPanel.getElement().getStyle().setOverflow(Overflow.VISIBLE);
    if (this.getGuiManager() != null && this.getGuiManager().getLayout() != null) {
      this.getGuiManager().getLayout().getDockManager().resizePanels();
    }

    if (this.getGuiManager() != null) {
      this.getGuiManager().setDraggingViews(false, true);
      this.getGuiManager().updateStyleBarPositions(false);
    }
  }