Re: CellTable odd/even row styles

2011-03-23 Thread Yaakov Chaikin
Sorry I didn't reply right away... Didn't have access to the app for
the last few days... So, I just checked and the styles that I set are
NOT there at all, i.e., they are not appearing at all.

What am I doing wrong there?

-Yaakov.

On Wed, Mar 16, 2011 at 5:09 PM, Jeff Larsen larse...@gmail.com wrote:
 Have you tried looking at the styles with firebug? Are they there and being
 overwritten or are they not appearing at all?

 --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To post to this group, send email to google-web-toolkit@googlegroups.com.
 To unsubscribe from this group, send email to
 google-web-toolkit+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: CellTable odd/even row styles

2011-03-23 Thread Yaakov Chaikin
Ok, I see. It works now and based on the code to which you provided
the link, here is the change that had to be made:

Rename the getStyle() method to cellTableStyle() and put @Override
just to make it clearer that we are overriding this interface method
with our own.

That's it!

Thanks!

-yaakov.

On Wed, Mar 16, 2011 at 7:58 PM, Thomas Broyer t.bro...@gmail.com wrote:
 The obfuscated names of the CSS classes are based on the return type of the
 ClientBundle method and the method name in the CssResource.
 Here, because your SystemStatusResources uses CellTable.Style, it will use
 the same CSS class names as the default resources' style. This means that if
 you use CellTable with the default resources elsewhere in your app, you'll
 have a conflict.
 Declare an interface extending CellTable.Style and
 make SystemStatusResources return that type (return type covariance FTW),
 and now you'll have CSS class names specific to SystemStatusResources.
 See http://code.google.com/p/google-web-toolkit/issues/detail?id=6144

 --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To post to this group, send email to google-web-toolkit@googlegroups.com.
 To unsubscribe from this group, send email to
 google-web-toolkit+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: CellTable odd/even row styles

2011-03-16 Thread Raphaël Brugier
The good way to override the style of a cellTable is to pass a Ressource to 
the constructor.
See the Expense 
examplehttp://code.google.com/p/google-web-toolkit/source/browse/trunk/samples/expenses/src/main/java/com/google/gwt/sample/expenses/client/ExpenseReportList.java#463

-Raphaël.

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: CellTable odd/even row styles

2011-03-16 Thread Jeff Larsen
You'll notice in CellTable there are some inner classes. One of those 
classes is Style and the other is Resources. 

Style is the class that has the styles which are used, Resources maps that 
class to its css value.

Inside Style you'll notice two methods called cellTableEvenRow and 
cellTableOddRow. Those are the two classes you're going to care about. 

If you want completely different styles, you can implement your own style 
sheet (just copy the Style.css from com.google.gwt.cellview.client package 
and change the values inside the classes). Or if you just want to override 
the alternating views you can do something like.


public interface MyResources extends CellTable.Resources{

@Source({CellTable.Style.DEFAULT_CSS, MyCssFile.css})
CellTable.Style getStyle();
}


and in MyCssFile.css just implement .cellTableEvenRow and cellTableOddRow.

Then make sure to pass in MyResources into the constructor of the CellTable 
and you should have the styles you're looking for.

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: CellTable odd/even row styles

2011-03-16 Thread Yaakov Chaikin
Ok, I did that and it's still showing the default styles.

To be clear, here is what I did:

SystemStatusResources.java
-
// import statements
...

public interface SystemStatusResources extends CellTable.Resources
{
   @Source ({CellTable.Style.DEFAULT_CSS, systemStatus.css})
   CellTable.Style getStyle();
}
-

The 'systemStatus.css' file sits in the same package as the
SystemStatusResources.java and looks like this:
-
.cellTableEvenRow {
   background: #ff;
}

.cellTableOddRow {
   background: #ff;
}

.cellTableOddRowCell {
   border: selectionBorderWidth solid #ff;
}

.cellTableEvenRowCell {
border: selectionBorderWidth solid #ff;
}
-

Inside the SystemStatusListView.java:
-
...
...
CellTable.Resources resources = GWT.create(SystemStatusResources.class);
CellTableListString dataTable = new CellTableListString(0, resources);
...
-

The end result is that the same default color shows up for the odd rows.

Any ideas what I am doing wrong?

Thanks,
Yaakov.


On Wed, Mar 16, 2011 at 1:24 PM, Jeff Larsen larse...@gmail.com wrote:
 You'll notice in CellTable there are some inner classes. One of those
 classes is Style and the other is Resources.
 Style is the class that has the styles which are used, Resources maps that
 class to its css value.
 Inside Style you'll notice two methods called cellTableEvenRow and
 cellTableOddRow. Those are the two classes you're going to care about.
 If you want completely different styles, you can implement your own style
 sheet (just copy the Style.css from com.google.gwt.cellview.client package
 and change the values inside the classes). Or if you just want to override
 the alternating views you can do something like.

 public interface MyResources extends CellTable.Resources{
     @Source({CellTable.Style.DEFAULT_CSS, MyCssFile.css})
     CellTable.Style getStyle();
 }

 and in MyCssFile.css just implement .cellTableEvenRow and cellTableOddRow.
 Then make sure to pass in MyResources into the constructor of the CellTable
 and you should have the styles you're looking for.

 --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To post to this group, send email to google-web-toolkit@googlegroups.com.
 To unsubscribe from this group, send email to
 google-web-toolkit+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: CellTable odd/even row styles

2011-03-16 Thread Jeff Larsen
Have you tried looking at the styles with firebug? Are they there and being 
overwritten or are they not appearing at all?

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: CellTable odd/even row styles

2011-03-16 Thread Thomas Broyer
The obfuscated names of the CSS classes are based on the return type of the 
ClientBundle method and the method name in the CssResource.
Here, because your SystemStatusResources uses CellTable.Style, it will use 
the same CSS class names as the default resources' style. This means that if 
you use CellTable with the default resources elsewhere in your app, you'll 
have a conflict.
Declare an interface extending CellTable.Style and 
make SystemStatusResources return that type (return type covariance FTW), 
and now you'll have CSS class names specific to SystemStatusResources.
See http://code.google.com/p/google-web-toolkit/issues/detail?id=6144

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.