/** Initialize this example. */ @ShowcaseSource @Override public Widget onInitialize() { // Create a Split Panel SplitLayoutPanel splitPanel = new SplitLayoutPanel(5); splitPanel.ensureDebugId("cwSplitLayoutPanel"); splitPanel.setPixelSize(500, 400); 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; }
public ServerGroupMgmtView() { super(); layout = new SplitLayoutPanel(4); contentCanvas = new LayoutPanel(); lhsNavigation = new LHSServerGroupNavigation(); layout.addWest(lhsNavigation.asWidget(), 180); layout.add(contentCanvas); }
public Widget asWidget() { SimplePanel panel = new SimplePanel(); definitionView = new DefinitionHistoryListView(); instanceView = new HistoryInstanceListView(); final SplitLayoutPanel splitPanel = new SplitLayoutPanel(); splitPanel.addWest(definitionView.asWidget(), 250); splitPanel.add(instanceView.asWidget()); panel.add(splitPanel); return panel; }
private void buildUI() { FlowPanel topPanel = new FlowPanel(); SimplePanel toolbarWrapper = new SimplePanel(); toolbarWrapper.setWidget(new BrowserToolbar()); toolbarWrapper.setStyleName("files-toolbar"); // $NON-NLS-1$ topPanel.add(toolbarWrapper); topPanel.add(new SolutionTreeWrapper(solutionTree)); solutionNavigatorPanel.setStyleName("puc-vertical-split-panel"); solutionNavigatorPanel.setWidth("100%"); solutionNavigatorPanel.addNorth(topPanel, 500); solutionNavigatorPanel.add(filesListPanel); navigatorAndContentSplit.setStyleName("puc-horizontal-split-panel"); navigatorAndContentSplit.addWest(solutionNavigatorPanel, 300); navigatorAndContentSplit.add(contentTabPanel); navigatorAndContentSplit.getElement().setAttribute("id", "solutionNavigatorAndContentPanel"); Window.addResizeHandler( new ResizeHandler() { @Override public void onResize(ResizeEvent event) { adjustContentPanelSize(); } }); solutionNavigatorPanel.getElement().getParentElement().addClassName("puc-navigator-panel"); solutionNavigatorPanel.getElement().getParentElement().removeAttribute("style"); setStyleName("panelWithTitledToolbar"); // $NON-NLS-1$ setHeight("100%"); // $NON-NLS-1$ setWidth("100%"); // $NON-NLS-1$ add(navigatorAndContentSplit); sinkEvents(Event.MOUSEEVENTS); navigatorAndContentSplit.getWidget(1).setWidth("100%"); navigatorAndContentSplit.getElement().getStyle().setHeight(1, Unit.PX); contentTabPanel.getElement().getStyle().setHeight(1, Unit.PX); }
public com.google.gwt.user.client.ui.Widget createAndBindUi( final PolyakovGWT.client.view.MailboxViewImpl owner) { PolyakovGWT.client.view.MailboxViewImpl_MyUiBinderImpl_GenBundle clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay = (PolyakovGWT.client.view.MailboxViewImpl_MyUiBinderImpl_GenBundle) GWT.create(PolyakovGWT.client.view.MailboxViewImpl_MyUiBinderImpl_GenBundle.class); PolyakovGWT.client.view.MailboxViewImpl_MyUiBinderImpl_GenCss_style style = clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay.style(); PolyakovGWT.client.view.widgets.CurrentPathWidget currentPathWidget = (PolyakovGWT.client.view.widgets.CurrentPathWidget) GWT.create(PolyakovGWT.client.view.widgets.CurrentPathWidget.class); PolyakovGWT.client.view.widgets.toolbar.ButtonsHolderWidget buttonsWidget = owner.buttonsWidget; com.google.gwt.user.client.ui.VerticalPanel f_VerticalPanel2 = (com.google.gwt.user.client.ui.VerticalPanel) GWT.create(com.google.gwt.user.client.ui.VerticalPanel.class); PolyakovGWT.client.view.widgets.FolderTreeWidget folderTree = owner.folderTree; com.google.gwt.user.client.ui.SimpleLayoutPanel containerPanel = (com.google.gwt.user.client.ui.SimpleLayoutPanel) GWT.create(com.google.gwt.user.client.ui.SimpleLayoutPanel.class); com.google.gwt.user.client.ui.SplitLayoutPanel f_SplitLayoutPanel3 = (com.google.gwt.user.client.ui.SplitLayoutPanel) GWT.create(com.google.gwt.user.client.ui.SplitLayoutPanel.class); com.google.gwt.user.client.ui.DockLayoutPanel f_DockLayoutPanel1 = new com.google.gwt.user.client.ui.DockLayoutPanel(com.google.gwt.dom.client.Style.Unit.PX); f_VerticalPanel2.add(currentPathWidget); f_VerticalPanel2.add(buttonsWidget); f_DockLayoutPanel1.addNorth(f_VerticalPanel2, 85); f_SplitLayoutPanel3.addWest(folderTree, 135); containerPanel.addStyleName("" + style.container() + ""); f_SplitLayoutPanel3.add(containerPanel); f_SplitLayoutPanel3.addStyleName("" + style.data_container() + ""); f_DockLayoutPanel1.add(f_SplitLayoutPanel3); owner.containerPanel = containerPanel; owner.currentPathWidget = currentPathWidget; clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay.style().ensureInjected(); return f_DockLayoutPanel1; }
public GeoStory() { panel = new SplitLayoutPanel(); types = new GeoEventTypes(); model = new GeoStoryModel(types); space = new Space(LatLng.newInstance(45.50, -73.60), 4, types, model); time = new TimeLine(model, types); list = new ListBox(true); list.setVisibleItemCount(20); for (GeoStoryItem i : model.getItems()) { list.addItem(i.toString()); } { controls = new VerticalPanel(); { email = new TextBox(); email.setText("*****@*****.**"); controls.add(email); email.addChangeHandler( new ChangeHandler() { @Override public void onChange(ChangeEvent event) {} }); } { Button getFromServer = new Button("Get from server"); getFromServer.addClickHandler( new ClickHandler() { @Override public void onClick(ClickEvent event) { types.getEventFromServer.shareEvent(getEmail()); } }); controls.add(getFromServer); } { Button dump = new Button("Json dump"); dump.addClickHandler( new ClickHandler() { @Override public void onClick(ClickEvent event) { StringBuilder sb = new StringBuilder(); for (GeoStoryItem item : model.getItems()) { sb.append(item.toJSON() + "\n"); } DialogBox db = new DialogBox(true); TextArea ta = new TextArea(); ta.setEnabled(true); ta.setText(sb.toString()); db.add(ta); db.center(); db.show(); } }); controls.add(dump); } { Button jsonload = new Button("Json load"); jsonload.addClickHandler( new ClickHandler() { @Override public void onClick(ClickEvent event) { Question<String> q = new ContentQuestion("Entrer la cha”ne JSON"); final QPanel textContent = new QPanel(new Questionnaire(q)); textContent.center(); textContent.show(); q.answerChannel() .registerHandler( new WHandler<String>() { @Override public void onEvent(WEvent<String> elt) { String[] lines = elt.getElement().split("\n"); for (String item : lines) { JSONValue json = JSONParser.parse(item); JSONObject object = json.isObject(); GeoStoryItem gsi = GeoStoryItem.fromJSON(object); types.itemAdded.shareEvent(gsi); types.centerEvent.shareEvent(null); } } }); } }); controls.add(jsonload); } { Button popRandom = new Button("Populate at random"); controls.add(popRandom); popRandom.addClickHandler( new ClickHandler() { @Override public void onClick(ClickEvent event) { model.populateRandomly(10); types.centerEvent.shareEvent(null); } }); } { Button popFromText = new Button("Populate from text"); controls.add(popFromText); popFromText.addClickHandler( new ClickHandler() { @Override public void onClick(ClickEvent event) { Question<String> q = new ContentQuestion("Description des evenements"); final QPanel textContent = new QPanel(new Questionnaire(q)); textContent.center(); textContent.show(); q.answerChannel() .registerHandler( new WHandler<String>() { @Override public void onEvent(WEvent<String> elt) { List<Triple<String, Interval, String>> res = GeoStoryParser.parse(elt.getElement()); int delay = 0; final Geocoder geo = new Geocoder(); for (final Triple<String, Interval, String> indiv : res) { geodecode(geo, indiv, delay = delay + 100); } textContent.hide(); } }); } }); } { Button cia = new Button("Draw borders"); controls.add(cia); cia.addClickHandler( new ClickHandler() { @Override public void onClick(ClickEvent event) { for (final Polyline poly : CIA.segments(CIA.northamerica)) { space.space.addOverlay(poly); } for (final Polyline poly : CIA.segments(CIA.europe)) { space.space.addOverlay(poly); } } }); } { Button family = new Button("Genealogy info"); controls.add(family); family.addClickHandler( new ClickHandler() { @Override public void onClick(ClickEvent event) { Geocoder geo = new Geocoder(); for (final Triple<String, Interval, String> indiv : Genea.people()) { geodecode(geo, indiv, 100); } } }); } { Button addOne = new Button("Add one"); addOne.addClickHandler( new ClickHandler() { @Override public void onClick(ClickEvent event) { ContentQuestion desc = new ContentQuestion("Description?"); WhenQuestion when = new WhenQuestion("Quand?"); ContentQuestion plac = new ContentQuestion("Nom du lieu?"); WhereQuestion wher = new WhereQuestion("Sur la carte?", plac.answerChannel()); Questionnaire q = new Questionnaire(desc, when, plac, wher); QPanel tested = new QPanel(q); // tested.setSize("50%", "50%"); q.answerChannel() .registerHandler( new WHandler<Map<String, String>>() { @Override public void onEvent(WEvent<Map<String, String>> elt) { Map<String, String> map = elt.getElement(); // Window.alert("Questionnaire are "+ elt.getElement().toString()); String[] coord = map.get("Sur la carte?").split("\\|"); // Window.alert("Questionnaire are "+ elt.getElement().toString()+" // "+Arrays.toString(coord)); LatLng ll = LatLng.newInstance( Double.parseDouble(coord[0]), Double.parseDouble(coord[1])); // ; String[] dates = map.get("Quand?").split("->"); Interval interval = new Interval( WhenQuestion.dtf.parse(dates[0]), WhenQuestion.dtf.parse(dates[1])); GeoStoryItem geo = new GeoStoryItem( interval, map.get("Nom du lieu?"), ll, map.get("Description?")); Window.alert( "GeoStory " + geo + " " + Arrays.toString(dates) + " " + map.get("Quand?")); types.itemAdded.shareEvent(geo); types.centerEvent.shareEvent(null); } }); tested.center(); tested.show(); } }); controls.add(addOne); } { Button reset = new Button("Reset"); reset.addClickHandler( new ClickHandler() { @Override public void onClick(ClickEvent event) { model.reset(); types.centerEvent.shareEvent(null); } }); controls.add(reset); } { final TextBox search = new TextBox(); search.setTitle("Search"); final Button go = new Button("go"); go.addClickHandler( new ClickHandler() { @Override public void onClick(ClickEvent event) { Set<GeoStoryItem> itemsSet = model.getItems(); // filtering if (search.getText() != null && !search.getText().isEmpty()) { for (GeoStoryItem geoStoryItem : itemsSet) { if (geoStoryItem.getDescription().contains(search.getText())) { geoStoryItem.setVisible(true); } else { geoStoryItem.setVisible(false); } } } types.centerEvent.shareEvent(null); } }); controls.add(go); controls.add(search); } { final Button removeFilter = new Button("remove filter"); removeFilter.addClickHandler( new ClickHandler() { @Override public void onClick(ClickEvent event) { Set<GeoStoryItem> itemsSet = model.getItems(); // filtering for (GeoStoryItem geoStoryItem : itemsSet) { geoStoryItem.setVisible(true); } types.centerEvent.shareEvent(null); } }); controls.add(removeFilter); } panel.addSouth(time, 150); panel.addWest(controls, 150); panel.add(space); Window.addResizeHandler(this); } this.initWidget(panel); // Short term timer to check and resize the badly initialized map. Timer t = new Timer() { public void run() { space.checkResizeAndCenter(); time.init(); } }; t.schedule(1); }
public void onModuleLoad() { TabLayoutPanel tabLayoutPanel = new TabLayoutPanel(2.5, Unit.EM); final SplitLayoutPanel splitLayoutPanel = new SplitLayoutPanel(); final HorizontalPanel hPanel = new HorizontalPanel(); hPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); hPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); hPanel.setSpacing(10); hPanel.add(new HTML("HQMF Viewer.")); Button processHQMFButton = new Button("Process HQMF."); processHQMFButton.addStyleName("sendButton"); hPanel.add(processHQMFButton); hPanel.add(new HTML("\t(For some reason, works only in IE right now.)")); final VerticalPanel summaryVerticalPanel = new VerticalPanel(); summaryVerticalPanel.setSpacing(3); processHQMFButton.setStyleName("summaryVPanel"); summaryVerticalPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); summaryVerticalPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); splitLayoutPanel.addNorth(hPanel, 50); splitLayoutPanel.addWest(summaryVerticalPanel, 0); final RichTextArea textArea = new RichTextArea(); textArea.setTitle("Paste your HQMF XML here."); textArea.setText("Paste your HQMF XML here."); textArea.addClickHandler( new ClickHandler() { @Override public void onClick(ClickEvent event) { if (textArea.getText().length() < 30 && textArea.getText().equals("Paste your HQMF XML here.")) { textArea.setText(""); } } }); textArea.addStyleName("boxsizingBorder"); textArea.setWidth("100%"); textArea.setHeight("100%"); processHQMFButton.addClickHandler( new ClickHandler() { @Override public void onClick(ClickEvent event) { processHQMF(textArea, splitLayoutPanel, summaryVerticalPanel); splitLayoutPanel.remove(hPanel); splitLayoutPanel.setWidgetSize(summaryVerticalPanel, 200); splitLayoutPanel.setWidgetToggleDisplayAllowed(summaryVerticalPanel, true); } }); splitLayoutPanel.add(textArea); MySplitLayoutPanel mySplitPanel = new MySplitLayoutPanel(); final VerticalPanel testVerticalPanel = new VerticalPanel(); testVerticalPanel.setSpacing(3); testVerticalPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); testVerticalPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); // final RichTextArea testtextArea = getSmartTextArea(); // final AceEditor testtextArea = getAceEditor(); AceEditor aceTxtArea = new AceEditor(); aceTxtArea.setWidth("100%"); aceTxtArea.setHeight("100%"); mySplitPanel.addEast(testVerticalPanel, 0); mySplitPanel.add(aceTxtArea); // mySplitPanel.add(testtextArea); aceTxtArea.startEditor(); setAceEditorProperties(aceTxtArea); mySplitPanel.setWidgetToggleDisplayAllowed(testVerticalPanel, true); tabLayoutPanel.add(mySplitPanel, "test CQL Editor."); tabLayoutPanel.add(splitLayoutPanel, "HQMF Viewer"); RootLayoutPanel.get().add(tabLayoutPanel); }