-
12 Apr 2012 12:02 AM #1Ext GWT Premium Member
- Join Date
- Aug 2010
- Location
- Germany, Solingen
- Posts
- 223
- Vote Rating
- 2
- Answers
- 4
Answered: change occapacity of disabled field
Answered: change occapacity of disabled field
What is the best way to change the occapacity of disable fields for the whole application in GXT 3?
-
Best Answer Posted by darrellmeyer
We have modified CommonStyles to be Appearance based. With these changes, you can substitute your own implementation with your custom styles. You would define your own rule similar to this:
Changes are in SVN.Code:<replace-with class="com.sencha.gxt.core.client.resources.CommonStyles.CommonStylesDefaultAppearance"> <when-type-is class="com.sencha.gxt.core.client.resources.CommonStyles.CommonStylesAppearance" /> </replace-with>
-
17 Apr 2012 1:14 PM #2Sencha - GXT Dev Team
- Join Date
- May 2007
- Location
- Washington, DC
- Posts
- 2,238
- Vote Rating
- 0
- Answers
- 1
We have modified CommonStyles to be Appearance based. With these changes, you can substitute your own implementation with your custom styles. You would define your own rule similar to this:
Changes are in SVN.Code:<replace-with class="com.sencha.gxt.core.client.resources.CommonStyles.CommonStylesDefaultAppearance"> <when-type-is class="com.sencha.gxt.core.client.resources.CommonStyles.CommonStylesAppearance" /> </replace-with>
-
2 May 2013 11:25 AM #3
You didn't give CommonStylesDefaultAppearance a constructor that takes a ClientBundle and you made the bundle and style properties private
Normally, I would extend the default appearance using a default constructor that calls super with my ClientBundleCode:private final CommonDefaultResources bundle; private final Styles styles; public CommonStylesDefaultAppearance() { bundle = GWT.create(CommonDefaultResources.class); styles = bundle.styles(); }
and I can't work around by doingCode:public interface Resources extends CommonDefaultResources { ImageResource shim(); @Override @Source("CommonStyles.css") Styles styles(); } public interface Styles extends CommonDefaultStyles { } public MyStylesAppearance() { super(GWT.<Resources> create(Resources.class)); }
because bundle and styles are private.Code:public MyStylesAppearance() { bundle = GWT.create(CommonDefaultResources.class); styles = bundle.styles(); }
-
2 May 2013 11:44 AM #4
While that is true, the CommonStylesAppearance interface is simple enough that you shouldn't be extending the default implementation - just implement your own, perhaps extending the ClientBundle or declaring your own. Then declare that in your module as the replacement for CommonStylesAppearance, as Darrell indicated in his post.
In cases where there is an abstract base appearance, there is some logic being provided that often would be shared by most real implementations of that appearance. There is no such logic here, so using the base class gains you nothing.


Reply With Quote