本文整理汇总了Java中com.intellij.openapi.application.ex.ApplicationInfoEx类的典型用法代码示例。如果您正苦于以下问题:Java ApplicationInfoEx类的具体用法?Java ApplicationInfoEx怎么用?Java ApplicationInfoEx使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ApplicationInfoEx类属于com.intellij.openapi.application.ex包,在下文中一共展示了ApplicationInfoEx类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: showFrame
import com.intellij.openapi.application.ex.ApplicationInfoEx; //导入依赖的package包/类
public void showFrame() {
final IdeFrameImpl frame = new IdeFrameImpl(ApplicationInfoEx.getInstanceEx(),
myActionManager, myDataManager,
ApplicationManager.getApplication());
myProject2Frame.put(null, frame);
if (myFrameBounds == null || !ScreenUtil.isVisible(myFrameBounds)) { //avoid situations when IdeFrame is out of all screens
myFrameBounds = ScreenUtil.getMainScreenBounds();
int xOff = myFrameBounds.width / 8;
int yOff = myFrameBounds.height / 8;
JBInsets.removeFrom(myFrameBounds, new Insets(yOff, xOff, yOff, xOff));
}
fixForOracleBug8007219(frame);
frame.setBounds(myFrameBounds);
frame.setExtendedState(myFrameExtendedState);
frame.setVisible(true);
}
示例2: updateTitle
import com.intellij.openapi.application.ex.ApplicationInfoEx; //导入依赖的package包/类
public static void updateTitle(JFrame frame, final String title, final String fileTitle, final File currentFile) {
if (myUpdatingTitle) return;
try {
myUpdatingTitle = true;
frame.getRootPane().putClientProperty("Window.documentFile", currentFile);
final String applicationName = ((ApplicationInfoEx)ApplicationInfo.getInstance()).getFullApplicationName();
final Builder builder = new Builder();
if (SystemInfo.isMac) {
boolean addAppName = StringUtil.isEmpty(title) ||
ProjectManager.getInstance().getOpenProjects().length == 0 ||
((ApplicationInfoEx)ApplicationInfo.getInstance()).isEAP() && !applicationName.endsWith("SNAPSHOT");
builder.append(fileTitle).append(title).append(addAppName ? applicationName : null);
} else {
builder.append(title).append(fileTitle).append(applicationName);
}
frame.setTitle(builder.sb.toString());
}
finally {
myUpdatingTitle = false;
}
}
示例3: initFramePainters
import com.intellij.openapi.application.ex.ApplicationInfoEx; //导入依赖的package包/类
public static void initFramePainters(@NotNull PaintersHelper painters) {
PaintersHelper.initWallpaperPainter("idea.wallpaper.ide", painters);
ApplicationInfoEx appInfo = ApplicationInfoEx.getInstanceEx();
String path = UIUtil.isUnderDarcula()? appInfo.getEditorBackgroundImageUrl() : null;
URL url = path == null ? null : appInfo.getClass().getResource(path);
Image centerImage = url == null ? null : ImageLoader.loadFromUrl(url);
if (centerImage != null) {
painters.addPainter(PaintersHelper.newImagePainter(centerImage, PaintersHelper.FillType.TOP_CENTER, 1.0f, JBUI.insets(10, 0, 0, 0)), null);
}
painters.addPainter(new AbstractPainter() {
EditorEmptyTextPainter p = ServiceManager.getService(EditorEmptyTextPainter.class);
@Override
public boolean needsRepaint() {
return true;
}
@Override
public void executePaint(Component component, Graphics2D g) {
p.paintEmptyText((JComponent)component, g);
}
}, null);
}
示例4: getUrl
import com.intellij.openapi.application.ex.ApplicationInfoEx; //导入依赖的package包/类
@NotNull
private static String getUrl(@NotNull IdeaPluginDescriptor descriptor,
@Nullable String host,
@Nullable BuildNumber buildNumber) throws URISyntaxException, MalformedURLException {
if (host != null && descriptor instanceof PluginNode) {
String url = ((PluginNode)descriptor).getDownloadUrl();
return new URI(url).isAbsolute() ? url : new URL(new URL(host), url).toExternalForm();
}
else {
Application app = ApplicationManager.getApplication();
ApplicationInfoEx appInfo = ApplicationInfoImpl.getShadowInstance();
String buildNumberAsString = buildNumber != null ? buildNumber.asString() :
app != null ? ApplicationInfo.getInstance().getApiVersion() :
appInfo.getBuild().asString();
String uuid = app != null ? UpdateChecker.getInstallationUID(PropertiesComponent.getInstance()) : UUID.randomUUID().toString();
URIBuilder uriBuilder = new URIBuilder(appInfo.getPluginsDownloadUrl());
uriBuilder.addParameter("action", "download");
uriBuilder.addParameter("id", descriptor.getPluginId().getIdString());
uriBuilder.addParameter("build", buildNumberAsString);
uriBuilder.addParameter("uuid", uuid);
return uriBuilder.build().toString();
}
}
示例5: getAppIconImages
import com.intellij.openapi.application.ex.ApplicationInfoEx; //导入依赖的package包/类
@SuppressWarnings({"UnnecessaryFullyQualifiedName", "deprecation"})
private static List<Image> getAppIconImages() {
ApplicationInfoEx appInfo = ApplicationInfoImpl.getShadowInstance();
List<Image> images = ContainerUtil.newArrayListWithCapacity(3);
if (SystemInfo.isXWindow) {
String bigIconUrl = appInfo.getBigIconUrl();
if (bigIconUrl != null) {
images.add(com.intellij.util.ImageLoader.loadFromResource(bigIconUrl));
}
}
images.add(com.intellij.util.ImageLoader.loadFromResource(appInfo.getIconUrl()));
images.add(com.intellij.util.ImageLoader.loadFromResource(appInfo.getSmallIconUrl()));
return images;
}
示例6: showSplash
import com.intellij.openapi.application.ex.ApplicationInfoEx; //导入依赖的package包/类
@Nullable
private Splash showSplash(String[] args) {
if (StartupUtil.shouldShowSplash(args)) {
final ApplicationInfoEx appInfo = ApplicationInfoImpl.getShadowInstance();
final SplashScreen splashScreen = getSplashScreen();
if (splashScreen == null) {
mySplash = new Splash(appInfo);
mySplash.show();
return mySplash;
}
else {
updateSplashScreen(appInfo, splashScreen);
}
}
return null;
}
示例7: runStartupWizard
import com.intellij.openapi.application.ex.ApplicationInfoEx; //导入依赖的package包/类
static void runStartupWizard() {
ApplicationInfoEx appInfo = ApplicationInfoImpl.getShadowInstance();
String stepsProvider = appInfo.getCustomizeIDEWizardStepsProvider();
if (stepsProvider != null) {
CustomizeIDEWizardDialog.showCustomSteps(stepsProvider);
PluginManagerCore.invalidatePlugins();
return;
}
if (PlatformUtils.isIntelliJ()) {
new CustomizeIDEWizardDialog().show();
PluginManagerCore.invalidatePlugins();
return;
}
List<ApplicationInfoEx.PluginChooserPage> pages = appInfo.getPluginChooserPages();
if (!pages.isEmpty()) {
StartupWizard startupWizard = new StartupWizard(pages);
startupWizard.setCancelText("Skip");
startupWizard.show();
PluginManagerCore.invalidatePlugins();
}
}
示例8: getSmallApplicationIcon
import com.intellij.openapi.application.ex.ApplicationInfoEx; //导入依赖的package包/类
protected static Icon getSmallApplicationIcon() {
if (ourSmallAppIcon == null) {
try {
Icon appIcon = IconLoader.findIcon(ApplicationInfoEx.getInstanceEx().getIconUrl());
if (appIcon != null) {
if (appIcon.getIconWidth() == JBUI.scale(16) && appIcon.getIconHeight() == JBUI.scale(16)) {
ourSmallAppIcon = appIcon;
} else {
BufferedImage image = ImageUtil.toBufferedImage(IconUtil.toImage(appIcon));
image = Scalr.resize(image, Scalr.Method.ULTRA_QUALITY, UIUtil.isRetina() ? 32 : JBUI.scale(16));
ourSmallAppIcon = toRetinaAwareIcon(image);
}
}
}
catch (Exception e) {//
}
if (ourSmallAppIcon == null) {
ourSmallAppIcon = EmptyIcon.ICON_16;
}
}
return ourSmallAppIcon;
}
示例9: render
import com.intellij.openapi.application.ex.ApplicationInfoEx; //导入依赖的package包/类
public void render(int indentX, int indentY, List<AboutBoxLine> lines) throws OverflowException {
x = indentX;
y = indentY;
ApplicationInfoEx appInfo = (ApplicationInfoEx)ApplicationInfo.getInstance();
for (AboutBoxLine line : lines) {
final String s = line.getText();
setFont(line.isBold() ? myBoldFont : myFont);
if (line.getUrl() != null) {
g2.setColor(myLinkColor);
FontMetrics metrics = g2.getFontMetrics(font);
myLinks.add(new Link(new Rectangle(x, yBase + y - fontAscent, metrics.stringWidth(s), fontHeight), line.getUrl()));
}
else {
g2.setColor(Registry.is("ide.new.about") ? Gray.x33 : appInfo.getAboutForeground());
}
renderString(s, indentX);
if (!line.isKeepWithNext() && !line.equals(lines.get(lines.size()-1))) {
lineFeed(indentX, s);
}
}
}
示例10: updateTitle
import com.intellij.openapi.application.ex.ApplicationInfoEx; //导入依赖的package包/类
public static void updateTitle(JFrame frame, final String title, final String fileTitle, final File currentFile) {
if (myUpdatingTitle) return;
try {
myUpdatingTitle = true;
frame.getRootPane().putClientProperty("Window.documentFile", currentFile);
final String applicationName = ((ApplicationInfoEx)ApplicationInfo.getInstance()).getFullApplicationName();
final Builder builder = new Builder();
if (SystemInfo.isMac) {
builder.append(fileTitle).append(title)
.append(ProjectManager.getInstance().getOpenProjects().length == 0
|| ((ApplicationInfoEx)ApplicationInfo.getInstance()).isEAP() && !applicationName.endsWith("SNAPSHOT") ? applicationName : null);
} else {
builder.append(title).append(fileTitle).append(applicationName);
}
frame.setTitle(builder.sb.toString());
}
finally {
myUpdatingTitle = false;
}
}
示例11: getAppIconImages
import com.intellij.openapi.application.ex.ApplicationInfoEx; //导入依赖的package包/类
@SuppressWarnings({"UnnecessaryFullyQualifiedName", "deprecation"})
private static List<Image> getAppIconImages() {
ApplicationInfoEx appInfo = ApplicationInfoImpl.getShadowInstance();
List<Image> images = ContainerUtil.newArrayListWithExpectedSize(3);
if (SystemInfo.isXWindow) {
String bigIconUrl = appInfo.getBigIconUrl();
if (bigIconUrl != null) {
images.add(com.intellij.util.ImageLoader.loadFromResource(bigIconUrl));
}
}
images.add(com.intellij.util.ImageLoader.loadFromResource(appInfo.getIconUrl()));
images.add(com.intellij.util.ImageLoader.loadFromResource(appInfo.getSmallIconUrl()));
return images;
}
示例12: render
import com.intellij.openapi.application.ex.ApplicationInfoEx; //导入依赖的package包/类
public void render(int indentX, int indentY, List<AboutBoxLine> lines) throws OverflowException {
x = indentX;
y = indentY;
ApplicationInfoEx appInfo = (ApplicationInfoEx)ApplicationInfo.getInstance();
for (AboutBoxLine line : lines) {
final String s = line.getText();
setFont(line.isBold() ? myBoldFont : myFont);
if (line.getUrl() != null) {
g2.setColor(linkCol);
FontMetrics metrics = g2.getFontMetrics(font);
myLinks.add(new Link(new Rectangle(x, yBase + y - fontAscent, metrics.stringWidth(s), fontHeight), line.getUrl()));
}
else {
g2.setColor(appInfo.getAboutForeground());
}
renderString(s, indentX);
if (!line.isKeepWithNext() && !line.equals(lines.get(lines.size()-1))) {
lineFeed(indentX, s);
}
}
}
示例13: showFrame
import com.intellij.openapi.application.ex.ApplicationInfoEx; //导入依赖的package包/类
public void showFrame() {
final IdeFrameImpl frame = new IdeFrameImpl(ApplicationInfoEx.getInstanceEx(), myActionManager, myDataManager, ApplicationManager.getApplication());
myProject2Frame.put(null, frame);
if (myFrameBounds == null || !ScreenUtil.isVisible(myFrameBounds)) { //avoid situations when IdeFrame is out of all screens
myFrameBounds = ScreenUtil.getMainScreenBounds();
int xOff = myFrameBounds.width / 8;
int yOff = myFrameBounds.height / 8;
JBInsets.removeFrom(myFrameBounds, new Insets(yOff, xOff, yOff, xOff));
}
frame.setBounds(myFrameBounds);
frame.setExtendedState(myFrameExtendedState);
frame.setVisible(true);
}
示例14: getServerHeaderValue
import com.intellij.openapi.application.ex.ApplicationInfoEx; //导入依赖的package包/类
@Nullable
public static String getServerHeaderValue() {
if (SERVER_HEADER_VALUE == null) {
Application app = ApplicationManager.getApplication();
if (app != null && !app.isDisposed()) {
SERVER_HEADER_VALUE = ApplicationInfoEx.getInstanceEx().getFullApplicationName();
}
}
return SERVER_HEADER_VALUE;
}
示例15: invokeHelp
import com.intellij.openapi.application.ex.ApplicationInfoEx; //导入依赖的package包/类
public void invokeHelp(@Nullable String id) {
UsageTrigger.trigger("ide.help." + id);
if (MacHelpUtil.isApplicable() && MacHelpUtil.invokeHelp(id)) {
return;
}
IdeaHelpBroker broker = myBrokerValue.getValue();
if (broker == null) {
ApplicationInfoEx info = ApplicationInfoEx.getInstanceEx();
String url = info.getWebHelpUrl() + "?";
if (PlatformUtils.isCLion()) {
url += "Keyword=" + id;
url += "&ProductVersion=" + info.getMajorVersion() + "." + info.getMinorVersion();
if (info.isEAP()) {
url += "&EAP";
}
} else {
url += id;
}
BrowserUtil.browse(url);
return;
}
Window activeWindow = KeyboardFocusManager.getCurrentKeyboardFocusManager().getActiveWindow();
broker.setActivationWindow(activeWindow);
if (id != null) {
try {
broker.setCurrentID(id);
}
catch (BadIDException e) {
Messages.showErrorDialog(IdeBundle.message("help.topic.not.found.error", id), CommonBundle.getErrorTitle());
return;
}
}
broker.setDisplayed(true);
}