How to customize a toolbar in Eclipse? - java

I am trying to customize Eclipse to speed up development and minimize distractions for Android Java development.
I am using SourceGear Vault for source control and installed the plugin for Eclipse. So to check stuff in/out, I have to right click on the Project/File, go to Team submenu, then pick a source control command (Check In, Check Out, Get Latest, etc...). I find this process slow. I'd like a button on the toolbar and a keyboard shortcut to do these operations.
I tried going to Customize Perspective, but under Team toolbar, there is only Synchronize command.
And I have no idea how to setup a shortcut for the SCC operations either as they are not present in Shortcuts tab.
Am I missing something simple?

(Revised)
Look in the Command Groups Availability tab of the dialog you get when you do the Customize Perspective and you should see an entry related to your VCS; turn this entry on and then go back to the Toolbar Visibility and you should see more stuff (under the name of the VCS). The Team area is not going to have what you want; the commands are grouped by the VCS name, like git, SVN, etc.
Sorry for the initial answer, I mis-read part of your question.

Eclipse Photon
Window
Perspective
Customize Perspective
Now you can check and uncheck checkboxes to customize the buttons that show up.
Tested on Photon Release Candidate 3 (4.8.0RC3).

I find that if you are currently using a base perspective that comes standard with the Eclipse install you need to: "Window -> Save Perspective As..." first. Then you can just customise the tool bar as you please.

Related

Context sensitive menu in eclipse editor

If I use eclipse and right click on a part of Java source code, the context menu depends on the syntactic element the user clicks on (like: a method, a variable,...).
How can I implement this kind of behaviour in my own eclipse plugin, e.g. add an item to the context menu only if the user clicks on a method in Java source code. Furthermore, the plugin needs to know which method the user clicks on.
I guess I have to relate the clicking position to the abstract syntax tree that eclipse builds but I have no idea how to do that.
You do this with Eclipse Commands and you can enable them and change their visibility in many ways, depending on selection, global state, etc.
I guess I have to relate the clicking position to the abstract syntax
tree that eclipse builds but I have no idea how to do that.
The good news is you (generally) don't have to do that, Eclipse has done all that heavy lifting for you.
It is quite a broad subject, so I suggest working through some tutorials on Commands first:
Adding menus, toolbar and popup menus to the Eclipse IDE - Tutorial
Eclipse Commands Advanced - Tutorial

How to make dock-able plugins for NetBeans IDE in Java?

I have created one analogue clock with Java. But i want to make it dock-able in NetBeans IDE (like shown in the screen shot).
like the left side navigator, files, bottom tasks are hidden, once i press it it shows in left or bottom
Any help on this, how can i tell my NetBeans plugin to act like dock-able? After making it working i would like to publish it to the community plugin.
This is not too complicated using the NetBeans Rich Client Platform. Follow this tutorial - http://platform.netbeans.org/tutorials/nbm-paintapp.html#impMod
Basically, you'll create a ClockTopComponent using the wizard. TopComponents automatically get nice windowing features for free, like docking, hiding, tiling, etc.
FAQs about TopComponent

IntelliJ show JavaDocs tooltip on mouse over

In Eclipse, when hovering over a method, variable, etc. a tooltip is displayed with the corresponding JavaDocs. Is there such a feature in IntelliJ?
For IntelliJ 13, there is a checkbox in Editor's page in IDE Settings
EDIT: For IntelliJ 14, the option has been moved to Editor > General page. It's the last option in the "Other" group. (For Mac the option is under the menu "IntelliJ Idea" > "Preferences").
EDIT: For IntelliJ 16, it's the second-to-last option in Editor > General > Other.
EDIT: For IntelliJ Ultimate 2016.1, it's been moved to Editor > General > Code Completion.
EDIT: For IntelliJ Ultimate 2017.2, aka IntelliJ IDEA 2017.2.3, there are actually two options:
In Editor > General > Other (section) > Show quick documentation on mouse move - delay 500 ms
Select this check box to show quick documentation for the symbol at caret. The quick documentation pop-up window appears after the specified delay.
In Editor > General > Code Completion (sub-item) > Autopopup documention in 1000 ms, for explicitly invoked completion
Select this check box to have IntelliJ IDEA automatically show a pop-up window with the documentation for the class, method, or field currently highlighted in the lookup list. If this check box is not selected, use Ctrl+Q to show quick documentation for the element at caret.
Quick documentation window will automatically pop up with the specified delay in those cases only, when code completion has been invoked explicitly. For the automatic code completion list, documentation window will only show up on pressing Ctrl+Q.
EDIT: For IntelliJ Ultimate 2020.3, the first option is now located under Editor > Code Editing > Quick Documentation > Show quick documentation on mouse move
Up until IntelliJ version 11, no, not just by hovering over it. If the cursor is inside the method- or attribute name, then CTRL+Q will show the JavaDoc on *nix and Windows. On MacOSX, this is CTRL+J.
Quote: "No, the only way to see the full javadoc is to use Quick Doc (Ctrl-Q)." -- http://devnet.jetbrains.net/thread/121174
EDIT
Since IntelliJ 12.1, this is possible. See #ADNow's answer.
It is possible in 12.1.
Find idea.properties in the BIN folder inside of wherever your IDE is installed, e.g. C:\Program Files (x86)\JetBrains\IntelliJ\bin
Add a new line to the end of that file:
auto.show.quick.doc=true
Start IDEA and just hover your mouse over something:
After doing CTRL+Q, you can
Pin the tooltip (top right corner)
Check Docked Mode (under gear in top right after pinning)
Size as desired
Click icon for Auto show documentation for selected item
Then when you move your cursor, the documentation will appear in this box. It costs you a little screen real estate, but I find it's worth it.
I'd post a screenshot but SO won't let me post images.
For Intellij 15, use the checkbox in File > Settings > Editor > General option Show quick documentation on mouse move.
You can also get there by typing "quick" or something similar in the search box:
In Intellij13, you can use Editor configuration like below:
IntelliJ IDEA 14.0.3 Ultimate: Press Ctrl+Alt+S, then choose Editor\General choose Show quick domentation on mouse move
Tips: Look at the top right conner (gear icon) at JavaDoc pop-up window, You can choose:
- Show Toolbar
- Pinded Mode
- Docked Mode
- Floatting Mode
- Split Mode
Adding on to what ADNow said. On the Macintosh:
Right click on IntelliJ IDEA 12
Click on the Show Package Contents menu option
Open the bin folder
Open idea.properties
Add the line:
auto.show.quick.doc=true
The easiest way, at least for me, was:
Ctrl+Shift+A
Type: show document
Show quick documentation on mouse move (set it to ON)
From IntelliJ Ultimate 2018.1.5, aka IntelliJ IDEA 2018.1.5, till 2019.3 , there are actually two options under File -> Preferences:
In Editor > General > Other (section) > Show quick documentation on mouse move - delay 500 ms
Select this check box to show quick documentation for the symbol at caret. The quick documentation pop-up window appears after the specified delay.
In Editor > General > Code Completion (sub-item) > Auto-display documentation in 1000 ms
Select this check box to have IntelliJ IDEA automatically show a pop-up window with the documentation for the class, method, or field currently highlighted in the lookup list. If this check box is not selected, use Ctrl+Q to show quick documentation for the element at caret.
Quick documentation window will automatically pop up with the specified delay in those cases only, when code completion has been invoked explicitly. For the automatic code completion list, documentation window will only show up on pressing Ctrl+Q.
In IntelliJ IDEA 14, it has moved to: File -> Settings -> Editor -> General -> "Show quick doc on mouse move"
In Intellij 2019, I did: File > Settings > Editor > General option Show quick documentation on mouse move.
File-->Settings-->Editor
Check "Show quick doc on mouse"
Now when you put the mouse over a method a tooltip with the documentation will appear. Sometimes the tooltip size is too small and you will have to resize it moving the mouse down to the bottom of the tooltip.
IDEA has "find action":
Open "Help" menu, type "doc", move cursor to "Quick Documentation" it will be highlighted.
Also "find action" can be called from hot key (you can find it in settings->hotkeys)
On mac in IntelliJ Ultimate (trial) 14 I have mine under Settings > Editor > General > Code completion. The tooltip short is F1 on my laptop.
It's called "Autopopup documentation in (ms):"
A note for Android Studio (2.3.3 at least) users, because this page came up for my google search "android studio hover javadoc", and android studio is based on Intellij:
See File->Settings->Editor->General: "show quick documentation on mouse moves",
rather than File->Settings->Editor->General->Code Completion
"Autopopup documentation in (ms) for explicitly invoked completion"
and "Autopopup in (ms)", which has been previously talked about.
I tried many ways mentioned here, especially the preference - editor - general - code completion - show documentation popup in.. isn't working in version 2019.2.2
Finally, i am just using F1 while caret is on the type/method and it displays the documentation nicely. This is not ideal but helpful.
In 2020.1 there is in editor javadocs rendering has been added. Screen shots borrowed from intellij documentation.
On my IntelliJ U on Mac I need to point with cursor on some method, variable etc. and press [cntrl] or [cmd] key. Then click on the link inside popup window which appeared to see JavaDocs
All of the above methods are useful but one basic thing missing you need to have src.zip in your JDK (C:\Program Files\Java\jdk1.8.0_171). I assumed it comes preinstalled but for some reason, it was not present in my installation. Another thing to check is if your project is using the specified (1.8.0_171 in this case) JDK.
The answer is CTRL + P (NOT CTRL + Q)
Someone else posted this answer on JetBrains forum:
The idea is a different IDE. Try to discover its features and try to make the best of it, rather than trying to emulate whatever you used before.
For the most part, Idea has very high usability (much better than Eclipse IMHO) and is streamlined for supporting code editing as best as possible (rather than relying on wizards too much for example).
Javadoc: Ctrl-Q
A quick view of the implementation: Ctrl-Shift-I
Show context: Alt-Q
Show parameters (in a method call): Ctrl-P
Show error description. Ctrl-F1
... plus many more shortcuts to navigate in code and different idea views.
I think it rather nice that you can see just the specific bit of information you are interested in with a simple keystroke.
Have a look at the menus which will also show the possibly modified shortcuts for your keymap.
0
Avatar
Jens Voß
Created June 12, 2008, 09:26
And, elsandros, in addition to what Stephen writes: Since you seem to be interested in IDEA's keyboard shortcuts, I highly recommend the "Key Promoter" plugin which helps you memorize the relevant shortcuts quickly.
Also very useful is the "Goto Action" feature, invoked by Ctrl-Shift-A. In the popup, you can enter a keyword (e.g. "Javadoc"), and the IDE tells you the available actions matching your search, along with keyboard shortcuts and the containing action groups (which often also give you a clue about how to navigate to the action using the menu).

Eclipse RCP: Why is the view missing when running as a Product?

I'm brushing up my Eclipse RCP skill by trying to enhance my one-year-old side RCP application. This application has one perspective, and this perspective has 3 views, and I'm adding another view into the same perspective. To add this new view, I added it in the MANIFEST.MF file under Extensions tab and created the Java file for it.
When I run it as an Application, it works. I see all 4 views in the application. But, when I run it as a Product, that new view is missing. It almost seems like the new view is not registered in the Product. There's no error in the console log either. I think I must be missing a step here, but I can't seem figure out here... pretty frustrating!
Note: The views are added into the perspective programmatically (in Java code), not through MANIFEST.MF file. I just realized that even when I change the existing view's layout (ex: size, or location), it doesn't get reflected when running as a Product either, but it works when running as an Application... sigh!
Note: I commented out all the code in my perspective class, in another word, all the views are removed from the perspective. When I launch the Product, I'm still seeing 3 views in the application. I'm thinking there's something to do with caching, but I'm just bummed now.
Any helps are greatly appreciated here! Thanks much,
Okay, after aimlessly clicking around, I figured out the solution. The workspace data needs to be cleared to pick up changes from the perspective.
To do so...
Right click the product file
Choose "Run Configurations..."
Under "Main" tab, check "Clear" checkbox and "workspace" radio button.
Run it.
Hope this will save some of you from troubles.
I've been bitten by this a couple of times until I figured out the easiest workaround: it's sufficient to reset the perspective. There are two ways to achieve this:
Right-click on your perspective in the perspective selector bar at the top right and click on Reset.
Switch to your perspective and then go to Window | Reset perspective....
After that, the changes to your perspective should be picked up.

How to run arbitrary server software from Eclipse?

I am developing a Flex-based game, and struggling with SmartFox Server.
Anyway, it's a java-based server for Flash platform games, and it's kind of clunky to develop with on Windows. So, I want to be able to start it (and stop it) via Eclipse rather than the current batch file nastiness they provide.
The problem is I've never done that with a non-standard server that didn't just have a server adaptor in Eclipse.
I know it should be pretty simple, but how do I do it? It's really just a matter of calling a command line executable with some arguments, or even just running it as a Java application without its executable shell. Killing it would just be a matter of killing the process in Eclipse.
Also of note is that I want to make sure I have the shell output in Eclipse for debugging purposes.
I would think you could run it as an "External Tool" from Eclipse (the little green arrow with the toolbox). Click on the menu arrow to the right of that icon and select the "Configure External Tools" option.
You can then right click on the "Program" tree-node (on the Left hand side) and select "New" to create a new configuration. You will need to fill in the values similar to what you would do if you were running the server on the command line.
Give your configuration a meaningful name, like "SmartFox" or something.
Location is the command that is run (might point to java in your case).
To get the console setup, click on the "Common" tab and the "Allocate Console" checkbox should already be checked.
Once you are done, press the "Apply" or "Run" button.
You can then start the server by selecting it from the "External Tools" list (same icon as earlier) and you can stop it using the red stop icon on the console (should work).
Optional... the other tabs of the configuration dialog may be useful. You might want to have the build tab not do a build before launch, depending on how you have things set up.
What this wont give you (necessarily) is the tight integration between the server and Eclipse. You may have to do additional configuration or just deploy your code to the server as necessary.
Hopefully I am not way off base of what you were looking for.
Good luck.

Categories

Resources