public class RssNavigationPanel extends ContentPanel {
final LinkFeedPopup linkFeedPopup;
public RssNavigationPanel(){
setHeading("Navigation");
final ToggleButton btnLinkFeed = new ToggleButton("Link Feed");
btnLinkFeed.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
if (btnLinkFeed.isPressed()){
linkFeedPopup.show(btnLinkFeed.getElement(), "bl-tl");
} else {
linkFeedPopup.hide();
}
}
});
btnLinkFeed.setIconStyle("link-feed");
setButtonAlign(HorizontalAlignment.LEFT);
Button btnCreateFeed = new Button("Create Feed");
btnCreateFeed.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
createNewFeedWindow();
}
});
setLayout(new FitLayout());
btnCreateFeed.setIconStyle("create-feed");
addButton(btnCreateFeed);
addButton(btnLinkFeed);
ToolTipConfig createFeedToolTipConfig = new ToolTipConfig();
createFeedToolTipConfig.setTitle("Create new RSS feed");
createFeedToolTipConfig.setText("Creates a new RSS feed");
btnCreateFeed.setToolTip(createFeedToolTipConfig);
ToolTipConfig linkFeedToolTipConfig = new ToolTipConfig();
linkFeedToolTipConfig.setTitle("Link to existing RSS feed");
linkFeedToolTipConfig.setText("Allows you to enter the URL of an " +
"existing RSS feed you would like to link to");
btnLinkFeed.setToolTip(linkFeedToolTipConfig);
linkFeedPopup = new LinkFeedPopup();
linkFeedPopup.setConstrainViewport(true);
add(new FeedList());
}