本文整理汇总了Java中com.google.gwt.user.client.Window.ClosingEvent类的典型用法代码示例。如果您正苦于以下问题:Java ClosingEvent类的具体用法?Java ClosingEvent怎么用?Java ClosingEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ClosingEvent类属于com.google.gwt.user.client.Window包,在下文中一共展示了ClosingEvent类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initialize
import com.google.gwt.user.client.Window.ClosingEvent; //导入依赖的package包/类
public void initialize() {
addChangelayerListener();
addRemoveLayerListener();
addAddLayerListener();
addChangeSelectedWMSLayerListener();
Window.addWindowClosingHandler(new Window.ClosingHandler() {
@Override
public void onWindowClosing(final ClosingEvent event) {
event.setMessage(UIMessages.INSTANCE.leaveWebText());
}
});
}
示例2: GwtCommandDispatcher
import com.google.gwt.user.client.Window.ClosingEvent; //导入依赖的package包/类
private GwtCommandDispatcher() {
locale = LocaleInfo.getCurrentLocale().getLocaleName();
if ("default".equals(locale)) {
locale = null;
}
deferreds = new ArrayList<Deferred>();
service = (GeomajasServiceAsync) GWT.create(GeomajasService.class);
setServiceEndPointUrl(GWT.getModuleBaseURL() + "geomajasService");
setUseLazyLoading(true);
setShowError(true);
Window.addWindowClosingHandler(new ClosingHandler() {
public void onWindowClosing(ClosingEvent event) {
GwtCommandDispatcher.getInstance().setShowError(false);
// Cancel all outstanding requests:
for (Deferred deferred : deferreds) {
deferred.cancel();
}
}
});
}
示例3: setupWindowClosingHandler
import com.google.gwt.user.client.Window.ClosingEvent; //导入依赖的package包/类
private void setupWindowClosingHandler() {
Window.addWindowClosingHandler(new Window.ClosingHandler() {
@Override
public void onWindowClosing(ClosingEvent event) {
if (savingInProcess) {
event.setMessage("Failed to save your last changes.");
}
}
});
}
示例4: releaseLockOnClose
import com.google.gwt.user.client.Window.ClosingEvent; //导入依赖的package包/类
private void releaseLockOnClose() {
closeHandler = Window.addWindowClosingHandler(new ClosingHandler() {
@Override
public void onWindowClosing(ClosingEvent event) {
releaseLock();
}
});
}
示例5: createMenuCloseEvent
import com.google.gwt.user.client.Window.ClosingEvent; //导入依赖的package包/类
public static void createMenuCloseEvent(final String uuid, final WindowPanel sender) {
sender.addWindowClosingHandler(new ClosingHandler() {
public void onWindowClosing(ClosingEvent event) {
if (Window.confirm("Are you sure you want to close the application and all of its windows ?")) {
MainFactoryActions.remove(uuid);
ComponentRepository.getInstance().removeAllItemsForWindow(uuid, null);
// ClientApplicationContext.getInstance().closeAllWindowsForUUID(uuid);
// return true;
} else {
// return false;
}
Window.prompt("Are you sure you want to close the application and all of its windows ?", "X");
}
});
}
示例6: setUpHistoryManagement
import com.google.gwt.user.client.Window.ClosingEvent; //导入依赖的package包/类
/**
* Set up the History management for the application.
*/
public void setUpHistoryManagement(){
// Make this class your history manager (see onValueChange method)
History.addValueChangeHandler(this);
// Handle any existing history token
History.fireCurrentHistoryState();
// Trap user hitting back button too many times.
Window.addWindowClosingHandler(new ClosingHandler(){
public void onWindowClosing(ClosingEvent event) {
event.setMessage("Ran out of history. Now leaving application, is that OK?");
}
});
}
示例7: initWindowClosingConfirmationDialog
import com.google.gwt.user.client.Window.ClosingEvent; //导入依赖的package包/类
/**
* Display a confirmation dialog to leave our site when the user refreshes
* or goes to another URL.
*/
protected void initWindowClosingConfirmationDialog() {
Window.addWindowClosingHandler(new ClosingHandler() {
@Override
public void onWindowClosing(ClosingEvent event) {
// This message doesn't show, but by adding this close handler,
// we get the default dialog to display and confirm that the
// user does want to leave our site.
event.setMessage("Are you sure you want to leave?");
}
});
}
示例8: onWindowClosing
import com.google.gwt.user.client.Window.ClosingEvent; //导入依赖的package包/类
@Override
public void onWindowClosing(ClosingEvent p_event)
{
AppMain.getRpcService().disconnect( getMyPresence(), m_dummyCallback );
}
示例9: onWindowClosing
import com.google.gwt.user.client.Window.ClosingEvent; //导入依赖的package包/类
@Override
public void onWindowClosing(ClosingEvent event) {
event.setMessage("ゲームプレイ中にウィンドウを閉じた場合\nレーティングにペナルティが加わります\nよろしいですか?");
}
示例10: onWindowClosing
import com.google.gwt.user.client.Window.ClosingEvent; //导入依赖的package包/类
public void onWindowClosing(ClosingEvent event) {
}