I previously used rectangular selection mode on my Java project in eclipse, but after doing an Android project, ALT+SHIFT+A now opens this box instead:
How can I get the old behaviour back?
If a plugin messes with your keybindings, you can always go to:
Window > Preferences > General > Keys
There, you can search for Toggle Block Selection (which is what I think you mean by "rectangular selection") and either assign a different key combination to it, or change it back to Alt+Shift+A and (if you want) assign a different combination to whatever had replaced it.
Related
On Eclipse 2019-09 there is a very annoying "feature" which finds the wrong method when you are typing its name. The image below speaks for itself.
When I type "rem", it selects hasRemaining() and not remaining(). Also when I type "rem", of course remaining() should appear first and before should_remanage(). Is it possible to fix that?
Click here for the image
Go to Window > Preferences > Java > Editor > Content assist and you will find an option that let you select between relevance and alphabetically.
Also checkbox allow you to select camelcase matches 'show camel case matches' -
tune these properties to get expected results..
Not quite sure whether I'm using the right terminology here, but Netbeans has a very nice feature where e.g. if you start typing for it will offer to write a code fragment looping over an array or list, basing it on the name and type of an array or list variable actually in scope.
If more than one such variable is in scope it will guess, sometimes correctly and sometimes not.
Is there a way to aim this feature at the correct array/list variable?
You can do that like this:
Type fore and press TAB. This will generate the for each loop.
The loop variable is selected. Press TAB again to select the list variable.
Finally, press CTRL+SPACE, select a different list variable, and press ENTER.
(Tested with Netbeans 8.0)
In netbeans terminology, it is called code templates (many editors call it code snippets). You can customize them also by going to tools > options > editor and select required language from the dropdow.
Is it possible to evaluate a expression in Eclipse similar to IntelliJ. Where you can dynamically type code and the result will be displayed during debug?. I know it does something similar "Display" but you need to highlight code that has been written (so you cant write any new code unless you re-compile).
Perhaps there are plugins that i could use?. I have just started using eclipse
There is a Display view as well that can do exactly what you want. Go to Window > Show view > Display (or Other... if the Display view is not there. In the Display view, you can type any code you want during debug (content assist is available). The current objects and variables are also available to use. After you wrote your code, you have to highlight it, right click and select Execute or hit CTRL-U. You may play around with the other possible actions as well.
Besides that, you can also write in the source code during debug and evaluate it using Display as you mentioned, if you have the source for the class you are debugging.
1 - Type your expression inside a method that you are debugging
2 - Select that code
3 - Press CTRL + SHIFT + I
4 - Eclipse will evaluate your expression and show the results in a floating window
You can change variable values on the fly using the Debug perspective.
The top right corner of Eclipse should have the variables view from which you can select a variable name and change its value. You can also set conditional breakpoints by selecting the breakpoints view in the top right corner of Eclipse. Right-click on the breakpoint and select breakpoint properties. Check the conditional checkbox and write an expression that only when it evaluates as true does the program suspend during Debugging.
Change Variable Values during Debug
Conditional Breakpoints
Although Display View works; There are two ways else to evaluate an expression.
In the context of the debugging session, we can write and run custom code to evaluate possibilities. This is done in the Debug Shell. For example, if we need to cross-check the correctness of the sqrt functionality, we could do it in the Debug Shell. On the code, Right-click -> Inspect to see the value.
You can select an expression then open Context Menu -> Inspect or press CTRL + Shift + I, during debugging, the result will be displayed.
Select any expression in your code. Then right-click and select "Display" (or press the associated key-combination).
For completely new expressions, use the Display view. It's like a scrapbook for expressions. If the Display view is not visible, select Window > Show view > Display to add it. Then type any expression in the view, and do the same thing as for expressions in your code: select the expression, right-click and select "Display".
For expressions that you want to always see the value of, every time execution is halted, use the Expressions view instead.
I've recently switched from Eclipse to IntelliJ IDEA 13. I use the VI keybindings.
One non-vi thing I am used to doing in Eclipse is using Shift + ↑ / Shift + ↓ to block a few lines of text. The behaviour of this text selection in Eclipse is the same as almost every other text input widget I've ever used. Typically I do one of two things after making the selection - delete this block or comment it out (⌘ + /).
I have no found equivalent keyboard-only multi-line selection function in IntelliJ IDEA 13.
Shift + ↑ does not start a block selection - it seems to page the cursor up and down the screen.
If I use the mouse to start making a selection, then the arrow keys do extend the selection. However, I'm unable to start a selection using the keyboard alone.
I'm aware of the ⌘ + W ever-outward-growing smart element selection - but if you then use the arrow keys, the selection is lost, not extended.
How can I start and then extend a selection region across multiple lines using the keyboard only on Mac OS X (that works with the VI keybindings enabled)?
Multi-line caret
For Mac, you can use ⌘+⌘(Hold)+↑ / ↓.
For Windows, replace the ⌘ with CTRL.
ESC will end multi-line mode.
Change Multi-caret Hotkey
To add a custom Keymap, ⌘+SHIFT+A, type keymap and click on the one with Settings as subtext. Search for Clone Caret Above and Clone Caret Below.
I mapped mine to ALT+SHIFT+↑ / ↓.
Bonus
Try holding combinations of ⌘, SHIFT, and arrows for improved selection power.
Sounds like you need to map it. In the default key mapping Shift+↑ and Shift+↓ work as expected (i.e. as you describe). I do not have the vi mapping available to check it. Go into Settings > [IDE Settings] > Keymap. In the Keymap, go to "Editor Actions". Configure the "Down with Selection" and "Up with Selection" options. This may mean removing the Shift+↑ and Shift+↓ mappings from something else.
I use the IdeaVIM plugin on Mac OS and I can increase or decrease my selection with the keyboard only with alt-Up/Down.
It is possible I customized the VIM keymap to this, can't remember if it is default or not. However, the editor action you are looking for in the keymap settings is "Select Word at Caret" and "Unselect Word at Caret". Repeatedly pressing the keystroke smartly selects/unselects the text. It almost always selects what I want.
You can use alt+Up/Down/Right/Left or alt+mouse-select to block select on mac in IntelliJ
This might seem like a very trivial problem but I have spent quite some time on this without finding a viable solution.
Nokia devices have a central select button,which allows us to assign soft keys to it.
According to my requirement, I need to assign a specific command as the soft key. For instance it might be "Play" on one screen and "Select" on other. Note that I have a default select command already set using:
setDefaultCommand((Command) v.elementAt(v.size() - 1));
which is always the first command in the menu at the right and is invoked when central select button is pressed.
From what I read, the way commands are assigned to each soft key is very arbitrary and varies from device to device. Since I have a default command already set, my problem can be solved in two ways:
1.By setting a soft key to the central button using
Display.getInstance().setThirdSoftButton(true);
I tried this, but the way commands are assigned is very random. Also,there is a default command "Select" always added to the menu. Is there a way to customize this so that a very specific command is shown above the central button?
2.By just assigning a label so that the default command set as above is displayed in the central soft key.
The 3rd softbutton mode has default implementations for many focusable components but not for labels. You can customize its label by invoking setSelectCommandText(String) on the component.
I suggest that rather than using a label for a center command just use a button and set it's UIID to Label if you want it to appear as a standard label.