SWT StyledText text completion ability - swt

Is there a way to add ability like code completion in eclipse to StyledText widget. I have a list of possible string inserts which depend on previous text.

greg-449 were right. I found very useful example SWT Completion Editor

Related

How to cancel focus() of Grav build-in CodeMirror editor

I would like to add my custom WYSIWYG-editor with my plugin over Grav build-in editor without removing the last.
I append my editor as a divider with contenteditable="true" to .CodeMirror-lines > div as the container where is also build-in .CodeMirror-code editor divider. And my editor is above as layer (z-index is higher).
But when I click the area, the build-in editor is focused and not mine.
I've viewed the codes of both user/plugins/admin/themes/grav/js/admin.min.js and user/plugins/admin/themes/grav/js/vendor.min.js to find the row(s) which is(are) responsible for such focusing, but I can't.
Could someone help to cancel this focusing?
Ok, to resolve the problem it's enough to append my editor not to .CodeMirror-lines > div, but to .grav-editor-content divider

How to highlight MenuItem programmatically in SWT

I open a context menu programmatically. Now additionally I would like to highlight the first menu entry.
This highlighting happens when I move with the mouse over the context menu or press the arrow keys on the keyboard. I am interested how I can trigger this programmatically.
I know the API of MenuItem does not offer this feature out of the box. So I tried to fire some MouseEvents of the type MouseOver and MouseHover, but without any success.
Has anybody an idea how to implement this feature?
I am not sure if you can change menuitem highlight colors, I haven't seen any previous example before. Look at this though: Change eclipse menuitem color
If you want to simulate what the user does and if you happen to know the location of the menu item, you can use Display#setCursorLocation() to position the mouse pointer over the menu item.
Note however, that if and how a menu item is highlighted is platform specific.
You should not use this method other than for demonstration of test purposes. If your application needs to highlight or preselect an entry in a list of choices,
you should probably use another widget. If you more describe your use case, we may be able to find a suitable widget.

Create jdt look like custom tool tip for GEF canvas objects

I have a graphical representation for my model, and I want to implement a tooltip that look like jdt tooltip in the following :
- the tooltip shows up when hover over the object in the canvas
- being able to click on the tooltip window to focus, and scroll bar is there if needed.
- Ability to resize the tooltip window after the user change focus to it
- being able to assign command with F2 keybind to pop up the tooltip window (I know how to create command, and how to associate keybind with it)
- Ability to have hyperlinks in the tooltip text ( optional )
I do not know from where to start.
Which eclipse interfaces/classes to implement, extensions to add, adaptors to support.
I tried to find a work through tutorial but I could not.
Thanks in advance
A lot of what you describe is specific to the Eclipse Text editor and JDT code so won't be available in a Canvas so you would have to write your own code.
You can create a tooltip based on org.eclipse.jface.window.ToolTip. If the tooltip contains StyledText you can create hyperlinks.
There is an example of a fairly elaborate custom tooltip Here
What Eclipse does when the tooltip is clicked is open a new normal window of exactly the same size and contents over the tooltip and close the tooltip.

GTK Widgets needed to implement auto-completion for Gtk TextView

I am a novice at using GTK widgets. I want to show a autocompletion drop-down when user types something in GTK-TextView. User should be able to select the preferred item from the drop-down Menu using keyboard or mouse. In case of GTK-TextEntry, we have built-in support for autocompletion. I want something similar for GTK TextView. Example code would be really helpful.. thanks..

How to add text hovers for generic eclipse editor- generic text hover for all text editors

I want to display a text hover functionality in Eclipse editors without contributing a new editor. That means my hover functionality shall work on CDT editor ,JDT editor (java editor) and all other text editors.Is their any generic extension point is present for this purpose ? I know, for java editor org.eclipse.jdt.ui.javaEdit or TextHovers is there and for CDT editor org.eclipse.cdt.ui.textHovers is there. But I want the hover shall work in all type of editors. is there any extension point present for this?
Thank you in advance.
I think what you are looking for is the org.eclipse.jface.text.ITextHover extension point and then write a class that implements ITextHover which allows you to specify an IRegion for areas where the hover should be displaye dand then another method for displaying hover text based in cursor position.