Thank you Leo for your time.
I tried it and got the error: "this object does not handle this
method" (see below).
I will go with your other solution: apply a style that override the
css
htmlPanel.addStyleName("override-style");
I will go through the all the html tags one by one...
.override-style h1{
...
}
.override-style ul{
...
}
...
-------------------------------------------------
public native void execCmd() /*-{
var he =
this.@com.gwtext.client.widgets.Component::getOrCreateJsObj()();
he.execCmd("useCSS",false);
}-*/;
[ERROR] Uncaught exception escaped
com.google.gwt.core.client.JavaScriptException: JavaScript TypeError
exception: Cet objet ne gère pas cette propriété ou cette méthode
at
com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:
481)
at
com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:
270)
at
com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:
137)
at
com.alineo.imprint.client.widget.ExtendedHTMLPanel.execCmd(ExtendedHTMLPanel.java:
8)
at
com.alineo.imprint.client.ui.util.UiWidgetFactory.addTab(UiWidgetFactory.java:
1979)
at com.alineo.imprint.client.ui.MainContentPanelWiki
$12.onSuccess(MainContentPanelWiki.java:269)
at com.alineo.imprint.client.service.ItemService_Proxy
$35.onCompletionImpl(transient source for
com.alineo.imprint.client.service.ItemService_Proxy:2342)
at com.alineo.imprint.client.service.ItemService_Proxy
$35.onCompletionAndCatch(transient source for
com.alineo.imprint.client.service.ItemService_Proxy:2318)
at com.alineo.imprint.client.service.ItemService_Proxy
$35.onCompletion(transient source for
com.alineo.imprint.client.service.ItemService_Proxy:2312)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
public native void execCmd(String cmd, String value) /*-{
var he = this.@com.gwtext.client.widgets.BaseExtWidget::jsObj;
he.execCmd("useCSS", false);
}-*/;
java.lang.IllegalArgumentException
at
sun.reflect.UnsafeFieldAccessorImpl.ensureObj(UnsafeFieldAccessorImpl.java:
37)
at
sun.reflect.UnsafeObjectFieldAccessorImpl.get(UnsafeObjectFieldAccessorImpl.java:
18)
On 22 avr, 20:02, leo_BsAs <
aito...@yahoo.es> wrote:
> Jean-Claude...
> here is an intuitive way to solve your problem. I have to warn you
> that I don't know if it works...
> If you look here (
http://www.koders.com/java/
> fidB1DD444CA549F35B0C04D3502E755747BD4E45BE.aspx), you can see how is
> implemented the execCmd in gwt-ext for HtmlEditor... So if you create
> a class that extends from HtmlPanel and then implement the follows
> native method into it... you could play with the
> this.execCmd("styleWithCSS",false) / this.execCmd("useCSS",false)
> stuff. Since the native method is working on the BaseExtWidget class
> level... it could work. I repeat... I'm not sure about that... But if
> it works... please let me know...
>
> The piece of code...
>
> /**
> * Executes a Midas editor command directly on the editor
> document. For visual commands, you should use relayCmd instead. This
> should only be called after the editor is initialized.
> *
> * @param cmd the Midas command
> * @param value the value to pass to the command
> */
> public native void execCmd(String cmd, String value) /*-{
> var he = th...@com.gwtext.client.widgets.BaseExtWidget::jsObj;