How to add custom classes to react-draft-wysiwyg - draftjs

I want to be able to add a custom class to a block or selected text. How do I do that?
I didn't find a way to add any custom block types.
When adding custom toolbar buttons, I didn't find a way to insert html, only plain text.

Related

Is it possible to put my own custom control or composite inside listviewer of Jface

I wanted to display list of custom controls or composite in a list .I was thinking to use listview But I stumbled that listview only supports text or image it does not support to put composite inside (Even I see its same with atble viewer too .Is there any way this can be done
You can accomplish that, with some extra effort, have a look to this:Snippet
https://github.com/eclipse/eclipse.platform.ui/blob/master/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet010OwnerDraw.java
in the "CountryEntries classes" you can find different methods that draw the parts:
drawFlag
drawName
drawCupYear

How can I customize partstack header in rcp application

I am trying to customize PartStack header of a view in rcp application. My goal is to customize the coloring of the header and to add date and time to it and hide minimize and maximize buttons. Buttons can be hidden using css but other goals give me hard time. At the moment I am looking to use a custom renderer by overriding some methods in StackRenderer class. Is that a right approach or is there another renderer that I shoud use?
If you don't want the min/max buttons then do not include MinMaxAddon in the Add On list in the Application.e4xmi.
Using a custom renderer for StackRenderer is useful for changing the text of the part tabs items. If you want to put text elsewhere on the part stack line you will probably need to look at the MinMaxAddon to see how it does that.

Steps for creating a custom view

How can I create a custom view with a custom style? I have many TextView's in my layout and its kind of difficult to manage all of them. I want to group them in a custom view with custom look (a box with rounded corners) and in my code just give the values to the custom view code to handle it itself.
What I am looking after is something like:
Can someone plesae tell me the steps to create such custom view with rounded box and few TextView's inside it?
Two approaches:
You can create a layout for your view. You need to take different layout widgets like textviews etc. and assign them values.
You can use canvas to draw such view.
The proper way is to inherit from View. Either programatically or in designer You assign any layout to this view. To the layout You assign Your elements ( TextViews, whatever ).
Create methods in the derived View class which fill the inner elements, something like getters/setters, like properties in c#. Those are public.
Then place Your custom compound control onto Your main view.
I for myself created a column orientated tablecontrol with custom scrollbar this way ( but pure via code ) and it works very well. Ah, and additionally You can draw shapes on Your derived view, which allow You relatively simple to apply round corners, and even color transitions.
I'm assuming you're using eclipse to create your android project.
Go to your src file and create a new layout (relative layout works best here). There is a visual representation of the layout you're creating so you should be able to play around with it. Drag and drop the textviews where you want them and give them unique names. Then in your java code, call the textviews like:
TextView text = (TextView) findViewById(R.id.textview_name_here);
text.setText("Your Text Here");
There are plenty of examples online.

How to add image to a table column in Wicket?

I am creating table with AjaxFallbackDefaultDataTable. I want to add image to each column and when user clicks any column for sorting, I want to change this image.
Is this is possible?
This is probably best handled by css.
If you look at this example of an AjaxFallbackDefaultDataTable, you'll note that with no work at all, the headers change background color when clicked.
This happens because of wicket-defined css classes "wicket_orderUp", "wicket_orderDown", and "wicket_orderNone" on the header set by the callbacks when you click on columns, and some default css supplied by wicket.
If you create css that sets a background image for these classes, possibly qualified by other css hierarchy if you don't want it everywhere, you should be able to get changing images with no Java code.

Best approach for adding non-web links to UITextView

I am creating a dictionary-style app that presents a tableview full of words, and when a word is selected, a UITextView is displayed that shows the definition of the word. What I would like to do is add a line that says "See also: synonym1, synonym2" where synonym1 and synonym2 are links that will take the user to the definition for the synonym that is touched.
What is the best way to add these dynamic links? Buttons? Somehow add a small UIWebView a UItable on the fly?
Thanks!
I would replace your UITextView with a UIWebView and use that contain your description text and your links. It's fairly trivial to generate HTML on the fly for something like that.
You could register a custom URL scheme for your app, or you could intercept links as they're clicked.
If your links are always grouped together there's no reason why you couldn't use a bunch of UIButtons inside a custom view, but then you'd have to handle layout and wrapping on your own. It seems a lot easier to do it in HTML.