gwt

How do you format a date range in Java?

空扰寡人 提交于 2020-01-03 20:56:18
问题 I have two dates - a start and an end. I'd like to format them so that if the months match, they collapse to something like "20-23 AUG" and still format correctly if they break over the end of the month, like "20 SEP - 1 OCT". Are there any libraries out there for accomplishing this, or would I have to hand code rules for displaying ranges of dates using individual DateFormats? 回答1: Here's a solution using JodaTime, the best library for dealing with dates in Java (last time I checked). The

GWT: How to add DockLayoutPanel inside another panel? Not the RootLayoutPanel

别来无恙 提交于 2020-01-03 19:05:17
问题 Is it possible to add DockLayoutPanel inside another panel other than the RootLayoutPanel? If so, how would you do it? I attempted to add it inside HTMLPanel, and only north of the DockLayoutPanel shows. Then I tried it inside LayoutPanel, it failed again. I thought it would have work for LayoutPanel because RootLayoutPanel is a subclass of LayoutPanel. Any answers welcome. Thanks, 回答1: DockLayoutPanel is a RequiresResize widget, so either you put it inside a ProvidesResize widget (any so

GWT.log logs not showing in the GWT Dev Mode console

青春壹個敷衍的年華 提交于 2020-01-03 19:04:40
问题 I have a GWT application which is run with maven: mvn gwt:run However, all the GWT.log logs are not being showed what could be the problem? 回答1: In order for the logging to work you need to have the following: Logging module inherited in your module xml file: <inherits name="com.google.gwt.logging.Logging" /> Logging level set and handlers configured: <set-property name="gwt.logging.logLevel" value="FINE" /> <set-property name="gwt.logging.systemHandler" value="ENABLED" /> <set-property name=

How to wire up GWT hyperlink click handler?

左心房为你撑大大i 提交于 2020-01-03 17:28:15
问题 I am brand new to GWT and am trying to achieve the following: Here's the code that I've cooked up: public class MyWebApp implements EntryPoint { // The main container for everything the user sees (the "view") private LayoutPanel mainPanel; // Simple HTML for the header ("MyWebApp") and subsequent <hr/> private SafeHtml header; // The three links "Dashboard", "Monitors" and "Help Desk" private HorizontalPanel navMenu; // The empty content that gets populated when user clicks one of // the 3

How to add an icon to a MenuItem in GWT?

北慕城南 提交于 2020-01-03 17:13:51
问题 How can I get add an icon with text to a menu item in GWT? The following does not work: <ui:with field='res' type='my.package.MyResources' /> <g:MenuItem text="test"><g:Image resource="{res.myIcon}" /></g:MenuItem> Resulting error: Not allowed in an HTML context: <g:Image resource='{res.myIcon}'> public interface MyResources extends ClientBundle { @Source("myIcon.png") ImageResource myIcon(); } 回答1: The MenuItem allows only HTML or plain text as its content. So you cannot use an Image widget,

How to add an icon to a MenuItem in GWT?

前提是你 提交于 2020-01-03 17:13:26
问题 How can I get add an icon with text to a menu item in GWT? The following does not work: <ui:with field='res' type='my.package.MyResources' /> <g:MenuItem text="test"><g:Image resource="{res.myIcon}" /></g:MenuItem> Resulting error: Not allowed in an HTML context: <g:Image resource='{res.myIcon}'> public interface MyResources extends ClientBundle { @Source("myIcon.png") ImageResource myIcon(); } 回答1: The MenuItem allows only HTML or plain text as its content. So you cannot use an Image widget,

GAE - Unable to update: com.google.appengine.tools.admin.HttpIoException:

走远了吗. 提交于 2020-01-03 17:07:48
问题 I tried to upload my test gwt app but I've just faced a quite strange error. Every time I try to upload app I get this: Unable to update app: Error posting to URL: https://appengine.google.com/api/appversion/create?app_id=gwttestapp001&version=1.0& 500 Internal Server Error Server Error (500) A server error has occurred. See the deployment console for more details Unable to update app: Error posting to URL: https://appengine.google.com/api/appversion/create?app_id=gwttestapp001&version=1.0&

GAE - Unable to update: com.google.appengine.tools.admin.HttpIoException:

旧城冷巷雨未停 提交于 2020-01-03 17:07:10
问题 I tried to upload my test gwt app but I've just faced a quite strange error. Every time I try to upload app I get this: Unable to update app: Error posting to URL: https://appengine.google.com/api/appversion/create?app_id=gwttestapp001&version=1.0& 500 Internal Server Error Server Error (500) A server error has occurred. See the deployment console for more details Unable to update app: Error posting to URL: https://appengine.google.com/api/appversion/create?app_id=gwttestapp001&version=1.0&

How to add tooltip to the cells in celltable?

筅森魡賤 提交于 2020-01-03 17:03:44
问题 I am using gwt cellTable. In this cell table i have one column containing compositeCell. Now i want to add a tooltip for all cells in that composite cell. Any work around for this? 回答1: Here's an abstract tooltip column class that you can extend in place of the normal Column class: public abstract class MyToolTipColumn<T, C> extends Column<T, C> { interface Templates extends SafeHtmlTemplates { @Template("<div title=\"{0}\">") SafeHtml startToolTip(String toolTipText); @Template("</div>")

For what is the AttachEvent

家住魔仙堡 提交于 2020-01-03 15:59:21
问题 i really doesnt understand for what the class AttachEvent or the addAttachHandler is. For what is this usefull? could somebody post an example for that? Thx a lot. 回答1: The AttachEvent informs you when a Widget is either attached or detached from the actual page. If something isn't attached, there is no way its elements can be visible or interacted with, so it can be beneficial to know when it isn't available for interaction. The main thing that GWT itself uses this knowledge for is for