public RoomsPanel() { setStyleName("roomsPanel"); SmartTable header = new SmartTable("Info", 0, 0); header.setWidget(0, 0, new Marquee(null, _msgs.roomsMarquee()), 1); header.getFlexCellFormatter().setVerticalAlignment(0, 0, HasAlignment.ALIGN_TOP); header.setText(1, 0, _msgs.roomsIntro(), 1, "Intro"); Widget button = MsoyUI.createImageButton( "TourButton", new ClickHandler() { public void onClick(ClickEvent event) { if (FlashClients.clientExists()) { FlashClients.startTour(); } else { Link.go(Pages.WORLD, "tour"); } } }); header.setWidget(0, 1, button, 1, "Tour"); header.getFlexCellFormatter().setRowSpan(0, 1, 2); header.getFlexCellFormatter().setHorizontalAlignment(0, 1, HasAlignment.ALIGN_CENTER); add(header); _worldsvc.loadOverview( new InfoCallback<WebRoomService.OverviewResult>() { public void onSuccess(WebRoomService.OverviewResult overview) { init(overview); } }); }
protected void displayThanks() { clear(); SmartTable box = new SmartTable(0, 10); box.setText(0, 0, _msgs.configThanks()); box.setWidget( 1, 0, MsoyUI.createButton(MsoyUI.MEDIUM_THIN, _msgs.configGoBack(), NaviUtil.onGoBack())); box.getFlexCellFormatter().setHorizontalAlignment(1, 0, HasAlignment.ALIGN_CENTER); add(box); }
protected void init(final GameData data) { clear(); SmartTable header = new SmartTable("Header", 0, 10); header.setText(0, 0, data.info.name, 1, "Title"); header.setWidget(0, 1, MsoyUI.createHTML(_msgs.egTip(), null), 1, "Tip"); Button delete = new Button(_msgs.egDelete()); header.setWidget(0, 2, delete); header.getFlexCellFormatter().setHorizontalAlignment(0, 2, HasAlignment.ALIGN_RIGHT); add(header); // wire up the delete button new ClickCallback<Void>(delete, _msgs.egDeleteConfirm()) { @Override protected boolean callService() { _gamesvc.deleteGame(data.info.gameId, this); return true; } @Override protected boolean gotResult(Void result) { Link.go(Pages.EDGAMES, "m"); return true; } }; // add our giant tab list of doom add( _tabs = new NaviTabPanel(Pages.EDGAMES) { protected Args getTabArgs(int tabIdx) { return Args.compose("e", _gameId, tabIdx); } }); _tabs.add( new LazyPanel() { protected Widget createWidget() { return new InfoEditorPanel(data); } }, _msgs.egTabInfo()); _tabs.add( new LazyPanel() { protected Widget createWidget() { return new CodeEditorPanel(data.info, data.devCode); } }, _msgs.egTabCode()); _tabs.add( new LazyPanel() { protected Widget createWidget() { return new PublishPanel(data); } @Override public void setVisible(boolean visible) { if (!visible) { setWidget(null); // clear out our panel when we change tabs } super.setVisible(visible); } }, _msgs.egTabPublish()); _tabs.add( new LazyPanel() { protected Widget createWidget() { return new FacebookGameInfoEditorPanel(data.facebook); } }, _msgs.egTabFacebook()); // NOTE: if you add a tab here, you have to adjust StuffPage.PRE_ITEM_TABS for (final MsoyItemType type : GameItem.TYPES) { _tabs.add( new LazyPanel() { protected Widget createWidget() { return new GameItemEditorPanel(data.info.gameId, type); } }, _dmsgs.xlateItemsType(type)); } }