本文整理汇总了Java中com.intellij.openapi.util.SystemInfo.isJavaVersionAtLeast方法的典型用法代码示例。如果您正苦于以下问题:Java SystemInfo.isJavaVersionAtLeast方法的具体用法?Java SystemInfo.isJavaVersionAtLeast怎么用?Java SystemInfo.isJavaVersionAtLeast使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.util.SystemInfo
的用法示例。
在下文中一共展示了SystemInfo.isJavaVersionAtLeast方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: apply
import com.intellij.openapi.util.SystemInfo; //导入方法依赖的package包/类
@Override
public void apply() throws ConfigurationException {
if (myPanel.myUseSecureConnection.isSelected() && !NetUtils.isSniEnabled()) {
boolean tooOld = !SystemInfo.isJavaVersionAtLeast("1.7");
String message = IdeBundle.message(tooOld ? "update.sni.not.available.error" : "update.sni.disabled.error");
throw new ConfigurationException(message);
}
boolean wasEnabled = mySettings.isCheckNeeded();
mySettings.setCheckNeeded(myPanel.myCheckForUpdates.isSelected());
if (wasEnabled != mySettings.isCheckNeeded()) {
UpdateCheckerComponent checker = ApplicationManager.getApplication().getComponent(UpdateCheckerComponent.class);
if (checker != null) {
if (wasEnabled) {
checker.cancelChecks();
}
else {
checker.queueNextCheck();
}
}
}
mySettings.setUpdateChannelType(myPanel.getSelectedChannelType().getCode());
mySettings.setSecureConnection(myPanel.myUseSecureConnection.isSelected());
}
示例2: getInstance
import com.intellij.openapi.util.SystemInfo; //导入方法依赖的package包/类
public static AppIcon getInstance() {
if (ourMacImpl == null) {
ourMacImpl = new MacAppIcon();
ourWin7Impl = new Win7AppIcon();
ourEmptyImpl = new EmptyIcon();
}
if (SystemInfo.isMac && SystemInfo.isJavaVersionAtLeast("1.6")) {
return ourMacImpl;
}
else if (SystemInfo.isWin7OrNewer) {
return ourWin7Impl;
}
else {
return ourEmptyImpl;
}
}
示例3: getStaticImage
import com.intellij.openapi.util.SystemInfo; //导入方法依赖的package包/类
/**
* This method is used to show an image during message showing
* @return image to show
*/
Image getStaticImage() {
final JFrame myOffScreenFrame = new JFrame() ;
myOffScreenFrame.add(mySheetPanel);
myOffScreenFrame.getRootPane().setDefaultButton(myDefaultButton);
final BufferedImage image = (SystemInfo.isJavaVersionAtLeast("1.7")) ?
UIUtil.createImage(SHEET_NC_WIDTH, SHEET_NC_HEIGHT, BufferedImage.TYPE_INT_ARGB) :
GraphicsUtilities.createCompatibleTranslucentImage(SHEET_NC_WIDTH, SHEET_NC_HEIGHT);
Graphics g = image.createGraphics();
mySheetPanel.paint(g);
g.dispose();
myOffScreenFrame.dispose();
return image;
}
示例4: testChangeMethodRefReturnType
import com.intellij.openapi.util.SystemInfo; //导入方法依赖的package包/类
public void testChangeMethodRefReturnType() throws Exception {
if (SystemInfo.isJavaVersionAtLeast("1.8")) {
doTest();
}
else {
System.err.println("Skipping test " + getTestName(true) + ": java version 8 or higher required to run it");
}
}
示例5: testChangeLambdaTargetReturnType
import com.intellij.openapi.util.SystemInfo; //导入方法依赖的package包/类
public void testChangeLambdaTargetReturnType() throws Exception {
if (SystemInfo.isJavaVersionAtLeast("1.8")) {
doTest();
}
else {
System.err.println("Skipping test " + getTestName(true) + ": java version 8 or higher required to run it");
}
}
示例6: testChangeSAMMethodSignature
import com.intellij.openapi.util.SystemInfo; //导入方法依赖的package包/类
public void testChangeSAMMethodSignature() throws Exception {
if (SystemInfo.isJavaVersionAtLeast("1.8")) {
doTest();
}
else {
System.err.println("Skipping test " + getTestName(true) + ": java version 8 or higher required to run it");
}
}
示例7: setUp
import com.intellij.openapi.util.SystemInfo; //导入方法依赖的package包/类
@Override
protected void setUp() throws Exception {
super.setUp();
final JavaTestFixtureFactory fixtureFactory = JavaTestFixtureFactory.getFixtureFactory();
final TestFixtureBuilder<IdeaProjectTestFixture> testFixtureBuilder = fixtureFactory.createLightFixtureBuilder();
myFixture = testFixtureBuilder.getFixture();
myFixture.setUp();
myJava6 = SystemInfo.isJavaVersionAtLeast("1.6");
}
示例8: createShortcut
import com.intellij.openapi.util.SystemInfo; //导入方法依赖的package包/类
/**
* Creates shortcut for mnemonic replacing standard Alt+Letter to Ctrl+Alt+Letter on Mac with jdk version newer than 6
* @param ch mnemonic letter
* @return shortcut for mnemonic
*/
public static CustomShortcutSet createShortcut(char ch) {
Character mnemonic = Character.valueOf(ch);
String shortcut = SystemInfo.isMac && SystemInfo.isJavaVersionAtLeast("1.7") ?
"control alt pressed " + mnemonic :
"alt pressed " + mnemonic;
return CustomShortcutSet.fromString(shortcut);
}
示例9: show
import com.intellij.openapi.util.SystemInfo; //导入方法依赖的package包/类
@Override
public void show() {
if (isMacSheetEmulation()) {
setInitialLocationCallback(new Computable<Point>() {
@Override
public Point compute() {
JRootPane rootPane = SwingUtilities.getRootPane(getWindow().getParent());
if (rootPane == null) {
rootPane = SwingUtilities.getRootPane(getWindow().getOwner());
}
Point p = rootPane.getLocationOnScreen();
p.x += (rootPane.getWidth() - getWindow().getWidth()) / 2;
return p;
}
});
animate();
if (SystemInfo.isJavaVersionAtLeast("1.7")) {
try {
Method method = Class.forName("java.awt.Window").getDeclaredMethod("setOpacity", float.class);
if (method != null) method.invoke(getPeer().getWindow(), .8f);
}
catch (Exception exception) {
}
}
setAutoAdjustable(false);
setSize(getPreferredSize().width, 0);//initial state before animation, zero height
}
super.show();
}
示例10: checkLookAndFeel
import com.intellij.openapi.util.SystemInfo; //导入方法依赖的package包/类
private boolean checkLookAndFeel(final UIManager.LookAndFeelInfo lafInfo, final boolean confirm) {
String message = null;
if (lafInfo.getName().contains("GTK") && SystemInfo.isXWindow && !SystemInfo.isJavaVersionAtLeast("1.6.0_12")) {
message = IdeBundle.message("warning.problem.laf.1");
}
if (message != null) {
if (confirm) {
final String[] options = {IdeBundle.message("confirm.set.look.and.feel"), CommonBundle.getCancelButtonText()};
final int result = Messages.showOkCancelDialog(message, CommonBundle.getWarningTitle(), options[0], options[1], Messages.getWarningIcon());
if (result == Messages.OK) {
myLastWarning = message;
return true;
}
return false;
}
if (!message.equals(myLastWarning)) {
Notifications.Bus.notify(new Notification(Notifications.SYSTEM_MESSAGES_GROUP_ID, "L&F Manager", message, NotificationType.WARNING,
NotificationListener.URL_OPENING_LISTENER));
myLastWarning = message;
}
}
return true;
}
示例11: process
import com.intellij.openapi.util.SystemInfo; //导入方法依赖的package包/类
@Override
public boolean process(Throwable e, StackTraceElement[] stack) {
if (e instanceof NullPointerException && stack.length > 3) {
//bombed for possible future fix
if (SystemInfo.isJavaVersionAtLeast("1.7")) return false;
return stack[0].getClassName().equals("java.util.Hashtable")
&& stack[0].getMethodName().equals("put")
&& stack[3].getClassName().equals("javax.swing.JEditorPane")
&& stack[3].getMethodName().equals("loadDefaultKitsIfNecessary");
}
return false;
}
示例12: Splash
import com.intellij.openapi.util.SystemInfo; //导入方法依赖的package包/类
public Splash(String imageName, final Color textColor) {
super((Frame)null, false);
setUndecorated(true);
if (!(SystemInfo.isLinux && SystemInfo.isJavaVersionAtLeast("1.7"))) {
setResizable(false);
}
setFocusableWindowState(false);
Icon originalImage = IconLoader.getIcon(imageName);
myImage = new SplashImage(originalImage, textColor);
myLabel = new JLabel(myImage) {
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
mySplashIsVisible = true;
myProgressLastPosition = 0;
paintProgress(g);
}
};
Container contentPane = getContentPane();
contentPane.setLayout(new BorderLayout());
contentPane.add(myLabel, BorderLayout.CENTER);
Dimension size = getPreferredSize();
setSize(size);
pack();
setLocationInTheCenterOfScreen();
}
示例13: getUsages
import com.intellij.openapi.util.SystemInfo; //导入方法依赖的package包/类
@NotNull
@Override
public Set<UsageDescriptor> getUsages() throws CollectUsagesException {
final String vendor = System.getProperty("java.vendor", "Unknown");
for (String version : new String[]{"1.9", "1.8", "1.7", "1.6"}) {
if (SystemInfo.isJavaVersionAtLeast(version)) {
return Collections.singleton(new UsageDescriptor(vendor + " " + version, 1));
}
}
return Collections.emptySet();
}
示例14: checkJvm
import com.intellij.openapi.util.SystemInfo; //导入方法依赖的package包/类
private void checkJvm() {
if (StringUtil.containsIgnoreCase(System.getProperty("java.vm.name", ""), "OpenJDK") && !SystemInfo.isJavaVersionAtLeast("1.7")) {
showNotification("unsupported.jvm.openjdk.message");
}
else if (StringUtil.endsWithIgnoreCase(System.getProperty("java.version", ""), "-ea")) {
showNotification("unsupported.jvm.ea.message");
}
}
示例15: canUseOptimizedFileManager
import com.intellij.openapi.util.SystemInfo; //导入方法依赖的package包/类
private static boolean canUseOptimizedFileManager(JavaCompilingTool compilingTool) {
// since java 9 internal API's used by the optimizedFileManager have changed
return compilingTool instanceof JavacCompilerTool && !SystemInfo.isJavaVersionAtLeast("1.9");
}