Search in sources :

Example 1 with PopupMenu

use of org.eclipse.che.ide.ui.toolbar.PopupMenu in project che by eclipse.

the class DropDownWidgetImpl method show.

/**
     * Shows a content menu and moves it to specified position.
     *
     * @param left
     *         horizontal position
     * @param top
     *         vertical position
     * @param width
     *         header width
     */
private void show(int left, int top, int width) {
    hide();
    updateActions();
    lockLayer = new MenuLockLayer();
    popupMenu = new PopupMenu(actions, actionManager, managerProvider, presentationFactory, lockLayer, this, keyBindingAgent, actionGroupId, true);
    popupMenu.addStyleName(resources.dropdownListCss().dropDownListMenu());
    popupMenu.getElement().getStyle().setTop(top, PX);
    popupMenu.getElement().getStyle().setLeft(left, PX);
    popupMenu.getElement().getStyle().setWidth(width, PX);
    lockLayer.add(popupMenu);
}
Also used : MenuLockLayer(org.eclipse.che.ide.ui.toolbar.MenuLockLayer) PopupMenu(org.eclipse.che.ide.ui.toolbar.PopupMenu)

Example 2 with PopupMenu

use of org.eclipse.che.ide.ui.toolbar.PopupMenu in project che by eclipse.

the class ContextMenu method show.

/**
     * Shows a content menu and moves it to specified position.
     *
     * @param x
     *         x coordinate
     * @param y
     *         y coordinate
     */
public void show(final int x, final int y) {
    hide();
    ActionGroup actions = updateActions();
    lockLayer = new MenuLockLayer(this);
    popupMenu = new PopupMenu(actions, actionManager, managerProvider, presentationFactory, lockLayer, this, keyBindingAgent, "contextMenu");
    popupMenu.getElement().getStyle().setProperty("opacity", "0");
    popupMenu.getElement().getStyle().setProperty("transition", "opacity 0.5s ease");
    lockLayer.add(popupMenu);
    Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {

        @Override
        public void execute() {
            popupMenu.getElement().getStyle().setProperty("opacity", "1");
            updateMenuPosition(popupMenu, x, y);
        }
    });
}
Also used : MenuLockLayer(org.eclipse.che.ide.ui.toolbar.MenuLockLayer) ActionGroup(org.eclipse.che.ide.api.action.ActionGroup) DefaultActionGroup(org.eclipse.che.ide.api.action.DefaultActionGroup) Scheduler(com.google.gwt.core.client.Scheduler) PopupMenu(org.eclipse.che.ide.ui.toolbar.PopupMenu)

Example 3 with PopupMenu

use of org.eclipse.che.ide.ui.toolbar.PopupMenu in project che by eclipse.

the class MenuBarItem method openPopupMenu.

/**
     * Open sub Popup Menu
     *
     * @param menuLockLayer
     *         - lock layer which will receive PopupMenu visual component and
     */
public void openPopupMenu(MenuLockLayer menuLockLayer) {
    int x = element.getAbsoluteLeft();
    int y = 0;
    popupMenu = new PopupMenu(group, actionManager, managerProvider, presentationFactory, menuLockLayer, this, keyBindingAgent, "topmenu/" + title);
    menuLockLayer.add(popupMenu, x, y);
}
Also used : PopupMenu(org.eclipse.che.ide.ui.toolbar.PopupMenu)

Aggregations

PopupMenu (org.eclipse.che.ide.ui.toolbar.PopupMenu)3 MenuLockLayer (org.eclipse.che.ide.ui.toolbar.MenuLockLayer)2 Scheduler (com.google.gwt.core.client.Scheduler)1 ActionGroup (org.eclipse.che.ide.api.action.ActionGroup)1 DefaultActionGroup (org.eclipse.che.ide.api.action.DefaultActionGroup)1