Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7458415
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T13:26:40+00:00 2026-05-29T13:26:40+00:00

I am trying to set a custom style to a GWT CellBrowser widget using

  • 0

I am trying to set a custom style to a GWT CellBrowser widget using UiBinder but I am not able to change any dependent styles (i.e. I can set a different background color for the whole widget but I don’t know how to change the style for a selected item)

I tried using “@external” as suggested in this forum for other widgets (for instance here or here) but it did not have any effect, I guess that it is because of the way styles are specified in CellBrowser.

I think that the approach I should take should be more similar to http://crazygui.wordpress.com/2011/11/01/how-to-skin-a-gwt-celltable/. Adapting their code to a CellBrowser instead of a CellTable I’m using:

@UiField (provided=true) CellBrowser cellbrowser;
interface CellBrowserCompanyUiBinder extends UiBinder<Widget, CellBrowserCompany> {}

public CellBrowserCompany() {

    TreeViewModel tvm = new TreeViewModelImpl();        
    CellBrowser.Resources reso = GWT.create(CellBrowsRes.class);

    cellbrowser = new CellBrowser(tvm, null, reso);
    cellbrowser.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.ENABLED);

    initWidget(uiBinder.createAndBindUi(this));
}
public interface CellBrowsRes extends CellBrowser.Resources{
    @Source({CellBrowser.Style.DEFAULT_CSS, "path/to/css.css"})
    BrowserStyle cellbrowserstyle();

    interface BrowserStyle extends CellBrowser.Style{}
}

and I am using the CSS file from GWT SDK as reference.

In the ui.xml file I have, inside a < g:HTMLPanel> tag:

<c:CellBrowser ui:field="cellbrowser" width="100%" height="100%"/>

The code works fine if I don’t use “CellBrosRes”. So, it works if I replace the line that creates the CellBrowser by this one:

CellBrowser browser = new CellBrowser(tvm, null);

If I use “CellBrosRes” it just ignores my style. I think the problem is in the way I create the Style Resource.

Any help on how to get this working would be appreciated. Let me know if you need additional details or if something is not clear enough.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T13:26:41+00:00Added an answer on May 29, 2026 at 1:26 pm

    After struggling with it a bit more I decided to create my own widget for it. It can definitely be improved, and I would love to hear suggestions but, by now, it is what I’m using.

    This is the structure: CellBrowser > CellPanel[] > Cell[]

    • The CellBrowser widget is initialized with a Cell Array.

    • These cells are placed on the first CellPanel. For each Cell you
      can set a Widget to be displayed on it and a CellPanel that will
      contain its children.

    As the whole thing uses a couple files I’ve uploaded the code as a google code project

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create a custom style for a WPF ComboBox but whenever
I am trying to set a custom class to an Iterator through the setInfoClass
I am trying to set an image as the background of a custom UIButton.
I'm trying to create a custom object that behaves properly in set operations. I've
I am trying to read a custom (non-standard) CSS property, set in a stylesheet
Trying to set up caching on our datasets - we're using clr stored procedures
I was trying to create a custom combobox that inherited from ComboBox, but I've
I want to insert text with custom formatting, then change the font style back
I am trying to change the background color of a custom UITableViewCell in a
I'm trying to set up a custom message source for Hibernate Validator 4.1 through

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.