// Path: src/main/java/com/jvms/i18neditor/swing/UndoAction.java
// public class UndoAction extends AbstractAction {
// 	private final static long serialVersionUID = -3051499148079684354L;
// 	private final UndoManager undoManager;
// 	
// 	public UndoAction(UndoManager undoManager) {
// 		super();
// 		this.undoManager = undoManager;
// 	}
// 	
// 	@Override
// 	public void actionPerformed(ActionEvent e) {
// 		if (undoManager.canUndo()) {
// 			undoManager.undo();
// 		}
// 	}
// }
// 
// Path: src/main/java/com/jvms/i18neditor/util/MessageBundle.java
// public final class MessageBundle {
// 	private final static String RESOURCES_PATH = "bundles/messages";
// 	private static ResourceBundle RESOURCES;
// 	
// 	/**
// 	 * Sets the preferred locale to use.
// 	 * When calling this function resources will be reloaded from disk.
// 	 * 
// 	 * @param 	locale the preferred locale to use
// 	 */
// 	public static void setLocale(Locale locale) {
// 		RESOURCES = ResourceBundle.getBundle(RESOURCES_PATH, locale);
// 	}
// 	
// 	/**
// 	 * Gets a value from this bundle for the given {@code key}. Any second arguments will
// 	 * be used to format the value.
// 	 * 
// 	 * @param 	key the bundle key
// 	 * @param 	args objects used to format the value.
// 	 * @return 	the formatted value for the given key.
// 	 */
// 	public static String get(String key, Object... args) {
// 		String value = RESOURCES.getString(key);
// 		return MessageFormat.format(value, args);
// 	}
// 	
// 	/**
// 	 * Gets a mnemonic value from this bundle.
// 	 * 
// 	 * @param 	key the bundle key.
// 	 * @return 	the mnemonic value for the given key.
// 	 */
// 	public static Character getMnemonic(String key) {
// 		String value = RESOURCES.getString(key);
// 		return value.charAt(0);
// 	}
// 	
// 	/**
// 	 * Loads the resources.
// 	 */
// 	public static void loadResources() {
// 		RESOURCES = ResourceBundle.getBundle(RESOURCES_PATH);
// 	}
// }


import java.awt.Component;
import java.awt.Toolkit;
import java.awt.event.KeyEvent;
import javax.swing.Action;
import javax.swing.JPopupMenu;
import javax.swing.KeyStroke;
import javax.swing.text.DefaultEditorKit;
import javax.swing.text.JTextComponent;
import javax.swing.undo.UndoManager;
import com.google.common.base.Strings;
import com.jvms.i18neditor.swing.UndoAction;
import com.jvms.i18neditor.util.MessageBundle;
		int keyMask =Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
		
		undoAction = new UndoAction(undoManager);
		undoAction.putValue(Action.NAME, MessageBundle.get("swing.action.undo"));
		undoAction.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_Z, keyMask));
		add(undoAction);
		
		addSeparator();
		
		cutAction = new DefaultEditorKit.CutAction();
		cutAction.putValue(Action.NAME, MessageBundle.get("swing.action.cut"));
		cutAction.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_X, keyMask));
		add(cutAction);
		
		copyAction = new DefaultEditorKit.CopyAction();
		copyAction.putValue(Action.NAME, MessageBundle.get("swing.action.copy"));
		copyAction.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_C, keyMask));
		add(copyAction);
		
		Action pasteAction = new DefaultEditorKit.PasteAction();
		pasteAction.putValue(Action.NAME, MessageBundle.get("swing.action.paste"));
		pasteAction.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_V, keyMask));
		add(pasteAction);
		
		deleteAction = new DeleteAction(MessageBundle.get("swing.action.delete"));
		add(deleteAction);
		
		addSeparator();
		
		Action selectAllAction = new SelectAllAction(MessageBundle.get("swing.action.selectall"));
// Path: src/main/java/com/jvms/i18neditor/swing/UndoAction.java
// public class UndoAction extends AbstractAction {
// 	private final static long serialVersionUID = -3051499148079684354L;
// 	private final UndoManager undoManager;
// 	
// 	public UndoAction(UndoManager undoManager) {
// 		super();
// 		this.undoManager = undoManager;
// 	}
// 	
// 	@Override
// 	public void actionPerformed(ActionEvent e) {
// 		if (undoManager.canUndo()) {
// 			undoManager.undo();
// 		}
// 	}
// }
// 
// Path: src/main/java/com/jvms/i18neditor/util/MessageBundle.java
// public final class MessageBundle {
// 	private final static String RESOURCES_PATH = "bundles/messages";
// 	private static ResourceBundle RESOURCES;
// 	
// 	/**
// 	 * Sets the preferred locale to use.
// 	 * When calling this function resources will be reloaded from disk.
// 	 * 
// 	 * @param 	locale the preferred locale to use
// 	 */
// 	public static void setLocale(Locale locale) {
// 		RESOURCES = ResourceBundle.getBundle(RESOURCES_PATH, locale);
// 	}
// 	
// 	/**
// 	 * Gets a value from this bundle for the given {@code key}. Any second arguments will
// 	 * be used to format the value.
// 	 * 
// 	 * @param 	key the bundle key
// 	 * @param 	args objects used to format the value.
// 	 * @return 	the formatted value for the given key.
// 	 */
// 	public static String get(String key, Object... args) {
// 		String value = RESOURCES.getString(key);
// 		return MessageFormat.format(value, args);
// 	}
// 	
// 	/**
// 	 * Gets a mnemonic value from this bundle.
// 	 * 
// 	 * @param 	key the bundle key.
// 	 * @return 	the mnemonic value for the given key.
// 	 */
// 	public static Character getMnemonic(String key) {
// 		String value = RESOURCES.getString(key);
// 		return value.charAt(0);
// 	}
// 	
// 	/**
// 	 * Loads the resources.
// 	 */
// 	public static void loadResources() {
// 		RESOURCES = ResourceBundle.getBundle(RESOURCES_PATH);
// 	}
// }


// Path: src/main/java/com/jvms/i18neditor/swing/text/JTextComponentMenu.java
import java.awt.Component;
import java.awt.Toolkit;
import java.awt.event.KeyEvent;
import javax.swing.Action;
import javax.swing.JPopupMenu;
import javax.swing.KeyStroke;
import javax.swing.text.DefaultEditorKit;
import javax.swing.text.JTextComponent;
import javax.swing.undo.UndoManager;
import com.google.common.base.Strings;
import com.jvms.i18neditor.swing.UndoAction;
import com.jvms.i18neditor.util.MessageBundle;

		int keyMask =Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
		
		undoAction = new UndoAction(undoManager);
		undoAction.putValue(Action.NAME, MessageBundle.get("swing.action.undo"));
		undoAction.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_Z, keyMask));
		add(undoAction);
		
		addSeparator();
		
		cutAction = new DefaultEditorKit.CutAction();
		cutAction.putValue(Action.NAME, MessageBundle.get("swing.action.cut"));
		cutAction.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_X, keyMask));
		add(cutAction);
		
		copyAction = new DefaultEditorKit.CopyAction();
		copyAction.putValue(Action.NAME, MessageBundle.get("swing.action.copy"));
		copyAction.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_C, keyMask));
		add(copyAction);
		
		Action pasteAction = new DefaultEditorKit.PasteAction();
		pasteAction.putValue(Action.NAME, MessageBundle.get("swing.action.paste"));
		pasteAction.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_V, keyMask));
		add(pasteAction);
		
		deleteAction = new DeleteAction(MessageBundle.get("swing.action.delete"));
		add(deleteAction);
		
		addSeparator();
		
		Action selectAllAction = new SelectAllAction(MessageBundle.get("swing.action.selectall"));
		selectAllAction.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_A, keyMask));