gwt

gwt pushButton in UiBinder

会有一股神秘感。 提交于 2019-12-21 07:29:13
问题 I need to create a pushButton(so it's a button with image) in gwt with UiBinder , but I'm not sure how proceed. Here is my ui.xml code: <g:PushButton ui:field="myPushButton"/> And in *.java file I defined: PushButton myPushButton; How can I add an image to the push button? I've tried the following but won't work: <g:PushButton ui:field="myPushButton" image="myImage.gif" /> Thanks 回答1: You can use following code straight from CustomButton Javadoc: g:PushButton ui:field='pushButton' enabled=

How can I consistently remove the default text from an input element with Selenium?

浪尽此生 提交于 2019-12-21 07:27:20
问题 I'm trying to use Selenium WebDriver to input text to a GWT input element that has default text, "Enter User ID". Here are a few ways I've tried to get this to work: searchField.click(); if(!searchField.getAttribute("value").isEmpty()) { // clear field, if not already empty searchField.clear(); } if(!searchField.getAttribute("value").isEmpty()) { // if it still didn't clear, click away and click back externalLinksHeader.click(); searchField.click(); } searchField.sendKeys(username); The

How to handle single quotes in internationalization constants?

你说的曾经没有我的故事 提交于 2019-12-21 07:10:31
问题 We define all our internationalized constant strings in a single properties file LocalizableResource_xx.properties (one per language) located in google.gwt.i18n.client . This way it is possible to access the constants in Java code via the constants interface Window.alert(myConstants.helloWorld()); as well as to use them inside the UiBinder .ui.xml <ui:attribute key="some.key" name="text" description="useful info" /> This approach doesn't work well if the string contains a single quote ( ' ).

Which GWT EventBus should I use?

…衆ロ難τιáo~ 提交于 2019-12-21 07:08:50
问题 In the gwt-user.jar there are 2 EventBus interfaces and SimpleEventBus implmentations. com.google.gwt.event.shared.EventBus and com.google.web.bindery.event.shared.EventBus I'll refer to these as 'gwt.event' and 'web.bindery'. Looking at the JavaDocs and source code I can see that the gwt.event merely wraps the web.bindery one. However the gwt.event implementation also hides a number of deprecated methods So which implementation should I use? (I'm on GWT 2.4) 回答1: Generally you should use the

Select element in CellList using SelectionModel or ListDataProvider

二次信任 提交于 2019-12-21 05:48:24
问题 I have used CellList for listing my data using ListDataProvider for managing the data and SelectionModel for selecting an element from CellList and generating events accordingly. Now when i update or delete element using cellList.getList().set(index, bean) or cellList.getList().remove() it sucessfully do the operation. But after that it automatically selects the first record in CellList which i do not want. Can anyone suggest how can i deselect the selected record in CellList? Below is the

gwt “CssResource.style” possible values, how to turn obfuscation ON

不打扰是莪最后的温柔 提交于 2019-12-21 05:44:08
问题 Is there a documentation of gwt.xml, a list of the setting with all accepted values? In my case i turned css obfuscation off in debug/developer environment. But for Production environment i want to turn it on. The same i did with "gwt.enableDebugId" it is true in .gwt.xml and false in -production.gwt.xml - this is working fine. The same i want with "CssResource.style". the only thing i found so far was the value "obf" but it seems that value also produces "human readable classes" see here for

gwt something other than an int was returned from jsni method

依然范特西╮ 提交于 2019-12-21 05:06:10
问题 since today i get an this error message for the same code like yesterday, but i changed nothing. i get this error message [WARN] [perchsearch] - Something other than an int was returned from JSNI method '@com.google.gwt.dom.client.DOMImplStandardBase$ClientRect::getTop()': Rounding double (178.40000915527344) to int for int and when i run the project on the browser a strange grafic object appears on the chrome browser (for firefox doesnt exists a gwt plugin for my version) , but i dont know

Links, Hyperlinks into a canvas using PDF.js

夙愿已清 提交于 2019-12-21 04:54:09
问题 I'm using PDF.js library to render a pdf into the canvas. That pdf has hyperlinks in there, The PDF.js library is drawing the pdf into the canvas but the hyperlinks doesn't work. Any Idea if it possible that hyperlinks works into the canvas? Thanks 回答1: Here is a fiddle that shows you how to enable annotations (including hyperlinks) in PDF files. The original PDF file used in the fiddle is here. I used viewer code (web/page_view.js,web/viewer.css) as refrence to write this fiddle. HTML: <

Mapping ui:field in GWT to generated code

爷,独闯天下 提交于 2019-12-21 04:27:13
问题 I'm trying to get some automated UI testing going on a GWT application and I'm having trouble finding a way to track UI elements. For example, I have the following: <g:Button text="Submit" ui:field="submitButton" enabled="true" /> which generates: <button class="gwt-Button" type="button">Submit</button> Its a compiler error to set both ui:field and id (id is considered deprecated anyway) so the problem is that I have no easy way to select my submit button using something like selenium. Is

When to use assert in client & common GWT code

陌路散爱 提交于 2019-12-21 04:13:34
问题 There are several questions on StackOverflow discussing the question of when one should use an assert statement versus throwing some exception. (Examples here, here, here, here, and here. However, I have come to suspect that the conventional wisdom of assert-versus-throw is based upon the assumption that you are running within a JVM. In the GWT universe, where your Java gets transliterated to JavaScript and runs in the context of a browser, the set of tradeoffs feels different: asserts are