Example usage for com.google.gwt.user.client Window alert

List of usage examples for com.google.gwt.user.client Window alert

Introduction

In this page you can find the example usage for com.google.gwt.user.client Window alert.

Prototype

public static void alert(String msg) 

Source Link

Usage

From source file:com.beyobe.client.MgwtAppEntryPoint.java

License:Apache License

@Override
public void onModuleLoad() {

    GWT.setUncaughtExceptionHandler(new UncaughtExceptionHandler() {

        @Override/*from  w w w  .ja v a  2s .  c  o  m*/
        public void onUncaughtException(Throwable e) {
            //TODO put in your own meaninful handler
            Window.alert("Sorry! Unexpected error: " + e.getMessage());
            e.printStackTrace();

        }
    });

    new Timer() {
        @Override
        public void run() {
            start();

        }
    }.schedule(1);

}

From source file:com.canoo.gwt.contentflow4gwt.client.ContentFlowDemo.java

License:Open Source License

public void onModuleLoad() {
    GWT.setUncaughtExceptionHandler(new GWT.UncaughtExceptionHandler() {
        public void onUncaughtException(Throwable e) {
            Window.alert("Exception: " + e.getMessage());
        }/*  w  w w.j av  a 2 s  .com*/
    });

    Button inButtonPhotos = new Button("Come in with photos!", new ClickHandler() {
        public void onClick(ClickEvent event) {
            doAnimateContentFlowIn();
        }
    });

    Panel buttonsPanel = new FlowPanel();

    buttonsPanel.add(inButtonPhotos);

    RootPanel.get().add(buttonsPanel);
}

From source file:com.canoo.gwt.contentflow4gwt.client.ContentFlowDemo.java

License:Open Source License

private ContentFlowPopupPanel<Person> doAnimateContentFlowIn() {
    int horizontalMargin = (Window.getClientWidth() - POPUP_WIDTH) / 2;
    int verticalMargin = (Window.getClientHeight() - POPUP_HEIGHT) / 2;
    final int initialLeft = Window.getClientWidth() + horizontalMargin;

    ContentFlow<Person> contentFlow = new ContentFlow<Person>(true, true);
    addItems(contentFlow, PEOPLE.length);
    final ContentFlowPopupPanel<Person> popupPanel = new ContentFlowPopupPanel<Person>(contentFlow);

    popupPanel.setSize(POPUP_WIDTH + "px", POPUP_HEIGHT + "px");
    popupPanel.setPopupPosition(initialLeft, verticalMargin);
    contentFlow.addItemClickListener(new ContentFlowItemClickListener() {
        public void onItemClicked(Widget widget) {
            Window.alert("Clicked: ");
        }/*  www.  j  a  va  2  s  . c o m*/
    });
    popupPanel.show();

    animatePopupPanel(popupPanel, initialLeft, horizontalMargin, ANIMATION_DURATION);

    return popupPanel;
}

From source file:com.centretown.parts.client.dispatch.AsyncCallbackImpl.java

License:Apache License

@Override
public void onFailure(Throwable caught) {
    String msg = "The server has taken excepton to your request: ";
    if (caught != null)
        msg += caught.getLocalizedMessage();
    Window.alert(msg);
}

From source file:com.chap.links.client.GraphDemo2_interactive_and_custom_css.java

License:Apache License

/**
 * Get the entered dates from the textboxes on screen, and apply them to
 * the timeline/*from   www  . ja  va2 s  .  c o  m*/
 */
private void setRange() {
    DateTimeFormat datetime = DateTimeFormat.getFormat("yyyy-MM-dd HH:mm:ss");
    DateTimeFormat date = DateTimeFormat.getFormat("yyyy-MM-dd");

    Date startDate;
    Date endDate;

    // Try to parse the startdate
    try {
        startDate = datetime.parse(txtStartDate.getText());
    } catch (IllegalArgumentException err) {
        try {
            startDate = date.parse(txtStartDate.getText());
        } catch (IllegalArgumentException err2) {
            Window.alert("I don't understand the startdate that you entered :(");
            return;
        }
    }

    // Try to parse the enddate
    try {
        endDate = datetime.parse(txtEndDate.getText());
    } catch (IllegalArgumentException err) {
        try {
            endDate = date.parse(txtEndDate.getText());
        } catch (IllegalArgumentException err2) {
            Window.alert("I cannot make sense of the enddate that you entered :(");
            return;
        }
    }

    graph.setVisibleChartRange(startDate, endDate);
    graph.redraw();
}

From source file:com.charlie.client.panels.SonglistPanel.java

License:Open Source License

private Menu createContextMenu() {
    Menu menu = new Menu();

    // MenuItem addUser = new MenuItem("Add Song", new
    // SelectionListener<MenuEvent>() {
    ////from w  ww.  ja  v  a  2  s .c o  m
    // @Override
    // public void componentSelected(MenuEvent ce) {
    // Controller.getEventBuss().fireEvent(new
    // UploadYourMusicEvent());
    //
    // }
    //
    // });
    // addUser.setIcon(Controller.getIntsance().getIcons().addSong());
    // menu.add(addUser);

    MenuItem removeTopLevelMenu = new MenuItem("Remove");
    Menu removeSubMenu = new Menu();

    MenuItem removeUser = new MenuItem("Remove Song from view", new SelectionListener<MenuEvent>() {

        @Override
        public void componentSelected(MenuEvent ce) {

            List<SongModelData> songs = getSelectedSongs();
            if (songs != null) {
                if (Controller.getIntsance().isPlaylistEditMode()) {
                    Controller.getEventBus().fireEvent(
                            new RemoveSongFromPlaylistEvent(Controller.getIntsance().getPlaylist(), songs));

                    for (SongModelData songModelData : songs) {

                        grid.getStore().remove(songModelData);

                    }
                    Controller.getPlaylistManager().removeSongsFromPlaylist(songs);

                } else {
                    MP3PlayerInfo.display("Info", "Removing " + songs.size() + " songs from this view.");
                    for (SongModelData songModelData : songs) {

                        grid.getStore().remove(songModelData);

                    }

                    Controller.getPlaylistManager().removeSongsFromPlaylist(songs);
                }

            }

        }

    });

    MenuItem removeArtist = new MenuItem("Remove Artist from view", new SelectionListener<MenuEvent>() {

        @Override
        public void componentSelected(MenuEvent ce) {

            List<SongModelData> songs = new ArrayList<SongModelData>();
            List<SongModelData> selectedSongs = getSelectedSongs();

            for (SongModelData songModelData : selectedSongs) {

                songs.addAll(getSongsByArtist(songModelData));
            }

            if (songs != null) {
                if (Controller.getIntsance().isPlaylistEditMode()) {
                    Controller.getEventBus().fireEvent(
                            new RemoveSongFromPlaylistEvent(Controller.getIntsance().getPlaylist(), songs));

                    for (SongModelData songModelData : songs) {

                        grid.getStore().remove(songModelData);

                    }

                    Controller.getPlaylistManager().removeSongsFromPlaylist(songs);

                } else {
                    MP3PlayerInfo.display("Info", "Removing " + songs.size() + " songs from this view.");
                    for (SongModelData songModelData : songs) {

                        grid.getStore().remove(songModelData);

                    }
                    Controller.getPlaylistManager().removeSongsFromPlaylist(songs);
                }

            }

        }

    });

    removeTopLevelMenu.setIcon(Controller.getIntsance().getIcons().deleteSong());
    removeTopLevelMenu.setSubMenu(removeSubMenu);
    removeSubMenu.add(removeUser);
    removeSubMenu.add(removeArtist);

    // menu.add(new SeparatorMenuItem());
    // MenuItem recommendThisTopLevelMenu = new MenuItem("Recommend this");
    // Menu recommendThisSubMenu = new Menu();
    //
    // MenuItem recomendThisToAFriend = new
    // MenuItem("Recommend this to a friend", new
    // SelectionListener<MenuEvent>() {
    //
    // @Override
    // public void componentSelected(MenuEvent ce) {
    // selectUserDialog.setRecommendationModelData(getRecommendationModelDataFromCurrentSelection());
    // selectUserDialog.show();
    //
    // }
    //
    // });
    // MenuItem recommendThisToAllFriends = new
    // MenuItem("Recommend this to all friends",
    // new SelectionListener<MenuEvent>() {
    //
    // @Override
    // public void componentSelected(MenuEvent ce) {
    // Controller.getEventBuss().fireEvent(
    // new
    // AddRecommendationEvent(getRecommendationModelDataFromCurrentSelection()));
    //
    // }
    //
    // });
    //
    // recomendThisToAFriend.setIcon(Controller.getIntsance().getIcons().recommendation());
    // recommendThisToAllFriends.setIcon(Controller.getIntsance().getIcons().recommendations());
    //
    // recommendThisSubMenu.add(recomendThisToAFriend);
    // recommendThisSubMenu.add(recommendThisToAllFriends);
    //
    // recommendThisTopLevelMenu.setIcon(Controller.getIntsance().getIcons().recommendations());
    //
    // recommendThisTopLevelMenu.setSubMenu(recommendThisSubMenu);
    //
    // menu.add(recommendThisTopLevelMenu);

    MenuItem nowPlaylingTopLevelMenu = new MenuItem("Add to now playing");
    nowPlaylingTopLevelMenu.setIcon(Controller.getIntsance().getIcons().bulletImage());
    Menu nowPlayingSubMenu = new Menu();
    nowPlaylingTopLevelMenu.setSubMenu(nowPlayingSubMenu);

    MenuItem nowPlayingAddToEnd = new MenuItem("Add To End", new SelectionListener<MenuEvent>() {

        @Override
        public void componentSelected(MenuEvent ce) {

            Controller.getPlaylistManager().addSongsToPlaylist(getSelectedSongs());

        }
    });

    MenuItem nowPlayingAddAfterCurrent = new MenuItem("Add After Current", new SelectionListener<MenuEvent>() {

        @Override
        public void componentSelected(MenuEvent ce) {
            Controller.getPlaylistManager().addSongsToPlaylistAfterCurrentSong(getSelectedSongs());

        }
    });

    nowPlayingSubMenu.add(nowPlayingAddToEnd);
    nowPlayingSubMenu.add(nowPlayingAddAfterCurrent);

    playlistTopLevelMenu = new MenuItem("Add to playlist");
    playlistSubMenu = new Menu();
    playlistTopLevelMenu.setSubMenu(playlistSubMenu);

    newPlaylist = new MenuItem("New Playlist", new SelectionListener<MenuEvent>() {

        @Override
        public void componentSelected(MenuEvent ce) {
            if (Controller.getIntsance().isDemoMode()) {
                Controller.getIntsance().showSignupDialog();

            } else {
                final Listener<MessageBoxEvent> onOk = new Listener<MessageBoxEvent>() {
                    public void handleEvent(MessageBoxEvent ce) {
                        if (ce.getButtonClicked().getText().equals("Ok")) {
                            Controller.getEventBus()
                                    .fireEvent(new AddPlaylistEvent(ce.getValue(), new AsyncCallback<Long>() {

                                        @Override
                                        public void onSuccess(Long result) {

                                            Controller.getEventBus().fireEvent(
                                                    new AddSongToPlaylistEvent(result, getSelectedSongs()));
                                            DeferredCommand.addCommand(new Command() {

                                                @Override
                                                public void execute() {
                                                    Controller.getEventBus()
                                                            .fireEvent(new PlaylistsNeedReloadingEvent());

                                                }
                                            });
                                        }

                                        @Override
                                        public void onFailure(Throwable caught) {
                                            Window.alert("FAILED");

                                        }
                                    }));

                        }
                    }
                };

                MessageBox box = new MessageBox();
                box.setButtons(MessageBox.OKCANCEL);
                box.setIcon(MessageBox.QUESTION);
                box.setType(MessageBox.MessageBoxType.PROMPT);

                box.setTitle("Playlist Name?");
                box.setMinWidth(300);
                box.addCallback(onOk);
                box.show();
            }

        }

    });

    playlistTopLevelMenu.setIcon(Controller.getIntsance().getIcons().musicNoteImage());

    // MenuItem createPlaylistTopLevelMenu = new
    // MenuItem("Create playlist");
    // createPlaylistTopLevelMenu.setIcon(Controller.getIntsance().getIcons().searchSongs());
    //
    // Menu createPlaylistSubMenu = new Menu();
    //      
    // MenuItem createPlaylistOfThisArtist = new MenuItem("Of This Artist",
    // new SelectionListener<MenuEvent>() {
    //
    // @Override
    // public void componentSelected(MenuEvent ce) {
    //
    // Controller.getEventBuss().fireEvent(
    // new CreatePlaylistOfThisArtistEvent(getSelectedSong()));
    //
    // }
    //
    // });
    //      
    // MenuItem createPlaylistOfThisAndSimilarArtist = new
    // MenuItem("Of This And Similar Artist", new
    // SelectionListener<MenuEvent>() {
    //
    // @Override
    // public void componentSelected(MenuEvent ce) {
    //
    // Controller.getEventBuss().fireEvent(
    // new CreatePlaylistOfThisAndSimilarArtistsEvent(getSelectedSong()));
    //
    // }
    //
    // });
    //      
    //      
    //      
    // createPlaylistSubMenu.add(createPlaylistOfThisArtist);
    // createPlaylistSubMenu.add(createPlaylistOfThisAndSimilarArtist);
    //      
    //      
    // createPlaylistTopLevelMenu.setSubMenu(createPlaylistSubMenu);
    // menu.add(createPlaylistTopLevelMenu);

    // menu.add(new SeparatorMenuItem());

    MenuItem searchTopLevelMenu = new MenuItem("Search");
    searchTopLevelMenu.setIcon(Controller.getIntsance().getIcons().searchSongs());

    Menu searchSubMenu = new Menu();

    MenuItem searchArtist = new MenuItem("Search for this Artist", new SelectionListener<MenuEvent>() {

        @Override
        public void componentSelected(MenuEvent ce) {

            Controller.getEventBus().fireEvent(new SearchSongsByArtistFromAllFriendsPagedEvent(
                    Controller.getIntsance().getPlaylistUserId(), getSelectedSong().getArtist()));

        }

    });
    // searchArtist.setIcon(Controller.getIntsance().getIcons().searchSongs());

    MenuItem searchAlbulm = new MenuItem("Search for this Album", new SelectionListener<MenuEvent>() {

        @Override
        public void componentSelected(MenuEvent ce) {

            Controller.getEventBus().fireEvent(new SearchSongsByAlbumFromAllFriendsPagedEvent(
                    Controller.getIntsance().getPlaylistUserId(), getSelectedSong().getAlbum()));

        }

    });
    // searchAlbulm.setIcon(Controller.getIntsance().getIcons().searchSongs());

    MenuItem searchGenre = new MenuItem("Search for this Genre", new SelectionListener<MenuEvent>() {

        @Override
        public void componentSelected(MenuEvent ce) {

            Controller.getEventBus().fireEvent(new SearchSongsByGenreFromAllFriendsPagedEvent(
                    Controller.getIntsance().getPlaylistUserId(), getSelectedSong().getGenre()));

        }

    });
    // searchGenre.setIcon(Controller.getIntsance().getIcons().searchSongs());
    MenuItem searchSimilarArtists = new MenuItem("Search for this and Similar Artists",
            new SelectionListener<MenuEvent>() {

                @Override
                public void componentSelected(MenuEvent ce) {

                    Controller.getEventBus()
                            .fireEvent(new SearchSongsByThisAndSimilarArtistsFromAllFriendsPagedEvent(
                                    Controller.getIntsance().getPlaylistUserId(),
                                    getSelectedSong().getArtist()));

                }

            });
    searchSubMenu.add(searchSimilarArtists);
    searchSubMenu.add(new SeparatorMenuItem());
    searchSubMenu.add(searchArtist);
    searchSubMenu.add(searchAlbulm);
    searchSubMenu.add(searchGenre);

    searchTopLevelMenu.setSubMenu(searchSubMenu);

    MenuItem infoTopLevelMenu = new MenuItem("Info");
    infoTopLevelMenu.setIcon(Controller.getIntsance().getIcons().similarArtist());

    Menu infoSubMenu = new Menu();

    MenuItem artistInfo = new MenuItem("View Artist Info", new SelectionListener<MenuEvent>() {

        @Override
        public void componentSelected(MenuEvent ce) {

            SongModelData song = getSelectedSong();
            if (song != null) {
                Controller.getEventBus().fireEvent(new ArtistInfoEvent(song.getArtist()));

            }

        }

    });

    infoSubMenu.add(artistInfo);

    // infoSubMenu.add(similarArtists);

    MenuItem artistPhotos = new MenuItem("View Artist Photos", new SelectionListener<MenuEvent>() {

        @Override
        public void componentSelected(MenuEvent ce) {

            SongModelData song = getSelectedSong();
            if (song != null) {
                Controller.getEventBus().fireEvent(new ArtistPhotosEvent(song.getArtist()));

            }

        }

    });

    infoSubMenu.add(artistPhotos);
    infoSubMenu.add(new SeparatorMenuItem());

    MenuItem editSongInfo = new MenuItem("Edit Song Info", new SelectionListener<MenuEvent>() {

        @Override
        public void componentSelected(MenuEvent ce) {

            SongModelData song = getSelectedSong();
            if (song != null) {

                editSongInfoDialog.setSongModelData(song);
                if (Controller.getIntsance().isDemoMode()) {
                    Controller.getIntsance().showSignupDialog();

                } else if (song.getUserId().equals(Controller.getIntsance().getUserId())) {
                    editSongInfoDialog.show();
                } else {
                    MessageBox.alert("I love you", "Sorry!  You need to be the owner of this song to edit it",
                            new Listener<MessageBoxEvent>() {

                                @Override
                                public void handleEvent(MessageBoxEvent be) {
                                    // TODO Auto-generated method stub

                                }
                            });
                }

            }

        }

    });

    infoSubMenu.add(editSongInfo);

    infoTopLevelMenu.setSubMenu(infoSubMenu);

    MenuItem showTopLevelMenu = new MenuItem("Show Music");
    showTopLevelMenu.setIcon(Controller.getIntsance().getIcons().bulletImage());

    Menu showSubMenu = new Menu();

    MenuItem showAllMusic = new MenuItem("All Music", new SelectionListener<MenuEvent>() {

        @Override
        public void componentSelected(MenuEvent ce) {
            Controller.getEventBus().fireEvent(new GetSongsForAllEvent(Controller.getIntsance().getUserId()));

        }

    });

    MenuItem nowPlaying = new MenuItem("Now Playing", new SelectionListener<MenuEvent>() {

        @Override
        public void componentSelected(MenuEvent ce) {
            Controller.getEventBus().fireEvent(new ShowNowPlayingEvent());

        }
    });

    MenuItem collectedMusic = new MenuItem("The Collective", new SelectionListener<MenuEvent>() {

        @Override
        public void componentSelected(MenuEvent ce) {
            Controller.getEventBus().fireEvent(
                    new GetCollectiveSongsForUserAndAllFriendsEvent(Controller.getIntsance().getUserId()));

        }
    });

    MenuItem recentlyUploaded = new MenuItem("Recently Uploaded", new SelectionListener<MenuEvent>() {

        @Override
        public void componentSelected(MenuEvent ce) {
            Controller.getEventBus()
                    .fireEvent(new GetRecentlyUploadedSongsFromAllEvent(Controller.getIntsance().getUserId()));

        }
    });

    showSubMenu.add(nowPlaying);
    showSubMenu.add(collectedMusic);
    showSubMenu.add(showAllMusic);
    showSubMenu.add(recentlyUploaded);

    showTopLevelMenu.setSubMenu(showSubMenu);

    MenuItem userTopLevelMenu = new MenuItem("Users");
    userTopLevelMenu.setIcon(Controller.getIntsance().getIcons().bulletImage());

    Menu userSubMenu = new Menu();

    MenuItem showMusicFromThisPerson = new MenuItem("Show This Users Music",
            new SelectionListener<MenuEvent>() {

                @Override
                public void componentSelected(MenuEvent ce) {
                    SongModelData selectedSong = getSelectedSong();

                    if (selectedSong != null) {

                        Controller.getEventBus().fireEvent(new GetSongsForUserEvent(selectedSong.getUserId()));
                    }

                }
            });

    MenuItem showCollectiveFromThisPerson = new MenuItem("Show This Users Collective",
            new SelectionListener<MenuEvent>() {

                @Override
                public void componentSelected(MenuEvent ce) {
                    SongModelData song = getSelectedSong();
                    if (song != null && song.getUserId() != null) {
                        Controller.getEventBus()
                                .fireEvent(new GetCollectiveSongsForUserEvent(song.getUserId()));
                    }

                }
            });

    /*      MenuItem inviteFriend = new MenuItem("Invite This User as a Friend", new SelectionListener<MenuEvent>() {
            
             @Override
             public void componentSelected(MenuEvent ce) {
    if (getSelectedSong() != null) {
       Long userId = getSelectedSong().getUserId();
       if (!Controller.getIntsance().isFriendsWith(userId)) {
          Controller.getEventBus().fireEvent(new InviteFriendByUserIdEvent(userId));
       } else
          MP3PlayerInfo.display("Oops!", "Looks like you are already friends with this person!");
    }
            
             }
          });
    */
    userSubMenu.add(showMusicFromThisPerson);
    userSubMenu.add(showCollectiveFromThisPerson);
    userSubMenu.add(new SeparatorMenuItem());
    //      userSubMenu.add(inviteFriend);

    userTopLevelMenu.setSubMenu(userSubMenu);
    userTopLevelMenu.setIcon(Controller.getIntsance().getIcons().getHappyFace());

    menu.add(showTopLevelMenu);
    menu.add(new SeparatorMenuItem());
    menu.add(searchTopLevelMenu);
    menu.add(new SeparatorMenuItem());
    menu.add(nowPlaylingTopLevelMenu);
    menu.add(new SeparatorMenuItem());
    menu.add(playlistTopLevelMenu);
    menu.add(new SeparatorMenuItem());
    menu.add(infoTopLevelMenu);
    menu.add(new SeparatorMenuItem());
    menu.add(userTopLevelMenu);
    menu.add(new SeparatorMenuItem());
    menu.add(removeTopLevelMenu);

    return menu;
}

From source file:com.chinarewards.gwt.license.client.core.presenter.DockPresenterImpl.java

public void bind() {
    List<UserRoleVo> roleslt = new ArrayList<UserRoleVo>();
    UserRoleVo[] roles = sessionManager.getSession().getUserRoles();

    if (roles.length > 0) {
        for (UserRoleVo r : roles) {
            roleslt.add(r);/*from w  w  w  .  j a  v  a  2  s.c om*/
        }
        if (!roleslt.contains(UserRoleVo.CORP_ADMIN)) {
            display.disableManagementCenter();
        }
        if (!roleslt.contains(UserRoleVo.STAFF)) {
            display.disableStaffCenter();
        }
    }

    registerHandler(display.getlogBtn().addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            eventBus.fireEvent(new LoginEvent(LoginEvent.LoginStatus.LOGOUT));
        }
    }));

    registerHandler(display.getBtnCollection().addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            Window.alert("?");
        }
    }));

    registerHandler(display.getStaffCenter().addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            dispatchAsync.execute(
                    new LastLoginRoleRequest(sessionManager.getSession().getToken(), UserRoleVo.STAFF),
                    new AsyncCallback<LastLoginRoleResponse>() {

                        @Override
                        public void onFailure(Throwable e) {
                            // Window.alert("?");
                        }

                        @Override
                        public void onSuccess(LastLoginRoleResponse resp) {
                            // ?
                            if ("success".equals(resp.getFal()))
                                Window.Location.reload();
                            else
                                Window.alert("?");

                        }
                    });

        }
    }));

}

From source file:com.chinarewards.gwt.license.client.core.ui.impl.SimpleEditorRegistry.java

public void openEditor(String editorId, String instanceId, Object model) {
    EditorDescriptor d = editors.get(editorId);
    Editor e;//  w ww . ja v  a 2  s  . c o m
    if (!openedEditors.containsKey(instanceId)) {
        // create an editor
        Editor editor = d.createEditor(instanceId, model);
        // open it using site manager
        platform.getSiteManager().openEditor(editor);
        // put it in opened list
        // avoid instanceId mismatch, use passed-in parameter
        //     openedEditors.put(instanceId, editor);
        e = editor;
        // alert to the user for development time correction
        if (instanceId != null && !instanceId.equals(editor.getInstanceId())) {
            Window.alert("Editor '" + editorId + "' Error: InstanceID " + editor.getInstanceId()
                    + " mismatched.  Should be " + instanceId);
        }
    } else {
        e = openedEditors.get(instanceId);

    }
    // focus the tab

    platform.getSiteManager().focusEditor(e);
}

From source file:com.chinarewards.gwt.license.client.core.ui.impl.SimpleEditorRegistry.java

public void closeEditor(String editorId, String instanceId) {
    Editor e = openedEditors.get(instanceId);
    if (e != null) {
        if (e.beforeClose()) {
            eventBus.fireEvent(new EditorCloseEvent(e.getEditorId(), e.getInstanceId()));
        }// ww w. j a  v a 2  s  .  c  o m
    } else {
        Window.alert("Editor '" + editorId + "': InstanceID " + instanceId + " not opened.");
    }
}

From source file:com.chinarewards.gwt.license.client.core.ui.impl.SimpleSiteManager.java

public void onValueChange(ValueChangeEvent<String> event) {
    String token = event.getValue();
    Window.alert("History: " + token);
    // if (token != null && token.startsWith("menu:")) {
    // if (menuProcessor != null) {
    // MenuItem i = menuProcessor.getMenuItem(token.substring(5));
    // if (i != null) {
    // i.execute();
    // }// w w  w .j  a v  a 2  s .  c  o m
    // }
    // } else if (token != null && token.startsWith("editor:")) {
    // Window.alert("TODO: Should open an editor: " + token);
    // // XXX how to get the model object to the editor?
    // }
}