source: josm/trunk/src/org/openstreetmap/josm/tools/PlatformHookWindows.java@ 4978

Last change on this file since 4978 was 4978, checked in by stoecker, 13 years ago

add reserved keys for unix

  • Property svn:eol-style set to native
File size: 1.8 KB
Line 
1// License: GPL. Copyright 2007 by Immanuel Scholz and others
2package org.openstreetmap.josm.tools;
3
4import static org.openstreetmap.josm.tools.I18n.tr;
5
6import java.awt.GraphicsEnvironment;
7import java.awt.event.KeyEvent;
8import java.io.File;
9import java.io.IOException;
10
11import org.openstreetmap.josm.Main;
12
13/**
14 * see PlatformHook.java
15 */
16public class PlatformHookWindows extends PlatformHookUnixoid implements PlatformHook {
17 @Override
18 public void openUrl(String url) throws IOException {
19 Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url);
20 }
21
22 @Override
23 public void initSystemShortcuts() {
24 // This list if far from complete!
25 Shortcut.registerSystemShortcut("system:exit", tr("unused"), KeyEvent.VK_F4, KeyEvent.ALT_DOWN_MASK).setAutomatic(); // items with automatic shortcuts will not be added to the menu bar at all
26 Shortcut.registerSystemShortcut("system:menuexit", tr("unused"), KeyEvent.VK_Q, KeyEvent.CTRL_DOWN_MASK);
27 Shortcut.registerSystemShortcut("system:copy", tr("unused"), KeyEvent.VK_C, KeyEvent.CTRL_DOWN_MASK);
28 Shortcut.registerSystemShortcut("system:paste", tr("unused"), KeyEvent.VK_V, KeyEvent.CTRL_DOWN_MASK);
29 Shortcut.registerSystemShortcut("system:cut", tr("unused"), KeyEvent.VK_X, KeyEvent.CTRL_DOWN_MASK);
30 Shortcut.registerSystemShortcut("system:duplicate", tr("unused"), KeyEvent.VK_D, KeyEvent.CTRL_DOWN_MASK); // not really system, but to avoid odd results
31 Shortcut.registerSystemShortcut("system:help", tr("unused"), KeyEvent.VK_F1, 0);
32 }
33
34 @Override
35 public String getDefaultStyle()
36 {
37 return "com.sun.java.swing.plaf.windows.WindowsLookAndFeel";
38 }
39
40 @Override
41 public boolean rename(File from, File to)
42 {
43 if(to.exists())
44 to.delete();
45 return from.renameTo(to);
46 }
47}
Note: See TracBrowser for help on using the repository browser.