tilesetMenu.add(createMenuItem(Resources.getString("menu.tilesets.manager"), null,
tilesetMenu.add(createMenuItem( Resources.getString("menu.tilesets.refresh"), null, Resources.getString("menu.tilesets.refresh.tooltip"), "F5")); tilesetMenu.addSeparator(); tilesetMenu.add(createMenuItem( Resources.getString("menu.tilesets.manager"), null,
    private void createMenuBar() {        JMenuItem save = new TMenuItem(saveAction);        JMenuItem saveAs = new TMenuItem(saveAsAction);        JMenuItem saveAsImage = createMenuItem(                Resources.getString("menu.file.image"), null,                Resources.getString("menu.file.image.tooltip"),                "control shift I");        JMenuItem close = new TMenuItem(new CloseMapAction(this, saveAction));        recentMenu = new JMenu(Resources.getString("menu.file.recent"));        mapEventAdapter.addListener(save);        mapEventAdapter.addListener(saveAs);        mapEventAdapter.addListener(saveAsImage);        mapEventAdapter.addListener(close);        JMenu fileMenu = new JMenu(Resources.getString("menu.file"));        fileMenu.add(new TMenuItem(new NewMapAction(this, saveAction)));        fileMenu.add(new TMenuItem(new OpenMapAction(this, saveAction)));        fileMenu.add(recentMenu);        fileMenu.add(save);        fileMenu.add(saveAs);        fileMenu.add(saveAsImage);        fileMenu.addSeparator();        fileMenu.add(close);        fileMenu.add(new TMenuItem(exitAction));        JMenuItem copyMenuItem = new TMenuItem(new CopyAction());        JMenuItem cutMenuItem = new TMenuItem(new CutAction());        JMenuItem pasteMenuItem = new TMenuItem(new PasteAction());        copyMenuItem.setEnabled(false);        cutMenuItem.setEnabled(false);        pasteMenuItem.setEnabled(false);        JMenu transformSub = new JMenu(Resources.getString("menu.edit.transform"));        transformSub.add(new TMenuItem(rot90Action, true));        transformSub.add(new TMenuItem(rot180Action, true));        transformSub.add(new TMenuItem(rot270Action, true));        transformSub.addSeparator();        transformSub.add(new TMenuItem(flipHorAction, true));        transformSub.add(new TMenuItem(flipVerAction, true));        mapEventAdapter.addListener(transformSub);        JMenu editMenu = new JMenu(Resources.getString("menu.edit"));        editMenu.add(new TMenuItem(undoHandler.getUndoAction()));        editMenu.add(new TMenuItem(undoHandler.getRedoAction()));        editMenu.addSeparator();        editMenu.add(copyMenuItem);        editMenu.add(cutMenuItem);        editMenu.add(pasteMenuItem);        editMenu.addSeparator();        editMenu.add(transformSub);        editMenu.addSeparator();        editMenu.add(createMenuItem(Resources.getString("menu.edit.preferences"),                null, Resources.getString("menu.edit.preferences.tooltip"), null));        editMenu.add(createMenuItem(Resources.getString("menu.edit.brush"), null,                Resources.getString("menu.edit.brush.tooltip"),                "control B"));        mapEventAdapter.addListener(copyMenuItem);        mapEventAdapter.addListener(cutMenuItem);        mapEventAdapter.addListener(pasteMenuItem);        JMenu mapMenu = new JMenu(Resources.getString("menu.map"));        mapMenu.add(createMenuItem(Resources.getString("menu.map.resize"), null,                Resources.getString("menu.map.resize.tooltip")));        mapMenu.add(createMenuItem(Resources.getString("menu.map.search"), null,                Resources.getString("menu.map.search.tooltip")));        mapMenu.addSeparator();        mapMenu.add(createMenuItem(Resources.getString("menu.map.properties"), null,                Resources.getString("menu.map.properties.tooltip")));        mapEventAdapter.addListener(mapMenu);        JMenuItem layerAdd = new TMenuItem(addLayerAction);        mapEventAdapter.addListener(layerAdd);        JMenu layerMenu = new JMenu(Resources.getString("menu.layer"));        layerMenu.add(layerAdd);        layerMenu.add(new TMenuItem(cloneLayerAction));        layerMenu.add(new TMenuItem(deleteLayerAction));        layerMenu.addSeparator();        layerMenu.add(new TMenuItem(moveLayerUpAction));        layerMenu.add(new TMenuItem(moveLayerDownAction));        layerMenu.addSeparator();        layerMenu.add(new TMenuItem(mergeLayerDownAction));        layerMenu.add(new TMenuItem(mergeAllLayersAction));        layerMenu.addSeparator();        layerMenu.add(createMenuItem(Resources.getString("menu.layer.properties"), null,                Resources.getString("menu.layer.properties.tooltip")));        JMenu tilesetMenu = new JMenu(Resources.getString("menu.tilesets"));        tilesetMenu.add(createMenuItem(Resources.getString("menu.tilesets.new"), null,                Resources.getString("menu.tilesets.new.tooltip")));        tilesetMenu.add(createMenuItem(Resources.getString("menu.tilesets.import"), null,                Resources.getString("menu.tilesets.import.tooltip")));        tilesetMenu.addSeparator();        tilesetMenu.add(createMenuItem(Resources.getString("menu.tilesets.manager"), null,                Resources.getString("menu.tilesets.manager.tooltip")));        /*        objectMenu = new JMenu("Objects");        objectMenu.add(createMenuItem("Add Object", null, "Add an object"));        mapEventAdapter.addListener(objectMenu);        JMenu modifySub = new JMenu("Modify");        modifySub.add(createMenuItem("Expand Selection", null, ""));        modifySub.add(createMenuItem("Contract Selection", null, ""));        */        JMenu selectMenu = new JMenu(Resources.getString("menu.select"));        selectMenu.add(new TMenuItem(selectAllAction, true));        selectMenu.add(new TMenuItem(cancelSelectionAction, true));        selectMenu.add(new TMenuItem(inverseAction, true));        //selectMenu.addSeparator();        //selectMenu.add(modifySub);        gridMenuItem = new JCheckBoxMenuItem(Resources.getString("menu.view.grid"));        gridMenuItem.addActionListener(this);        gridMenuItem.setToolTipText(Resources.getString("menu.view.grid.tooltip"));        gridMenuItem.setAccelerator(KeyStroke.getKeyStroke("control G"));        cursorMenuItem = new JCheckBoxMenuItem(Resources.getString("menu.view.cursor"));        cursorMenuItem.setSelected(prefs.getBoolean("cursorhighlight", true));        cursorMenuItem.addActionListener(this);        cursorMenuItem.setToolTipText(                Resources.getString("menu.view.cursor.tooltip"));        boundaryMenuItem = new JCheckBoxMenuItem(Resources.getString("menu.view.boundaries"));        boundaryMenuItem.addActionListener(this);        boundaryMenuItem.setToolTipText(Resources.getString("menu.view.boundaries.tooltip"));        boundaryMenuItem.setAccelerator(KeyStroke.getKeyStroke("control E"));        coordinatesMenuItem = new JCheckBoxMenuItem(Resources.getString("menu.view.coordinates"));        coordinatesMenuItem.addActionListener(this);        coordinatesMenuItem.setToolTipText(Resources.getString("menu.view.coordinates.tooltip"));        JMenu viewMenu = new JMenu(Resources.getString("menu.view"));        viewMenu.add(new TMenuItem(zoomInAction));        viewMenu.add(new TMenuItem(zoomOutAction));        viewMenu.add(new TMenuItem(zoomNormalAction));        viewMenu.addSeparator();        viewMenu.add(gridMenuItem);        viewMenu.add(cursorMenuItem);        //TODO: Enable when boudary drawing code finished.        //viewMenu.add(boundaryMenuItem);        viewMenu.add(coordinatesMenuItem);        mapEventAdapter.addListener(layerMenu);        mapEventAdapter.addListener(tilesetMenu);        mapEventAdapter.addListener(selectMenu);        mapEventAdapter.addListener(viewMenu);        JMenu helpMenu = new JMenu(Resources.getString("menu.help"));        helpMenu.add(createMenuItem(Resources.getString("menu.help.plugins"), null,                Resources.getString("menu.help.plugins.tooltip")));        helpMenu.add(createMenuItem(Resources.getString("menu.help.about"), null, Resources.getString("menu.help.about.tooltip")));        menuBar = new JMenuBar();        menuBar.add(fileMenu);        menuBar.add(editMenu);        menuBar.add(selectMenu);        menuBar.add(viewMenu);        menuBar.add(mapMenu);        menuBar.add(layerMenu);        menuBar.add(tilesetMenu);        //menuBar.add(objectMenu);        menuBar.add(helpMenu);    }