Library for eclipse style tooltips? - java

Does anyone know of an open source swing tooltip library that works like eclipse's tooltips? Specifically, the functionality I'm looking for is a tooltip that acts like a regular tooltip, but persists when you press F2 (or some key) so that you can copy the contents to the clipboard.
Thanks.

Not tested myself, but maybe the JCustomTooltip (based on the javax.swing.JToolTip class)
of prefuse.org:
setPersistent(boolean inter)
Sets if the tooltip will stay persistent on the screen to support interaction within the tooltip component.
Since the sources are available, that could be a starting point to code your own version.

Related

Scrolling through Netbeans code assistance list without mouse or keyboard arrows

This is basically the same question as this except for Netbeans 8.0.2 (running under jMonkeyEngine SDK 3.1-alpha1) instead of Visual Studio.
Honestly, the aforemetnioned link says it better than I can, but basically I'm a vim key binding user, and have the netbeans jVi plugin installed and want to map, for example, alt-j and alt-k to scroll through the code completion list instead of the arrow keys:
I've searched through Tools->Options->Keymap, as well as the the JVi configs at Tools->Options->jViConfig. I don't see anything at all under jViConfig, so I think the standard NetBeans key bindings are the way to go.
I have tried modifying most of the obvious down keys e.g insertion point down, scroll down, page down etc, but they all affect the underlying text in the editor, never the completion list.
And:
Does anyone know of a way to do this?
Or maybe a plugin to provide the functionality?
It simply appears that the raw arrow key movements are not mappable by netbeans (?).
Note: this is possible to do in Visual Studio 2015, so I'm hoping it's possible in NetBeans as well.
Many Thanks.
AFAIK, there is no way to do this in NetBeans. At least there wasn't in 2010, when I filed the NetBeans bug hint completion makes assumptions about associated editor pane bindings. I maintain jVi. I filed the bug since I was having trouble with completion bindings for some special keys. In the NB source take a look at
editor.completion/src/org/netbeans/modules/editor/completion/CompletionScrollPane.java
And you'll see a bunch of hardcoded stuff.
In the jVi source
nbvi/nbvi-module/src/org/netbeans/modules/jvi/KeyBindings.java
method fixupKeypadKeys, you see what jVi does (given the fix for the bug I filed). This is part of some arcane code that depends on being friend with some NB editor package.
You could file a bug with NB. If you provided NB a patch, they might incorporate it. If you file a NB bug, cc me (err at netbeans.org)
Alternately, you could try adding some code to the jVi file to add your keybindings.

Eclipse Plugin Development: Extending default Java Editor/Text Hover

I've been trying develop my custom plugin for Eclipse, and basically I want to make is a "richer" version on the current TextHover. I don't know what widget(?) Eclipse uses to display the hovering text, but I want to use something different, like SWT Image or SWT Browser.
Most of the tutorials that I've read suggest that I have to implement my own Java Editor to do this, but I don't want the user to switch to my custom editor just for a simple feature (and I don't want to implement a whole editor).
Some Tests:
I've already created two Eclipse Plugin Projects. The first one is a extension for the JavaEditorTextHovers, and with this project I managed to show some custom Strings when hovering some random texts, but wasn't able to change the hover appearance. The second project was a editor plugin. With this last one I managed to get a Browser to appear when hovering a random text(this tutorial helped me), but again, this editor had nothing, no syntax coloring, no rules, etc., and for the previous reasons, I couldn't accept this has a solution.
Maybe if there was way to change the (or set a new) SourceViewerConfiguration of the current editor I could pass my custom SourceViewerConfiguration, but I'm not sure if this is possible.

Auxiliary arrows in forms like in Eclipse

When you open a dialog in Eclipse, where is a form layout, you can see that when you hover your mouse over some item, its label or space between them, there's an auxiliary arrow shown. Screenshot:
My question is: is there any (simple) way to achieve the same in Java with SWT and JFace?
Regards
No there is no standard way to achieve this through SWT or JFace, as it is not a built in feature. It is not that difficult to add on your own though.
Have a look at this ConfigurationBlock.java file from the PDE source. This class is the base for all option blocks in PDE preference pages. This exact same code snippet is also used by JDT but it has a different copy in OptionConfigurationBlock.java.
The method that gets called for each combo control is ConfigurationBlock#addHighlight(..), which is responsible for adding the highlight when the control is in focus or when mouse is hovering over its label.

How to create a "help / information bubble" with netbean

I'm trying to create a GUI with netbean, and I've created a tool bar with different icon. What I want to do is this: When you mouse over one of the button I want a little text bubble to appear with text that I will have specified.
I've been searching the web for a while, and all I could find was something about this package: "org.openide.awt" wich contains (in theory from what I've read) NotificationDisplayer.
If this thing really works with java and netbeans well, I can't get it to work. All I need to know is does this package is actually netbean/java compatible, or better, if there is a simpler way to display a text bubble.
A tool tip?
The JComponent API has support for that.
Check if this is what you need:
How to Use Tool Bars
ie:

Eclipse text-editor drag-and-drop mouse click key combination

In the Java source editor in Eclipse, you could select a block of code, pick it with a mouse click and drop the block of code into another area of the code.
You can't do that for other text editors like XML, HTML, etc. I had to press a key combination before I could use the mouse to move and drop the selected text. I have a new Eclipse set-up now and I can't recall what the key combination is. I tried ctrl-shift, ctrl-alt, alt-shift, and ctrl-shift-alt. None of them work. I had drag-and-drop enabled.
Is there something else on Eclipse that I had installed in my old Eclipse set-up that I forgot to install in my new Eclipse set-up? It shouldn't be because the text editor config has a check box for "enable drag and drop" which I enabled.
Of course, if you are one of those guys who wrote the eclipse text editor, you should also answer this question:
why did you not make the other text editors behave like the Java code editor? Why did you make us into having to do a key-combination to perform drag and drop for the other editors? What's wrong with having all the editors exhibit the same behaviour?
I woogled and googled and could not find any eclipse manual that would tell me what the key combination is. I also could not find it in the local help files. If you required us to use key-combination, why did you not document that in a manual?
My apologies, but I realise I sound a little frustrated now.
The text DnD (Drag and Drop) feature (initially introduced by bug 11624 in 2007) has been slowly extended to various editors, as reported by the bug 231294:
Tested in EclipsePdt-2.2.0.v20100427
Verified fixed for:
PHP files
JS files
Still reproducible in:
CSS files
HTML files
XML files (source view)
So it is still "work in progress".
The relevant blocking issues are:
bug 178104: [DND] Need to revisit dnd API to allow multiple drop targets
bug 173405 Make use of IDragAndDropService (Show Votes)
bug 195655 Drag'n'drop selected text

Categories

Resources