本文整理汇总了Java中com.google.gwt.event.dom.client.ErrorEvent类的典型用法代码示例。如果您正苦于以下问题:Java ErrorEvent类的具体用法?Java ErrorEvent怎么用?Java ErrorEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ErrorEvent类属于com.google.gwt.event.dom.client包,在下文中一共展示了ErrorEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: undo
import com.google.gwt.event.dom.client.ErrorEvent; //导入依赖的package包/类
@Override
public void undo() {
ImageElementLoader loader=new ImageElementLoader();
loader.load(beforeUri, new ImageElementListener() {
@Override
public void onLoad(ImageElement element) {
canvas.getContext2d().save();
canvas.getContext2d().setGlobalCompositeOperation(Composite.COPY);
canvas.getContext2d().drawImage(element,0,0);
canvas.getContext2d().restore();
updateCurrentSelectionDataUrl(beforeUri);
}
@Override
public void onError(String url, ErrorEvent event) {
Window.alert(event.toDebugString());
}
});
}
示例2: redo
import com.google.gwt.event.dom.client.ErrorEvent; //导入依赖的package包/类
@Override
public void redo() {
ImageElementLoader loader=new ImageElementLoader();
loader.load(afterUri, new ImageElementListener() {
@Override
public void onLoad(ImageElement element) {
canvas.getContext2d().save();
canvas.getContext2d().setGlobalCompositeOperation(Composite.COPY);
canvas.getContext2d().drawImage(element,0,0);
canvas.getContext2d().restore();
updateCurrentSelectionDataUrl(afterUri);
}
@Override
public void onError(String url, ErrorEvent event) {
Window.alert(event.toDebugString());
}
});
}
示例3: execAsync
import com.google.gwt.event.dom.client.ErrorEvent; //导入依赖的package包/类
@Override
public void execAsync(final String data) {
new ImageElementLoader().load(data, new ImageElementListener() {
@Override
public void onLoad(ImageElement element) {
done(data,true);
imageElements.add(element);
}
@Override
public void onError(String url, ErrorEvent event) {
done(data,false);
}
});
}
示例4: doCropSrcs
import com.google.gwt.event.dom.client.ErrorEvent; //导入依赖的package包/类
protected void doCropSrcs() {
resetCanvas();
ImageElementUtils.createWithLoader(backgroundDataUrl,new ImageElementListener() {
@Override
public void onLoad(ImageElement element) {
//Window.open(overlayCanvas.toDataUrl(), "hello", null);
canvas.getContext2d().save();
canvas.getContext2d().setGlobalCompositeOperation(Composite.DESTINATION_OUT);
canvas.getContext2d().drawImage(element, 0, 0);//TODO support scale
canvas.getContext2d().restore();
updateCanvas();
}
@Override
public void onError(String url, ErrorEvent event) {
// TODO Auto-generated method stub
}
});
}
示例5: updateAppImage
import com.google.gwt.event.dom.client.ErrorEvent; //导入依赖的package包/类
/**
* Helper method to update the app image
* @param url The URL of the image to show
* @param container The container that image widget resides
*/
private void updateAppImage(String url, final Panel container) {
image = new Image();
image.addStyleName("app-image");
image.setUrl(url);
// if the user has provided a gallery app image, we'll load it. But if not
// the error will occur and we'll load default image
image.addErrorHandler(new ErrorHandler() {
public void onError(ErrorEvent event) {
image.setUrl(GalleryApp.DEFAULTGALLERYIMAGE);
}
});
container.add(image);
if(gallery.getSystemEnvironment() != null &&
gallery.getSystemEnvironment().toString().equals("Development")){
final OdeAsyncCallback<String> callback = new OdeAsyncCallback<String>(
// failure message
MESSAGES.galleryError()) {
@Override
public void onSuccess(String newUrl) {
image.setUrl(newUrl + "?" + System.currentTimeMillis());
}
};
Ode.getInstance().getGalleryService().getBlobServingUrl(url, callback);
}
}
示例6: updateUserImage
import com.google.gwt.event.dom.client.ErrorEvent; //导入依赖的package包/类
/**
* Helper method to update the user's image
* @param url The URL of the image to show
* @param container The container that image widget resides
*/
private void updateUserImage(final String url, Panel container) {
userAvatar = new Image();
//setUrl if the new URL is the same one as it was before; an easy workaround is
//to make the URL unique so it forces the browser to reload
userAvatar.setUrl(url + "?" + System.currentTimeMillis());
userAvatar.addStyleName("app-image");
if (profileStatus == PRIVATE) {
//userAvatar.addStyleName("status-updating");
}
// if the user has provided a gallery app image, we'll load it. But if not
// the error will occur and we'll load default image
userAvatar.addErrorHandler(new ErrorHandler() {
public void onError(ErrorEvent event) {
userAvatar.setUrl(GalleryApp.DEFAULTUSERIMAGE);
}
});
container.add(userAvatar);
if(gallery.getSystemEnvironment() != null &&
gallery.getSystemEnvironment().toString().equals("Development")){
final OdeAsyncCallback<String> callback = new OdeAsyncCallback<String>(
// failure message
MESSAGES.galleryError()) {
@Override
public void onSuccess(String newUrl) {
userAvatar.setUrl(newUrl + "?" + System.currentTimeMillis());
}
};
Ode.getInstance().getGalleryService().getBlobServingUrl(url, callback);
}
}
示例7: GalleryAppWidget
import com.google.gwt.event.dom.client.ErrorEvent; //导入依赖的package包/类
private GalleryAppWidget(final GalleryApp app) {
nameLabel = new Label(app.getTitle());
authorLabel = new Label(app.getDeveloperName());
numDownloadsLabel = new Label(Integer.toString(app.getDownloads()));
numLikesLabel = new Label(Integer.toString(app.getLikes()));
numViewsLabel = new Label(Integer.toString(app.getViews()));
numCommentsLabel = new Label(Integer.toString(app.getComments()));
image = new Image();
image.addErrorHandler(new ErrorHandler() {
public void onError(ErrorEvent event) {
image.setUrl(GalleryApp.DEFAULTGALLERYIMAGE);
}
});
String url = gallery.getCloudImageURL(app.getGalleryAppId());
image.setUrl(url);
if(gallery.getSystemEnvironment() != null &&
gallery.getSystemEnvironment().toString().equals("Development")){
final OdeAsyncCallback<String> callback = new OdeAsyncCallback<String>(
// failure message
MESSAGES.galleryError()) {
@Override
public void onSuccess(String newUrl) {
image.setUrl(newUrl + "?" + System.currentTimeMillis());
}
};
Ode.getInstance().getGalleryService().getBlobServingUrl(url, callback);
}
}
示例8: onError
import com.google.gwt.event.dom.client.ErrorEvent; //导入依赖的package包/类
/** {@inheritDoc}) */
@Override
public void onError(ErrorEvent e) {
if (completed) {
return;
}
cleanUp();
spinner.setVisible(false);
error.setVisible(true);
}
示例9: onError
import com.google.gwt.event.dom.client.ErrorEvent; //导入依赖的package包/类
@Override
public void onError(ErrorEvent event) {
loadFailed = true;
ClientUtils.warning(LOG, "image onError: %s", image.getUrl());
Img img = new Img("[SKIN]/Dialog/warn.png", 2 * 16, 2 * 16);
img.setLayoutAlign(Alignment.CENTER);
img.setAltText(i18n.DigitalObjectPreview_NoContent_Msg());
img.setPrompt(i18n.DigitalObjectPreview_NoContent_Msg());
imgContainer.setMembers(img);
}
示例10: onError
import com.google.gwt.event.dom.client.ErrorEvent; //导入依赖的package包/类
public void onError(ErrorEvent ev) {
Object src = ev.getSource();
if (src instanceof Image) {
Image image = (Image) src;
image.setUrl("images/blank_image_icon.png");
}
}
示例11: onError
import com.google.gwt.event.dom.client.ErrorEvent; //导入依赖的package包/类
public void onError(ErrorEvent ev) {
Object src = ev.getSource();
if (src instanceof Image) {
Image image = (Image)src;
image.setUrl("images/blank_image_icon.png");
}
}
示例12: loadFile
import com.google.gwt.event.dom.client.ErrorEvent; //导入依赖的package包/类
protected void loadFile(final File file, String asStringText) {
ImageElementUtils.createWithLoader(asStringText, new ImageElementListener() {
@Override
public void onLoad(ImageElement element) {
loadFile(file,element);
}
@Override
public void onError(String url, ErrorEvent event) {
LogUtils.log(event.getNativeEvent());
}
});
}
示例13: ImageSprite
import com.google.gwt.event.dom.client.ErrorEvent; //导入依赖的package包/类
public ImageSprite(Sprite sprite) {
this.sprite = sprite;
addErrorHandler(new ErrorHandler(){
public void onError(ErrorEvent event) {
Window.alert(appMessages.paragraphCannotLoadImage(backImage.getUrl()));
}
});
setUrl(sprite.getPicture().getUrl());
}
示例14: onError
import com.google.gwt.event.dom.client.ErrorEvent; //导入依赖的package包/类
public void onError(ErrorEvent event) {
nrAttempts--;
if (nrAttempts > 0) {
asImage().addLoadHandler(this);
asImage().addErrorHandler(this);
asImage().setUrl(src);
} else if (onDoneLoading != null) {
onDoneLoading.onFailure(src);
}
}
示例15: onError
import com.google.gwt.event.dom.client.ErrorEvent; //导入依赖的package包/类
/** {@inheritDoc}) */
public void onError(ErrorEvent e) {
if (completed) {
return;
}
cleanUp();
spinner.setVisible(false);
error.setVisible(true);
}