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

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

Related

Customize TinyMCE Code Editor

I use TinyMCE (with react-tinymce moudle on npm). I need to customize the HTML code editor, so that it looks like the one on Wordpress. I think it should be possible as Wordpress use TinyMCE.
What makes the editor on Wordpress comfortable is we don't need to enter <br> or <p> on code editor. But when we switch to visual mode, it will add <br> or <p> automatically. That makes the text looks much cleaner and easier to read.
Another question is how to make the code editor not displayed in a popup. The main problem with the popup is it will be closed when we accidentally press esc or the cancel button. In addition, the Wordpress code editor also has a toolbar, while the default TinyMCE code editor is just a textarea on a popup.
The code plugin that comes with TinyMCE places the HTML code is a separate window - there in no configuration option that will allow the code to appear directly in the editor's main window.
If you'd like to submit this as a feature request, TinyMCE has a place for that:
https://community.tinymce.com/communityIdeasHome

Is there a shortcut for color chooser in NetBeans?

Is there a shortcut for color chooser in NetBeans?
I found this same query on NetBeans website, it was said that this was possible but I can't find an actual answer how to do it.
I mean this: when I am in a CSS file and I am editing a property that involves a color, the color chooser pops up automatically. I would like to have the color chooser pop up on demand when I am editing any file (e.g. a PHP file). It would be very helpful.
I already looked in Options -> Keymap and there seems to be no shortcut containing the word "color".
Thanks.
In the editor, click the text representing the color (you don't even have to highlight the whole thing), then hit Ctrl+Spacebar.
While it's not ideal in Netbeans 8.0.2 you can do the following:
open any CSS file that contains a rule with a property that takes colour as value and place the cursor inside the declaration block of that rule,
in the top menu click on Window -> Web -> CSS Styles,
click on the dropdown with colour values and scroll right to the top,
click on Choose Color and a colour chooser will appear.
You can now close the CSS file (if you like) and open any type of file - the CSS Styles window will stay and you can repeat the above procedure starting from step 3.
P.S. Netbeans has a bug tracker that is not just for reporting bugs:
Issues = Bugs, Feature Requests, and Enhancements

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.

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.

How to Display Current Function in Eclipse

I miss a certain functionality in Eclipse. I would like to know the name of the current function the cursor is currently inside. This is useful when browsing unknown code using the search function, for example.
Any idea how to show it? Maybe a plugin?
I'm using the "Toggle Breadcrumb" option from toolbar:
It shows a nice breadcrumb, ending with current function name.
It's quite handy for me, as Outline becomes cumbersome to use if you have zilions of functions.
It produces the following structure above your Java Editor (truncated at the picture below):
The "Outline" view shows the current function.
It may be necessary to enable the 'Link to Editor' option in the Outline View dropdown menu. This might be off by default for CDT.
I was looking for something similar (Xcode-like bar at the top showing the current function, where you can also go to another function by clicking on it to open a popup list of functions). Here is what I settled on with Eclipse 3.5.1 CDT:
I moved the Outline view to the top, resized it to make it a 1-line horizontal strip (don't make it too narrow), and selected "Link With Editor" in its menu, so that it always shows the current function. However, this doesn't open a popup list like Xcode. For that functionality, I assigned a shortcut to the "Show Outline" command which does open a popup list of all functions.
The Eclipse function 'show outline' will pop up a list of outline objects, and it will highlight the object your cursor is inside in grey. It's typically bound to 'ctrl-o' (the letter 'o', not zero), but you can re-bind it as you see fit. I'm running Eclipse with the CDT plugin and it works pretty well for me.
To enable the breadcrumb invoke Toggle Java Editor Breadcrumb in the toolbar or press Alt+Shift+B in the Java editor.
You can also display the Quick Outline (ctrl+o). This way you see the context quickly without having to have a permanent Outline Window linked to the Editor.
Use the "Link With Editor" option on the outline menu
Press Ctrl+o (cursor is currently inside a function at a particular line).
It highlights the current method, or name of the class if the cursor is outside the method body.
You can click on highlighted method.
It has got inline search feature ...start typing name of the method to navigate to the specified method or method with matching search pattern.
If you press again Ctrl+o to shows the inherited members/methods.
Using outline with "link with editor" option worked also for me, thanks!
Just an addition, you can move outline pane in to the same window group as search, progress etc. saves the space in your perspective instead of keeping it at another group.