code: private void applySettings() {
  		linkContainer.reset();
  		WLink exampleLink = new WLink();
  		exampleLink.setText(tfLinkLabel.getText());
  		final String url = tfUrlField.getValue();
  
  		if ("".equals(url) || !isValidUrl(url)) {
  			tfUrlField.setText(URL);
  			exampleLink.setUrl(URL);
  		} else {
  			exampleLink.setUrl(url);
  		}
  
  		exampleLink.setRenderAsButton(cbRenderAsButton.isSelected());
  
  		exampleLink.setText(tfLinkLabel.getText());
  
  		if (cbSetImage.isSelected()) {
  			WImage linkImage = new WImage("/image/attachment.png", "Add attachment");
  			exampleLink.setImage(linkImage.getImage());
  			exampleLink.setImagePosition((ImagePosition) ddImagePosition.getSelected());
  		}
  
  		exampleLink.setDisabled(cbDisabled.isSelected());
  
  		if (tfAccesskey.getText() != null && tfAccesskey.getText().length() > 0) {
  			exampleLink.setAccessKey(tfAccesskey.getText().toCharArray()[0]);
  		}
  		if (cbOpenNew.isSelected()) {
  			exampleLink.setOpenNewWindow(true);
  			exampleLink.setTargetWindowName("_blank");
  		} else {
  			exampleLink.setOpenNewWindow(false);
  		}
  
  		linkContainer.add(exampleLink);
  	}
docs: this is were the majority of the work is done for building the link. Note that it is in a container that is
  reset, effectively creating a new link. this is only done to enable to dynamically change the link to a button
  and back.