当前位置: 首页>>代码示例>>Java>>正文


Java SystemInfo.isJavaVersionAtLeast方法代码示例

本文整理汇总了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());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:UpdateSettingsConfigurable.java

示例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;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:AppIcon.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:SheetController.java

示例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");
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:MethodPropertyTest.java

示例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");
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:MethodPropertyTest.java

示例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");
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:MethodPropertyTest.java

示例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");
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:NotNullVerifyingInstrumenterTest.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:MnemonicHelper.java

示例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();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:31,代码来源:Messages.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:LafManagerImpl.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:ToolkitBugsProcessor.java

示例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();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:29,代码来源:Splash.java

示例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();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:JdkInfoUsageCollector.java

示例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");
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:SystemHealthMonitor.java

示例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");
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:JavacMain.java


注:本文中的com.intellij.openapi.util.SystemInfo.isJavaVersionAtLeast方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。