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.
Related
How to know where eclipse will open the next sub menu inside popup.
For example in Java Class file, right click and the menu appears, mouse over an item which has sub menu.
Even when there is enough space most of the time it is illusive. Is there a rule of thumb for correctly predicting eclipse behavior
cheers :)
Not sure this is what you want but you might try customizing your Java perspective: Window->Perspective->Customize Perspective...
You'll have to look through the tabs (2 of which I included) to see what can be done.
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
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.
I have created a wizard in swt/jface. and i would like to remove the wizard container bar. I checked the documentation of the wizard page but couldn't find anything. Is their is a way to do this.Here a pic to explain better
So i need to remove this red rectangaled part
The first thing I'd try would be to try returning null from the methods that populate that area of the wizard UI.
If that doesn't work, you can always look into the Eclipse implementation of Wizard and WizardPage to see what draws that area and implement your own version that draws what you want - IWizard and IWizardPage are just interfaces after all. I've done something similar (though this was a few years ago) for implementing a much more customized wizard that ended up containing a GEF editor inside it as well.
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.