Java Code Examples for com.google.gwt.user.client.ui.RootPanel#clear()

The following examples show how to use com.google.gwt.user.client.ui.RootPanel#clear() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ConflictBasedStatisticsPage.java    From unitime with Apache License 2.0 5 votes vote down vote up
protected void populate(FilterInterface filter, GwtRpcResponseList<CBSNode> response) {
	iLastFilter = filter;
	iLastResponse = response;
	for (int row = iPanel.getRowCount() - 1; row > 0; row--)
		iPanel.removeRow(row);
	
	RootPanel cpm = RootPanel.get("UniTimeGWT:CustomPageMessages");
	if (cpm != null && iFilterResponse != null) {
		cpm.clear();
		if (iFilterResponse.hasPageMessages()) {
			for (final PageMessage pm: iFilterResponse.getPageMessages()) {
				P p = new P(pm.getType() == PageMessageType.ERROR ? "unitime-PageError" : pm.getType() == PageMessageType.WARNING ? "unitime-PageWarn" : "unitime-PageMessage");
				p.setHTML(pm.getMessage());
				if (pm.hasUrl()) {
					p.addStyleName("unitime-ClickablePageMessage");
					p.addClickHandler(new ClickHandler() {
						@Override
						public void onClick(ClickEvent event) {
							if (pm.hasUrl()) ToolBox.open(GWT.getHostPageBaseURL() + pm.getUrl());
						}
					});
				}
				cpm.add(p);
			}
		}
	}
	
	if (response == null || response.isEmpty()) {
		iFilter.getFooter().setMessage(MESSAGES.errorConflictStatisticsNoDataReturned());
		return;
	}
	
	if (iTree == null) {
		iTree = new ConflictBasedStatisticsTree(iFilterResponse.getSuggestionProperties());
	}
	iTree.setValue(response);
	iPanel.addRow(iTree);
	iPanel.addRow(iLegend);
}
 
Example 2
Source File: WordCloudDetailApp.java    From swcv with MIT License 5 votes vote down vote up
private void initializeContentPanel(WordCloud cloud)
{
    SimplePanel panel = createPanel(cloud.getSvg(), cloud.getWidth() + 20, cloud.getHeight() + 20);
    RootPanel rPanel = RootPanel.get("cloud-div");
    rPanel.clear();
    rPanel.add(panel);
    rPanel.setPixelSize(cloud.getWidth() + 20, cloud.getHeight() + 20);
    rPanel.addStyleName("center");
}
 
Example 3
Source File: WordCloudDetailApp.java    From swcv with MIT License 5 votes vote down vote up
private void initializeSettingPanel(WordCloud cloud)
{
    CaptionPanel settingArea = new SettingsPanel().create(setting);
    settingArea.setCaptionText("options");
    
    RootPanel rPanel = RootPanel.get("cloud-setting");
    rPanel.clear();
    rPanel.add(settingArea);
}