public abstract Canvas getViewPanel();
protected void showSource(SourceEntity[] sourceUrls, int width, int height) {
final Window win = new Window();
win.setTitle("Source");
win.setHeaderIcon("pieces/16/cube_green.png", 16, 16);
win.setKeepInParentRect(true);
int userWidth = com.google.gwt.user.client.Window.getClientWidth() - 20;
win.setWidth(userWidth < width ? userWidth : width);
int userHeight = com.google.gwt.user.client.Window.getClientHeight() - 96;
win.setHeight(userHeight < height ? userHeight : height);
int windowTop = 40;
int windowLeft = com.google.gwt.user.client.Window.getClientWidth() - (win.getWidth() + 20) - getPageLeft();
win.setLeft(windowLeft);
win.setTop(windowTop);
win.setCanDragReposition(true);
win.setCanDragResize(true);
win.setMembersMargin(5);
final TabSet tabs = new TabSet();
tabs.setTabBarPosition(Side.TOP);
tabs.setWidth100();
tabs.setHeight100();
for (int i = 0; i < sourceUrls.length; i++) {
SourceEntity sourceUrl = sourceUrls[i];
tabs.addTab(buildSourceTab(sourceUrl));
}
int lastPeriodIndex = getClass().getName().lastIndexOf('.');
String simpleClassName = getClass().getName().substring(lastPeriodIndex + 1);
String[] dataURLs = DataURLRecords.getDataURLs(simpleClassName);
if (dataURLs != null) {
for (String dataURL : dataURLs) {
String url = "sourcegen/" + dataURL + ".html";
int lastSlashIndex = dataURL.lastIndexOf('/');
String tabTitle = lastSlashIndex >= 0 ? dataURL.substring(lastSlashIndex + 1) : dataURL;
tabs.addTab(buildSourceTab(tabTitle, "silk/page_white_cup.png", url));
}
}
if (getCssUrl() != null)
tabs.addTab(buildSourceTab("CSS", "silk/css.png", getCssUrl()));
if (getJsonDataUrl() != null)
tabs.addTab(buildSourceTab("JSON", "silk/database_table.png", getJsonDataUrl()));
if (getXmlDataUrl() != null)
tabs.addTab(buildSourceTab("XML", "silk/database_table.png", getXmlDataUrl()));
win.addItem(tabs);
addChild(win);
win.show();
}