///**** I don't like to re-post, but here's the complete code of what
I'm trying to to *****///
public class AnchorsPanel extends Composite {
private FlowPanel fpLinks;
private VerticalPanel verticalPanel;
public AnchorsPanel() {
verticalPanel = new VerticalPanel();
verticalPanel.setStylePrimaryName("caronte-VerticalTabPanel-
VPanel");
fpLinks = new FlowPanel();
verticalPanel.add(fpLink);
this.initWidget(verticalPanel);
}
// ADD A WIDGET
public void addTab(String name, String refName, Widget widget) {
HTMLLinkSource sourceLink = new HTMLLinkSource(name,refName);
HTMLLinkTarget targetLink = new HTMLLinkTarget(name,refName);
fpLinks.add(sourceLink);
verticalPanel.add(targetLink);
verticalPanel.add(widget);
}
// CLASS FOR LINK
public class HTMLLinkSource extends Widget {
public HTMLLinkSource(String text, String anchorName) {
Element element = DOM.createAnchor();
setElement(element);
DOM.setElementAttribute(element, "href", anchorName ==
null ? "" : "#" + anchorName);
DOM.setInnerText(element, text == null ? "" : text);
}
}
// CLASS FOR TARGET
public class HTMLLinkTarget extends Widget {
public HTMLLinkkDestino(String text, String anchorName) {