我有一个锚标记,我希望在悬停时出现禁止圆形的字形.我知道添加禁用的类只会改变外观而不是它的功能.请注意,此链接不是导航组件,列表或btn组的一部分,只是一个在单击时会触发模态的链接.
我希望在您将鼠标悬停在已禁用的链接上时遵循此行为,如下所示:已禁用链接
<div>
<a class="disabled" data-toggle="modal" data-target="#notAvailable">Not Available</a>
</div>
Run Code Online (Sandbox Code Playgroud) 我正在使用StringUtils.abbreviateMiddle(string, middle, targetLength);缩写中间的字符串,但使用此方法切断了单词.有没有一种方法,它只会在最接近弦的中间位置的空间切断弦?
public static String shortenStringMiddle(String string, String middle, int targetLength) {
targetLength = Math.abs(targetLength);
if (string != null && string.length() > targetLength) {
return StringUtils.abbreviateMiddle(string, middle, targetLength);
}
else {
return string;
}
}
Run Code Online (Sandbox Code Playgroud)
输入如果应用于此文本:
东南亚鱼虾养殖的疾病控制 - 诊断和畜牧技术:SEAFDEC-OIE研讨会论文集 - 东南亚鱼虾养殖疾病控制研讨会 - 诊断和畜牧技术,2001年12月4日至6日,伊洛伊洛市,菲律宾
System.out.println(StringUtils.abbreviateMiddle("Disease Control in Fish and Shrimp Aquaculture in Southeast Asia - Diagnosis and Husbandry Techniques: Proceedings of the SEAFDEC-OIE Seminar-Workshop on Disease Control in Fish and Shrimp Aquaculture in Southeast Asia - Diagnosis and …Run Code Online (Sandbox Code Playgroud) 码:
/**
* Creates a
* cited document from the given bitstream of the given item. This
* requires that bitstream is contained in item.
* <p>
* The Process for adding a cover page is as follows:
* <ol>
* <li> Load source file into PdfReader and create a
* Document to put our cover page into.</li>
* <li> Create cover page and add content to it.</li>
* <li> Concatenate the coverpage and the source
* document.</li>
* </p> …Run Code Online (Sandbox Code Playgroud) 如果语言被切换,我想翻译我正在维护的DSPace实例中item-view.xsl中显示的主题(MeSH)术语.以前我使用下面的代码(我在XSLUtils.java课堂上添加了这个代码)来查找Babelmesh网站并动态翻译它.
public static String lookupBabelMeSH(String term, String lang) {
try {
URLConnection babelMeshConn = (new URL("https://babelmesh.nlm.nih.gov/mesh_trans.php?oterm=" + URLEncoder.encode(term, "UTF-8") + "&in=ENG&out=" + lang)).openConnection();
babelMeshConn.setConnectTimeout(5000);
babelMeshConn.setReadTimeout(5000);
BufferedReader in = new BufferedReader(new InputStreamReader(babelMeshConn.getInputStream(), "UTF-8"));
String value = in.readLine();
in.close();
if (!StringUtils.isEmpty(value)) {
return value;
}
} catch (MalformedURLException mue) {
} catch (IOException ioe) {
}
return null;
}
Run Code Online (Sandbox Code Playgroud)
然后我就这样使用它item-view.xsl:
<xsl:choose>
<xsl:when test="$active-locale!='en'">
<xsl:variable name="current-locale">
<xsl:if test="$active-locale='fr'">
<xsl:text>FRE</xsl:text>
</xsl:if>
<xsl:if test="$active-locale='zh'">
<xsl:text>CHN</xsl:text>
</xsl:if>
</xsl:variable>
<xsl:variable name="translation">
<xsl:value-of select="util:lookupBabelMeSH(node(),$current-locale)"/> …Run Code Online (Sandbox Code Playgroud) if (authors.length >= 1) {
System.out.print(authors[0]);
}
for (int i = 1; i < authors.length; i++) {
System.out.print("; " + authors[i]);
}
Run Code Online (Sandbox Code Playgroud)
所以这个的输出是author1; author2; author3
如何将其改为author1; author2 & author3?如果只有2位作者,那么输出应该是author1 & author2.提前致谢.