本文整理汇总了Java中com.intellij.openapi.application.ApplicationNamesInfo.getFullProductName方法的典型用法代码示例。如果您正苦于以下问题:Java ApplicationNamesInfo.getFullProductName方法的具体用法?Java ApplicationNamesInfo.getFullProductName怎么用?Java ApplicationNamesInfo.getFullProductName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.application.ApplicationNamesInfo
的用法示例。
在下文中一共展示了ApplicationNamesInfo.getFullProductName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getProductNameWithArticle
import com.intellij.openapi.application.ApplicationNamesInfo; //导入方法依赖的package包/类
static String getProductNameWithArticle() {
final ApplicationNamesInfo namesInfo = ApplicationNamesInfo.getInstance();
// example: "to create an IntelliJ IDEA project" (full product name is ok);
// "to create a JetBrains Astella project" (better use not full product name: "to create an Astella project")
final String productName = PlatformUtils.isIdeaUltimate() ? namesInfo.getFullProductName() : namesInfo.getProductName();
final String article = StringUtil.isVowel(Character.toLowerCase(productName.charAt(0))) ? "an " : "a ";
return article + productName;
}
示例2: UpdateInfoPanel
import com.intellij.openapi.application.ApplicationNamesInfo; //导入方法依赖的package包/类
public UpdateInfoPanel() {
ApplicationInfo appInfo = ApplicationInfo.getInstance();
ApplicationNamesInfo appNames = ApplicationNamesInfo.getInstance();
String message = myLatestBuild.getMessage();
final String fullProductName = appNames.getFullProductName();
if (message == null) {
message = IdeBundle.message("updates.new.version.available", fullProductName);
}
final String homePageUrl = myUpdatedChannel.getHomePageUrl();
if (!StringUtil.isEmptyOrSpaces(homePageUrl)) {
final int idx = message.indexOf(fullProductName);
if (idx >= 0) {
message = message.substring(0, idx) +
"<a href=\'" + homePageUrl + "\'>" + fullProductName + "</a>" + message.substring(idx + fullProductName.length());
}
}
configureMessageArea(myUpdateMessage, message, null, BrowserHyperlinkListener.INSTANCE);
myCurrentVersion.setText(
formatVersion(
appInfo.getFullVersion() + (appInfo instanceof ApplicationInfoEx && ((ApplicationInfoEx)appInfo).isEAP() ? " EAP": ""),
appInfo.getBuild().asStringWithoutProductCode()
)
);
myNewVersion.setText(formatVersion(myLatestBuild.getVersion(), myLatestBuild.getNumber().asStringWithoutProductCode()));
if (myPatch != null && !StringUtil.isEmptyOrSpaces(myPatch.getSize())) {
myPatchInfo.setText(myPatch.getSize() + " MB");
}
else {
myPatchLabel.setVisible(false);
myPatchInfo.setVisible(false);
}
if (myWriteProtected) {
message = IdeBundle.message("updates.write.protected", appNames.getProductName(), PathManager.getHomePath());
configureMessageArea(myMessageArea, message, JBColor.RED, null);
}
else {
configureMessageArea(myMessageArea);
}
if (myLicenseInfo != null) {
configureMessageArea(myLicenseArea, myLicenseInfo, myPaidUpgrade ? JBColor.RED : null, null);
}
}