List of usage examples for com.google.gwt.user.client.ui StackLayoutPanel StackLayoutPanel
public StackLayoutPanel(Unit unit)
From source file:at.ait.dme.yuma.client.map.explore.ExplorationComposite.java
License:EUPL
public ExplorationComposite(TiledImageComposite imageComposite) { // Container stack panel containerPanel = new StackLayoutPanel(Unit.EM); AnnotationConstants i18n = Application.getConstants(); // Map metadata containerPanel.add(new HTML("Map thumbnail and metadata will be shown here..."), i18n.aboutThisMap(), 3); // Search panel containerPanel.add(new SearchPanel(imageComposite), i18n.placeSearch(), 3); // Vector overlay panel containerPanel.add(new KMLOverlayPanel(imageComposite), i18n.dataOverlay(), 3); containerPanel.showWidget(0);/*from w ww . j av a 2 s. c o m*/ initWidget(containerPanel); }
From source file:at.ait.dme.yuma.suite.apps.map.client.explore.ExplorationComposite.java
License:EUPL
public ExplorationComposite(TileBasedImageViewer imageComposite) { // Container stack panel containerPanel = new StackLayoutPanel(Unit.EM); I18NConstants i18n = YUMACoreProperties.getConstants(); // Map metadata String metadataURL = YUMACoreProperties.getObjectURI().substring(0, YUMACoreProperties.getObjectURI().lastIndexOf(".") + 1) + XML; containerPanel.add(new MapMetaDataPanel(metadataURL), i18n.aboutThisMap(), 3); // Search panel containerPanel.add(new SearchPanel(imageComposite), i18n.placeSearch(), 3); // Vector overlay panel containerPanel.add(new KMLOverlayPanel(imageComposite), i18n.dataOverlay(), 3); containerPanel.showWidget(0);// w ww . j av a 2 s. co m initWidget(containerPanel); }
From source file:com.google.gwt.examples.StackLayoutPanelExample.java
License:Apache License
public void onModuleLoad() { // Create a three-item stack, with headers sized in EMs. StackLayoutPanel p = new StackLayoutPanel(Unit.EM); p.add(new HTML("this"), new HTML("[this]"), 4); p.add(new HTML("that"), new HTML("[that]"), 4); p.add(new HTML("the other"), new HTML("[the other]"), 4); // Attach the LayoutPanel to the RootLayoutPanel. The latter will listen for // resize events on the window to ensure that its children are informed of // possible size changes. RootLayoutPanel rp = RootLayoutPanel.get(); rp.add(p);//from w w w . j a v a 2s. co m }
From source file:com.google.gwt.sample.showcase.client.content.lists.CwStackLayoutPanel.java
License:Apache License
/** * Initialize this example./* w w w . ja v a 2 s . co m*/ */ @ShowcaseSource @Override public Widget onInitialize() { // Get the images. Images images = (Images) GWT.create(Images.class); // Create a new stack layout panel. StackLayoutPanel stackPanel = new StackLayoutPanel(Unit.EM); stackPanel.setPixelSize(200, 400); // Add the Mail folders. Widget mailHeader = createHeaderWidget(constants.cwStackLayoutPanelMailHeader(), images.mailgroup()); stackPanel.add(createMailItem(images), mailHeader, 4); // Add a list of filters. Widget filtersHeader = createHeaderWidget(constants.cwStackLayoutPanelFiltersHeader(), images.filtersgroup()); stackPanel.add(createFiltersItem(), filtersHeader, 4); // Add a list of contacts. Widget contactsHeader = createHeaderWidget(constants.cwStackLayoutPanelContactsHeader(), images.contactsgroup()); stackPanel.add(createContactsItem(images), contactsHeader, 4); // Return the stack panel. stackPanel.ensureDebugId("cwStackLayoutPanel"); return stackPanel; }
From source file:com.google.gwt.sample.stockwatcher.client.Panels.java
private Widget loadStackLayoutPanel() { StackLayoutPanel p = new StackLayoutPanel(EM); p.add(new HTML("this content"), new HTML("this"), 4); p.add(new HTML("that content"), new HTML("that"), 4); p.add(new HTML(MUSSUM_IPSUM_LITERIS), new HTML("the other"), 4); p.setPixelSize(800, 500);//from w w w.j a va 2 s .c o m return p; }
From source file:com.mashery.examples.api.client.Examples.java
License:Open Source License
@Override public void onModuleLoad() { DockLayoutPanel mainPanel = new DockLayoutPanel(Unit.PX); RootLayoutPanel.get().add(mainPanel); DockLayoutPanel headerPanel = new DockLayoutPanel(Unit.PX); mainPanel.addNorth(headerPanel, 80d); FlexTable rightPanel = new FlexTable(); headerPanel.addEast(rightPanel, 250d); rightPanel.setCellPadding(4);/*from w ww .j a v a 2 s. c o m*/ rightPanel.setSize("100%", "100%"); rightPanel.getCellFormatter().setHeight(0, 0, "100%"); rightPanel.getCellFormatter().setWidth(1, 0, "100%"); rightPanel.getCellFormatter().setAlignment(0, 0, HasHorizontalAlignment.ALIGN_RIGHT, HasVerticalAlignment.ALIGN_TOP); ((FlexTable.FlexCellFormatter) rightPanel.getCellFormatter()).setColSpan(0, 0, 2); final FlowPanel userPanel = new FlowPanel(); rightPanel.setWidget(0, 0, userPanel); LoginServiceAsync loginSvc = GWT.create(LoginService.class); loginSvc.getUserEmail(new AsyncCallback<String>() { @Override public void onSuccess(final String email) { final Anchor loginLink = new Anchor(); loginLink.setHref(email == null ? "/examples/login" : "/examples/login?logout=true"); loginLink.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { String callbackURL = Window.Location.createUrlBuilder().buildString(); StringBuilder buf = new StringBuilder("/examples/login?callbackURL="); buf.append(URL.encodeQueryString(callbackURL)); if (email != null) buf.append("&logout=true"); loginLink.setHref(buf.toString()); } }); if (email == null) { loginLink.setHTML("Sign in"); } else { loginLink.setHTML("Sign out"); userPanel.add(new InlineLabel(email)); userPanel.add(new InlineHTML(" | ")); } userPanel.add(loginLink); } @Override public void onFailure(Throwable caught) { userPanel.add(new Label(caught.getLocalizedMessage())); } }); mapWidget = new PopupMapWidget(); rightPanel.setWidget(1, 1, mapWidget); Grid logoPanel = new Grid(1, 2); logoPanel.setCellSpacing(8); logoPanel.getRowFormatter().setVerticalAlign(0, HasVerticalAlignment.ALIGN_TOP); headerPanel.add(logoPanel); Image masheryLogoImg = new Image("resources/img/mashery.gif"); Anchor masheryLink = new Anchor(); masheryLink.setTitle("Mashery, Inc."); masheryLink.setHref("http://developer.mashery.com"); masheryLink.getElement().appendChild(masheryLogoImg.getElement()); logoPanel.setWidget(0, 0, masheryLink); InlineLabel logoLabel = new InlineLabel("Mashery Examples"); logoLabel.getElement().getStyle().setFontWeight(FontWeight.BOLD); logoLabel.getElement().getStyle().setFontSize(28d, Unit.PT); logoLabel.getElement().getStyle().setColor("#c1080a"); logoPanel.setWidget(0, 1, logoLabel); SplitLayoutPanel centerPanel = new SplitLayoutPanel(); mainPanel.add(centerPanel); final StackLayoutPanel examplesPanel = new StackLayoutPanel(Unit.PX); centerPanel.addWest(examplesPanel, 200d); contentPanel = new DeckPanel(); centerPanel.add(contentPanel); contentPanel.getElement().getStyle().setPaddingLeft(8d, Unit.PX); contentPanel.setAnimationEnabled(true); addExample(new Example("quova", "Quova") { @Override public Widget createContent() { return new QuovaExample(mapWidget); } }, examplesPanel); addExample(new Example("etsy", "Etsy") { @Override public Widget createContent() { return new EtsyExample(mapWidget); } }, examplesPanel); addExample(new Example("weatherbug", "WeatherBug") { @Override public Widget createContent() { return new WeatherBugExample(mapWidget); } }, examplesPanel); addExample(new Example("hotwire", "Hotwire") { @Override public Widget createContent() { return new HotwireExample(mapWidget); } }, examplesPanel); addExample(new Example("active", "Active") { @Override public Widget createContent() { return new ActiveExample(mapWidget); } }, examplesPanel); String historyToken = History.getToken(); Integer index = exampleIndex.get(historyToken); if (index == null) index = 0; examplesPanel.showWidget(index); showExample(index); examplesPanel.addSelectionHandler(new SelectionHandler<Integer>() { @Override public void onSelection(SelectionEvent<Integer> event) { int index = event.getSelectedItem(); Example example = examples.get(index); if (example != null) History.newItem(example.getId()); } }); History.addValueChangeHandler(new ValueChangeHandler<String>() { @Override public void onValueChange(ValueChangeEvent<String> event) { String historyToken = event.getValue(); Integer index = exampleIndex.get(historyToken); if (index != null) { examplesPanel.showWidget(index); showExample(index); } } }); }
From source file:com.ponysdk.core.terminal.ui.PTStackLayoutPanel.java
License:Apache License
@Override protected StackLayoutPanel createUIObject() { return new StackLayoutPanel(unit); }
From source file:com.ponysdk.ui.terminal.ui.PTStackLayoutPanel.java
License:Apache License
@Override public void create(final PTInstruction create, final UIService uiService) { init(create, uiService, new StackLayoutPanel(Unit.values()[create.getInt(PROPERTY.UNIT)])); }
From source file:com.square.composant.emails.square.client.view.emails.GroupeEmailsViewImpl.java
License:Open Source License
/** * Constructeur.// w ww . j a v a 2 s . c om */ public GroupeEmailsViewImpl() { super(); container = new VerticalPanel(); container.setWidth(ComposantEmailsConstants.POURCENT_100); container.setSpacing(10); btnRetour = new DecoratedButton(VIEW_CONSTANTS.hlBackward()); lSujetGroupeEmails = new Label(); lSujetGroupeEmails.addStyleName(ComposantEmailsController.RESOURCES.css().sujetEmail()); stackEmails = new StackLayoutPanel(Unit.PX); stackEmails.setSize(ComposantEmailsConstants.POURCENT_100, "600px"); container.add(btnRetour); container.add(lSujetGroupeEmails); container.add(stackEmails); initWidget(container); }
From source file:de.yarkon.gwt.eventcalendar.client.EventCalendar.java
License:Open Source License
@SuppressWarnings("deprecation") private void initStackPanel() { panel = new StackLayoutPanel(Unit.EM); EventTable table;// w w w . j a v a2 s .co m Date date = new Date(firstYear, firstMonth, 10); DateTimeFormat dateFormatMonth = DateTimeFormat.getFormat(DateTimeFormat.PredefinedFormat.MONTH); DateTimeFormat dateFormatYear = DateTimeFormat.getFormat(DateTimeFormat.PredefinedFormat.YEAR_MONTH); String header; // create number_of_months stacks for (int i = 0; i < NUMBER_OF_MONTHS; i++) { // Create a new table widget for the event list int newMonth = (firstMonth + i) % 12; date.setMonth(newMonth); if (newMonth == 0 && i != 0) { date.setYear(date.getYear() + 1); } if (newMonth == 0 || i == 0) { header = dateFormatYear.format(date); } else { header = dateFormatMonth.format(date); } table = new EventTable((Date) date.clone()); ScrollPanel scrollPanel = new ScrollPanel(table); scrollPanel.addStyleName("scrollPanel"); panel.add(scrollPanel, header, 2); } /* * show current month, SHOW_PAST_MONTHS luckily is the index of the * current month */ panel.showWidget(SHOW_PAST_MONTHS, true); // event handler to fill table with data on selection panel.addBeforeSelectionHandler(new BeforeSelectionHandler<Integer>() { @Override public void onBeforeSelection(BeforeSelectionEvent<Integer> event) { ScrollPanel scrollPanel = (ScrollPanel) panel.getWidget(event.getItem()); EventTable tableWidget = (EventTable) scrollPanel.getWidget(); if (tableWidget.isTableFilled() == false) { // logger.log(Level.SEVERE, "Header Height:" + // Integer.toString(panel.getVisibleWidget().getOffsetHeight())); dataModel.getEventList(tableWidget.getMonth(), tableWidget); tableWidget.setFocus(true); } } }); // fire event to load data for current month BeforeSelectionEvent.fire(panel, SHOW_PAST_MONTHS); }