Change Style of mxCell - jgraphx

I have to re-engineer a Java program which uses the old version 5 of JGraph. I have to replace this package with the new version 6.
It was possible in version 5 to create a cell with an HTML-Object, so I could change the style of a cell into a style which looks like a database table.
Is it possible to change the style of a mxCell like this with user object oder other methods in the new version?

You can create custom vertices that may use any Swing components when rendering. Create a custom vertex that uses a Swing component that supports HTML (and a good number of them do). Displaying the HTML label string directly to the component will cause it to render the HTML correctly.

Related

Toggle vue2-editor view content to html

I am using vue2-editor and i want to toggle the content view of the editor like ckeditor or mailchimp editor does
It is possible using vue2-editor or quill?
You can have a computed property that either returns the actual text or uses a library like hypertext to generate html, the return value of the html would be contingent on another computed property and returns the html you want.
I also have a simpler solution, which I used once but need to take a look at my code in a few hours which is not in front of me.

How to extend the Image plugin in ckeditor5 with custom elements?

We're evaluating an upgrade from ckeditor 4 to the new ckeditor 5, but I need to be able to extend the Image plugin/package with some custom elements, e.g. a text input for licensing information about the image, a button/checkbox for toggling the image to be a thumbnail or not etc.
How can I add these custom elements in the image package and write my own javascript code to handle the values from these elements?
The image toolbar is being controlled by the config.image.toolbar property. It accepts names of UI components registered in the editor.ui.components factory. In other words, it works like the main editor toolbar which is configurable via editor.toolbar and you can learn more how to create buttons here: Creating a simple plugin.

Aurelia popover checkbox checked.bind not reflecting on the view model

We have implemented checkbox in popover. There we are using checked.bind , but in the view model its not reflecting its value on change of the checkboxes.
Sample Gist Run Provided below:
Gist Run
Thanks in Advance
Programmatically injected HTML needs to be compiled manually
The integration with bootstrap I provided to you earlier cannot do this. The bootstrap plugin assigns the innerHTML property of the popover and it does this outside of aurelia's rendering pipeline. The HTML is therefore not compiled by aurelia, which is why bindings (and other aurelia behaviors) will not work.
The templating framework takes care of this for you automatically as long as you are following conventions (such as custom elements). In any other case you'll need to manually work with the ViewCompiler.
In case you're interested, you can see an example with programmatically generated HTML in this gist. Also see this question if you want to know more about it. I do not recommend it in this scenario however.
Use aurelia-dialog
A tooltip (or popover) is just that: a tip on how to use the tool. It should not need more than some plain markup, text and styling (of course this is subjective to some degree, and some people may disagree)
For collecting user input in-between pages or screens, I'd argue a modal dialog is a better fit because of its property to "pop out" more and to de-emphasize the rest of the screen until the user either proceeds or cancels.
More importantly, by using aurelia-dialog your bindings and behaviors will simply work because, well, it's an aurelia plugin :-)

How to inject CSS into webkit?

On Linux I'm creating a webkit window which needs to display a certain URL.
I'm doing that like the following:
GtkWidget *main_window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
// Create a browser instance
WebKitWebView *webView = WEBKIT_WEB_VIEW(webkit_web_view_new());
// Put the browser area into the main window
gtk_container_add(GTK_CONTAINER(main_window), GTK_WIDGET(webView));
// Load a web page into the browser instance
webkit_web_view_load_uri(webView, "http://example.com");
// Make sure that when the browser area becomes visible, it will get mouse
// and keyboard events
gtk_widget_grab_focus(GTK_WIDGET(webView));
// Show the result
gtk_window_set_default_size(GTK_WINDOW(main_window), 800, 600);
gtk_widget_show_all(main_window);
However, I need to inject some CSS into this to hide a certain checkbox.
How do I inject CSS into the DOM.
I see that I can get the dom like
WebKitDOMDocument *dom = webkit_web_view_get_dom_document(webView);
But from here I can't see how to inject the CSS.
It sounds like the webkit_web_view_run_javascript() answer was a good solution to your specific problem, since you only needed to hide one checkbox.
To answer the general problem of how to inject arbitrary CSS: if you're using a recent version of WebKitGTK+, create a WebKitUserContentManager, call webkit_user_content_manager_add_stylesheet(), and then pass the WebKitUserContentManager when creating your WebKitWebView, either using webkit_web_view_new_with_user_content_manager() or by using g_object_new() manually if you need to set multiple construct-only properties.
Unrelated warning: webkit_web_view_get_dom_document() was removed in WebKitGTK+ 2.6. (The DOM API is only accessible via web process extensions nowadays.) You are using an old, insecure version of WebKitGTK+!
Its not clear which Webkit GTK version you are using, however concepts essentially remain same for both versions. For webkit version 2, its slightly more complicated as DOM manipulation is done on extension side.
You need to reach to the desired element - either by id e.webkit-dom-document-get-element-by-id or by name. This will return you instance of WebElement. If you use by name call, please be ware that there could be multiple elements with same name
From here you can either set the style by setting appropriate style attribute webkit_dom_element_set_attribute or other variations that can deal with styles and css rules.
Or you can take easy option and just execute the javascript that does the same thing by calling webkit_web_view_run_javascript

-webkit-transform suddently added to List elements in Sencha Touch 2.1

I upgraded from Sencha Touch 2.0.1 to 2.1 and suddently the framework adds a -webkit-transform to all my list elements which destroys lot of my layout, anyone knows why it does so and how to remove it?
See attachement:
With Sencha Touch 2.1 the list component was completly redesigned.
Quote from Realease notes:
The new List component is included with this release. This implementation replaces the old one for lists and is no longer bound one-to-one between a store and DOM elements. This means that the length of the list will no longer have a bearing on it's scrolling performance. In addition, lists can use components if you specify them with an itemConfig and itemTpl will be converted to an itemConfig dynamically if you specify one. Due to these changes, the DOM structure was altered for lists and you may need to change some css selectors to add appropriate styling for your lists. Typically you need to change the selector from '.x-list-item' to '.x-list-item > .x-dock-vertical > .x-dock-body' for any padding or margins you may have added. We have change the TouchTweets example from using a component based DataView to the new List very easily and should be a good example of using the new List component with dynamic large lists.
http://www.sencha.com/blog/whats-coming-in-sencha-touch-2-1
The redesign is the reason for the new css list elements.
I think you have to change and customize your css again for your list.