issue #7549 : content editor toolbar/context menu (help for #7550)#7576
Conversation
…review Unblock PR apache#7550 by addressing the three gaps Nicolas hit: - RAP implements getLanguage() and builds the shared ContentEditor toolbar so plugin actions (Markdown preview) appear in hop-web. - BaseGuiWidgets resolves static toolbar listeners with assignable parameter types (interface/facade), so previewMarkdown(IContentEditorWidget) works when the registered instance is ContentEditorWidget or RAP widgets. - Markdown preview is a static listener taking IContentEditorWidget; dedupe content-editor i18n keys.
|
For the RCP client, it works like a charm: you're a genius and so fast! |
|
I don't know. I'm still seeing issues but perhaps I need to rebuild my Hop Web container. |
|
Flattering always works but to be completely fair it's Grok Build 4.5 doing the heavy lifting. |
Move ContentEditor-Toolbar @GuiToolbarElement handlers to a ui-module GuiPlugin (ContentEditorActions) so Hop Web registers undo/copy/etc. without loading hop-ui-rcp. - Extend IContentEditorWidget with cut/paste/undo/redo - RCP ContentEditorWidget keeps context menu + keyboard shortcuts - RAP implements new ops (Text cut/paste; Monaco no-ops for now) - Exclude hop-ui-rcp from Hop Web image (fixes Tomcat 404 startup) - Skip ContentEditorWidget GuiPlugin scan on web as defense in depth
…alog Temp file:// URLs open on the client browser, so server-side temp HTML never displays in Hop Web. Use ShowBrowserDialog for the RAP case; desktop keeps the system browser + temp file path. Also surface InvocationTargetException from static toolbar listeners instead of silently falling through to a failed instance-method path.
|
Pushed additional commits after Hop Web validation:
Verified locally: toolbars above text editors, Preview only for Markdown, Preview dialog works in Hop Web. |
Pass PropsUi dark mode into the Monaco remote widget as theme vs-dark or vs (same pattern as canvas themeId). monaco-editor.js honors the theme property on create and via setTheme.
|
Pushed: Monaco dark theme for Hop Web content editors. When the session is dark ( Try: http://localhost:8080/ui-dark → open a text/markdown file → editor background should match the dark UI. |

Summary
Helps unblock @nadment's #7550 / #7549.
Includes Nicolas's original change (shared content-editor toolbar + context menu on RCP, cut/paste capabilities on text file types) plus fixes for the three gaps he called out:
IContentEditorWidget.getLanguage()implemented on Monaco and fallback RAP widgets (CI was failing onhop-ui-rap).ContentEditor-Toolbarso plugin actions (Markdown preview) show in web, not only desktop.BaseGuiWidgetsresolves static toolbar methods with assignable parameter types (interface/facade), sopreviewMarkdown(IContentEditorWidget)works when the registered instance isContentEditorWidgetor a RAP widget. Preview is restored as that static method.Also dedupes content-editor i18n keys and adds a small unit test for static listener resolution.
Nicolas: if you prefer to keep ownership on #7550, you can cherry-pick
d221789455(or merge this branch) into7549and close this PR.Test plan
./mvnw -pl ui,rcp,rap,plugins/transforms/textfile -am install -DskipTests(includeshop-ui-rap)./mvnw -pl ui test -Dtest=BaseGuiWidgetsStaticListenerTest./mvnw -pl plugins/transforms/textfile,rcp test.md→ shared toolbar Preview works; cut/copy/paste/context menu on text.md→ Preview button visible and works