List of usage examples for com.google.gwt.user.client.ui NamedFrame setUrl
public void setUrl(String url)
From source file:com.chinarewards.gwt.license.client.license.presenter.LicenseListPresenterImpl.java
License:Open Source License
private void initTableColumns() { Sorting<LicenseClient> ref = new Sorting<LicenseClient>() { @Override/*from ww w. j a v a 2 s.co m*/ public void sortingCurrentPage(Comparator<LicenseClient> comparator) { // listViewAdapter.sortCurrentPage(comparator); } @Override public void sortingAll(String sorting, String direction) { listViewAdapter.sortFromDateBase(sorting, direction); } }; cellTable.addColumn("??", new TextCell(), new GetValue<LicenseClient, String>() { @Override public String getValue(LicenseClient license) { return license.getCorporationName(); } }, ref, "licenseName"); cellTable.addColumn("?", new TextCell(), new GetValue<LicenseClient, String>() { @Override public String getValue(LicenseClient license) { return license.getLicenseTypeText(); } }, ref, ""); cellTable.addColumn("", new TextCell(), new GetValue<LicenseClient, String>() { @Override public String getValue(LicenseClient license) { return license.getStaffNumber() + ""; } }, ref, ""); cellTable.addColumn("?", new TextCell(), new GetValue<LicenseClient, String>() { @Override public String getValue(LicenseClient license) { return license.getMacaddress(); } }, ref, ""); cellTable.addColumn("", new DateCell(dateFormatAll), new GetValue<LicenseClient, Date>() { @Override public Date getValue(LicenseClient object) { return object.getNotafter(); } }, ref, "notafter"); cellTable.addColumn("", new TextCell(), new GetValue<LicenseClient, String>() { @Override public String getValue(LicenseClient license) { return license.getDescription(); } }, ref, ""); cellTable.addColumn("?", new TextCell(), new GetValue<LicenseClient, String>() { @Override public String getValue(LicenseClient license) { return license.getAwarduser(); } }, ref, "awarduser"); cellTable.addColumn("?", new DateCell(dateFormatAll), new GetValue<LicenseClient, Date>() { @Override public Date getValue(LicenseClient object) { return object.getIssued(); } }, ref, "issued"); cellTable.addColumn("?", new TextCell(), new GetValue<LicenseClient, String>() { @Override public String getValue(LicenseClient license) { return license.getStatus().getDisplayName(); } }, ref, "status"); cellTable.addColumn("?", new HyperLinkCell(), new GetValue<LicenseClient, String>() { @Override public String getValue(LicenseClient arg0) { return ""; } }, new FieldUpdater<LicenseClient, String>() { @Override public void update(int index, LicenseClient licenseClient, String value) { licenseClient.setThisAction(LicenseConstants.ACTION_LICENSE_VIEW); Platform.getInstance().getEditorRegistry().openEditor(LicenseConstants.EDITOR_LICENSE_VIEW, LicenseConstants.EDITOR_LICENSE_VIEW + licenseClient.getId(), licenseClient); } }); cellTable.addColumn("?", new HyperLinkCell(), new GetValue<LicenseClient, String>() { @Override public String getValue(LicenseClient arg0) { return ""; } }, new FieldUpdater<LicenseClient, String>() { @Override public void update(int index, final LicenseClient licenseClient, String value) { licenseClient.setThisAction(LicenseConstants.ACTION_LICENSE_EDIT); Platform.getInstance().getEditorRegistry().openEditor(LicenseConstants.EDITOR_LICENSE_EDIT, LicenseConstants.EDITOR_LICENSE_EDIT + licenseClient.getId(), licenseClient); } }); cellTable.addColumn("?", new HyperLinkCell(), new GetValue<LicenseClient, String>() { @Override public String getValue(LicenseClient license) { return ""; } }, new FieldUpdater<LicenseClient, String>() { @Override public void update(int index, LicenseClient o, String value) { if (Window.confirm("?")) { delteLicense(o.getId()); } } }); cellTable.addColumn("?", new HyperLinkCell(), new GetValue<LicenseClient, String>() { @Override public String getValue(LicenseClient license) { return ""; } }, new FieldUpdater<LicenseClient, String>() { @Override public void update(int index, LicenseClient license, String value) { if (RootPanel.get("downloadiframe") != null) { Widget widgetFrame = (Widget) RootPanel.get("downloadiframe"); widgetFrame.removeFromParent(); } NamedFrame frame = new NamedFrame("downloadiframe"); String url = ""; // url+=GWT.getModuleBaseURL(); url += "filedownload?licenseFileName=" + license.getLicenseFileName(); frame.setUrl(url); frame.setVisible(false); RootPanel.get().add(frame); } }); }
From source file:com.google.gerrit.prettify.client.PrivateScopeImpl.java
License:Apache License
public PrivateScopeImpl() { scopeName = nextScopeName();/* w w w .ja v a2 s . c o m*/ NamedFrame frame = new NamedFrame(scopeName); frame.setUrl("javascript:''"); initWidget(frame); setVisible(false); }