*/
private void showQuickView() {
if (entries == null) {
return;
}
VerticalPanel panel = new VerticalPanel();
panel.setStylePrimaryName("lab-Explorer-Documents");
int totalEntries = 0;
for (DocumentServiceEntry entry : entries) {
if (!entry.isStarred()) {
continue;
}
final String id = entry.getDocumentId();
FlexTable docTable = new FlexTable();
docTable.insertRow(0);
docTable.insertCell(0, 0);
docTable.insertCell(0, 1);
docTable.insertCell(0, 2);
docTable.insertRow(1);
docTable.insertCell(1, 0);
docTable.insertCell(1, 1);
docTable.insertCell(1, 2);
docTable.insertRow(2);
docTable.insertCell(2, 0);
docTable.insertCell(2, 1);
docTable.insertCell(2, 2);
docTable.setStylePrimaryName("lab-Explorer-Document");
Anchor link = new Anchor();
link.setText(entry.getTitle());
link.setTarget("_blank");
if (entry.getType().equalsIgnoreCase("document")) {
link.setHref("/docs?docid=" + entry.getDocumentId());
}
ToggleButton star = new ToggleButton(
Icons.editorIcons.StarEmpty().createImage(),
Icons.editorIcons.StarFull().createImage());
star.setDown(entry.isStarred());
star.addClickHandler(new ClickHandler(){
public void onClick(ClickEvent event) {
ToggleButton btn = (ToggleButton)event.getSource();
if (btn.isDown()) {
CommandEvent.fire(new SystemStarDocumentCommand(id));
} else {
CommandEvent.fire(new SystemUnstarDocumentCommand(id));
}
}
});
Label info = new Label(entry.getEdited().toString() + " by " + entry.getEditor());
info.setStylePrimaryName("lab-Explorer-Document-Info");
docTable.setWidget(0, 0, star);
docTable.setWidget(0, 1, Icons.editorIcons.Document().createImage());
docTable.setWidget(0, 2, link);
docTable.setWidget(1, 2, info);
if (entry.getFolders().length > 0) {
Label folderLabel = new Label(entry.getFolders()[0]);
folderLabel.setStylePrimaryName("lab-Explorer-Document-Folder");
HorizontalPanel folderPanel = new HorizontalPanel();
folderPanel.add(folderLabel);
docTable.setWidget(2, 2, folderPanel);
}
panel.add(docTable);
totalEntries++;
}
if (totalEntries == 0) {
panel.add(new Label("You have no starred documents."));
}
documentsPanel = new ScrollPanel(panel);
rightPanel.add(documentsPanel);
resize();
}