How give style for GWT CellList in Onclick event? - gwt

I'm confused by the showcase example of Cell List. Shown below is a screenshot, when I inspect the element I can see a png image is used to give a blue background for the selected cell. I cannot find any reference to such an image or css file from its source code here or from google-code. I couldn't find any injection of css or things like that as mentioned in related sof answers. Please show me where the code is or some other example code. I'd like to know how this exact scenario works, not an alternate solution to get the effect. I'm pretty new to gwt, I'm sure this is a piece of cake for the veterans out here,any clues?

It's the default styling for the CellList. You can use your own by passing a CellList.Resources to the CellList constructor.

Related

What kind of widget is this? / How to make this widget?

I've looked through every single widget on glade trying to replicate this "box/table" style seen here on Settings:
But I haven't found anything like it anywhere on Glade or on the official docs :(
The closest I've come to replicating it is through a frame without a label and with separators and custom css that changes the background color to #base-color, and although it kinda works alright in some themes:
In others it just plain doesn't work:
And I'd imagine that with more elaborate or complex themes it will look even worse.
So my questions are: What is the name of this Widget shown in these pictures? And if it does not exist or is not available in Glade, is there a way to replicate it more reliably than what I've shown here?
It is called a GtkListBox. As you can see, it takes any other widget as a child. So you have to add rows to the ListBox and then add widgets to each row.
Here is an example in Python.

Changing color of a string in listbox - MATLAB GUI

I have a list of names in a listbox. What I would like to do is have a certain selected name change color, from red to green, when I click a button.
Thank you
It is not supported officially. There are non-documented features that do it - check out http://www.undocumentedmatlab.com.
You might have already solved this, but I thought I would clarify Andrey just a bit. MATLAB GUI components can handle HTML in their properties. So, I imagine setting up your button callback to edit the properties of your listbox using HTML to change the color would be an appropriate way to proceed here. Yair Altman has a pretty good write up here: http://undocumentedmatlab.com/blog/html-support-in-matlab-uicomponents/
Granted, that example is simple, but you should be able to adapt it to fit your needs if I have understood your question correctly.

Help with / Tutorial for Styling for GWT Beginners

I am new to GWT and am having a hard time finding any good tutorials focused especially on teaching styling with GWT. The few examples I've found provided by Google are rather paltry, and don't really explain much.
Some things I'm trying to do would be:
Change the global font style
Change existing widgets' styling, such as the background color of a
selected item in a CellTree
Replace a button's text with an image instead
Remove borders of text fields
the list goes on
I've been searching and searching, and am not finding anything particularly helpful with styling, so any advice/direction would be greatly appreciated! Thank you!
Styling in GWT is done almost entirely with CSS. You can link an ordinary CSS file to your host html, as you would with a normal website, and its rules will apply just as normal CSS does with normal HTML. GWT provides a couple of ways to optimize your CSS, and that gets pretty complicated, but at a basic level you can just use Firebug to look at the HTML of your app, figure out what CSS you need from that, and throw it in your css file. GWT applies many special styles to the widgets that come built-in, and you can learn all of those style names from the generated HTML and the documentation.

Smartgwt - create a panel with title and a border

This sounds like a pretty simple thing to do but I havent been able to find an easy way to do this. How do I create a panel with a title and a border which can contain my widgets? I have seen the SectionStack class which provides this. But I dont want to create a section stack.
Window can be added to a layout and drawn. But is it the only way or is there a container class that I am missing?
Also, how does one center things? Say a textfield and a button at the center of the page. How is this achieved?
If you are using a DynamicForm, you can give it a border and title with
form.setIsGroup(true);
form.setGroupTitle(title);
This actually works for Canvas, too (which is the superclass of most widgets and layouts in SmartGWT).
(I just had the same problem, and found this question, as well as the thread Is there a "titled Border" on the SmartGWT Forums, which gave this answer. I tried and it seems to work.)
To do form-related tasks, look into DynamicForm. To set the inputs in the form, you use setItems(Item...). A text field is a TextItem. You set it's title to control the label that SmartGWT will build. To get a title for the form, the best I've come up with is to use a container canvas that will contain both the title (probably a Label element) and the DynamicForm. To center the inputs, I believe you'd need to use setAlignment on the DynamicForm.
You could create an object that is actually a VLayout that contains a Label (the tile), has a border as you need and includes a Canvas (the generic stuff you want included).
In my experience, I noticed that very often I have a DynamicForm visible, so I just add a BlurbItem control to diplay the tile and a small explanation.

GWT text inputs with spell-check like behavior?

Does anyone know of a GWT widget that works like a spelling suggestor?
Ideally it would be similar to this: http://www.polishmywriting.com/
I need a click-triggered popup on user generated text so that I can suggest replacements (I am not building a spell-checker, but something similar). I also really like the way the polishmywriting menu is set up (when you click on an underlined word).
Is there a widget that would allow me to make something similar?
Basically I'm trying to clone the little popups used by spellchecking in Gmail and polishmywriting.
If not, what would be my first step to make it?
Thanks for your time and answers,
DTrejo
Have you had any luck yet? I know it's been quite a lot of time, but found this just now.
It is a very specific widget, so maybe you won't be able to find exactly what you are looking for. In that case, making one from scratch might prove as a challenge.
The first thing you will notice is that a regular gwt TextArea won't do the job of holding the text. You will need something more flexible to dynamically put clickable labels in the text itself.
TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control, released as Open Source.
http://en.wikipedia.org/wiki/TinyMCE
There is also a gwt wrapper available, so you might find that useful:
http://code.google.com/p/tinymce-gwt/
If you check the polishmywriting editor after the spell checking markup is displayed, you will notice it is not a TextArea. The text is a series of paragraphs and the labeled parts are span elements. This are the elements you can easily access with gwt and put some click handlers there to open the popup.
And for the popups, it shouldn't be difficult. Use a standard gwt PopupPanel. The popup panel can be displayed in a relative position to other elements displayed on the page:
popup.showRelativeTo(otherElement);
If you did find something useful in the mean time, feel free to share.