In Eclipse, you can focus on class XXX and press Ctrl+Alt+H, to get a call hierarchy showing everywhere that new XXX(...) is called.
In IntelliJ IDEA, I can only do this on each constructor separately, and I can't do it at all on the default constructor (invisible).
Is there a way in IDEA that I'm missing? (Ultimate 12.1.3)
If I'm understanding your question correctly - one way you can do this is to select the classname (instead of an individual constructor name) and press Alt+F7 (Find usages).
This will find all usages of that class - the "Found Usages" window that will be displayed is split up into expandable sections, one of which will be "new instance creation".
NOTE: if you can't see a New instance creation grouping, makes sure Group by usage type is enabled (the "funnel" looking icon in the screen shot below).
In IDEA 2017.2, it looks like this:
Related
i want to extend the QuickInfo in IntelliSense.
When i type my variable and the type ".", IntelliSense shows me all Method, Properties and Fields inside the Object.
Wen i move the Curser via Keyboard and wait a second... an Quick info will be shown with Method, Property or Field informations.
Now i want to extend this Informations from Attributes there are on it.
For exsample...
I have an Class with Properties:
When i select this in IntelliCode like this:
Iwant to insert in the red marked QuickInfo my "TranslationItem" Attribute informations.
The Final will look like this:
For Mouse-Move-Actions i am finished.
I hope anybody can help me.
I really like the "structure" tab in IntelliJ, especially because I use regions a lot. Any elements in it are closed by default, and that's good for me, but I'd like the element my cursor is in to be expanded.
The idea is, here is a part of the code:
//region First
...
//endregion
//region Second
public void foo(){
System.out.println("Hello");
}
//endregion
If my cursor is in the method 'foo', I'd like everything to be "closed" in the structure tab, except the region "Second" and the method "foo", which should be expanded.
I'm pretty sure there is a setting for that somewhere, but I couldn't find it by myself and google shows no results (probably because of how bad I am at putting words on it).
Here's a screenshot to be sure we mean the same thing:
Enable the Autoscroll from Source option in the Structure tool window:
I have parent class Parent with method getToken(). And I have its child class - ChildA and ChildB, which don't override method getToken().
How I can search usages of method getToken() which used by instance of class ChildA?
Sorry for my English. Thanks!
As I spent half an hour to find the exact solution through all complicated and outdated documentations and examples, I just put the full answer using SSR here (Intellij 15.0.5):
Open SSR dialog (Edit > Find > Search Structurally...) and input template in screenshot, then click on "Edit variables..." to see the second dialog and edit the "Expression type (regexp)" as shown:
and if you want to include subclasses of ChildA too, just check the box "Apply constraint within type hierarchy" bellow the expression type:
You can add getToken() to ChildA, perform the search only for this method, then delete it. Another way is to use Structural Search and Replace.
Intellij asks about this if you use Ctrl+Alt+Shift+F7 for the search. First you have to explicitly override the method in the subclass/subinterface though, as CrazyCoder suggested.
I am busy teaching myself FXML.
I'm doing this by following this example.
It's a simple text editor.
However, in the tutorial everything is Java code.
I myself am using FXML to seperate the view of the logic.
I currently face the following challenge:
I have defined an TextArea in my FXML like so:
<TextArea id="taTextArea" fx:id="taContent" wrapText="true" />
Usually you add action listeners using onAction="#actionName"
What I want to know is, how can I do something similar for text changes. So I can detect wether a save is needed, modify the status bar label etc.
I want to avoid having to attach the TextArea to a change listener in the init method of the controller(implementing Initializable).
Also.. when I complete this application, I will write a blog about it.
With the lacking FXML documentation, I think itll be helpfull to other newbies.
So I want my code to be as clean as possible.
EDIT 1
No progress yet. I need to know if theres a thing such as code completion in FXML
So I can check what kind of properties I can use in FXMl. There should be a textLength property. In the provided link the author uses lengthProperty.addListener. I need an FXML equivilant
You could use the onKeyPressed property:
onKeyPressed="#textChanged"
which calls the textChanged method in the specified controller.
For the second question: The best reference for FXML currently is the javadoc of JavaFX, since all properties are listed there.
Say for example that i have a grid (dojox.grid.DataGrid). I want to know all the extension points available on that grid.
When checked with the dojo api doc in events section of the grid i cant find the extension points, (say for example extension point onBeforeRow is not listed in that event section).
Thanks in advance.
pretty much every public method is an extension point, in that you can dojo.connect to it. The "on" pattern indicates an event pattern, and there's no formal declaration beyond the naming pattern AFAIK.