本文整理汇总了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;
}
}
示例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;
}
示例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());
}
示例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) {
}
}
}
示例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();
}
示例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);
}