本文整理汇总了Java中com.intellij.openapi.application.ex.ApplicationInfoEx.getInstanceEx方法的典型用法代码示例。如果您正苦于以下问题:Java ApplicationInfoEx.getInstanceEx方法的具体用法?Java ApplicationInfoEx.getInstanceEx怎么用?Java ApplicationInfoEx.getInstanceEx使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.application.ex.ApplicationInfoEx
的用法示例。
在下文中一共展示了ApplicationInfoEx.getInstanceEx方法的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: 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);
}
示例3: 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);
}
示例4: 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);
}
示例5: createLogo
import com.intellij.openapi.application.ex.ApplicationInfoEx; //导入方法依赖的package包/类
private JComponent createLogo() {
NonOpaquePanel panel = new NonOpaquePanel(new BorderLayout());
ApplicationInfoEx app = ApplicationInfoEx.getInstanceEx();
JLabel logo = new JLabel(IconLoader.getIcon(app.getWelcomeScreenLogoUrl()));
logo.setBorder(JBUI.Borders.empty(30,0,10,0));
logo.setHorizontalAlignment(SwingConstants.CENTER);
panel.add(logo, BorderLayout.NORTH);
JLabel appName = new JLabel(ApplicationNamesInfo.getInstance().getFullProductName());
Font font = getProductFont();
appName.setForeground(JBColor.foreground());
appName.setFont(font.deriveFont(JBUI.scale(36f)).deriveFont(Font.PLAIN));
appName.setHorizontalAlignment(SwingConstants.CENTER);
String appVersion = "Version " + app.getFullVersion();
if (app.isEAP() && app.getBuild().getBuildNumber() < Integer.MAX_VALUE) {
appVersion += " (" + app.getBuild().asString() + ")";
}
JLabel version = new JLabel(appVersion);
version.setFont(getProductFont().deriveFont(JBUI.scale(16f)));
version.setHorizontalAlignment(SwingConstants.CENTER);
version.setForeground(Gray._128);
panel.add(appName);
panel.add(version, BorderLayout.SOUTH);
panel.setBorder(JBUI.Borders.emptyBottom(20));
return panel;
}
示例6: showLicenseeInfo
import com.intellij.openapi.application.ex.ApplicationInfoEx; //导入方法依赖的package包/类
public static boolean showLicenseeInfo(Graphics g, int x, int y, final int height, final Color textColor) {
if (ApplicationInfoImpl.getShadowInstance().showLicenseeInfo()) {
final LicensingFacade provider = LicensingFacade.getInstance();
if (provider != null) {
UIUtil.applyRenderingHints(g);
g.setFont(new Font(UIUtil.ARIAL_FONT_NAME, Font.BOLD, JBUI.scale(Registry.is("ide.new.about") ? 12 : SystemInfo.isUnix ? 10 : 11)));
g.setColor(textColor);
final String licensedToMessage = provider.getLicensedToMessage();
final List<String> licenseRestrictionsMessages = provider.getLicenseRestrictionsMessages();
int offsetX = JBUI.scale(15);
if (Registry.is("ide.new.about")) {
ApplicationInfoEx infoEx = ApplicationInfoEx.getInstanceEx();
if (infoEx instanceof ApplicationInfoImpl) {
offsetX = ((ApplicationInfoImpl)infoEx).getProgressX();
} else {
return false;
}
}
int offsetY = Registry.is("ide.new.about") ? 85 : 30;
g.drawString(licensedToMessage, x + offsetX, y + height - JBUI.scale(offsetY));
if (licenseRestrictionsMessages.size() > 0) {
g.drawString(licenseRestrictionsMessages.get(0), x + offsetX, y + height - JBUI.scale(offsetY - 16));
}
}
return true;
}
return false;
}
示例7: launchBrowser
import com.intellij.openapi.application.ex.ApplicationInfoEx; //导入方法依赖的package包/类
public static void launchBrowser(@Nullable Project project) {
final ApplicationInfoEx appInfo = ApplicationInfoEx.getInstanceEx();
boolean eap = appInfo.isEAP();
String urlTemplate = eap ? appInfo.getEAPFeedbackUrl() : appInfo.getReleaseFeedbackUrl();
urlTemplate = urlTemplate
.replace("$BUILD", eap ? appInfo.getBuild().asStringWithoutProductCode() : appInfo.getBuild().asString())
.replace("$TIMEZONE", System.getProperty("user.timezone"))
.replace("$EVAL", isEvaluationLicense() ? "true" : "false")
.replace("$DESCR", getDescription());
BrowserUtil.browse(urlTemplate, project);
}
示例8: initApplicationSpecificImages
import com.intellij.openapi.application.ex.ApplicationInfoEx; //导入方法依赖的package包/类
private void initApplicationSpecificImages() {
if (myCaptionImage == null) {
ApplicationInfoEx applicationInfoEx = ApplicationInfoEx.getInstanceEx();
myCaptionImage = IconLoader.getIcon(applicationInfoEx.getWelcomeScreenCaptionUrl());
myDeveloperSlogan = IconLoader.getIcon(applicationInfoEx.getWelcomeScreenDeveloperSloganUrl());
myCaptionBackground = UIUtil.getColorAt(myCaptionImage, myCaptionImage.getIconWidth() - 1, myCaptionImage.getIconHeight() - 2);
}
}
示例9: launchBrowser
import com.intellij.openapi.application.ex.ApplicationInfoEx; //导入方法依赖的package包/类
public static void launchBrowser() {
final ApplicationInfoEx appInfo = ApplicationInfoEx.getInstanceEx();
String urlTemplate = appInfo.isEAP() ? appInfo.getEAPFeedbackUrl() : appInfo.getReleaseFeedbackUrl();
urlTemplate = urlTemplate
.replace("$BUILD", appInfo.getBuild().asString())
.replace("$TIMEZONE", System.getProperty("user.timezone"))
.replace("$VERSION", appInfo.getFullVersion())
.replace("$EVAL", isEvaluationLicense() ? "true" : "false");
BrowserUtil.launchBrowser(urlTemplate);
}
示例10: actionPerformed
import com.intellij.openapi.application.ex.ApplicationInfoEx; //导入方法依赖的package包/类
public void actionPerformed(AnActionEvent e) {
final String url = KEYMAP_URL;
File file = new File(url);
if (file.isFile()) {
BrowserUtil.browse(file);
}
else {
final ApplicationInfoEx appInfo = ApplicationInfoEx.getInstanceEx();
String webUrl = SystemInfo.isMac ? appInfo.getMacKeymapUrl() : appInfo.getWinKeymapUrl();
if (webUrl != null) {
BrowserUtil.launchBrowser(webUrl);
}
}
}
示例11: InstalledPluginsTableModel
import com.intellij.openapi.application.ex.ApplicationInfoEx; //导入方法依赖的package包/类
public InstalledPluginsTableModel() {
super.columns = new ColumnInfo[]{new EnabledPluginInfo(), new MyPluginManagerColumnInfo()};
view = new ArrayList<IdeaPluginDescriptor>(Arrays.asList(PluginManager.getPlugins()));
view.addAll(myInstalled);
reset(view);
ApplicationInfoEx applicationInfo = ApplicationInfoEx.getInstanceEx();
for (Iterator<IdeaPluginDescriptor> iterator = view.iterator(); iterator.hasNext(); ) {
@NonNls final String s = iterator.next().getPluginId().getIdString();
if ("com.intellij".equals(s) || applicationInfo.isEssentialPlugin(s)) iterator.remove();
}
setSortKey(new RowSorter.SortKey(getNameColumn(), SortOrder.ASCENDING));
}
示例12: handle
import com.intellij.openapi.application.ex.ApplicationInfoEx; //导入方法依赖的package包/类
@Nonnull
@Override
public JsonResponse handle() {
ApplicationInfoEx applicationInfoEx = ApplicationInfoEx.getInstanceEx();
AboutInfo data = new AboutInfo();
data.name = ApplicationNamesInfo.getInstance().getFullProductName();
data.build = applicationInfoEx.getBuild().getBuildNumber();
data.build = applicationInfoEx.getBuild().getBuildNumber();
data.channel = UpdateSettings.getInstance().getChannel();
return JsonResponse.asSuccess(data);
}
示例13: initFramePainters
import com.intellij.openapi.application.ex.ApplicationInfoEx; //导入方法依赖的package包/类
public static void initFramePainters(@Nonnull IdeGlassPaneImpl glassPane) {
PaintersHelper painters = glassPane.getNamedPainters(FRAME_PROP);
PaintersHelper.initWallpaperPainter(FRAME_PROP, 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.Fill.PLAIN, PaintersHelper.Place.TOP_CENTER, 1.0f, JBUI.insets(10, 0, 0, 0)), null);
}
painters.addPainter(new AbstractPainter() {
EditorEmptyTextPainter p = EditorEmptyTextPainter.ourInstance;
@Override
public boolean needsRepaint() {
return true;
}
@Override
public void executePaint(Component component, Graphics2D g) {
p.paintEmptyText((JComponent)component, g);
}
}, null);
}
示例14: launchBrowser
import com.intellij.openapi.application.ex.ApplicationInfoEx; //导入方法依赖的package包/类
public static void launchBrowser() {
final ApplicationInfoEx appInfo = ApplicationInfoEx.getInstanceEx();
String urlTemplate = appInfo.getReleaseFeedbackUrl();
urlTemplate = urlTemplate
.replace("$BUILD", appInfo.getBuild().asString())
.replace("$TIMEZONE", System.getProperty("user.timezone"))
.replace("$EVAL", "false");
BrowserUtil.browse(urlTemplate);
}
示例15: execute
import com.intellij.openapi.application.ex.ApplicationInfoEx; //导入方法依赖的package包/类
@Nullable
@Override
public String execute(@NotNull QueryStringDecoder urlDecoder, @NotNull FullHttpRequest request, @NotNull ChannelHandlerContext context) throws IOException {
BuildNumber build = ApplicationInfo.getInstance().getBuild();
@SuppressWarnings("IOResourceOpenedButNotSafelyClosed")
BufferExposingByteArrayOutputStream byteOut = new BufferExposingByteArrayOutputStream();
JsonWriter writer = createJsonWriter(byteOut);
writer.beginObject();
ApplicationInfoEx appInfo = ApplicationInfoEx.getInstanceEx();
String appName = appInfo.getFullApplicationName();
if (!PlatformUtils.isIdeaUltimate()) {
String productName = ApplicationNamesInfo.getInstance().getProductName();
appName = appName.replace(productName + " (" + productName + ")", productName);
if (appName.startsWith("JetBrains ")) {
appName = appName.substring("JetBrains ".length());
}
}
writer.name("name").value(appName);
writer.name("productName").value(ApplicationNamesInfo.getInstance().getProductName());
writer.name("baselineVersion").value(build.getBaselineVersion());
if (build.getBuildNumber() != Integer.MAX_VALUE) {
writer.name("buildNumber").value(build.getBuildNumber());
}
if (getBooleanParameter("registeredFileTypes", urlDecoder)) {
writer.name("registeredFileTypes").beginArray();
for (FileType fileType : FileTypeRegistry.getInstance().getRegisteredFileTypes()) {
writer.beginObject();
writer.name("name").value(fileType.getName());
writer.name("description").value(fileType.getDescription());
writer.name("isBinary").value(fileType.isBinary());
writer.endObject();
}
writer.endArray();
}
String uri = request.getUri();
if (uri != null && uri.endsWith("?more")) {
writer.name("vendor").value(appInfo.getCompanyName());
writer.name("isEAP").value(appInfo.isEAP());
writer.name("productCode").value(appInfo.getBuild().getProductCode());
writer.name("buildDate").value(appInfo.getBuildDate().getTime().getTime());
writer.name("isSnapshot").value(appInfo.getBuild().isSnapshot());
writer.name("configPath").value(PathManager.getConfigPath());
writer.name("systemPath").value(PathManager.getSystemPath());
writer.name("binPath").value(PathManager.getBinPath());
writer.name("logPath").value(PathManager.getLogPath());
writer.name("homePath").value(PathManager.getHomePath());
}
writer.endObject();
writer.close();
send(byteOut, request, context);
return null;
}