Eclipse PDT: show every call of function - eclipse

Is there an option in Eclipse PDT to show every call of chosen function.
I now if you select some kind of function and hit F3 key you will see a definition of selected function.

Open the Search Menu, Choose 'Search...', and navigate to the PHP tab, then
Enter the method name in the search string text box;
Select Method in the Search for group;
Select References in the Limit to group.
Find method usages http://img217.imageshack.us/img217/83/eclipsepdtfindmethodusa.png

We have a plugin for that... nWire for PHP. It's a comprehensive PHP code analyzer which represents all your code associations, invocations included in one quick and easy to use view. It can also represent the associations graphically.

Related

Surround selection with method call

Often when I'm writing code I forget to surround a section of code with a method. For example, when printing an array, I realize that I forgot to pass the array into Arrays.toString().
String[] foo(){
return new String[3];
}
main() {
System.out.println(foo());
}
Is there a way in Eclipse that I can select foo() and then use auto complete or something to surround it with Arrays.toString()? So I want to end up with this:
main() {
System.out.println(Arrays.toString(foo()));
}
I know I could use templates, but I would have to make a template for each method I want to use. I'm looking for something like Eclipse's auto complete feature, which knows about every class and method in the build path.
Yes, you could use templates for that:
First, experiment with existing templates:
Go to the source editor and select "foo()".
Open the view General > Templates.
Select some template, for example, Java > toArray and see how it works.
Then, add your own template:
Windows > Preferences > Java > Editor > Templates > New.
I think the right context should be "Java".
Another way of accesing templates is through the content assist: In the source code, in a new line, start typing the first letters of your template, then press [CTRL][SPACE]. A selector will appear with the matching templates. You may find it useful to check the checkbox "Automatically inserted" in the template definition window.
And yet another way to access them is to select a line of code and then Context Menu > Surround With.
A quick way:
Double click or use select enclosing element and its cousins to select the expression you wish to wrap. ctrl-x to temporarily cut it. Type a few characters and ctrl-space to insert your method name and parentheses. Finally, ctrl-v to paste what you just cut.
with templates - under Java Statements: ${method}(${word_selection})${cursor}
You can make a template like the one described by #LittleSanti. If you use a fake template variable for the method name (like ${method} or ${name}) instead of a constant like foo, Eclipse will highlight it and let you paste or type or complete over it. Then when you hit return or tab, it will jump the cursor to the end (the position indicated by ${cursor}
Unfortunately I don't think Eclipse provides a "real" template variable for selecting methods in scope. It would be nice if it would let did completion for you on methods.

Custom content assist for default java editor in Eclipse

I'm currently trying to develop an Eclipse Plugin to support code replacement, like what the default content assist in Eclipse do. What I want to implement is something like "insert argument names automatically on method completion with visualized box around the argument" and I can "use the Tab key to navigate between the inserted names" and "while navigating, list of optional variables for current argument can be displayed and be chosen".
In short, it comes to two questions:
How to add the visualized box around the already existed variable or even Java keywords that need replacement? And at the meanwhile I can use Tab key to switch between these boxes.
How to display a list of candidates to select from when I trigger on the box?
By now I only figure out the extension point : org.eclipse.jdt.ui.javaCompletionProposalComputer may be useful, but I have no idea where to start at? Thanks in advance.
Oh, finally I've solved it myself...
For the 'box', it should be the LinkedModeModel, this class should work with LinkedPositionGroup and LinkedPosition to add mutiple boxes. And we should use LinkedModeUI to set it up.
For the content assistant, there's no need to use the extension point. There is a ProposalPosition class which extends LinkedPosition for you to add your proposals for the 'box' in its constructor. And we can simply use the CompletionProposal to construct a ICompletionProposal array as the argument of ProposalPosition's constructor.

Eclipse Kepler Content Assist Customization

Is it possible to customize how it searches for methods and fields, for example:
JFileChooser j = new JFileChooser();
j. //I begin to type here and then it lists all the different methods and fields
Now lets say for example I begin to type Dialogue, the Content Assist will show DIALOG_TITLE_CHANGED_PROPERTY but it will not show ShowOpenDialog is there a way to customize the Content Assist so that it will more liberally search the middle and end of the words rather than just the beginning?
There is an open bug/feature request in the eclipse bug tracker for that: https://bugs.eclipse.org/bugs/show_bug.cgi?id=350000
It is mentioned that this feature is included in the Code Recommenders plug-in.

typo3: what is the fast way to find which page has certain extension

I want to find which page has installed this extension: jc_register, I can check every page, but it takes too much time since there are many pages, so I wonder if there is any fast way to find it instead of checking every page?
If you mean you want to find a content record of type "Insert Plugin" set to a particular extension, you can use "Admin tools".
Open "Admin Tools -> DB check".
Select "Full search" from the drop-down list.
Select "Advanced query".
Tick "Use formatted strings, labels and dates instead of original values for results". This will give you page titles in the results when pid is displayed.
Set the query so that it finds your plugin and lists the page IDs (which means that the "Select fields" must contain pid).
Note: Tested in TYPO3 4.5 LTS and might not work in later versions.
Hi the extension name is located in "tt_content.list_type" field. So something like this should help you:
SELECT tt_content.pid,pages.title
FROM tt_content JOIN pages ON tt_content.pid = pages.uid
WHERE tt_content.list_type LIKE '%register%'
ORDER BY tt_content.uid DESC
gl
If you need to do it more often, you might consider the extension backendtools: http://typo3.org/extensions/repository/view/backendtools
It offers an extension listing with search functionality and links to the according page.

eclipse - how to change package explorer sorting order (don't want lexicographic sorting)?

Is there a way I can have it:
Sonication1,
Sonication2,
Sonication3...
I think you can't. Change naming if possible: Sonication01, Sonication02, ..., Sonication10, Sonication11 to get wanted order.
I believe that it is possible but it is a long and manual process.
You can select the properties of the Java project and click properties. Then, go to Java Build Path and selecting 'Order and Export.' There, you would move the wanted file up and down using the buttons and clicking apply.
I hope that this would answer your question.