For example, when I type
Scanner s;
s.
then, right after I type the '.' one popup windows comes up with all the Scanner methods, the first one being highlighted, and a second popup window comes up with the javadoc for that first method (close()). I can use the up and down arrows to select different methods and their docs show up in the second popup. Awesome.
But, when I type:
String s;
s.
then I get the first popup with the methods but not the second popup with the method's javadoc. How do I get that second popup to pop up?
I think this was working before...not sure.
I'm on a Mac.
I visited Preferences->installed JREs and took a look at the current value, which is JVM 1.6.0 (Mac Os X Default). All the Javadoc Locations there point to http://java.sun.com/javase/6/docs/api. Maybe there was some problem downloading these docs?
Ahh, after posting I noticed the url now forwards to oracle so I changed the javadoc URLS to http://download.oracle.com/javase/6/docs/api/ and now it works.
Related
This question is conceptual, and I am asking on this help forum in order to look for a lead to go off and research, and will not contain any code examples other than one to demo what I am using to grab the element value described below, here is some background:
The test I am writing involves signing in to the same application using two driver sessions each of which open a webdriver chrome window. Each one logs in to our app as a different user, and then from one, you can see the "online/offline" status of the other.
We use one class of methods for the first session, and another class of methods for the second session, and if a feature file title appears in a third class containing a LinkedList of strings, then the system knows to open the second session, and we then call methods in the relevant class to run jobs in the appropriate window.
In the current test case I am creating, the objective is to assert in a window we shall call "A", that the element being checked has a specific CSS property, namely its color property. It is grey when the other window that we shall call "B" does not have focus, and it is green, meaning online, when it does have focus, and is logged in.
The logged in side I can take care of, and manually I can see that it is working, but after this log in, when I use from the class that runs commands for window "A" the following line, directly after the last line that directs window "B" to have focus and do something, then it writes the value for "offline" in to the variable shown, as the window "B" has had to lose focus in order to check the element in window "A".
String color = seleniumClient.getWebDriver().findElement(By.xpath("//div[#id='user-content-button']/span/span")).getCssValue("background-color");
I am not able to influence the development of our app, as I am a QA, but I am asking if anyone knows how to maybe freeze the state of the chrome session for window A showing window B to be online before I run the above line, or any other way that I can get my test to see the correct state when the focus is not on the window "B"
Thanks.
int beginIndex, int endIndex
is important when we invoke methods.
How to show this when the cursor is in the brackets?
Got the final answer.
Just Ctrl +P in Windows/Linux
or ⌘ +P in macOS.
JetBrains reference: Parameter Info
To view the method parameters
Place the caret anywhere within the call of the desired method or function.
Choose View | Parameter Info on the main menu or press Ctrl+P.
To configure the behavior of the view parameter information functionality
Open the IDE Settings and click Code Completion below the Editor node.
In the Parameter info section, define the following options:
To have a complete method or function signature shown rather than a list of required types, select the Show full signatures check box.
Make sure to include the required third-party libraries in the project source path. Otherwise, names of the parameters will not be displayed.
To have the list of parameter types for the called method or function shown automatically after a certain delay, select the Auto pop-up (in ms) check box and specify the time period in milliseconds.
If you have non-standard bindings (or want to change what this is bound to), then look here:
Settings > Keymap > Main menu > View > Tool Windows > Parameter Info
And see what the binding is and/or change it to what you want.
Default shortcut to show parameter info in IDEA is ctrl+P.
Here is a sheet from JetBrains with this and other useful keyboard shortcuts: https://resources.jetbrains.com/storage/products/intellij-idea/docs/IntelliJIDEA_ReferenceCard.pdf
This tooltip appears on mouse over events.
Workaround with keyboard:
Try to use quick documentation pop-up CTRL+Q .
A Javadoc from MMenuElement says:
String org.eclipse.e4.ui.model.application.ui.menu.MMenuElement.getMnemonics()
Returns the value of the 'Mnemonics' attribute.
If the meaning of the 'Mnemonics' attribute isn't clear, there really should be more of a description here...
Returns:
the value of the 'Mnemonics' attribute.
I strongly suspect, that Mnemonics attribute has something to do with hot-key shortcuts, like in Swing or AWT. But still, it is not quite clear, how to use them on Eclipse4 platform correctly. For example, how to assign Alt+F to a "File" menu item?
Can anyone provide me with a clue, example or HOWTO on this topic?
This is only the default javadoc as set by the EMF generator. So there was no real documentation done up to now.
You're right, mnemnoics got to do with shortcuts, but not the way you describe it. You are talking about key bindings, mnemonics are this:
&Open leads to a menu text with an underlined O which indicates keyboard accessibility. This shows to the user that the command is reachable using the platform specific accelerator. It is however platform dependent on how you see them, on OS X for example the accelerator is shown next to the label and hence has no effect.
see the javadoc of org.eclipse.swt.widgets.MenuItem.setText(String string) for a detailed explanation. The e4 model simply results in this call on the element, which happens in org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem:499
OS X information Mnemonics are not shown on Mac by definition, see Java Development Guide for OS X for the design definition.
When hovering your mouse over a Class or variable, how come I don't see any information on the type of the class?
Is this not a feature in IntelliJ?
For example, in vs.net, if I mouse over any variable or class it will popup and tell me what namespace that belongs to etc.
And when I am using a method of a class, it also tells me the different overloads for the method (like types for each parameter, and a list of all the overloads).
This must be a feature in IntelliJ, I just don't know how to get it.
Can someone please clear this up?
Also, how can I tidy up the formatting of a page?
It doesn't work on hover yet, please star/vote the issue.
You need to use keyboard shortcuts for quick documentation pop-up or parameter info pop-up (Ctrl+Q and Ctrl+P with default Windows keymap, F1 and Cmd+P with default OS X 10.5+ keymap).
Code | Reformat Code... is the answer to your second question.
Formatting: Code -> Reformat (shortcut: Ctrl-Alt-L)
Hover doesn't produce the kind of information I'd like either. You can get info with Ctrl-Q ("Quick Help") in Windows or F1 in OS X, which will show where it's from and what it is, with most stuff in the popup window linked up in a reasonable way.
That popup view can also be pinned and/or docked; I often have it docked on the bottom.
When I am coding Java in Eclipse I like the auto-completion feature. With that I mean the popup with method-names that comes when you start typing in a method name for an object. Or maybe it's called something different, i.e. method-suggestions?
But the popup is hidden if I misspells a method name, and it doesn't come back if I delete the misspelled part of the method name. Is there any way to get back the popup after a misspelling without starting to type in the hole method name again?
Press Ctrl+ (Blank). For a complete list of keyboard shortcuts have a look in the eclipse "Preferences" and there "General/Keys".
You should also check out Preferences->Java->Editor->Content Assist. You'll be able to select how it acts; things like if you use it in the middle of a word should it insert or overwrite, should it show deprecated methods, the delay before it automatically appears, and it can even (try to) guess your method parameters based on the variables in the current scope.
I think you're after the Ctrl-Space keyboard shortcut.
(In Eclipse this is called Content Assist. In Visual Studio it's called IntelliSense.)