buttonPanel.setLayout(new RowLayout(Orientation.VERTICAL));
buttonPanel.setHeaderVisible(false);
buttonPanel.setBorders(false);
buttonPanel.setBodyBorder(false);
panel.add(buttonPanel, new FlowData(10, 0, 0, 100));
final String basePath = JahiaGWTParameters.getContextPath() + "/cms/gconvert/"
+ JahiaGWTParameters.getWorkspace() + node.getPath() + "?exportFormat=";
panel.mask(Messages.get("label.loading","Loading..."), "x-mask-loading");
JahiaContentManagementService.App.getInstance().getGoogleDocsExportFormats(node.getUUID(), new BaseAsyncCallback<List<String>>() {
public void onSuccess(List<String> result) {
panel.unmask();
for (final String format : result) {
Button btn = new Button(Messages.get("label.googleDocs.export.format." + format, format), ContentModelIconProvider.getInstance().getIcon("jnt_file_"+format, false,false));
btn.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
com.google.gwt.user.client.Window.open(basePath + format, "_blank", "");
}
});
buttonPanel.add(btn, new RowData(-1, -1, new Margins(2)));
}
layout();
}
@Override
public void onFailure(Throwable caught) {
panel.unmask();
super.onFailure(caught);
}
});
panel.add(new Label(Messages.get("mount.disclaimer",
"Disclaimer") + ": " + Messages.get("label.googleDocs.export.disclaimer", "")));
panel.setButtonAlign(HorizontalAlignment.CENTER);
panel.addButton(new Button(Messages.get("label.cancel", "Cancel"), new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent event) {
hide();
}
}));
add(panel, new FlowData(10));
setScrollMode(Style.Scroll.AUTO);
}