List of usage examples for com.google.gwt.user.client.ui DisclosurePanel add
public void add(IsWidget w)
From source file:ch.heftix.mailxel.client.MailxelMainToolBar.java
License:Open Source License
public MailxelMainToolBar(final MailServiceAsync mailxelService, final MailxelPanel mailxelPanel) { this.mailxelService = mailxelService; this.mailxelPanel = mailxelPanel; logo = new Image("img/mailxel.png"); logo.setTitle("MailXel " + Version.getVersion()); logo.addClickHandler(new ClickHandler() { public void onClick(ClickEvent sender) { PopupPanel pp = new PopupPanel(true); DisclosurePanel dp = new DisclosurePanel("MailXel " + Version.getVersion()); dp.setWidth("400px"); dp.setOpen(true);//from w ww .j a va 2 s.c o m HTML html = new HTML(); StringBuffer sb = new StringBuffer(); sb.append("(c) 2008-2010 by Simon Hefti. All rights reserved.<br/>"); sb.append( "<p>mailxel is licensed under the <a href=\"http://www.eclipse.org/legal/epl-v10.html\">EPL 1.0</a>. mailxel is distributed on an \"AS IS\" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied."); sb.append("<p>mailxel relies on the following components:"); sb.append("<ul>"); sb.append( "<li>GWT, <a href=\"http://code.google.com/webtoolkit\">http://code.google.com/webtoolkit</a></li>"); sb.append( "<li>sqlite-jdbc, <a href=\"http://www.xerial.org/trac/Xerial/wiki/SQLiteJDBC\">http://www.xerial.org/trac/Xerial/wiki/SQLiteJDBC</a></li>"); sb.append( "<li>(and thus on sqlite itself, <a href=\"http://www.sqlite.org\">http://www.sqlite.org</a>)</li>"); sb.append( "<li>Java Mail API, <a href=\"http://java.sun.com/products/javamail\">http://java.sun.com/products/javamail</a></li>"); sb.append( "<li>jetty servlet container, <a href=\"http://www.eclipse.org/jetty/\">http://www.eclipse.org/jetty/</a></li>"); sb.append( "<li>fugue-icons, <a href=\"http://code.google.com/p/fugue-icons-src/\">http://code.google.com/p/fugue-icons-src/</a></li>"); sb.append("<li>jsoup, <a href=\"http://jsoup.org\">http://jsoup.org</a></li>"); sb.append("</ul>"); html.setHTML(sb.toString()); dp.add(html); dp.setOpen(true); pp.add(dp); pp.show(); } }); Image home = new Image("img/find.png"); home.setTitle("Search"); home.setStylePrimaryName("mailxel-toolbar-item"); home.addClickHandler(new ClickHandler() { public void onClick(ClickEvent sender) { Panel panel = new MailOverviewGrid(mailxelService, mailxelPanel); mailxelPanel.addTab(panel, "Search"); } }); final Image query = new Image("img/document-task.png"); query.setTitle("Search (predefined query)"); query.setStylePrimaryName("mailxel-toolbar-item"); query.addClickHandler(new ClickHandler() { public void onClick(ClickEvent sender) { final StatusItem si = mailxelPanel.statusStart("retrieve stored message queries"); mailxelService.searchQueries(MessageQueryTO.T_MESSAGE_QUERY, null, new AsyncCallback<List<MessageQueryTO>>() { public void onFailure(Throwable caught) { si.error(caught); } public void onSuccess(List<MessageQueryTO> result) { si.done(); if (null != result && result.size() > 0) { PopupMenu popupMenu = new PopupMenu(query); for (MessageQueryTO mqTO : result) { String name = mqTO.shortname + " (" + UIUtil.shorten(mqTO.name) + ")"; MenuItem menuItem = new MenuItem(name, new MessageQueryCommand( mailxelService, mailxelPanel, popupMenu, mqTO)); String url = DirectMailServiceUtil.getIconURL(mqTO.iconId); if (null != url) { String html = "<img src=\"" + url + "\"/> " + name; menuItem.setHTML(html); } popupMenu.addItem(menuItem); } popupMenu.show(); } } }); } }); Image mailnew = new Image("img/mail-new.png"); mailnew.setTitle("New Mail"); mailnew.setStylePrimaryName("mailxel-toolbar-item"); mailnew.addClickHandler(new ClickHandler() { public void onClick(ClickEvent sender) { final MailSendGrid mailSendGrid = new MailSendGrid(mailxelService, mailxelPanel, null, MailSendGrid.TYPE_NEW); mailxelPanel.addTab(mailSendGrid, "New Mail"); } }); Image noteToSelf = new Image("img/note.png"); noteToSelf.setTitle("Note to myself"); noteToSelf.setStylePrimaryName("mailxel-toolbar-item"); noteToSelf.addClickHandler(new ClickHandler() { public void onClick(ClickEvent sender) { final MailSendGrid mailSendGrid = new MailSendGrid(mailxelService, mailxelPanel, null, MailSendGrid.TYPE_SELF); mailxelPanel.addTab(mailSendGrid, "New Note"); } }); Image contacts = new Image("img/address-book.png"); contacts.setTitle("Address Book"); contacts.setStylePrimaryName("mailxel-toolbar-item"); contacts.addClickHandler(new ClickHandler() { public void onClick(ClickEvent sender) { AddressOverviewGrid ag = new AddressOverviewGrid(mailxelService, mailxelPanel); mailxelPanel.addTab(ag, "Contacts"); } }); /** * mail download menu on click, a menu with the available accounts is * displayed, allowing the user is asked to choose the data source. */ final Image download = new Image("img/download-mail.png"); download.setTitle("Mail download"); download.setStylePrimaryName("mailxel-toolbar-item"); download.addClickHandler(new ClickHandler() { public void onClick(ClickEvent sender) { ConfigTO configTO = mailxelPanel.getConfig(); String[] accounts = configTO.accountNames; if (null != accounts && accounts.length > 0) { PopupMenu popupMenu = new PopupMenu(download); // first item: allow download from all known accounts MenuItem menuItem = new MenuItem("Scan all accounts", new ScanMailFolderCommand(mailxelService, mailxelPanel, popupMenu, accounts)); popupMenu.addItem(menuItem); // add one menu item per account for (int i = 0; i < accounts.length; i++) { String[] selectedAccount = new String[1]; selectedAccount[0] = accounts[i]; menuItem = new MenuItem(accounts[i], new ScanMailFolderCommand(mailxelService, mailxelPanel, popupMenu, selectedAccount)); popupMenu.addItem(menuItem); } popupMenu.show(); } } }); final Image reorgMailFolder = new Image("img/wand.png"); reorgMailFolder.setTitle("reorganize mail folder"); reorgMailFolder.setStylePrimaryName("mailxel-toolbar-item"); reorgMailFolder.addClickHandler(new ClickHandler() { public void onClick(ClickEvent sender) { ConfigTO configTO = mailxelPanel.getConfig(); String[] accounts = configTO.accountNames; if (null != accounts && accounts.length > 0) { PopupMenu popupMenu = new PopupMenu(reorgMailFolder); // first item: allow reorg from all known accounts MenuItem menuItem = new MenuItem("All accounts", new ReorgMailFolderCommand(mailxelService, mailxelPanel, popupMenu, reorgMailFolder, accounts)); popupMenu.addItem(menuItem); // add one menu item per account for (int i = 0; i < accounts.length; i++) { String[] selectedAccount = new String[1]; selectedAccount[0] = accounts[i]; menuItem = new MenuItem(accounts[i], new ReorgMailFolderCommand(mailxelService, mailxelPanel, popupMenu, reorgMailFolder, selectedAccount)); popupMenu.addItem(menuItem); } popupMenu.show(); } } }); final Image categories = new Image("img/tags.png"); categories.setTitle("Manage Categories"); categories.setStylePrimaryName("mailxel-toolbar-item"); categories.addClickHandler(new ClickHandler() { public void onClick(ClickEvent sender) { CategoryOverviewGrid cog = new CategoryOverviewGrid(mailxelService, mailxelPanel); mailxelPanel.addTab(cog, "Categories"); } }); final Image setup = new Image("img/preferences-system.png"); setup.setTitle("System Setup"); setup.setStylePrimaryName("mailxel-toolbar-item"); setup.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { // ConfigTabPanel cg = new ConfigTabPanel(); ConfigGrid cg = new ConfigGrid(mailxelService, mailxelPanel); mailxelPanel.addTab(cg, "Setup"); } }); final Image login = new Image("img/lock.png"); login.setTitle("Login"); login.setStylePrimaryName("mailxel-toolbar-item"); login.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { // create login box LoginPanel loginPanel = new LoginPanel(mailxelService, mailxelPanel); int x = login.getAbsoluteLeft(); int y = login.getAbsoluteTop(); loginPanel.setPopupPosition(x, y); loginPanel.show(); } }); final Image additional = new Image("img/context-menu.png"); additional.setTitle("Additional functions"); additional.setStylePrimaryName("mailxel-toolbar-item"); final PopupCommand importMboxCommand = new PopupCommand() { public void execute() { final PopupPanel pup = new PopupPanel(true); HorizontalPanel hp = new HorizontalPanel(); final TextBox tb = new TextBox(); tb.setWidth("300px"); hp.add(tb); Button b = new Button(); b.setText("import"); b.addClickHandler(new ClickHandler() { public void onClick(ClickEvent sender) { String name = tb.getText(); if (null != name) { name = name.trim(); if (name.length() > 0) { final StatusItem si = mailxelPanel.statusStart("Import from mbox: " + name); mailxelService.importMboxFile(name, new AsyncCallback<Void>() { public void onFailure(Throwable caught) { si.error(caught); } public void onSuccess(Void result) { si.done(); } }); pup.hide(); } } } }); hp.add(b); pup.add(hp); int x = additional.getAbsoluteLeft(); int y = additional.getAbsoluteTop(); pup.setPopupPosition(x, y); /** show input box for path to mbox file */ pup.show(); /** hide the list of available additional commands */ hide(); } }; final PopupCommand addressUploadCommand = new PopupCommand() { public void execute() { AddressUploadGrid ug = new AddressUploadGrid(mailxelService, mailxelPanel); mailxelPanel.addTab(ug, "Address Upload"); /** hide the list of available additional commands */ hide(); } }; final Command showWelcomePanelCommand = new Command() { public void execute() { WelcomeToMailxelPanel wp = new WelcomeToMailxelPanel(mailxelService, mailxelPanel); mailxelPanel.addTab(wp, "Welcome"); } }; final PopupCommand deleteConfigCommand = new PopupCommand() { public void execute() { PopupPanel pop = new PopupPanel(true, true); HorizontalPanel hp = new HorizontalPanel(); Label label = new Label("Really delete all configuration?"); hp.add(label); Button b = new Button(); b.setText("Ok"); b.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { final StatusItem si = mailxelPanel.statusStart("deleting configuration"); mailxelService.deleteConfig(new AsyncCallback<Void>() { public void onFailure(Throwable caught) { si.error(caught); } public void onSuccess(Void result) { si.done(); } }); } }); hp.add(b); pop.add(hp); int x = additional.getAbsoluteLeft(); int y = additional.getAbsoluteTop(); pop.setPopupPosition(x, y); pop.show(); /** hide the list of available additional commands */ hide(); } }; final Command updateToMeFlagCommand = new Command() { public void execute() { final StatusItem si = mailxelPanel.statusStart("Update 'to me' flag"); mailxelService.updateToMeFlag(new AsyncCallback<Void>() { public void onFailure(Throwable caught) { si.error(caught); } public void onSuccess(Void result) { si.done(); } }); } }; final Command updateFromMeFlagCommand = new Command() { public void execute() { final StatusItem si = mailxelPanel.statusStart("Update 'from me' flag"); mailxelService.updateFromMeFlag(new AsyncCallback<Void>() { public void onFailure(Throwable caught) { si.error(caught); } public void onSuccess(Void result) { si.done(); } }); } }; final Command showStatisticsCommand = new Command() { public void execute() { StatisticsGrid sg = new StatisticsGrid(mailxelService, mailxelPanel); mailxelPanel.addTab(sg, "Statistics"); } }; final Command showIconsCommand = new Command() { public void execute() { IconOverviewGrid og = new IconOverviewGrid(mailxelService, mailxelPanel); mailxelPanel.addTab(og, "Icons"); } }; final Command showMessageQueriesCommand = new Command() { public void execute() { MessageQueryOverviewGrid mqog = new MessageQueryOverviewGrid(mailxelService, mailxelPanel); mailxelPanel.addTab(mqog, "Message Queries"); } }; final Command showAttachmentGridCommand = new Command() { public void execute() { AttachmentOverviewGrid aog = new AttachmentOverviewGrid(mailxelService, mailxelPanel); mailxelPanel.addTab(aog, "Attachment Overview"); } }; final Command closeAllTabsCommand = new Command() { public void execute() { mailxelPanel.closeAllNonEditTabs(); } }; final Command dbHousekeeping = new Command() { public void execute() { final StatusItem si = mailxelPanel.statusStart("DB housekeeping"); mailxelService.housekeeping(new AsyncCallback<String>() { public void onFailure(Throwable caught) { si.error(caught); } public void onSuccess(String result) { if (result.startsWith("200 OK")) { si.done(); } else { si.error(result); } } }); } }; final Command messageCount = new Command() { public void execute() { updateCounts(); } }; additional.addClickHandler(new ClickHandler() { public void onClick(ClickEvent sender) { MenuBar popupMenuBar = new MenuBar(true); PopupPanel popupPanel = new PopupPanel(true); MenuItem menuItem = new MenuItem("Attachment Overview", showAttachmentGridCommand); popupMenuBar.addItem(menuItem); menuItem = new MenuItem("Close all Tabs", closeAllTabsCommand); popupMenuBar.addItem(menuItem); menuItem = new MenuItem("Message Queries", showMessageQueriesCommand); popupMenuBar.addItem(menuItem); menuItem = new MenuItem("DB Housekeeping", dbHousekeeping); popupMenuBar.addItem(menuItem); menuItem = new MenuItem("update pending messages count", messageCount); popupMenuBar.addItem(menuItem); menuItem = new MenuItem("Statistics", showStatisticsCommand); popupMenuBar.addItem(menuItem); menuItem = new MenuItem("Icons", showIconsCommand); popupMenuBar.addItem(menuItem); menuItem = new MenuItem("Import mbox file", importMboxCommand); importMboxCommand.setPopupPanel(popupPanel); popupMenuBar.addItem(menuItem); menuItem = new MenuItem("Address upload", addressUploadCommand); addressUploadCommand.setPopupPanel(popupPanel); popupMenuBar.addItem(menuItem); menuItem = new MenuItem("Welcome", showWelcomePanelCommand); popupMenuBar.addItem(menuItem); menuItem = new MenuItem("Delete existing configuration", deleteConfigCommand); popupMenuBar.addItem(menuItem); menuItem = new MenuItem("Update 'from me' flag", updateFromMeFlagCommand); popupMenuBar.addItem(menuItem); menuItem = new MenuItem("Update 'to me' flag", updateToMeFlagCommand); popupMenuBar.addItem(menuItem); popupMenuBar.setVisible(true); popupPanel.add(popupMenuBar); int x = additional.getAbsoluteLeft(); int y = additional.getAbsoluteTop(); popupPanel.setPopupPosition(x, y); popupPanel.show(); } }); updateCounts(); add(home); add(query); add(mailnew); add(noteToSelf); add(contacts); add(categories); add(download); add(reorgMailFolder); add(setup); add(login); add(additional); add(logo); add(msgCountAct); }
From source file:client.template.dialog.ErrorDialog.java
License:Open Source License
public ErrorDialog(final String title, final Throwable caught) { String message;//from w ww . j a v a 2 s . c om if ((null == caught.getMessage()) || ("" == caught.getMessage())) { message = "Unknown reason (" + caught.toString() + ")"; } else { message = caught.getMessage(); } GuiLogger.errorLog(message); message = StringUtils.escape(message); String stackTrace = null; try { final GuiException ex = (GuiException) caught; stackTrace = ex.getStackTraceString(); } catch (final Exception e) { stackTrace = GuiException.exception2string(caught); } this.setText(title); this.vPanel.add(new HTML(message + "<br> <br>")); if ((null != stackTrace) && ("" != stackTrace)) { final DisclosurePanel details = new DisclosurePanel("Details"); final HTML stackTraceWidget = new HTML(stackTrace); stackTraceWidget.setStyleName("gui-ErrorPanel"); details.add(stackTraceWidget); this.vPanel.add(details); } this.vPanel.setStyleName("gwt-DialogBoxContent"); this.vPanel.add(new Button("Close", new ClickListener() { public void onClick(final Widget sender) { ErrorDialog.this.hide(); } })); this.setWidget(this.vPanel); }
From source file:com.akjava.gwt.subplayer.client.SubPlayer.java
License:Apache License
@Override public void onModuleLoad() { //pre load resource ImageResource icon = Binder.INSTANCE.loadanime(); loadImg = new Image(icon); loadImg.setVisible(false);//www. ja va 2s .c o m loadImg.addLoadHandler(new LoadHandler() { @Override public void onLoad(LoadEvent event) { RootPanel.get().remove(loadImg); loadImg.setVisible(true); } }); RootPanel.get().add(loadImg); preference = new SubPlayerPreference(); preference.initialize(); tab = new TabLayoutPanel(2, Unit.EM); tab.setHeight("500px"); VerticalPanel root = new VerticalPanel(); root.setWidth("100%"); root.setHeight("100%"); //root.setHeight("200px"); DockLayoutPanel doc = new DockLayoutPanel(Unit.PX); doc.addSouth(new HTMLPanel( "<div align='center'>Subtitle TTS Player by <a href='http://www.akjava.com'>akjava.com</a></div>"), 40); doc.add(tab); RootLayoutPanel.get().add(doc); //RootLayoutPanel.get().add(new Label("hello")); tab.add(root, "PLAY"); noSubtitle = new Label("Subtitle is empty.load from Load tab"); noSubtitle.setStyleName("nosubtitle"); root.add(noSubtitle); loadPanel = new LoadPanel(); loadPanel.setWidth("100%"); loadPanel.setHeight("100%"); tab.add(loadPanel, "LOAD"); loadPanel.setText(preference.getSrtText()); itemPanel = new VerticalPanel(); itemPanel.setSpacing(8); itemPanelScroll = new ScrollPanel(itemPanel); itemPanelScroll.setWidth("100%"); itemPanelScroll.setHeight("350px"); root.add(itemPanelScroll); /* for(int i=0;i<5;i++){ String text=i+" hello world\n"; for(int j=0;j<i;j++){ text+="line\n"; } HTMLPanel label=new HTMLPanel(text.replace("\n", "<br/>")); FocusPanel panel=new FocusPanel(label); panel.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { unselectAll(); setlectWidget((Widget) event.getSource()); } }); //label.setHeight("100px"); itemPanel.add(panel); }*/ playerWidget = new PlayerWidget(this); root.add(playerWidget); DisclosurePanel ds = new DisclosurePanel("show subtitle time [start] - [end]"); timeLabel = new Label(); ds.add(timeLabel); //ds.add(new Label("0:0:0 - 0:0:12")); root.add(ds); selectWidgetHandler = new ClickHandler() { @Override public void onClick(ClickEvent event) { unselectAll(); setlectWidget((Widget) event.getSource()); } }; DisclosurePanel vs = new DisclosurePanel("Voice Settings"); root.add(vs); voiceSettings = new VoiceSettings(); vs.add(voiceSettings); //load data from preferences //if empty load mode. if (!loadPanel.getText().isEmpty()) { loadSrt(preference.getSrtSelectIndex()); } else { tab.selectTab(1); } }
From source file:com.appspot.hommkmessage.client.view.ListView.java
License:Open Source License
private void createListEntry(final int index, final MessageMetadata messageMetadata) { final HorizontalPanel entryLinePanel = new HorizontalPanel(); final DisclosurePanel entryPanel = new DisclosurePanel(); entryPanel.addStyleName("messageListEntryPanel"); setEntryHeader(messageMetadata, entryPanel, true); entryLinePanel.add(entryPanel);/* w ww. ja v a 2 s . c o m*/ addDeleteLink(messageMetadata, entryLinePanel); add(entryLinePanel); entryPanel.addOpenHandler(new OpenHandler<DisclosurePanel>() { @Override public void onOpen(OpenEvent<DisclosurePanel> event) { entryPanel.clear(); final MessageFrame messageFrame = new MessageFrame("messageFrame" + index); messageFrame.addStyleName("messageInListView"); entryPanel.add(messageFrame); messageFrame.showMessage(messageMetadata.getId()); localStorage.markAsRead(messageMetadata.getId()); setEntryHeader(messageMetadata, entryPanel, false); } }); entryPanel.addCloseHandler(new CloseHandler<DisclosurePanel>() { @Override public void onClose(CloseEvent<DisclosurePanel> event) { setEntryHeader(messageMetadata, entryPanel, true); } }); }
From source file:com.apress.progwt.client.college.gui.CollegeEntry.java
License:Apache License
public CollegeEntry(User user, Application application, ServiceCache serviceCache, MyRankings myRankings) { this.application = application; this.serviceCache = serviceCache; this.user = user; this.myRankings = myRankings; collegeNameLabel = new Label(application.getSchool().getName()); collegeNameLabel.setStylePrimaryName("TC-CollegeLabel"); rankLabel = new Label(); rankLabel.setStylePrimaryName("TC-CollegeEntry-RankLabel"); HorizontalPanel mainPanel = new HorizontalPanel(); mainPanel.add(rankLabel);/* www.j ava 2s. c o m*/ mainPanel.add(collegeNameLabel); mainPanel.setCellWidth(rankLabel, "30px"); DisclosurePanel disclosurePanel = new DisclosurePanel(" "); disclosurePanel.add(getInfoPanel()); mainPanel.add(disclosurePanel); mainPanel.setCellHorizontalAlignment(disclosurePanel, HorizontalPanel.ALIGN_RIGHT); mainPanel.setStylePrimaryName("TC-CollegeEntry"); initWidget(mainPanel); }
From source file:com.bramosystems.oss.player.core.client.ui.Logger.java
License:Apache License
/** * Constructs a Logger object/*from w w w. j a va2 s. com*/ */ public Logger() { impl = GWT.create(LoggerConsoleImpl.class); // build the indicator... DisclosurePanel dp = new DisclosurePanel(imgpack.disclosurePanelOpen(), imgpack.disclosurePanelClosed(), ""); dp.setAnimationEnabled(true); dp.setStyleName(""); dp.add(impl.getConsole()); initWidget(dp); setWidth("100%"); }
From source file:com.google.livingstories.client.contentmanager.ContentItemManager.java
License:Apache License
/** * Create a multiselect list box for displaying all the themes that a content item is a part of. *//*from w w w. j a v a 2s . c om*/ private Widget createThemeListBox() { themeListBox = new ItemList<Theme>(true, false) { @Override public void loadItems() { try { Long livingStoryId = livingStorySelector.getSelectedLivingStoryId(); if (livingStoryId != null) { livingStoryService.getThemesForLivingStory(livingStoryId, getCallback(new ThemeListAdaptor())); } } catch (UnsupportedOperationException ignored) { } } }; themeListBox.setVisibleItemCount(5); DisclosurePanel themesPanel = new DisclosurePanel("Themes"); themesPanel.add(themeListBox); return themesPanel; }
From source file:com.google.livingstories.client.contentmanager.ContentItemManager.java
License:Apache License
private Widget createLocationPanel() { final VerticalPanel locationPanel = new VerticalPanel(); // show a map based on geocoded or manually-inputted lat-long combination HorizontalPanel descriptionPanel = new HorizontalPanel(); descriptionPanel.add(new HTML("Location name (displayed to readers):")); locationDescriptionTextArea = new TextArea(); locationDescriptionTextArea.setCharacterWidth(50); locationDescriptionTextArea.setHeight("60px"); descriptionPanel.add(locationDescriptionTextArea); Label geocodingOptions = new Label("Geocode based on:"); useDisplayedLocation = new RadioButton("geoGroup", "The displayed location name"); useDisplayedLocation.setValue(true); useAlternateLocation = new RadioButton("geoGroup", "An alternate location that geocodes better: "); alternateTextBox = new TextBox(); alternateTextBox.setEnabled(false);//from w ww . j a v a 2 s. c o m HorizontalPanel alternatePanel = new HorizontalPanel(); alternatePanel.add(useAlternateLocation); alternatePanel.add(alternateTextBox); useManualLatLong = new RadioButton("geoGroup", "Manually entered latitude and longitude numbers (enter these below)"); HorizontalPanel latLongPanel = new HorizontalPanel(); latLongPanel.add(new HTML("Latitude: ")); latitudeTextBox = new TextBox(); latitudeTextBox.setEnabled(false); latLongPanel.add(latitudeTextBox); latLongPanel.add(new HTML(" Longitude: ")); longitudeTextBox = new TextBox(); longitudeTextBox.setEnabled(false); latLongPanel.add(longitudeTextBox); HorizontalPanel buttonPanel = new HorizontalPanel(); geocodeButton = new Button("Geocode location"); geocodeButton.setEnabled(false); buttonPanel.add(geocodeButton); geocoderStatus = new Label(""); buttonPanel.add(geocoderStatus); AjaxLoaderOptions options = AjaxLoaderOptions.newInstance(); options.setOtherParms(mapsKey + "&sensor=false"); AjaxLoader.loadApi("maps", "2", new Runnable() { @Override public void run() { map = new MapWidget(); map.setSize(MAP_WIDTH + "px", MAP_HEIGHT + "px"); map.addControl(new SmallMapControl()); map.setDoubleClickZoom(true); map.setDraggable(true); map.setScrollWheelZoomEnabled(true); map.setZoomLevel(MAP_ZOOM); map.setVisible(false); locationPanel.add(map); createLocationHandlers(); } }, options); locationPanel.add(descriptionPanel); locationPanel.add(geocodingOptions); locationPanel.add(useDisplayedLocation); locationPanel.add(alternatePanel); locationPanel.add(useManualLatLong); locationPanel.add(latLongPanel); locationPanel.add(buttonPanel); locationPanel.add(new Label("Tip: once the map is visible, right-click a point on the map to indicate that" + " this is the precise location you want")); DisclosurePanel locationZippy = new DisclosurePanel("Location"); locationZippy.add(locationPanel); return locationZippy; }
From source file:com.google.livingstories.client.contentmanager.ContentItemManager.java
License:Apache License
private Widget createSourceInformationPanel() { VerticalPanel panel = new VerticalPanel(); panel.add(new Label("You can enter either one or both of these fields.")); sourceContentItemSelector = new SingleContentItemSelectionPanel(); sourceDescriptionBox = new TextBox(); sourceDescriptionBox.setVisibleLength(LONG_TEXTBOX_VISIBLE_LENGTH); Grid grid = new Grid(2, 2); grid.setWidget(0, 0, new Label("Content item that contains source information:")); grid.setWidget(0, 1, sourceContentItemSelector); grid.setWidget(1, 0, new Label("Description of source material:")); grid.setWidget(1, 1, sourceDescriptionBox); panel.add(grid);/* w w w . ja v a 2 s. c om*/ DisclosurePanel sourcePanel = new DisclosurePanel("Source Information"); sourcePanel.add(panel); return sourcePanel; }
From source file:com.google.sampling.experiential.client.ChartOMundo.java
License:Open Source License
private Widget createDisclosurePanel(String chartTitleWithKey, Widget chart) { DisclosurePanel p = new DisclosurePanel(); p.setHeader(new Label(chartTitleWithKey)); p.add(chart); return p;/*from www. j a va2s . c o m*/ }