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


Java UpdateChecker类代码示例

本文整理汇总了Java中com.intellij.openapi.updateSettings.impl.UpdateChecker的典型用法代码示例。如果您正苦于以下问题:Java UpdateChecker类的具体用法?Java UpdateChecker怎么用?Java UpdateChecker使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


UpdateChecker类属于com.intellij.openapi.updateSettings.impl包,在下文中一共展示了UpdateChecker类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: canHandle

import com.intellij.openapi.updateSettings.impl.UpdateChecker; //导入依赖的package包/类
public boolean canHandle(IdeaLoggingEvent event) {
  if (ourLoggerBroken) return false;

  try {
    UpdateChecker.checkForUpdate(event);

    boolean notificationEnabled = !DISABLED_VALUE.equals(System.getProperty(FATAL_ERROR_NOTIFICATION_PROPERTY, ENABLED_VALUE));

    ErrorReportSubmitter submitter = IdeErrorsDialog.getSubmitter(event.getThrowable());
    boolean showPluginError = !(submitter instanceof ITNReporter) || ((ITNReporter)submitter).showErrorInRelease(event);

    //noinspection ThrowableResultOfMethodCallIgnored
    return notificationEnabled ||
           showPluginError ||
           ApplicationManagerEx.getApplicationEx().isInternal() ||
           isOOMError(event.getThrowable()) ||
           event.getThrowable() instanceof MappingFailedException;
  }
  catch (LinkageError e) {
    if (e.getMessage().contains("Could not initialize class com.intellij.diagnostic.IdeErrorsDialog")) {
      //noinspection AssignmentToStaticFieldFromInstanceMethod
      ourLoggerBroken = true;
    }
    throw e;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:DefaultIdeaErrorLogger.java

示例2: createFooterPanel

import com.intellij.openapi.updateSettings.impl.UpdateChecker; //导入依赖的package包/类
private static JPanel createFooterPanel() {
  JLabel versionLabel = new JLabel(ApplicationNamesInfo.getInstance().getFullProductName() +
                           " " +
                           ApplicationInfo.getInstance().getFullVersion() +
                           " Build " +
                           ApplicationInfo.getInstance().getBuild().asStringWithoutProductCode());
  makeSmallFont(versionLabel);
  versionLabel.setForeground(WelcomeScreenColors.FOOTER_FOREGROUND);

  JPanel footerPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
  footerPanel.setBackground(WelcomeScreenColors.FOOTER_BACKGROUND);
  footerPanel.setBorder(new EmptyBorder(2, 5, 2, 5) {
    @Override
    public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
      g.setColor(WelcomeScreenColors.BORDER_COLOR);
      g.drawLine(x, y, x + width, y);
    }
  });
  footerPanel.add(versionLabel);
  footerPanel.add(makeSmallFont(new JLabel(".  ")));
  footerPanel.add(makeSmallFont(new LinkLabel("Check", null, new LinkListener() {
    @Override
    public void linkSelected(LinkLabel aSource, Object aLinkData) {
      UpdateChecker.updateAndShowResult(null, null);
    }
  })));
  footerPanel.add(makeSmallFont(new JLabel(" for updates now.")));
  return footerPanel;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:NewWelcomeScreen.java

示例3: testOnlyCompatiblePluginsAreChecked

import com.intellij.openapi.updateSettings.impl.UpdateChecker; //导入依赖的package包/类
public void testOnlyCompatiblePluginsAreChecked() throws Exception {
  final LinkedHashMap<PluginId, PluginDownloader> toUpdate = new LinkedHashMap<PluginId, PluginDownloader>();
  final IdeaPluginDescriptor[] descriptors = new IdeaPluginDescriptor[] {loadDescriptor("plugin1.xml"), loadDescriptor("plugin2.xml")};

  final BuildNumber currentBuildNumber = BuildNumber.fromString("IU-142.100");
  for (IdeaPluginDescriptor descriptor : descriptors) {
    UpdateChecker.checkAndPrepareToInstall(PluginDownloader.createDownloader(descriptor, null, currentBuildNumber), new InstalledPluginsState(),
                                           toUpdate, new ArrayList<IdeaPluginDescriptor>(), null);
  }
  Assert.assertEquals("Found: " + toUpdate.size(), 1, toUpdate.size());
  final PluginDownloader downloader = toUpdate.values().iterator().next();
  Assert.assertNotNull(downloader);
  Assert.assertEquals("0.1", downloader.getPluginVersion());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:UpdatePluginsFromCustomRepositoryTest.java

示例4: updateRepositoryPlugins

import com.intellij.openapi.updateSettings.impl.UpdateChecker; //导入依赖的package包/类
public void updateRepositoryPlugins() {
  myPlugin2host.clear();
  final JDOMExternalizableStringList pluginHosts = UpdateSettings.getInstance().myPluginHosts;
  for (String host : pluginHosts) {
    try {
      final ArrayList<PluginDownloader> downloaded = new ArrayList<PluginDownloader>();
      UpdateChecker.checkPluginsHost(host, downloaded, false, null);
      for (PluginDownloader downloader : downloaded) {
        myPlugin2host.put(downloader.getPluginId(), host);
      }
    }
    catch (Exception ignored) {
    }
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:16,代码来源:InstalledPluginsTableModel.java

示例5: addBetaChannel

import com.intellij.openapi.updateSettings.impl.UpdateChecker; //导入依赖的package包/类
public void addBetaChannel() {
  LOG.info("Enabled BETA update channel for Pants Plugin!");
  final UpdateSettings updateSettings = UpdateSettings.getInstance();
  updateSettings.getStoredPluginHosts().add(UPDATE_URL);
  UpdateChecker.updateAndShowResult();
}
 
开发者ID:pantsbuild,项目名称:intellij-pants-plugin,代码行数:7,代码来源:PantsSystemSettingsControl.java

示例6: main

import com.intellij.openapi.updateSettings.impl.UpdateChecker; //导入依赖的package包/类
@Override
public void main(String[] args) {
  SystemDock.updateMenu();

  // Event queue should not be changed during initialization of application components.
  // It also cannot be changed before initialization of application components because IdeEventQueue uses other
  // application components. So it is proper to perform replacement only here.
  ApplicationEx app = ApplicationManagerEx.getApplicationEx();
  WindowManagerImpl windowManager = (WindowManagerImpl)WindowManager.getInstance();
  IdeEventQueue.getInstance().setWindowManager(windowManager);

  Ref<Boolean> willOpenProject = new Ref<Boolean>(Boolean.FALSE);
  AppLifecycleListener lifecyclePublisher = app.getMessageBus().syncPublisher(AppLifecycleListener.TOPIC);
  lifecyclePublisher.appFrameCreated(args, willOpenProject);

  LOG.info("App initialization took " + (System.nanoTime() - PluginManager.startupStart) / 1000000 + " ms");
  PluginManagerCore.dumpPluginClassStatistics();

  if (!willOpenProject.get()) {
    WelcomeFrame.showNow();
    lifecyclePublisher.welcomeScreenDisplayed();
  }
  else {
    windowManager.showFrame();
  }

  app.invokeLater(new Runnable() {
    @Override
    public void run() {
      if (mySplash != null) {
        mySplash.dispose();
        mySplash = null; // Allow GC collect the splash window
      }
    }
  }, ModalityState.NON_MODAL);

  app.invokeLater(new Runnable() {
    @Override
    public void run() {
      if (myPerformProjectLoad) {
        loadProject();
      }

      final UpdateSettings settings = UpdateSettings.getInstance();
      if (settings != null) {
        final ApplicationInfo appInfo = ApplicationInfo.getInstance();
        if (StringUtil.compareVersionNumbers(settings.LAST_BUILD_CHECKED, appInfo.getBuild().asString()) < 0 ||
            (UpdateChecker.isMyVeryFirstOpening() && UpdateChecker.checkNeeded())) {
          UpdateChecker.setMyVeryFirstOpening(false);
          UpdateChecker.updateAndShowResult();
        }
      }

      //noinspection SSBasedInspection
      SwingUtilities.invokeLater(new Runnable() {
        @Override
        public void run() {
          PluginManager.reportPluginError();
        }
      });
    }
  }, ModalityState.NON_MODAL);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:64,代码来源:IdeaApplication.java


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