shortcut

How do you make menu item (JMenuItem) shortcut?

此生再无相见时 提交于 2019-12-03 15:17:34
问题 So i noticed that in awt there is a MenuItem constructor for adding a CTRL + (some key) shortcut, but there is no such constructor for JMenuItem . What is the correct way to do this? I need an equivelent of awt: MenuItem mi = new MenuItem("Copy", new MenuShortcut(KeyEvent.VK_C)); but for Swing. 回答1: Example for CTRL + N . menuItem.setAccelerator(KeyStroke.getKeyStroke('N', Toolkit.getDefaultToolkit ().getMenuShortcutKeyMask())); Toolkit.getDefaultToolkit ().getMenuShortcutKeyMask() returns

Eclipse shortcut “debug last debug configuration” (not F11)

断了今生、忘了曾经 提交于 2019-12-03 14:25:43
问题 I'm looking for a shortcut to debug the last debug configuration. I know about the existence of F11 , but the problem is, that I want to start debugging the last configuration. F11 runs the debugging of the class currently opened. I thought it would be easy to find that shortcut on the net, but no luck... 回答1: Check the prefs, namely "Run/Debug" -> "Launching" -> "Launch Operation". There you can select what F11 does: Run/Debug the file open in the current editor or use the last launch config

How to install a desktop shortcut (to a batch file) from a WiX-based installer that has “Run as Administrator” enabled?

。_饼干妹妹 提交于 2019-12-03 13:21:57
I'm installing a desktop shortcut (to a batch file) from a WiX-based installer -- how do I automatically configure this shortcut with the "Run as Administrator" setting enabled? The target OS is Windows Server 2008 R2, and the installer is running with elevated priveleges. Update: Thanks to the link provided by @Anders, I was able to get this working. I needed to do this in a C# CustomAction, so here is the C# version of the code: namespace CustomAction1 { public class CustomAction1 { public bool MakeShortcutElevated(string file_) { if (!System.IO.File.Exists(file_)) { return false; }

Eclipse autocompletion problem

不羁的心 提交于 2019-12-03 11:43:16
问题 Just installed Eclipse Helios (Win7 64) and I'm having a strange problem. I type syso-Ctrl-Space which is expected to complete to System.out.println("") but it doesn't work! I searched the web for about an hour now, I set Preferences > Java > Editor > Content Assist to defaults, nothing. Everything else seems to work. Ideas? To be clear: the shortcut works, it completes everything except "syso" as seen so far, on syso (also tried sysout) it says "No Default Proposals". I couldn't find this

How can I specify an icon with a RELATIVE path for a Linux desktop entry file?

二次信任 提交于 2019-12-03 11:40:20
问题 For one of my Linux applications, I have the application binary, a launcher.sh script (for the LD_LIBRARY_PATH) and a .desktop file, all in the same folder. I'd like to use a relative path rather than an absolute path for the icon. I've tried: Icon=app.svg Icon=./app.svg Icon=$PWD/app.svg Icon=$(dirname %k)/app.svg but none of these work (only Icon=/path/to/app.svg ). If it's not possible to specify a relative path and I must use a workaround, I was thinking I could regenerate the icon path

Is there any shortcut to select the current line in Visual Studio?

半城伤御伤魂 提交于 2019-12-03 10:30:14
问题 I couldn't find such feature in VS's shortcut list. Is there anyway? 回答1: If you want to copy a line, simply place cursor somewhere in that line and hit CTRL + C To cut an entire line CTRL + X @Sean found what I was looking for: To disable this default behavior remove the checkmark (or check to re-enable) Apply cut or copy commands to blank lines when there is no selection Accessed from the menu bar: Tools | Options | Text Editor | All languages You can also enter copy into the options search

MacOS, how to delete unused service item in Keyboard Shortcuts

两盒软妹~` 提交于 2019-12-03 09:38:45
问题 I'm a newbie to Mac OS and learning with Automator, I found it useful but not quite controllable. I made a shortcut in services but I don't know how to delete it. The item highlighted is what I want to delete. I think I should do it with Automator but I don't find out how. Any help will be appreciated. 回答1: crtl + mouse click on the service to get a context menu for the service. Select Show in Finder. This will take you to the service file by opening a new finder window and selecting it. You

How do you use replace in Spyder?

早过忘川 提交于 2019-12-03 09:33:05
Well, you start with cursor on your text, Ctrl + H and type replacement. But surprisingly i was not able to found any shorcut for actual replace or replace all action, rather than tabbing 5(!) times or moving my hand for a mouse. Straightforward enter does nothing, tabbing to replace button and entering replaces, but throws me into the editor. VisualStudio-like Alt + A does nothing. Am i missing something in spyder shortcuts? The shortcut for replace is Ctrl + R . drexiya I have the same issue with Spyder, I don't know why this has not been implemented in the editor. The work around I

Make 'n' always search forwards, regardless of whether / or ? was used for searching

怎甘沉沦 提交于 2019-12-03 07:09:21
I almost always search in Vim with / , and then continue searching forwards with n and backwards with N . Sometimes, however, I use ? to jump to an item just a few lines above the line I'm currently at, and in that case, if I want to search the same item forwards, I have to use N instead of n , an annoying mental speed bump. So my question is: is it possible to make n always go forwards, and N backwards? P.S. Documentation seems to hint that it's not possible, since n simply "Repeats the latest "/" or "?" [count] times", but who knows. This was taken from ZyX's post on the vim mailing list.

does webstorm have some shortcut for console.log or console.info

☆樱花仙子☆ 提交于 2019-12-03 06:27:36
问题 Just tired of typing console.log again and again, and do not find a way like 'Sysout + Control + Space' in Eclipse will create System.out.println(). 回答1: There's a predefined Postfix template that allows you to type .log after a JavaScript expression or string and hit Tab to transform it to console.log(). You can also create a Live template (see Preferences | Editor | Live templates) that would expand into a code snippet once you type the selected abbreviation and hit Tab. Update: there's now