String helpIconUrl = GadgetUtils.getIconURL(null, "help.jpg", false);
String href = GadgetUtils.getGadgetserver(false)
+ SharedConstants.gadgetHelpDirName + "?gadget="
+ GadgetConfig.getGadgetConfig().getGadgetName();
PreferencesFeature prefsUtils = PreferencesProvider.get();
Anchor help = new Anchor();
help.setHref(href);
help.setTitle(prefsUtils.getMsg("gadgetLabelHelp"));
help.setTarget("_blank");
help.setHTML("<img src=\"" + helpIconUrl + "\">");
header.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LOCALE_START);
header.add(help);
header.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LOCALE_END);
header.add(new HTML(" "));
// add profile link
if (!GadgetConfig.getGadgetConfig().getGadgetType()
.equals(GadgetType.OTHER)) {
Image profileImage = new Image(GadgetUtils.getIconURL("profile",
null, false));
profileImage.setTitle(prefsUtils.getMsg("gadgetLabelProfile"));
profileImage.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
profileRegistration.editProfile();
}
});
profileImage.setStyleName("actionIcon");
header.add(profileImage);
}
header.add(new HTML(" "));
// add friends link
if (GadgetConfig.getGadgetConfig().getGadgetType()
.equals(GadgetType.MINGLET)) {
Image friendsImage = new Image(GadgetUtils.getIconURL("friends",
null, false));
friendsImage.setTitle(prefsUtils.getMsg("gadgetLabelFriends"));
friendsImage.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
friendsPanel.showDialog();
}
});
friendsImage.setStyleName("actionIcon");
header.add(friendsImage);
}
else if (GadgetConfig.getGadgetConfig().getGadgetType()
.equals(GadgetType.BIZLET)) {
Image friendsImage = new Image(GadgetUtils.getIconURL("friends",
null, false));
friendsImage.setTitle(prefsUtils.getMsg("gadgetLabelFriends"));
friendsImage.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
domainFriendsPanel.showDialog();
}
});
friendsImage.setStyleName("actionIcon");
header.add(friendsImage);
}
// make footer
if (!GadgetUtils.isDefaultServer())
footer.add(new HTML(prefsUtils.getMsg("gadgetMsgPoweredBy")));
else {
footer.add(new HTML(prefsUtils.getMsg("gadgetMsgCopyright")));
Anchor contact = new Anchor();
contact.setHref(GadgetUtils.getGadgetserver(false)
+ SharedConstants.gadgetContactUs);
contact.setTarget("_blank");
contact.setHTML(prefsUtils.getMsg("gadgetLabelContactUs"));
footer.add(new HTML(" "));
footer.add(contact);
}
}