String url = hash.get( "URL" );
if( url != null && url.length() > 0 ) {
hint.append( " <control href='linkc'/> " );
// hint.append(" <a href='").append( hash.get( "URL" ) ).append( "'><img href='link'/></a>" );
ImageHyperlink imgLink = toolkit.createImageHyperlink( formText, SWT.WRAP );
imgLink.setImage( linkImg );
imgLink.setHref( url );
imgLink.setToolTipText( url );
formText.setControl( "linkc", imgLink );
imgLink.addHyperlinkListener( new HyperlinkAdapter() {
@Override
public void linkActivated( HyperlinkEvent e )
{
handleLink( e.getHref().toString() );
}
});
}
hint.append( "</p></form>" );
formText.setText( hint.toString(), true, true );
Composite bottomPanel = toolkit.createComposite( knowPanel );
TableWrapLayout tableLayout = new TableWrapLayout();
tableLayout.verticalSpacing = 0;
tableLayout.leftMargin = 10;
bottomPanel.setLayout( tableLayout );
Composite btnPanel = toolkit.createComposite( bottomPanel );
RowLayout layout = new RowLayout();
layout.spacing = 1;
layout.wrap = true;
layout.marginTop = 5;
layout.marginBottom = 0;
btnPanel.setLayout( layout );
String resourceID = hash.get( "ID" );
ImageHyperlink btn;
btn = toolkit.createImageHyperlink( btnPanel, SWT.WRAP );
btn.setImage( positiveImg );
btn.setToolTipText( "Vote the note as helpful" );
btn.setHref( resourceID );
btn.addHyperlinkListener( new HyperlinkAdapter() {
@Override
public void linkActivated( HyperlinkEvent e )
{
getEmbetClient().vote( (String) e.getHref(), "Good", userID );
reloadContent();
}
});
btn = toolkit.createImageHyperlink( btnPanel, SWT.WRAP );
btn.setImage( negativeImg );
btn.setToolTipText( "Vote the note as NOT helpful" );
btn.setHref( resourceID );
btn.addHyperlinkListener( new HyperlinkAdapter() {
@Override
public void linkActivated( HyperlinkEvent e )
{
getEmbetClient().vote( (String) e.getHref(), "Bad", userID );
reloadContent();
}
});
btn = toolkit.createImageHyperlink( btnPanel, SWT.WRAP );
btn.setImage( removeImg );
btn.setToolTipText( "Don't show the note in this context" );
btn.setHref( resourceID );
btn.addHyperlinkListener( new HyperlinkAdapter() {
@Override
public void linkActivated( HyperlinkEvent e )
{
getEmbetClient().vote( (String) e.getHref(), "Close", userID );
reloadContent();