List of usage examples for com.google.gwt.user.client.ui SplitLayoutPanel add
@Override public void add(Widget widget)
From source file:cc.alcina.framework.gwt.client.ide.SimpleWorkspaceVisualiser.java
License:Apache License
protected void createContentContainer(SplitLayoutPanel hsp) { this.contentContainer = new ScrollPanel(); contentContainer.setStyleName("alcina-WorkspaceContent"); setContentWidget(model.getContentWidget()); contentContainer.setHeight("100%"); hsp.add(contentContainer); }
From source file:com.ephesoft.dcma.gwt.foldermanager.client.view.FolderManagementView.java
License:Open Source License
public void setInitialFolderManagementView(FolderManagementController controller, String parentFolderPath, String baseFolderUrl, Map<String, String> batchClassesMap) { Label footer = new Label(); folderTableView = new FolderTableView(footer); folderTablePresenter = new FolderTablePresenter(controller, folderTableView, parentFolderPath, baseFolderUrl);/*from w ww . j a v a 2s. c o m*/ folderSystemTreeView = new FolderSystemTreeView(); folderSystemTreePresenter = new FolderSystemTreePresenter(controller, folderSystemTreeView, parentFolderPath, footer); SplitLayoutPanel mainContentPanel = new SplitLayoutPanel(); DockLayoutPanel leftLayoutPanel = new DockLayoutPanel(Unit.PCT); ScrollPanel treeScrollPanel = new ScrollPanel(); treeScrollPanel.add(folderSystemTreeView); FolderSelectionWidget folderSelectionWidget = new FolderSelectionWidget(batchClassesMap, controller.getEventBus()); leftLayoutPanel.addNorth(folderSelectionWidget, 10); leftLayoutPanel.add(treeScrollPanel); mainContentPanel.addWest(leftLayoutPanel, 200); DockLayoutPanel contentMainPanel = new DockLayoutPanel(Unit.PCT); contentMainPanel.add(folderTableView); contentMainPanel.addStyleName(FolderManagementConstants.WHITE_BACKGROUND); mainContentPanel.add(contentMainPanel); mainPanel.add(mainContentPanel); ScreenMaskUtility.unmaskScreen(); }
From source file:com.gmail.cjbooms.thesis.pythonappengine.client.PythonAppEngine.java
License:Open Source License
/** * This is the entry point method./*from ww w. j a v a2s. c o m*/ */ public void onModuleLoad() { VerticalPanel menuAndToolBarPanel = new VerticalPanel(); menuAndToolBarPanel.setWidth("100%"); // Panel to house the Main Menu FlowPanel menuBarPanel = new FlowPanel(); DOM.setElementAttribute(menuBarPanel.getElement(), "id", "main_menu_panel"); menuBarPanel.add(new MainMenuWidget()); menuBarPanel.setHeight("1"); HTMLPanel titleBar = new HTMLPanel(TITLE); DOM.setElementAttribute(titleBar.getElement(), "id", "pa-header"); menuAndToolBarPanel.add(titleBar); menuAndToolBarPanel.add(menuBarPanel); menuAndToolBarPanel.add(new Toolbar()); rootPanel.addNorth(menuAndToolBarPanel, 7); // Panel to house a footer containing File Context HTML footer = new HTML(); DOM.setElementAttribute(footer.getElement(), "id", "pa-footer"); rootPanel.addSouth(footer, 2); //Build the Main Work Area Panel and Add to Root SplitLayoutPanel mainWorkAreaPanel = new SplitLayoutPanel(); rootPanel.add(mainWorkAreaPanel); FileSystemTreeWidget fileSystemTreeWidget = new FileSystemTreeWidget("Available Projects", editor, footer); treeScrollPanel.add(fileSystemTreeWidget); mainWorkAreaPanel.addWest(treeScrollPanel, 200); //contentScrollPanel.setHeight("100%"); editor.setWidth("100%"); editor.setHeight("100%"); //contentScrollPanel.setWidget(editor); mainWorkAreaPanel.add(editor); mainWorkAreaPanel.setHeight("100%"); RootLayoutPanel.get().add(rootPanel); }
From source file:com.google.gwt.examples.SplitLayoutPanelExample.java
License:Apache License
public void onModuleLoad() { // Create a three-pane layout with splitters. SplitLayoutPanel p = new SplitLayoutPanel(); p.addWest(new HTML("navigation"), 128); p.addNorth(new HTML("list"), 384); p.add(new HTML("details")); // 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);/*w ww . j a v a 2 s . c o m*/ }
From source file:com.google.gwt.sample.showcase.client.content.panels.CwSplitLayoutPanel.java
License:Apache License
/** * Initialize this example.//from ww w . j a va 2 s. c o m */ @ShowcaseSource @Override public Widget onInitialize() { // Create a Split Panel SplitLayoutPanel splitPanel = new SplitLayoutPanel(5); splitPanel.ensureDebugId("cwSplitLayoutPanel"); splitPanel.getElement().getStyle().setProperty("border", "3px solid #e7e7e7"); // Add text all around. splitPanel.addNorth(new Label(constants.cwSplitLayoutPanelNorth1()), 50); splitPanel.addSouth(new Label(constants.cwSplitLayoutPanelSouth1()), 50); splitPanel.addEast(new Label(constants.cwSplitLayoutPanelEast()), 100); splitPanel.addWest(new Label(constants.cwSplitLayoutPanelWest()), 100); splitPanel.addNorth(new Label(constants.cwSplitLayoutPanelNorth2()), 50); splitPanel.addSouth(new Label(constants.cwSplitLayoutPanelSouth2()), 50); // Add scrollable text to the center. String centerText = constants.cwSplitLayoutPanelCenter(); for (int i = 0; i < 3; i++) { centerText += " " + centerText; } Label centerLabel = new Label(centerText); ScrollPanel centerScrollable = new ScrollPanel(centerLabel); splitPanel.add(centerScrollable); // Return the content return splitPanel; }
From source file:com.google.gwt.sample.stockwatcher.client.Panels.java
private Widget loadSplitLayoutPanel() { SplitLayoutPanel p = new SplitLayoutPanel(); p.addWest(new HTML("navigation"), 128); p.addNorth(new HTML("list"), 384); p.add(new HTML(MUSSUM_IPSUM_LITERIS)); p.setPixelSize(800, 500);/*from w w w . ja v a 2 s. c o m*/ return p; }
From source file:com.mashery.examples.api.client.EtsyExample.java
License:Open Source License
public EtsyExample(final PopupMapWidget mapWidget) { AbsolutePanel rootPanel = new AbsolutePanel(); rootPanel.setSize("100%", "100%"); SplitLayoutPanel panel = new SplitLayoutPanel(); rootPanel.add(panel);/* w ww.j a v a2 s . co m*/ panel.setHeight("100%"); FlowPanel topPanel = new FlowPanel(); panel.addNorth(topPanel, 250d); topPanel.add(new HTML("<h1>Featured Listings</h1>")); dragController = new PickupDragController(rootPanel, false); dragController.setBehaviorDragProxy(true); dragController.setBehaviorMultipleSelection(false); dragController.setBehaviorDragStartSensitivity(2); featuredListingsTable = new FeaturedListingsTable(20); topPanel.add(new ScrollPanel(featuredListingsTable)); DockLayoutPanel bottomPanelContainer = new DockLayoutPanel(Unit.PX); panel.add(bottomPanelContainer); bottomPanelContainer.addNorth(new HTML("<h1>Favorite Listings</h1>"), 50d); bottomPanel = new DeckPanel(); bottomPanelContainer.add(bottomPanel); bottomPanel.add(new HTML("Obtaining your Etsy account information...")); favoriteListingsTable = new FavoriteListingsTable(20); dropController = new SimpleDropController(favoriteListingsTable) { public void onDrop(DragContext context) { Image img = (Image) context.draggable; String id = img.getElement().getId(); if (id != null && id.startsWith("listing_")) { try { int listingId = Integer.parseInt(id.substring("listing_".length())); favoriteListingsTable.createUserFavoriteListing(listingId); } catch (NumberFormatException e) { GWT.log("Unable to parse listing id.", e); } } } }; dragController.registerDropController(dropController); FlowPanel userPanel = new FlowPanel(); userPanel.add(userLabel = new InlineHTML()); userPanel.add(new InlineHTML(" ")); Anchor disconnectLink = new Anchor("Disconnect", "#"); userPanel.add(disconnectLink); disconnectLink.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { event.preventDefault(); disconnectEtsyAccount(); } }); userPanel.add(new InlineHTML(" | ")); Anchor mapProfileLink = new Anchor("Map Profile", "#"); userPanel.add(mapProfileLink); mapProfileLink.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { event.preventDefault(); if (user != null) { UserProfile profile = user.getProfile(); if (profile != null) { MarkerOptions opt = new MarkerOptions(); opt.setTitle(profile.getLoginName()); opt.setPosition(new LatLng(profile.getLat(), profile.getLon())); opt.setClickable(true); opt.setVisible(true); mapWidget.show(new Marker(opt)); } } } }); mapWidget.addAutoHidePartner(mapProfileLink.getElement()); userPanel.add(new HTML()); userPanel.add(favoriteListingsTable); bottomPanel.add(new ScrollPanel(userPanel)); bottomPanel.add(new HTML("You must be logged in in order to manage your favorite listings.")); bottomPanel.add(createOAuthPanel()); etsySvc = GWT.create(EtsyService.class); infoPanel = new PopupPanel(true); infoPanel.setAutoHideOnHistoryEventsEnabled(true); infoGrid = new Grid(2, 1); infoPanel.setWidget(infoGrid); infoGrid.setWidth("240px"); mapListingLink = new Anchor("Map", "#"); mapListingLink.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { event.preventDefault(); if (selectedListing == null) return; Shop shop = selectedListing.getShop(); if (shop == null) { Window.alert("No shop information available."); return; } if (!shop.hasLatLon()) { Window.alert("No location information available."); return; } MarkerOptions opt = new MarkerOptions(); opt.setTitle(shop.getShopName()); opt.setPosition(new LatLng(shop.getLat(), shop.getLon())); opt.setClickable(true); opt.setVisible(true); mapWidget.show(new Marker(opt)); } }); mapWidget.addAutoHidePartner(mapListingLink.getElement()); deleteFavListingLink = new Anchor("Delete", "#"); deleteFavListingLink.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { event.preventDefault(); favoriteListingsTable.deleteUserFavoriteListing(selectedListing.getListingId()); infoPanel.hide(); } }); initWidget(rootPanel); bottomPanel.showWidget(0); }
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);/* ww w.ja 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.nitrous.gwt.earth.client.demo.MouseListenerDemo.java
License:Apache License
/** * The Google earth API has loaded, start the application *//*from w ww . j a va 2s. co m*/ private void onApiLoaded() { // the table that will be used to render mouse event information table = new CellTable<MouseEventInfo>(); TextColumn<MouseEventInfo> eventType = new TextColumn<MouseEventInfo>() { @Override public String getValue(MouseEventInfo object) { return object.getEventType(); } }; eventType.setSortable(false); TextColumn<MouseEventInfo> eventDetail = new TextColumn<MouseEventInfo>() { @Override public String getValue(MouseEventInfo object) { KmlMouseEvent event = object.getMouseEvent(); return "Button=" + event.getButton() + " Latitude=" + event.getLatitude() + " Longitude=" + event.getLongitude() + " X=" + event.getClientX() + " Y=" + event.getClientY(); } }; eventDetail.setSortable(false); TextColumn<MouseEventInfo> eventTime = new TextColumn<MouseEventInfo>() { @Override public String getValue(MouseEventInfo object) { return dateTimeFormat.format(object.getTimestamp()); } }; eventTime.setSortable(false); // add the columns table.addColumn(eventTime, "Time"); table.addColumn(eventType, "Type"); table.addColumn(eventDetail, "Detail"); table.setWidth("100%"); // set the data model into the table dataProvider = new ListDataProvider<MouseEventInfo>(); dataProvider.addDataDisplay(table); // construct the UI widget earth = new GoogleEarthWidget(); // register a listener to be notified when the earth plug-in has loaded earth.addPluginReadyListener(new GEPluginReadyListener() { public void pluginReady(GEPlugin ge) { // show map content once the plugin has loaded loadMapContent(); } public void pluginInitFailure() { // failure! Window.alert("Failed to initialize Google Earth Plug-in"); } }); scrollPanel = new ScrollPanel(); scrollPanel.setHeight("100%"); scrollPanel.add(table); HorizontalPanel header = new HorizontalPanel(); header.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); mouseLocation = new HTML(""); header.add(mouseLocation); SplitLayoutPanel split = new SplitLayoutPanel(); split.addWest(scrollPanel, 450); split.add(earth); DockLayoutPanel dockLayout = new DockLayoutPanel(Unit.PX); dockLayout.addNorth(header, 30D); dockLayout.add(split); RootLayoutPanel.get().add(dockLayout); // begin loading the Google Earth Plug-in earth.init(); }
From source file:edu.caltech.ipac.firefly.ui.previews.DataSourceCoveragePreview.java
public DataSourceCoveragePreview(DataSourceCoverageData covData) { super(covData.getTitle(), covData.getTip()); _covData = covData;/* w w w . j a v a2s. c o m*/ setName(covData.getTitle()); String group = covData.getGroup(); MiniPlotWidget mpw = new MiniPlotWidget(group); mpw.setImageSelection(true); mpw.setRemoveOldPlot(false); _plotDeck = new DisableablePlotDeckPanel(_prop.getName("noplot"), mpw, true); if (covData.getEnableDetails()) { _detailsView = new ScrollPanel(_details); SplitLayoutPanel display = new SplitLayoutPanel(); display.addSouth(_detailsView, 120); GwtUtil.setStyle(_detailsView, "borderTop", "1px solid gray"); GwtUtil.setStyle(_detailsView, "paddingTop", "3px"); display.add(_plotDeck); setDisplay(display); } else { setDisplay(_plotDeck); } }