天道酬勤,学无止境

gwt

Using Freebase API in Java

I am developing a GWT application to get the query results from the Freebase. This is the code of my EntryPoint class. package com.google.tracker.client; import com.freebase.api.Freebase; import com.freebase.json.JSON; import com.google.gwt.core.client.EntryPoint; public class Tracker implements EntryPoint{ public void onModuleLoad() { Freebase freebase = Freebase.getFreebase(); String query_str = "{" + "'id': null," + "'type': '/film/film'," + "'name': 'Blade Runner'," + "'directed_by': [{" + "'id': null," + "'name': null" + "}]" + "}​".replace('\'', '"'); JSON query = new JSON(query_str)

2021-09-23 23:41:38    分类:问答    java   json   gwt   freebase   mql

how to remove the focus on disclosure panel's header

i noticed that whenever i click the disclosure panel's header, it got focused, namely you can see the black dotted border around the header, is there any way i can get rid of that? Thanks.

2021-09-23 21:11:33    分类:问答    gwt

在 GWT 中如何知道应用于给定元素的所有样式(通过 id 或类名)(In GWT how to know all the styles applied to a given element (by id or class name))

问题 我有以下问题:在我的 GWT 项目中,应用程序有一个“主”css 文件,来自应用程序计算的 DOM 中的内联 css 和捆绑在上传到应用程序并动态加载的存档中的 css 文件. 现在我需要一个Element来查找应用了哪些 CSS 规则,来自三个来源中的任何一个。 据我了解,GWT 的getStyle()函数只返回 DOM 中的信息。 实现这一目标的最简单方法是什么? 编辑:如果可能,我会搜索客户端解决方案(在 java 或 javascript 中)而不是服务器端解决方案。 回答1 找到了我的问题的解决方案(实际上有两个,但我要第一个): 使用 jQuery 的 css() 做我想要的这个 SO 问题中的纯 javascript 解决方案 我现在只需要为 jQuery 函数编写一个 JNSI 包装器...... 编辑:找到了与我想要的完全对应的第三个解决方案:GQuery,它是 jQuery 到 GWT 的一个端口,包含(根据主页)98% 的 jQuery 核心功能。

2021-09-23 20:37:56    分类:技术分享    javascript   css   gwt   jsni

Can't Run html libgdx with libgdx-utils

Im trying to compile my libgdx game, its working for android and desktop, but not HTML GWT. Im using Intellij / Gradle for the project. I just added the libgdx-utils extension lib found here which seems to be causing the error: https://bitbucket.org/dermetfan/libgdx-utils/wiki/Dependency%20Instructions The error i get when attempting this gradle command ./gradlew html:dist is: :html:compileGwt Compiling module com.xx.xx.GdxDefinition Validating units: [ERROR] Errors in 'file:/xx/xx/xx/screens/GameScreen.java' [ERROR] Line 66: No source code is available for type net.dermetfan.gdx.graphics.g2d

2021-09-23 18:07:29    分类:问答    java   gwt   libgdx   box2d

GWT FileUpload with Servlet

I try to make a very simple GWT-Application: The User can choose a txt file an upload it to the Server. Later I want to implement more functionality but for now I'm stuck on the FileUpload: On the client Side I have the following Code working: public class GwtDemoProject implements EntryPoint { private static final String UPLOAD_ACTION_URL = GWT.getModuleBaseURL() + "upload"; private FormPanel form; private Label info; private FileUpload fileupload; private Button uploadFileBtn; public void onModuleLoad() { init(); uploadFileBtn.addClickHandler(new ClickHandler() { @Override public void

2021-09-23 18:06:50    分类:问答    java   servlets   file-upload   gwt

Why gwt event bubbling doesn't work?

I have a custom widget with a constructor body like this public MyWidget() { this.containerDiv = DOM.createDiv(); this.containerDiv.getStyle().setPosition(Position.ABSOLUTE); this.containerDiv.getStyle().setLeft(20, Style.Unit.PX); this.containerDiv.getStyle().setTop(20, Style.Unit.PX); this.containerDiv.getStyle().setWidth(50, Style.Unit.PX); this.containerDiv.getStyle().setHeight(20, Style.Unit.PX); final Element canvasContainer = DOM.createDiv(); canvasContainer.getStyle().setPosition(Position.ABSOLUTE); canvasContainer.getStyle().setLeft(0, Style.Unit.PX); canvasContainer.getStyle().setTop

2021-09-23 17:55:37    分类:问答    javascript   gwt   event-handling

是否可以为 Window.scrollTop 设置动画(Is it possible to animate Window.scrollTop)

问题 我想添加动画平滑,任何 adia? Window.scrollTo(0, MyPanel.getAbsoluteTop()); 回答1 您可以使用 jQuery 动画功能。 $('html').animate({ scrollTop: '0' }); 回答2 我使用的是velocity.js 和JSNI 调用: public static native void setAnimatedScrollTop(MyView instance, String topElementId, String scrollPanelId, int offsetPosition) /*-{ $wnd.Velocity($wnd.document.getElementById(topElementId), 'scroll', {duration: 1000, offset: offsetPosition, container: $wnd.document.getElementById(scrollPanelId), complete: function(){ instance.@com.project.client.views.MyView::setScrollAnimationInProgress(Z)(false); } }); }-*/;

2021-09-23 17:19:07    分类:技术分享    gwt   scroll

GWT 确认对话框(GWT confirmation dialog box)

问题 我正在尝试创建一个模态确认对话框。 我希望它像Window.confirm("")一样工作,我可以在其中调用它,并获得布尔响应。 我的问题是我不知道该怎么做。 我正在尝试在我的应用程序中使用 MVP。 这是我到目前为止的代码: public class DialogBoxPresenter implements Presenter { public interface Display { Label getDialogText(); Button getAffirmativeButton(); Button getCancelButton(); Widget asWidget(); public void center(); public void hide(); public void setHeader(String text); } private Display display; private String header; private String dialogText; private String cancelButtonText; private String affirmativeButtonText; protected DialogBoxPresenter() { } public DialogBoxPresenter(Display display

2021-09-23 12:49:18    分类:技术分享    gwt

服务器端的 GWT 国际化 (i18n)(GWT Internationalization (i18n) in server side)

问题 我有一个支持国际化的 GWT 应用程序(在客户端)。 我有一个消息类: /** * Interface to represent the messages contained in resource bundle: */ public interface Messages extends com.google.gwt.i18n.client.Messages { /** * Translated "No". * * @return translated "No" */ @DefaultMessage("No") @Key("NO") String NO(); } 我有两个属性 Messages.properties 和 Messages_fr.properties。 我也有这个配置: <inherits name="com.google.gwt.i18n.I18N" /> <extend-property name="locale" values="fr" /> <set-configuration-property name="locale.useragent" value="Y"/> 在客户端我这样做: private final Messages messages = GWT.create(Messages.class); //... messages.NO()

2021-09-23 10:09:12    分类:技术分享    gwt   internationalization

GWT Internationalization (i18n) in server side

I have a GWT application with internationalization support (in client side). I have a Messages class: /** * Interface to represent the messages contained in resource bundle: */ public interface Messages extends com.google.gwt.i18n.client.Messages { /** * Translated "No". * * @return translated "No" */ @DefaultMessage("No") @Key("NO") String NO(); } I have two properties Messages.properties and Messages_fr.properties. I also have this configuration : <inherits name="com.google.gwt.i18n.I18N" /> <extend-property name="locale" values="fr" /> <set-configuration-property name="locale.useragent"

2021-09-23 09:43:24    分类:问答    gwt   internationalization