Issue while setting custom appearance for TextButton
I created custom appearance for TextButton and applied it for one particular button. Here is code:
Code:
public class OrangeButtonCellAppearance<C> extends ButtonCellDefaultAppearance<C> {
public interface OrangeButtonCellResources extends ButtonCellResources
{
@Source({"com/sencha/gxt/theme/base/client/button/ButtonCell.css"})
ButtonCellStyle style();
}
public interface OrangeButtonTableFrameResources extends ButtonTableFrameResources
{
@Source({"com/sencha/gxt/theme/base/client/frame/TableFrame.css",
"com/sencha/gxt/theme/base/client/button/ButtonTableFrame.css",
"OrangeButtonCell.css"})
TableFrame.TableFrameStyle style();
@Source("orange_bg_bar.png")
@ImageResource.ImageOptions(repeatStyle = ImageResource.RepeatStyle.Horizontal)
ImageResource buttonBackground();
}
public OrangeButtonCellAppearance() {
this(GWT.<OrangeButtonCellResources> create(OrangeButtonCellResources.class));
}
/**
* Creates a button cell base appearance using the specified resources and
* templates.
*
* @param resources the button cell resources
*/
public OrangeButtonCellAppearance(OrangeButtonCellResources resources) {
super(resources, GWT.<ButtonCellTemplates>create(ButtonCellTemplates.class),
new TableFrame(GWT.<OrangeButtonTableFrameResources>create(OrangeButtonTableFrameResources.class)));
}
}
OrangeButtonCell.css file:
Code:
@sprite .over .content {
gwt-image: 'buttonBackground';
height: 100%;
width: 100%;
}
Here is how i set this appearance for button:
Code:
film = new TextButton(new TextButtonCell(new OrangeButtonCellAppearance<String>()), "Films");
but this changed appearance for all buttons in the application. why is it happening like this?
Is the code written appropriate?