/** * Creates a source anchor (link to URI). * * That is, an anchor with an href attribute specifying the destination URI. * * @param text the anchor's text * @param asHtml asHTML <code>true</code> to treat the specified text as html * @param href the url to which it will link * @param target the target frame (e.g. "_blank" to open the link in a new * window) */ public Anchor(@IsSafeHtml String text, boolean asHtml, @IsSafeUri String href, String target) { this(text, asHtml, href); setTarget(target); }
/** * Creates a source anchor (link to URI). * * That is, an anchor with an href attribute specifying the destination URI. * * @param text the anchor's text * @param asHtml asHTML <code>true</code> to treat the specified text as html * @param href the url to which it will link * @param target the target frame (e.g. "_blank" to open the link in a new * window) */ public Anchor(String text, boolean asHtml, String href, String target) { this(text, asHtml, href); setTarget(target); }
/** * Creates a source anchor (link to URI). * * That is, an anchor with an href attribute specifying the destination URI. * * @param text the anchor's text * @param asHtml asHTML <code>true</code> to treat the specified text as html * @param href the url to which it will link * @param target the target frame (e.g. "_blank" to open the link in a new * window) */ public Anchor(String text, boolean asHtml, String href, String target) { this(text, asHtml, href); setTarget(target); }
public EIRowWidget(final SearchResult searchResult, final HashMap<EIURI, EIEntity> mapURIToRootEntity, final String baseSearchUrl, final boolean openInNew) { super(searchResult, mapURIToRootEntity, baseSearchUrl, openInNew); // reset href so we point to the instance page instead of the dissemination page instanceLink.setHref(baseUrl + "#" + INSTANCE_PAGE_TOKEN + "?" + URI_KEY + "=" + instanceLink.getHref()); if( openInNew ) { instanceLink.setTarget( "_blank" ); } }
/** * Use this when you want a simple External link. * @param text - label of link * @param externalHref - URL */ public void addExternalLink(String text, String externalHref, boolean openInNewWin){ Anchor anchor = new Anchor(text, externalHref); anchor.addStyleName("contentBlock-navLink"); if (openInNewWin){ anchor.setTarget("newWin"); } this.add(anchor); }
@Override public void onClick(final ClickEvent event) { if ( !isDiagnosisValid( request ) ) { event.preventDefault(); Window.alert( noDiseaseMessage ); } else if ( !isTypeSelectionValid() ) { event.preventDefault(); Window.alert( typeMessage ); } else { setTypeRestriction( request ); appState.updateCurrentRequest( request, false ); searchButton.setTarget( "_blank" ); searchButton.setHref( appState.buildResultsPageUrl( request ) ); } }
labLink = new Anchor( lab.getLabel(), true, sb.toString() ); if( openInNew ) { labLink.setTarget( "_blank" );
/** * Prepares the disclaimer message with the appropriate text, styling and link. */ private void setDisclaimerMessage() { disclaimerLabel.setText( "Please note: a resource listing in eagle-i does not guarantee or imply availability of that resource." + " For more information, please see the " ); disclaimerLabel.setStyleName( "termsOfUse" ); disclaimerLabel.addStyleName( "showInline" ); final String termsOfServiceURL = SearchApplicationContext.getInstance().getTermsOfServiceUrl(); disclaimerAnchor.setText( "Terms of Use" ); disclaimerAnchor.setStyleName( "termsOfUse" ); disclaimerAnchor.addStyleName( "showInline" ); disclaimerAnchor.setHref( termsOfServiceURL ); disclaimerAnchor.setTarget( "_blank" ); disclaimerPeriodLabel.setText( "."); disclaimerPeriodLabel.setStyleName( "termsOfUse" ); disclaimerPeriodLabel.addStyleName( "showInline" ); }
moreInfoAnchor.addStyleName( "showInline" ); moreInfoAnchor.setHref( moreInfoURL ); moreInfoAnchor.setTarget( "_blank" );