Results 1 to 3 of 3

Thread: Problem with customise button appearances

  1. #1
    Sencha Premium Member
    Join Date
    Apr 2011
    Location
    Ireland
    Posts
    264

    Post Problem with customise button appearances

    Its been a while since using appearances and I'm a bit stuck with something.

    my xml code;

    Code:
        <replace-with
            class="com.meridianp2p.stf.webclient.ui.theme.meridian.client.button.ButtonCellDefaultAppearance.java">
            <when-type-is
                class="com.sencha.gxt.theme.base.client.button.ButtonCellDefaultAppearance" />
        </replace-with>
    That should replace the base appearance with my themed appearance, is that right?

    My new appearance has this interface inside;

    PHP Code:
       public interface ButtonCellResources extends ClientBundle {

        @
    ImageOptions(repeatStyle RepeatStyle.None)
        
    ImageResource arrow();

        @
    ImageOptions(repeatStyle RepeatStyle.None)
        
    ImageResource arrowBottom();

        @
    ImageOptions(repeatStyle RepeatStyle.None)
        
    ImageResource split();

        @
    ImageOptions(repeatStyle RepeatStyle.None)
        
    ImageResource splitBottom();

        @
    Source("ButtonCell.css")
        
    ButtonCellStyle style();
      } 

    Inside ButtonCell.css to test that its working I've change the font family;

    PHP Code:
      .text {
      
    padding0px 2px;
      
    font-familyTimes New RomanTahomaArialVerdanasans-serif;
      
    font-size11px;
      
    font-weightnormal;
      
    text-aligncenter;
      
    cursorpointer;
      
    white-spacenowrap;
      
    overflowhidden;

    But this doesn't change the font css.

    On Inspecting the tag in the brower I can see that it hasn't had the associated css above, nor does it look like from the Html that the template is being swapped in;

    Code:
     
        <div class="GIHDFSDHDB-com-sencha-gxt-theme-base-client-button-ButtonCellDefaultAppearance-ButtonCellStyle-text">Save</div>
    How do I ensure its getting swapped in?



    Second attempt

    I'm trying this in a different way now with the same folder and css, but I'm getting an error thrown.

    My xml;

    Code:
        <replace-with
            class="com.meridianp2p.stf.webclient.ui.theme.meridian.client.button.SytleButtonCellResources">
            <when-type-is
                class="com.sencha.gxt.theme.base.client.button.ButtonCellDefaultAppearance.ButtonCellResources" />
        </replace-with>

    The Java for the replace-with class ;

    PHP Code:
     package com.meridianp2p.stf.webclient.ui.theme.meridian.client.button;

    import com.google.gwt.resources.client.ClientBundle;
    import com.google.gwt.resources.client.ImageResource;
    import com.google.gwt.resources.client.ClientBundle.Source;
    import com.google.gwt.resources.client.ImageResource.ImageOptions;
    import com.google.gwt.resources.client.ImageResource.RepeatStyle;
    import com.meridianp2p.stf.webclient.ui.theme.meridian.client.button.ButtonCellDefaultAppearance.ButtonCellStyle;
    import com.sencha.gxt.theme.base.client.button.ButtonCellDefaultAppearance;

    public class 
    SytleButtonDefaultAppearance<C> extends ButtonCellDefaultAppearance<C> {
        
          public interface 
    SytleButtonCellResources extends ButtonCellResources {


                @
    Source("ButtonCell.css")
                
    ButtonCellStyle style();
              }    



    The error;

    Code:
    09:03:49.905 [ERROR] [sandbox] Failed to create an instance of 'com.sencha.gxt.cell.core.client.ButtonCell$ButtonCellAppearance' via deferred binding 
    
    java.lang.RuntimeException: Deferred binding failed for 'com.sencha.gxt.theme.base.client.button.ButtonCellDefaultAppearance$ButtonCellResources' (did you forget to inherit a required module?)
        at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:53)
        at com.google.gwt.core.shared.GWT.create(GWT.java:57)
        at com.google.gwt.core.client.GWT.create(GWT.java:85)
        at com.sencha.gxt.theme.base.client.button.ButtonCellDefaultAppearance.&lt;init&gt;(ButtonCellDefaultAppearance.java:135)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:475)
        at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:49)
        at com.google.gwt.core.shared.GWT.create(GWT.java:57)
        at com.google.gwt.core.client.GWT.create(GWT.java:85)
        at com.sencha.gxt.cell.core.client.TextButtonCell.&lt;init&gt;(TextButtonCell.java:15)
        at com.sencha.gxt.widget.core.client.button.TextButton.&lt;init&gt;(TextButton.java:34)
        at com.sencha.gxt.widget.core.client.button.TextButton.&lt;init&gt;(TextButton.java:55)
        at com.meridianp2p.stf.webclient.ui.plugin.dashboard.DashboardView$GadgetChooser$GadgetDetailsPanel.getAddButton(DashboardView.java:156)
        at com.meridianp2p.stf.webclient.ui.plugin.dashboard.DashboardView$GadgetChooser$GadgetDetailsPanel.&lt;init&gt;(DashboardView.java:136)
        at com.meridianp2p.stf.webclient.ui.plugin.dashboard.DashboardView$GadgetChooser.getGadgetDetailsPanel(DashboardView.java:235)
        at com.meridianp2p.stf.webclient.ui.plugin.dashboard.DashboardView$GadgetChooser.&lt;init&gt;(DashboardView.java:208)
        at com.meridianp2p.stf.webclient.ui.plugin.dashboard.DashboardView.getGadgetChooser(DashboardView.java:294)
        at com.meridianp2p.stf.webclient.ui.plugin.dashboard.DashboardView.&lt;init&gt;(DashboardView.java:254)
        at com.meridianp2p.stf.webclient.ui.plugin.dashboard.com_meridianp2p_stf_webclient_sandbox_ui_DefaultInjector_DefaultInjectorGinjector_fragment.com$meridianp2p$stf$webclient$ui$plugin$dashboard$DashboardView_com$meridianp2p$stf$webclient$ui$plugin$dashboard$DashboardView_methodInjection(com_meridianp2p_stf_webclient_sandbox_ui_DefaultInjector_DefaultInjectorGinjector_fragment.java:125)
        at com.meridianp2p.stf.webclient.ui.plugin.dashboard.com_meridianp2p_stf_webclient_sandbox_ui_DefaultInjector_DefaultInjectorGinjector_fragment.get_Key$type$com$meridianp2p$stf$webclient$ui$plugin$dashboard$DashboardView$_annotation$$none$$(com_meridianp2p_stf_webclient_sandbox_ui_DefaultInjector_DefaultInjectorGinjector_fragment.java:117)
        at com.meridianp2p.stf.webclient.ui.plugin.dashboard.com_meridianp2p_stf_webclient_sandbox_ui_DefaultInjector_DefaultInjectorGinjector_fragment.get_Key$type$com$meridianp2p$stf$webclient$ui$plugin$dashboard$DashboardPresenter$Display$_annotation$$none$$(com_meridianp2p_stf_webclient_sandbox_ui_DefaultInjector_DefaultInjectorGinjector_fragment.java:28)
        at com.meridianp2p.stf.webclient.ui.plugin.dashboard.com_meridianp2p_stf_webclient_sandbox_ui_DefaultInjector_DefaultInjectorGinjector_fragment.get_Key$type$com$meridianp2p$stf$webclient$ui$plugin$dashboard$DashboardPresenter$_annotation$$none$$(com_meridianp2p_stf_webclient_sandbox_ui_DefaultInjector_DefaultInjectorGinjector_fragment.java:40)
        at com.meridianp2p.stf.webclient.ui.plugin.dashboard.com_meridianp2p_stf_webclient_sandbox_ui_DefaultInjector_DefaultInjectorGinjector_fragment.get_Key$type$com$meridianp2p$stf$webclient$ui$plugin$dashboard$DashboardScreen$_annotation$$none$$(com_meridianp2p_stf_webclient_sandbox_ui_DefaultInjector_DefaultInjectorGinjector_fragment.java:59)
        at com.meridianp2p.stf.webclient.ui.plugin.dashboard.com_meridianp2p_stf_webclient_sandbox_ui_DefaultInjector_DefaultInjectorGinjector_fragment.get_Key$type$com$meridianp2p$stf$webclient$ui$plugin$dashboard$DashboardPlugin$_annotation$$none$$(com_meridianp2p_stf_webclient_sandbox_ui_DefaultInjector_DefaultInjectorGinjector_fragment.java:75)
        at com.meridianp2p.stf.webclient.ui.plugin.dashboard.com_meridianp2p_stf_webclient_sandbox_ui_DefaultInjector_DefaultInjectorGinjector_fragment$1$1.onSuccess(com_meridianp2p_stf_webclient_sandbox_ui_DefaultInjector_DefaultInjectorGinjector_fragment.java:98)
        at com.google.gwt.core.client.GWT.runAsync(GWT.java:248)
        at com.meridianp2p.stf.webclient.ui.plugin.dashboard.com_meridianp2p_stf_webclient_sandbox_ui_DefaultInjector_DefaultInjectorGinjector_fragment$1.get(com_meridianp2p_stf_webclient_sandbox_ui_DefaultInjector_DefaultInjectorGinjector_fragment.java:96)
        at com.meridianp2p.stf.webclient.ui.services.PluginAsyncService$Loader.load(PluginAsyncService.java:49)
        at com.meridianp2p.stf.webclient.ui.services.PluginAsyncService$Loader.access$3(PluginAsyncService.java:47)
        at com.meridianp2p.stf.webclient.ui.services.PluginAsyncService$1.onDataReceived(PluginAsyncService.java:93)
        at com.meridianp2p.stf.webclient.ui.services.PluginAsyncService$1.onDataReceived(PluginAsyncService.java:1)
        at com.meridianp2p.stf.webclient.ui.useragent.AbstractRequestCallback.onResponseReceived(AbstractRequestCallback.java:101)
        at com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java:258)
        at com.google.gwt.http.client.RequestBuilder$1.onReadyStateChange(RequestBuilder.java:412)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
        at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
        at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
        at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:338)
        at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:219)
        at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
        at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:571)
        at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:279)
        at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
        at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
        at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:242)
        at sun.reflect.GeneratedMethodAccessor104.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
        at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
        at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
        at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:293)
        at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:547)
        at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364)
        at java.lang.Thread.run(Unknown Source)
    Caused by: com.google.gwt.core.ext.UnableToCompleteException: (see previous log entries)
        at com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:513)
        at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:49)
        at com.google.gwt.core.shared.GWT.create(GWT.java:57)
        at com.google.gwt.core.client.GWT.create(GWT.java:85)
        at com.sencha.gxt.theme.base.client.button.ButtonCellDefaultAppearance.&lt;init&gt;(ButtonCellDefaultAppearance.java:135)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:475)
        at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:49)
        at com.google.gwt.core.shared.GWT.create(GWT.java:57)
        at com.google.gwt.core.client.GWT.create(GWT.java:85)
        at com.sencha.gxt.cell.core.client.TextButtonCell.&lt;init&gt;(TextButtonCell.java:15)
        at com.sencha.gxt.widget.core.client.button.TextButton.&lt;init&gt;(TextButton.java:34)
        at com.sencha.gxt.widget.core.client.button.TextButton.&lt;init&gt;(TextButton.java:55)
        at com.meridianp2p.stf.webclient.ui.plugin.dashboard.DashboardView$GadgetChooser$GadgetDetailsPanel.getAddButton(DashboardView.java:156)
        at com.meridianp2p.stf.webclient.ui.plugin.dashboard.DashboardView$GadgetChooser$GadgetDetailsPanel.&lt;init&gt;(DashboardView.java:136)
        at com.meridianp2p.stf.webclient.ui.plugin.dashboard.DashboardView$GadgetChooser.getGadgetDetailsPanel(DashboardView.java:235)
        at com.meridianp2p.stf.webclient.ui.plugin.dashboard.DashboardView$GadgetChooser.&lt;init&gt;(DashboardView.java:208)
        at com.meridianp2p.stf.webclient.ui.plugin.dashboard.DashboardView.getGadgetChooser(DashboardView.java:294)
        at com.meridianp2p.stf.webclient.ui.plugin.dashboard.DashboardView.&lt;init&gt;(DashboardView.java:254)
        at com.meridianp2p.stf.webclient.ui.plugin.dashboard.com_meridianp2p_stf_webclient_sandbox_ui_DefaultInjector_DefaultInjectorGinjector_fragment.com$meridianp2p$stf$webclient$ui$plugin$dashboard$DashboardView_com$meridianp2p$stf$webclient$ui$plugin$dashboard$DashboardView_methodInjection(com_meridianp2p_stf_webclient_sandbox_ui_DefaultInjector_DefaultInjectorGinjector_fragment.java:125)
        at com.meridianp2p.stf.webclient.ui.plugin.dashboard.com_meridianp2p_stf_webclient_sandbox_ui_DefaultInjector_DefaultInjectorGinjector_fragment.get_Key$type$com$meridianp2p$stf$webclient$ui$plugin$dashboard$DashboardView$_annotation$$none$$(com_meridianp2p_stf_webclient_sandbox_ui_DefaultInjector_DefaultInjectorGinjector_fragment.java:117)
        at com.meridianp2p.stf.webclient.ui.plugin.dashboard.com_meridianp2p_stf_webclient_sandbox_ui_DefaultInjector_DefaultInjectorGinjector_fragment.get_Key$type$com$meridianp2p$stf$webclient$ui$plugin$dashboard$DashboardPresenter$Display$_annotation$$none$$(com_meridianp2p_stf_webclient_sandbox_ui_DefaultInjector_DefaultInjectorGinjector_fragment.java:28)
        at com.meridianp2p.stf.webclient.ui.plugin.dashboard.com_meridianp2p_stf_webclient_sandbox_ui_DefaultInjector_DefaultInjectorGinjector_fragment.get_Key$type$com$meridianp2p$stf$webclient$ui$plugin$dashboard$DashboardPresenter$_annotation$$none$$(com_meridianp2p_stf_webclient_sandbox_ui_DefaultInjector_DefaultInjectorGinjector_fragment.java:40)
        at com.meridianp2p.stf.webclient.ui.plugin.dashboard.com_meridianp2p_stf_webclient_sandbox_ui_DefaultInjector_DefaultInjectorGinjector_fragment.get_Key$type$com$meridianp2p$stf$webclient$ui$plugin$dashboard$DashboardScreen$_annotation$$none$$(com_meridianp2p_stf_webclient_sandbox_ui_DefaultInjector_DefaultInjectorGinjector_fragment.java:59)
        at com.meridianp2p.stf.webclient.ui.plugin.dashboard.com_meridianp2p_stf_webclient_sandbox_ui_DefaultInjector_DefaultInjectorGinjector_fragment.get_Key$type$com$meridianp2p$stf$webclient$ui$plugin$dashboard$DashboardPlugin$_annotation$$none$$(com_meridianp2p_stf_webclient_sandbox_ui_DefaultInjector_DefaultInjectorGinjector_fragment.java:75)
        at com.meridianp2p.stf.webclient.ui.plugin.dashboard.com_meridianp2p_stf_webclient_sandbox_ui_DefaultInjector_DefaultInjectorGinjector_fragment$1$1.onSuccess(com_meridianp2p_stf_webclient_sandbox_ui_DefaultInjector_DefaultInjectorGinjector_fragment.java:98)
        at com.google.gwt.core.client.GWT.runAsync(GWT.java:248)
        at com.meridianp2p.stf.webclient.ui.plugin.dashboard.com_meridianp2p_stf_webclient_sandbox_ui_DefaultInjector_DefaultInjectorGinjector_fragment$1.get(com_meridianp2p_stf_webclient_sandbox_ui_DefaultInjector_DefaultInjectorGinjector_fragment.java:96)
        at com.meridianp2p.stf.webclient.ui.services.PluginAsyncService$Loader.load(PluginAsyncService.java:49)
        at com.meridianp2p.stf.webclient.ui.services.PluginAsyncService$Loader.access$3(PluginAsyncService.java:47)
        at com.meridianp2p.stf.webclient.ui.services.PluginAsyncService$1.onDataReceived(PluginAsyncService.java:93)
        at com.meridianp2p.stf.webclient.ui.services.PluginAsyncService$1.onDataReceived(PluginAsyncService.java:1)
        at com.meridianp2p.stf.webclient.ui.useragent.AbstractRequestCallback.onResponseReceived(AbstractRequestCallback.java:101)
        at com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java:258)
        at com.google.gwt.http.client.RequestBuilder$1.onReadyStateChange(RequestBuilder.java:412)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
        at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
        at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
        at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:338)
        at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:219)
        at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
        at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:571)
        at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:279)
        at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
        at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
        at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:242)
        at sun.reflect.GeneratedMethodAccessor104.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
        at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
        at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
        at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:293)
        at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:547)
        at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364)
        at java.lang.Thread.run(Unknown Source)
    There is also a post that gives some more detail about what I'm trying to achieve here;

    http://www.sencha.com/forum/showthre...rance-in-GXT-3

    I'm going to continue looking through the forums for answers, or I might just create a whole theme as outlined here http://neiliscoding.blogspot.ie/2012...ustomised.html and work from there, because that worked from me before.

  2. #2
    Sencha Premium Member
    Join Date
    Sep 2007
    Posts
    13,976

    Default

    You basicly need to replace your own implementation against the basic appearance interface:

    Code:
      <replace-with
            class="com.meridianp2p.stf.webclient.ui.theme.meridian.client.button.ButtonCellDefaultAppearance">
            <when-type-is
                class="com.sencha.gxt.cell.core.client.ButtonCell.ButtonCellAppearance" />
        </replace-with>

  3. #3
    Sencha Premium Member
    Join Date
    Apr 2011
    Location
    Ireland
    Posts
    264

    Thumbs up

    Ah, so you have pointed out I should have been replacing the "appearance" that is in core, and not the "default appearance" that it in base.

    Thanks very much. I can see my css changes now.

    Note to self and anyone else reading this;

    Don't use .java in the class="" attribute in the replace-with tag as it might not find your custom "default appearance"

    Code:
        <replace-with
            class="com.meridianp2p.stf.webclient.ui.theme.meridian.client.button.ButtonCellDefaultAppearance">
            <when-type-is
                class="com.sencha.gxt.cell.core.client.ButtonCell.ButtonCellAppearance" />
        </replace-with>

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •