Example usage for com.google.gwt.user.client.ui MenuBar addSeparator

List of usage examples for com.google.gwt.user.client.ui MenuBar addSeparator

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui MenuBar addSeparator.

Prototype

public MenuItemSeparator addSeparator() 

Source Link

Document

Adds a thin line to the MenuBar to separate sections of MenuItem s.

Usage

From source file:accelerator.client.view.desktop.DesktopMainMenuView.java

License:Open Source License

@UiHandler("editButton")
void onEditButtonClick(ClickEvent e) {
    final PopupPanel popup = new PopupPanel(true, false);
    MenuBar menu = new MenuBar(true);

    {/* w ww .j a  v a2s . co  m*/
        final Project p = getSelectedProject();
        final boolean isProjectSelected = p != null;

        // 
        MenuItem edit = new MenuItem("", new Command() {
            public void execute() {
                assert (p != null);
                popup.hide();
                ProjectDialogBox dlg = new ProjectDialogBox(p);
                dlg.setHandler(new ProjectDialogBox.Handler() {
                    public void onOk(Project input) {
                        handler.updateProject(input);
                    }
                });
                dlg.center();
            }
        });
        edit.setEnabled(isProjectSelected);
        menu.addItem(edit);

        // 
        MenuItem delete = new MenuItem("", new Command() {
            public void execute() {
                assert (p != null);
                popup.hide();
                handler.deleteProject(p);
            }
        });
        delete.setEnabled(isProjectSelected);
        menu.addItem(delete);
    }

    menu.addSeparator();

    {
        final Tag t = getSelectedTag();
        final boolean isTagSelected = t != null;

        // 
        MenuItem edit = new MenuItem("", new Command() {
            public void execute() {
                assert (t != null);
                popup.hide();
                TagDialogBox dlg = new TagDialogBox(t);
                dlg.setHandler(new TagDialogBox.Handler() {
                    public void onOk(Tag input) {
                        handler.updateTag(input);
                    }
                });
                dlg.center();
            }
        });
        edit.setEnabled(isTagSelected);
        menu.addItem(edit);

        // 
        MenuItem delete = new MenuItem("", new Command() {
            public void execute() {
                assert (t != null);
                popup.hide();
                handler.deleteTag(t);
            }
        });
        delete.setEnabled(isTagSelected);
        menu.addItem(delete);
    }

    popup.setWidget(menu);
    popup.setPopupPositionAndShow(new PositionCallback() {
        public void setPosition(int offsetWidth, int offsetHeight) {
            int left = editButton.getAbsoluteLeft();
            int top = editButton.getAbsoluteTop() - offsetHeight;
            popup.setPopupPosition(left, top);
        }
    });
}

From source file:ch.takoyaki.email.html.client.MenuBarBuilder.java

License:Open Source License

public void constructMenu() {

    MenuBar fileMenu = new MenuBar(true);
    fileMenu.addSeparator();
    fileMenu.addItem("Close", new CloseTabCommand(tab));
    fileMenu.addItem("Close all", new CloseAllTabsCommand(tab));
    fileMenu.addSeparator();//from www.j  a v  a 2s.co  m
    fileMenu.addItem("Open from file system", new OpenFromFileSystemCommand(fservice, tab));
    fileMenu.addSeparator();
    fileMenu.addItem("Save as zip", new DownloadAsZipCommand(fservice));

    MenuBar exportMenu = new MenuBar(true);
    exportMenu.addItem("Single HTML", new DownloadHtmlCommand(contentRenderer, fservice));
    exportMenu.addItem("EML File", new DownloadEmlCommand(contentRenderer, fservice));

    menu = new MenuBar();
    menu.addSeparator();
    menu.addItem("File", fileMenu);
    menu.addSeparator();
    menu.addItem("Export", exportMenu);
    menu.addSeparator();

}

From source file:com.colinalworth.xmlview.client.XmlTreeViewModel.java

License:Apache License

/**
 * /*from  www.  j a  v a 2  s  . c  om*/
 * @param validator
 */
public XmlTreeViewModel(XmlValidator validator) {
    final MenuBar subMenu = new MenuBar(true);

    subMenu.addItem(i18n.delete(), new DeleteElementCommand());
    subMenu.addSeparator();
    subMenu.addItem(i18n.addElement(), new NewElementCommand());
    subMenu.addItem(i18n.addAttr(), new NewAttrCommand());
    subMenu.addItem(i18n.addText(), new NewTextCommand());
    contextMenu = new XmlEditContextMenu();

    contextMenu.setWidget(subMenu);
    contextMenu.addCloseHandler(new CloseHandler<PopupPanel>() {
        @Override
        public void onClose(CloseEvent<PopupPanel> event) {
            subMenu.selectItem(null);
        }
    });

    nodeCell = new ElementCell(validator, contextMenu);

    refreshAccess = new HashMap<Node, ValueUpdater<Node>>();
}

From source file:com.gmail.cjbooms.thesis.pythonappengine.client.menus.MainMenuWidget.java

License:Open Source License

private MenuBar createFileMenu() {
    MenuBar fileMenu = new MenuBar(true);
    fileMenu.addItem("New File", newFileDialog.openMenuDialog());
    fileMenu.addItem("Delete File", createBlankCommand());
    fileMenu.addItem("Upload File", createBlankCommand());
    fileMenu.addItem("Refresh", createBlankCommand());
    fileMenu.addSeparator();
    fileMenu.addItem("Exit", createBlankCommand());
    return fileMenu;
}

From source file:com.goodow.web.ui.client.nav.MenuBarUi.java

License:Apache License

private void setMenuData(final MenuBar parentBar, final TreeNodeProxy parentNode) {
    List<TreeNodeProxy> childNodes = parentNode.getChildren();
    if (childNodes == null) {
        return;/*w w  w . j av a2s. c om*/
    }
    parentBar.clearItems();
    for (final TreeNodeProxy childNode : childNodes) {
        Command command = new Command() {
            @Override
            public void execute() {
                TreeNodePlace place = placeProvider.get().setPath(childNode.getPath());
                placeController.goTo(place);
            }
        };
        parentBar.addItem(childNode.getName(), command);
        parentBar.addSeparator();
    }
    // for (final TreeNode childNode : childNodes) {
    // if (childNode.getChildren() == null || childNode.getChildren().isEmpty()) {
    // Command command = new Command() {
    // public void execute() {
    // TreeNodePlace place = placeProvider.get();
    // place.setMenuId(childNode.getId());
    // placeController.goTo(place);
    // }
    // };
    // parentBar.addItem(childNode.getName(), command);
    // } else {
    // MenuBar childBar = new MenuBar(true);
    // childBar.setAnimationEnabled(true);
    //
    // setMenuData(childBar, childNode);
    // parentBar.addItem(childNode.getName(), childBar);
    // parentBar.addSeparator();
    // }
    // }
}

From source file:com.google.gwt.sample.showcase.client.content.lists.CwMenuBar.java

License:Apache License

/**
 * Initialize this example./*from   www.  j  av a  2s . c  om*/
 */
@ShowcaseSource
@Override
public Widget onInitialize() {
    // Create a command that will execute on menu item selection
    Command menuCommand = new Command() {
        private int curPhrase = 0;
        private final String[] phrases = constants.cwMenuBarPrompts();

        public void execute() {
            Window.alert(phrases[curPhrase]);
            curPhrase = (curPhrase + 1) % phrases.length;
        }
    };

    // Create a menu bar
    MenuBar menu = new MenuBar();
    menu.setAutoOpen(true);
    menu.setWidth("500px");
    menu.setAnimationEnabled(true);

    // Create a sub menu of recent documents
    MenuBar recentDocsMenu = new MenuBar(true);
    String[] recentDocs = constants.cwMenuBarFileRecents();
    for (int i = 0; i < recentDocs.length; i++) {
        recentDocsMenu.addItem(recentDocs[i], menuCommand);
    }

    // Create the file menu
    MenuBar fileMenu = new MenuBar(true);
    fileMenu.setAnimationEnabled(true);
    menu.addItem(new MenuItem(constants.cwMenuBarFileCategory(), fileMenu));
    String[] fileOptions = constants.cwMenuBarFileOptions();
    for (int i = 0; i < fileOptions.length; i++) {
        if (i == 3) {
            fileMenu.addSeparator();
            fileMenu.addItem(fileOptions[i], recentDocsMenu);
            fileMenu.addSeparator();
        } else {
            fileMenu.addItem(fileOptions[i], menuCommand);
        }
    }

    // Create the edit menu
    MenuBar editMenu = new MenuBar(true);
    menu.addItem(new MenuItem(constants.cwMenuBarEditCategory(), editMenu));
    String[] editOptions = constants.cwMenuBarEditOptions();
    for (int i = 0; i < editOptions.length; i++) {
        editMenu.addItem(editOptions[i], menuCommand);
    }

    // Create the GWT menu
    MenuBar gwtMenu = new MenuBar(true);
    menu.addItem(new MenuItem("GWT", true, gwtMenu));
    String[] gwtOptions = constants.cwMenuBarGWTOptions();
    for (int i = 0; i < gwtOptions.length; i++) {
        gwtMenu.addItem(gwtOptions[i], menuCommand);
    }

    // Create the help menu
    MenuBar helpMenu = new MenuBar(true);
    menu.addSeparator();
    menu.addItem(new MenuItem(constants.cwMenuBarHelpCategory(), helpMenu));
    String[] helpOptions = constants.cwMenuBarHelpOptions();
    for (int i = 0; i < helpOptions.length; i++) {
        helpMenu.addItem(helpOptions[i], menuCommand);
    }

    // Return the menu
    menu.ensureDebugId("cwMenuBar");
    return menu;
}

From source file:com.google.gwt.sample.stockwatcher.client.GuiWorldTree.java

public GuiWorldTree(GuiWorldTreeListener listener) {
    this.listener = listener;

    MenuBar insertMenu = new MenuBar(true);
    insertMenu.addItem("Sphere", new ObjectCommandInsertSphere());
    insertMenu.addItem("Box", new ObjectCommandInsertBox());
    insertMenu.addSeparator();
    insertMenu.addItem("Add", new ObjectCommandInsertCsgOp(Type.TypeAdd));
    insertMenu.addItem("Subtract", new ObjectCommandInsertCsgOp(Type.TypeSub));
    insertMenu.addItem("Intersect", new ObjectCommandInsertCsgOp(Type.TypeAnd));

    MenuBar objectMenu = new MenuBar();
    objectMenu.addItem(new Icon("shape_square_add.png"), insertMenu);
    objectMenu.addItem(new Icon("shape_square_delete.png"), new ObjectCommandDelete());
    objectMenu.addItem(new Icon("arrow_up.png"), new ObjectCommandMoveUp());
    objectMenu.addItem(new Icon("arrow_down.png"), new ObjectCommandMoveDown());

    guiTree.addSelectionHandler(new TreeSelectionHandler(this));

    FlowPanel menuFlowPanel = new FlowPanel();
    menuFlowPanel.add(objectMenu);//from  www.  ja va2 s . c o  m
    menuFlowPanel.add(guiTree);
    menuPanel.add(menuFlowPanel);

    addNorth(menuPanel, 200);
}

From source file:com.lushprojects.circuitjs1.client.CirSim.java

License:Open Source License

public void init() {

    boolean printable = false;
    boolean convention = true;
    boolean euroRes = false;
    boolean usRes = false;
    MenuBar m;

    CircuitElm.initClass(this);

    QueryParameters qp = new QueryParameters();

    try {//w w w.jav  a2 s .com
        //baseURL = applet.getDocumentBase().getFile();
        // look for circuit embedded in URL
        //      String doc = applet.getDocumentBase().toString();
        String cct = qp.getValue("cct");
        if (cct != null)
            startCircuitText = cct.replace("%24", "$");
        startCircuit = qp.getValue("startCircuit");
        startLabel = qp.getValue("startLabel");
        startCircuitLink = qp.getValue("startCircuitLink");
        euroRes = qp.getBooleanValue("euroResistors", false);
        usRes = qp.getBooleanValue("usResistors", false);
        printable = qp.getBooleanValue("whiteBackground", getOptionFromStorage("whiteBackground", false));
        convention = qp.getBooleanValue("conventionalCurrent",
                getOptionFromStorage("conventionalCurrent", true));
    } catch (Exception e) {
    }

    boolean euroSetting = false;
    if (euroRes)
        euroSetting = true;
    else if (usRes)
        euroSetting = false;
    else
        euroSetting = getOptionFromStorage("euroResistors", !weAreInUS());

    transform = new double[6];
    String os = Navigator.getPlatform();
    isMac = (os.toLowerCase().contains("mac"));
    ctrlMetaKey = (isMac) ? "Cmd" : "Ctrl";

    shortcuts = new String[127];

    layoutPanel = new DockLayoutPanel(Unit.PX);

    fileMenuBar = new MenuBar(true);
    importFromLocalFileItem = new MenuItem(LS("Import From Local File"),
            new MyCommand("file", "importfromlocalfile"));
    importFromLocalFileItem.setEnabled(LoadFile.isSupported());
    fileMenuBar.addItem(importFromLocalFileItem);
    importFromTextItem = new MenuItem(LS("Import From Text"), new MyCommand("file", "importfromtext"));
    fileMenuBar.addItem(importFromTextItem);
    importFromDropboxItem = new MenuItem(LS("Import From Dropbox"), new MyCommand("file", "importfromdropbox"));
    fileMenuBar.addItem(importFromDropboxItem);
    exportAsUrlItem = new MenuItem(LS("Export As Link"), new MyCommand("file", "exportasurl"));
    fileMenuBar.addItem(exportAsUrlItem);
    exportAsLocalFileItem = new MenuItem(LS("Export As Local File"),
            new MyCommand("file", "exportaslocalfile"));
    exportAsLocalFileItem.setEnabled(ExportAsLocalFileDialog.downloadIsSupported());
    fileMenuBar.addItem(exportAsLocalFileItem);
    exportAsTextItem = new MenuItem(LS("Export As Text"), new MyCommand("file", "exportastext"));
    fileMenuBar.addItem(exportAsTextItem);
    exportToDropboxItem = new MenuItem(LS("Export To Dropbox"), new MyCommand("file", "exporttodropbox"));
    exportToDropboxItem.setEnabled(ExportToDropbox.isSupported());
    fileMenuBar.addItem(exportToDropboxItem);
    fileMenuBar.addSeparator();
    aboutItem = new MenuItem(LS("About"), (Command) null);
    fileMenuBar.addItem(aboutItem);
    aboutItem.setScheduledCommand(new MyCommand("file", "about"));

    int width = (int) RootLayoutPanel.get().getOffsetWidth();
    VERTICALPANELWIDTH = width / 5;
    if (VERTICALPANELWIDTH > 166)
        VERTICALPANELWIDTH = 166;
    if (VERTICALPANELWIDTH < 128)
        VERTICALPANELWIDTH = 128;

    menuBar = new MenuBar();
    menuBar.addItem(LS("File"), fileMenuBar);
    verticalPanel = new VerticalPanel();

    // make buttons side by side if there's room
    buttonPanel = (VERTICALPANELWIDTH == 166) ? new HorizontalPanel() : new VerticalPanel();

    m = new MenuBar(true);
    m.addItem(undoItem = menuItemWithShortcut(LS("Undo"), LS("Ctrl-Z"), new MyCommand("edit", "undo")));
    m.addItem(redoItem = menuItemWithShortcut(LS("Redo"), LS("Ctrl-Y"), new MyCommand("edit", "redo")));
    m.addSeparator();
    m.addItem(cutItem = menuItemWithShortcut(LS("Cut"), LS("Ctrl-X"), new MyCommand("edit", "cut")));
    m.addItem(copyItem = menuItemWithShortcut(LS("Copy"), LS("Ctrl-C"), new MyCommand("edit", "copy")));
    m.addItem(pasteItem = menuItemWithShortcut(LS("Paste"), LS("Ctrl-V"), new MyCommand("edit", "paste")));
    pasteItem.setEnabled(false);

    m.addItem(menuItemWithShortcut(LS("Duplicate"), LS("Ctrl-D"), new MyCommand("edit", "duplicate")));

    m.addSeparator();
    m.addItem(selectAllItem = menuItemWithShortcut(LS("Select All"), LS("Ctrl-A"),
            new MyCommand("edit", "selectAll")));
    m.addSeparator();
    m.addItem(new MenuItem(weAreInUS() ? LS("Center Circuit") : LS("Centre Circuit"),
            new MyCommand("edit", "centrecircuit")));
    m.addItem(menuItemWithShortcut(LS("Zoom 100%"), "0", new MyCommand("edit", "zoom100")));
    m.addItem(menuItemWithShortcut(LS("Zoom In"), "+", new MyCommand("edit", "zoomin")));
    m.addItem(menuItemWithShortcut(LS("Zoom Out"), "-", new MyCommand("edit", "zoomout")));
    menuBar.addItem(LS("Edit"), m);

    MenuBar drawMenuBar = new MenuBar(true);
    drawMenuBar.setAutoOpen(true);

    menuBar.addItem(LS("Draw"), drawMenuBar);

    m = new MenuBar(true);
    m.addItem(new MenuItem(LS("Stack All"), new MyCommand("scopes", "stackAll")));
    m.addItem(new MenuItem(LS("Unstack All"), new MyCommand("scopes", "unstackAll")));
    m.addItem(new MenuItem(LS("Combine All"), new MyCommand("scopes", "combineAll")));
    menuBar.addItem(LS("Scopes"), m);

    optionsMenuBar = m = new MenuBar(true);
    menuBar.addItem(LS("Options"), optionsMenuBar);
    m.addItem(dotsCheckItem = new CheckboxMenuItem(LS("Show Current")));
    dotsCheckItem.setState(true);
    m.addItem(voltsCheckItem = new CheckboxMenuItem(LS("Show Voltage"), new Command() {
        public void execute() {
            if (voltsCheckItem.getState())
                powerCheckItem.setState(false);
            setPowerBarEnable();
        }
    }));
    voltsCheckItem.setState(true);
    m.addItem(powerCheckItem = new CheckboxMenuItem(LS("Show Power"), new Command() {
        public void execute() {
            if (powerCheckItem.getState())
                voltsCheckItem.setState(false);
            setPowerBarEnable();
        }
    }));
    m.addItem(showValuesCheckItem = new CheckboxMenuItem(LS("Show Values")));
    showValuesCheckItem.setState(true);
    //m.add(conductanceCheckItem = getCheckItem(LS("Show Conductance")));
    m.addItem(smallGridCheckItem = new CheckboxMenuItem(LS("Small Grid"), new Command() {
        public void execute() {
            setGrid();
        }
    }));
    m.addItem(crossHairCheckItem = new CheckboxMenuItem(LS("Show Cursor Cross Hairs"), new Command() {
        public void execute() {
            setOptionInStorage("crossHair", crossHairCheckItem.getState());
        }
    }));
    crossHairCheckItem.setState(getOptionFromStorage("crossHair", false));
    m.addItem(euroResistorCheckItem = new CheckboxMenuItem(LS("European Resistors"), new Command() {
        public void execute() {
            setOptionInStorage("euroResistors", euroResistorCheckItem.getState());
        }
    }));
    euroResistorCheckItem.setState(euroSetting);
    m.addItem(printableCheckItem = new CheckboxMenuItem(LS("White Background"), new Command() {
        public void execute() {
            int i;
            for (i = 0; i < scopeCount; i++)
                scopes[i].setRect(scopes[i].rect);
            setOptionInStorage("whiteBackground", printableCheckItem.getState());
        }
    }));
    printableCheckItem.setState(printable);
    m.addItem(conventionCheckItem = new CheckboxMenuItem(LS("Conventional Current Motion"), new Command() {
        public void execute() {
            setOptionInStorage("conventionalCurrent", conventionCheckItem.getState());
        }
    }));
    conventionCheckItem.setState(convention);
    m.addItem(optionsItem = new CheckboxAlignedMenuItem(LS("Other Options..."),
            new MyCommand("options", "other")));

    mainMenuBar = new MenuBar(true);
    mainMenuBar.setAutoOpen(true);
    composeMainMenu(mainMenuBar);
    composeMainMenu(drawMenuBar);

    layoutPanel.addNorth(menuBar, MENUBARHEIGHT);
    layoutPanel.addEast(verticalPanel, VERTICALPANELWIDTH);
    RootLayoutPanel.get().add(layoutPanel);

    cv = Canvas.createIfSupported();
    if (cv == null) {
        RootPanel.get().add(new Label("Not working. You need a browser that supports the CANVAS element."));
        return;
    }

    cvcontext = cv.getContext2d();
    backcv = Canvas.createIfSupported();
    backcontext = backcv.getContext2d();
    setCanvasSize();
    layoutPanel.add(cv);
    verticalPanel.add(buttonPanel);
    buttonPanel.add(resetButton = new Button(LS("Reset")));
    resetButton.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            resetAction();
        }
    });
    resetButton.setStylePrimaryName("topButton");
    buttonPanel.add(runStopButton = new Button(LSHTML("<Strong>RUN</Strong>&nbsp;/&nbsp;Stop")));
    runStopButton.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            setSimRunning(!simIsRunning());
        }
    });

    /*
    dumpMatrixButton = new Button("Dump Matrix");
    dumpMatrixButton.addClickHandler(new ClickHandler() {
    public void onClick(ClickEvent event) { dumpMatrix = true; }});
    verticalPanel.add(dumpMatrixButton);// IES for debugging
    */

    if (LoadFile.isSupported())
        verticalPanel.add(loadFileInput = new LoadFile(this));

    Label l;
    verticalPanel.add(l = new Label(LS("Simulation Speed")));
    l.addStyleName("topSpace");

    // was max of 140
    verticalPanel.add(speedBar = new Scrollbar(Scrollbar.HORIZONTAL, 3, 1, 0, 260));

    verticalPanel.add(l = new Label(LS("Current Speed")));
    l.addStyleName("topSpace");
    currentBar = new Scrollbar(Scrollbar.HORIZONTAL, 50, 1, 1, 100);
    verticalPanel.add(currentBar);
    verticalPanel.add(powerLabel = new Label(LS("Power Brightness")));
    powerLabel.addStyleName("topSpace");
    verticalPanel.add(powerBar = new Scrollbar(Scrollbar.HORIZONTAL, 50, 1, 1, 100));
    setPowerBarEnable();

    //   verticalPanel.add(new Label(""));
    //        Font f = new Font("SansSerif", 0, 10);
    l = new Label(LS("Current Circuit:"));
    l.addStyleName("topSpace");
    //        l.setFont(f);
    titleLabel = new Label("Label");
    //        titleLabel.setFont(f);
    verticalPanel.add(l);
    verticalPanel.add(titleLabel);

    verticalPanel.add(iFrame = new Frame("iframe.html"));
    iFrame.setWidth(VERTICALPANELWIDTH + "px");
    iFrame.setHeight("100 px");
    iFrame.getElement().setAttribute("scrolling", "no");

    setGrid();
    elmList = new Vector<CircuitElm>();
    //   setupList = new Vector();
    undoStack = new Vector<String>();
    redoStack = new Vector<String>();

    scopes = new Scope[20];
    scopeColCount = new int[20];
    scopeCount = 0;

    random = new Random();
    //   cv.setBackground(Color.black);
    //   cv.setForeground(Color.lightGray);

    elmMenuBar = new MenuBar(true);
    elmMenuBar.addItem(elmEditMenuItem = new MenuItem(LS("Edit"), new MyCommand("elm", "edit")));
    elmMenuBar
            .addItem(elmScopeMenuItem = new MenuItem(LS("View in Scope"), new MyCommand("elm", "viewInScope")));
    elmMenuBar.addItem(elmCutMenuItem = new MenuItem(LS("Cut"), new MyCommand("elm", "cut")));
    elmMenuBar.addItem(elmCopyMenuItem = new MenuItem(LS("Copy"), new MyCommand("elm", "copy")));
    elmMenuBar.addItem(elmDeleteMenuItem = new MenuItem(LS("Delete"), new MyCommand("elm", "delete")));
    elmMenuBar.addItem(new MenuItem(LS("Duplicate"), new MyCommand("elm", "duplicate")));
    elmMenuBar.addItem(elmFlipMenuItem = new MenuItem(LS("Swap Terminals"), new MyCommand("elm", "flip")));

    scopeMenuBar = buildScopeMenu(false);
    transScopeMenuBar = buildScopeMenu(true);

    if (startCircuitText != null) {
        getSetupList(false);
        readSetup(startCircuitText, true);
    } else {
        if (stopMessage == null && startCircuitLink != null) {
            readSetup(null, 0, false, true);
            getSetupList(false);
            ImportFromDropboxDialog.setSim(this);
            ImportFromDropboxDialog.doImportDropboxLink(startCircuitLink, false);
        } else {
            readSetup(null, 0, false, true);
            if (stopMessage == null && startCircuit != null) {
                getSetupList(false);
                readSetupFile(startCircuit, startLabel, true);
            } else
                getSetupList(true);
        }
    }

    enableUndoRedo();
    enablePaste();
    setiFrameHeight();
    cv.addMouseDownHandler(this);
    cv.addMouseMoveHandler(this);
    cv.addMouseOutHandler(this);
    cv.addMouseUpHandler(this);
    cv.addClickHandler(this);
    cv.addDoubleClickHandler(this);
    doTouchHandlers(cv.getCanvasElement());
    cv.addDomHandler(this, ContextMenuEvent.getType());
    menuBar.addDomHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            doMainMenuChecks();
        }
    }, ClickEvent.getType());
    Event.addNativePreviewHandler(this);
    cv.addMouseWheelHandler(this);
    setSimRunning(true);
    // setup timer

    timer.scheduleRepeating(FASTTIMER);

}

From source file:com.qualogy.qafe.gwt.client.ui.renderer.AbstractComponentRenderer.java

License:Apache License

private static void processMenu(MenuBar menu, MenuItemGVO[] subMenus, String name, String uuid, String parent) {
    MenuBar subMenu = new MenuBar(true);
    for (int j = 0; j < subMenus.length; j++) {
        if (subMenus[j].getSubMenus() != null && subMenus[j].getSubMenus().length > 0) {
            processMenu(subMenu, subMenus[j].getSubMenus(), subMenus[j].getDisplayname(), uuid, parent);
        } else {// w w w  .  ja  v a2s .co  m
            if (subMenus[j] instanceof MenuItemSeparatorGVO) {
                menu.addSeparator();
            } else {
                MenuItem menuItem = new MenuItem(subMenus[j].getDisplayname(), (Command) null);
                RendererHelper.fillIn(subMenus[j], menuItem, uuid, parent, subMenus[j].getContext());
                subMenu.addItem(menuItem);
            }
        }
    }
    if (tempString.equals(name)) {
        contextMenu.addItem(new MenuItem(name, subMenu));
    } else {
        menu.addItem(new MenuItem(name, subMenu));
    }
}

From source file:com.qualogy.qafe.gwt.client.ui.renderer.WindowRenderer.java

License:Apache License

private void processMenu(MenuBar menu, MenuItemGVO subMenuGVO, String name, String uuid, String parent) {
    MenuBar subMenu = new MenuBar(true);
    MenuItemGVO[] subMenus = subMenuGVO.getSubMenus();
    for (int j = 0; j < subMenus.length; j++) {
        if (subMenus[j].getSubMenus() != null && subMenus[j].getSubMenus().length > 0) {
            processMenu(subMenu, subMenus[j], subMenus[j].getDisplayname(), uuid, parent);
        } else {//w  ww. j  av a  2s .  c  o  m
            if (subMenus[j] instanceof MenuItemSeparatorGVO) {
                subMenu.addSeparator();
            } else {
                MenuItem menuItem = new MenuItem(subMenus[j].getDisplayname(), (Command) null);
                RendererHelper.fillIn(subMenus[j], menuItem, uuid, parent, subMenus[j].getContext());
                subMenu.addItem(menuItem);
            }
        }

    }
    MenuItem subMenuItem = new MenuItem(name, subMenu);
    RendererHelper.fillIn(subMenuGVO, subMenuItem, uuid, parent, subMenuGVO.getContext());
    menu.addItem(subMenuItem);
}