1. #1
    Ext GWT Premium Member
    Join Date
    Aug 2010
    Location
    Germany, Solingen
    Posts
    223
    Vote Rating
    2
    Answers
    4
    gishmo is on a distinguished road

      0  

    Default 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?

  2. 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:

    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>
    Changes are in SVN.

  3. #2
    Sencha - GXT Dev Team darrellmeyer's Avatar
    Join Date
    May 2007
    Location
    Washington, DC
    Posts
    2,238
    Vote Rating
    0
    Answers
    1
    darrellmeyer is on a distinguished road

      0  

    Default


    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:

    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>
    Changes are in SVN.

  4. #3
    Sencha User
    Join Date
    Sep 2012
    Posts
    27
    Vote Rating
    0
    Answers
    2
    billsalvucci is on a distinguished road

      0  

    Default


    You didn't give CommonStylesDefaultAppearance a constructor that takes a ClientBundle and you made the bundle and style properties private

    Code:
    private final CommonDefaultResources bundle;
        private final Styles styles;
        
        public CommonStylesDefaultAppearance() {
          bundle = GWT.create(CommonDefaultResources.class);
          styles = bundle.styles();
        }
    Normally, I would extend the default appearance using a default constructor that calls super with my ClientBundle

    Code:
    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));
            }
    and I can't work around by doing

    Code:
    public MyStylesAppearance() {
                bundle = GWT.create(CommonDefaultResources.class);
                styles = bundle.styles();
              }
    because bundle and styles are private.

  5. #4
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Posts
    1,931
    Vote Rating
    55
    Answers
    73
    Colin Alworth is a jewel in the rough Colin Alworth is a jewel in the rough Colin Alworth is a jewel in the rough

      0  

    Default


    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.