List of usage examples for com.google.gwt.user.client Window open
public static void open(String url, String name, String features)
From source file:com.dawg6.web.dhcalc.client.LeaderboardPanel.java
License:Open Source License
protected void leaderboardLink() { Realm realm = mainPanel.getSelectedRealm(); Integer season = getSelectedSeason(); LeaderboardType type = getSelectedLeaderboard(); if ((realm != null) && (season != null) && (type != null)) { boolean hardcore = this.hardcore.getValue(); String which = type.getKey(hardcore); String server = realm.getHost(); String url = server + "/d3/rankings/" + ((season < 0) ? "era" : "season") + "/" + Math.abs(season) + "/" + which;/*from w ww. j a v a 2s. com*/ Window.open(url, "_blank", ""); } }
From source file:com.dawg6.web.dhcalc.client.LeaderboardPanel.java
License:Open Source License
protected void showHero() { String btag = getSelectedAccount(); Realm realm = mainPanel.getSelectedRealm(); if ((realm != null) && (btag != null)) { String[] split = btag.split("#"); String server = realm.getHost(); String url = server + "/d3/profile/" + split[0] + "-" + split[1] + "/hero/" + split[2]; Window.open(url, "_blank", ""); }//from ww w . j a va 2s . c o m }
From source file:com.dawg6.web.dhcalc.client.LeaderboardPanel.java
License:Open Source License
protected void showCareer() { String btag = getSelectedAccount(); Realm realm = mainPanel.getSelectedRealm(); if ((realm != null) && (btag != null)) { String[] split = btag.split("#"); String server = realm.getHost(); String url = server + "/d3/profile/" + split[0] + "-" + split[1] + "/"; Window.open(url, "_blank", ""); }//w w w . j a va2 s . c o m }
From source file:com.dawg6.web.dhcalc.client.MainPanel.java
License:Open Source License
protected void showHelp() { Window.open("help.html", "_blank", ""); }
From source file:com.dawg6.web.dhcalc.client.MainPanel.java
License:Open Source License
protected void showProfile() { Realm realm = getSelectedRealm();//from w w w.j a v a 2s . co m final String server = realm.getHost(); if ((battleTag.getText() == null) || (battleTag.getText().trim().length() == 0)) { ApplicationPanel.showErrorDialog("Enter Battle Tag"); return; } final String profile = battleTag.getText(); if ((tagNumber.getValue() == null) || (tagNumber.getValue().trim().length() == 0)) { ApplicationPanel.showErrorDialog("Enter Battle Tag Number"); return; } int tag = (int) getValue(this.tagNumber); String url = server + "/d3/profile/" + URL.encode(profile) + "-" + tag + "/"; int index = heroList.getSelectedIndex(); if (index >= 0) { String value = heroList.getValue(index); if (value.length() > 0) { url += ("hero/" + value); } } Window.open(url, "_blank", ""); }
From source file:com.edgenius.wiki.gwt.client.page.widgets.PrintButton.java
License:Open Source License
public void onClick(ClickEvent event) { String token = GwtClientUtils.getToken(); if (token.indexOf(PageMain.TOKEN_HISTORY) != -1) { Window.open(GwtClientUtils.getBaseUrl() + "print.do?i=" + main.getPageUuid() + "&v=" + main.getPageVersion() + "&h=true", SharedConstants.APP_NAME + "Print", ""); } else {//from w w w . j ava 2 s. c o m Window.open(GwtClientUtils.getBaseUrl() + "print.do?i=" + main.getPageUuid(), SharedConstants.APP_NAME + "Print", ""); } }
From source file:com.edgenius.wiki.gwt.client.page.widgets.RSSFeedButton.java
License:Open Source License
private void openFeed() { if (this.spaceUname == null || this.spaceUname.trim().length() == 0) { Window.alert(Msg.consts.error_request()); return;/* ww w . java 2 s .c o m*/ } //TODO: user spaceUid? it also not good as it stick to database record, which may change after backup/restore // if(GwtUtils.isSupportInURL(spaceUname)){ Window.open(getRSSURL(), SharedConstants.APP_NAME + "RSSFeed", ""); // }else{ // Window.open(GwtUtils.getBaseUrl()+"feed.do?suid="+spaceUid,SharedConstants.APP_NAME+"RSSFeed",""); // } }
From source file:com.edgenius.wiki.gwt.client.widgets.HelpDialog.java
License:Open Source License
public void onClick(ClickEvent event) { Object sender = event.getSource(); this.hidebox(); if (sender == sPop || sender == sImg) { Window.open(GwtClientUtils.getBaseUrl() + "static/syntax.html", SharedConstants.APP_NAME + "SyntaxHelp", ""); } else if (sender == kPop) { Window.open(GwtClientUtils.getBaseUrl() + "static/keys.html", SharedConstants.APP_NAME + "KeysHelp", ""); }/* w ww . j av a 2 s . c o m*/ }
From source file:com.eduworks.russel.ui.client.pagebuilder.screen.HomeScreen.java
License:Apache License
/** * display Renders the RUSSEL home screen using appropriate templates and sets up handlers */// w ww.j a v a 2 s .c om public void display() { ((Label) PageAssembler.elementToWidget("r-menuUserName", PageAssembler.LABEL)).setText(RusselApi.username); PageAssembler.ready(new HTML(Russel.htmlTemplates.getMenuBar().getText())); PageAssembler.ready(new HTML(Russel.htmlTemplates.getObjectPanel().getText())); PageAssembler.buildContents(); PageAssembler.inject("flowContainer", "x", new HTML(Russel.htmlTemplates.getDetailModal().getText()), true); PageAssembler.inject("objDetailPanelWidget", "x", new HTML(Russel.htmlTemplates.getDetailPanel().getText()), true); DOM.getElementById("r-menuWorkspace").getParentElement().addClassName("active"); DOM.getElementById("r-menuCollections").getParentElement().removeClassName("active"); DOM.getElementById("r-menuProjects").getParentElement().removeClassName("active"); PageAssembler.attachHandler("r-uploadContentTile", Event.ONCLICK, new EventCallback() { @Override public void onEvent(Event event) { Russel.screen.loadScreen(new EditScreen(), true); } }); PageAssembler.attachHandler("r-projectsTile", Event.ONCLICK, new EventCallback() { @Override public void onEvent(Event event) { Russel.screen.loadScreen(new FeatureScreen(FeatureScreen.PROJECTS_TYPE), true); } }); PageAssembler.attachHandler("r-menuProjects", Event.ONCLICK, new EventCallback() { @Override public void onEvent(Event event) { Russel.screen.loadScreen(new FeatureScreen(FeatureScreen.PROJECTS_TYPE), true); } }); PageAssembler.attachHandler("r-menuCollections", Event.ONCLICK, new EventCallback() { @Override public void onEvent(Event event) { Russel.screen.loadScreen(new FeatureScreen(FeatureScreen.COLLECTIONS_TYPE), true); } }); PageAssembler.attachHandler("r-collectionsTile", Event.ONCLICK, new EventCallback() { @Override public void onEvent(Event event) { Russel.screen.loadScreen(new FeatureScreen(FeatureScreen.COLLECTIONS_TYPE), true); } }); PageAssembler.attachHandler("r-manageUsersTile", Event.ONCLICK, new EventCallback() { @Override public void onEvent(Event event) { Russel.screen.loadScreen(new UserScreen(), true); } }); PageAssembler.attachHandler("r-groupTile", Event.ONCLICK, new EventCallback() { @Override public void onEvent(Event event) { Russel.screen.loadScreen(new GroupScreen(), true); } }); PageAssembler.attachHandler("r-menuHelp", Event.ONCLICK, new EventCallback() { @Override public void onEvent(Event event) { String help = PageAssembler.getHelp(); if (help != null && help != "") Window.open(PageAssembler.getHelp(), "_blank", null); else Window.alert("Help has not been configured for this installation of RUSSEL."); } }); ((TextBox) PageAssembler.elementToWidget("r-menuSearchBar", PageAssembler.TEXT)).setFocus(true); ash.hookAndClear("r-menuSearchBar", "searchObjectPanelScroll", SearchHandler.TYPE_RECENT); Date currentDate = new Date(); Date pastDate = new Date(); pastDate.setDate(pastDate.getDate() - 10); ash.query(RUSSELFileRecord.UPDATED_DATE + ":[" + pastDate.getTime() + " TO " + currentDate.getTime() + "]"); PageAssembler.attachHandler("r-menuSearchBar", Event.ONKEYUP, new EventCallback() { @Override public void onEvent(Event event) { Russel.screen.loadScreen(new SearchScreen(SearchHandler.TYPE_SEARCH), true); } }); PageAssembler.attachHandler("r-objectEditSelected", Event.ONCLICK, new EventCallback() { @Override public void onEvent(Event event) { Russel.screen.loadScreen(new EditScreen(ash.getSelected()), true); } }); }
From source file:com.emitrom.gwt4.touch2.demo.client.KitchenSinkEntryPoint.java
License:Open Source License
private void addListeners() { if (backButton != null) { backButton.addTapHandler(new TapHandler() { @Override// w w w .j av a 2s . co m public void onTap(Button button, EventObject event) { // remove where we are stack.pop(); // and then go to the previous place Place place = stack.pop(); factory.getEventBus().fireEvent(new PlaceChangeEvent(place)); } }); } sourceButton.addTapHandler(new TapHandler() { @Override public void onTap(Button button, EventObject event) { loadMask.show(); service.getSource(currentView, new AsyncCallback<String>() { @Override public void onSuccess(String result) { loadMask.hide(); srcPanel.setHtml(""); String html = "<textarea name=\"code\" class=\"java:nocontrols\" rows=\"15\" cols=\"100\">"; html += result; html += "</textarea>"; srcPanel.setHtml(html); srcPanel.show(); highlight(); } @Override public void onFailure(Throwable caught) { loadMask.hide(); System.out.println(caught.getMessage()); } }); } }); homeButton.addTapHandler(new TapHandler() { @Override public void onTap(Button button, EventObject event) { Window.open("http://www.emitrom.com", "Emitrom", ""); } }); aboutButton.addTapHandler(new TapHandler() { public void onTap(Button button, EventObject event) { if (version == null) { loadMask.show(); service.getVersion(new AsyncCallback<String>() { @Override public void onSuccess(String result) { loadMask.hide(); version = result; MessageBox.alert("About", version); } @Override public void onFailure(Throwable caught) { loadMask.hide(); System.out.println(caught.getMessage()); } }); } else { MessageBox.alert("About", version); } } }); }