⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 updatemonitor.java

📁 java 文件下载器。可自定义
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   UpdateMonitor.java

package org.gudy.azureus2.ui.swt.update;

import com.aelitis.azureus.core.AzureusCore;
import com.aelitis.azureus.ui.*;
import com.aelitis.azureus.ui.swt.UIFunctionsManagerSWT;
import com.aelitis.azureus.ui.swt.UIFunctionsSWT;
import java.io.File;
import org.eclipse.swt.SWT;
import org.gudy.azureus2.core3.config.COConfigurationManager;
import org.gudy.azureus2.core3.internat.MessageText;
import org.gudy.azureus2.core3.logging.*;
import org.gudy.azureus2.core3.util.*;
import org.gudy.azureus2.plugins.PluginInterface;
import org.gudy.azureus2.plugins.PluginManager;
import org.gudy.azureus2.plugins.update.*;
import org.gudy.azureus2.plugins.utils.DelayedTask;
import org.gudy.azureus2.plugins.utils.resourcedownloader.ResourceDownloader;
import org.gudy.azureus2.pluginsimpl.local.utils.UtilitiesImpl;
import org.gudy.azureus2.ui.swt.Utils;
import org.gudy.azureus2.ui.swt.components.StringListChooser;
import org.gudy.azureus2.ui.swt.progress.*;
import org.gudy.azureus2.update.CoreUpdateChecker;

// Referenced classes of package org.gudy.azureus2.ui.swt.update:
//			SimpleInstallUI, UpdateAutoDownloader, UpdateWindow

public class UpdateMonitor
	implements UpdateCheckInstanceListener
{
	protected class updateStatusChanger
		implements IProgressReportConstants
	{

		UpdateCheckInstance instance;
		int check_num;
		IProgressReporter updateReporter;
		final UpdateMonitor this$0;

		protected updateStatusChanger(UpdateCheckInstance _instance)
		{
			this$0 = UpdateMonitor.this;
			super();
			check_num = 0;
			updateReporter = ProgressReportingManager.getInstance().addReporter(MessageText.getString("UpdateWindow.title"));
			instance = _instance;
			updateReporter.setReporterType("reporterType_updater");
			updateReporter.setCancelAllowed(true);
			updateReporter.setTitle(MessageText.getString("updater.progress.window.title"));
			updateReporter.appendDetailMessage(format(instance, "added"));
			String name = instance.getName();
			if (MessageText.keyExists(name))
				updateReporter.setMessage(MessageText.getString(name));
			else
				updateReporter.setMessage(name);
			updateReporter.setMinimum(0);
			updateReporter.setMaximum(instance.getCheckers().length);
			updateReporter.setSelection(check_num, null);
			updateReporter.addListener(new IProgressReporterListener() {

				final UpdateMonitor val$this$0;
				final updateStatusChanger this$1;

				public int report(IProgressReport progressReport)
				{
					if (progressReport.getReportType() == 2 || progressReport.getReportType() == 4)
						return 1;
					if (progressReport.getReportType() == 1)
					{
						if (null != instance)
							instance.cancel();
						return 1;
					} else
					{
						return 0;
					}
				}


// JavaClassFileOutputException: Invalid index accessing method local variables table of <init>
			});
			instance.addListener(new UpdateCheckInstanceListener() {

				final UpdateMonitor val$this$0;
				final updateStatusChanger this$1;

				public void cancelled(UpdateCheckInstance instance)
				{
					updateReporter.appendDetailMessage(format(instance, MessageText.getString("Progress.reporting.status.canceled")));
					updateReporter.cancel();
				}

				public void complete(UpdateCheckInstance instance)
				{
					updateReporter.appendDetailMessage(format(instance, MessageText.getString("Progress.reporting.status.finished")));
					updateReporter.setDone();
				}


// JavaClassFileOutputException: Invalid index accessing method local variables table of <init>
			});
			UpdateChecker checkers[] = instance.getCheckers();
			for (int i = 0; i < checkers.length; i++)
			{
				final UpdateChecker checker = checkers[i];
				checker.addListener(new UpdateCheckerListener() {

					final UpdateMonitor val$this$0;
					final updateStatusChanger this$1;

					public void cancelled(UpdateChecker checker)
					{
						updateReporter.appendDetailMessage(format(checker, MessageText.getString("Progress.reporting.status.canceled")));
					}

					public void completed(UpdateChecker checker)
					{
						updateReporter.appendDetailMessage(format(checker, MessageText.getString("Progress.reporting.status.finished")));
						updateReporter.setSelection(++check_num, null);
					}

					public void failed(UpdateChecker checker)
					{
						updateReporter.appendDetailMessage(format(checker, MessageText.getString("Progress.reporting.default.error")));
						updateReporter.setSelection(++check_num, null);
						updateReporter.setErrorMessage(null);
					}


// JavaClassFileOutputException: Invalid index accessing method local variables table of <init>
				});
				checker.addProgressListener(new UpdateProgressListener() {

					final UpdateMonitor val$this$0;
					final UpdateChecker val$checker;
					final updateStatusChanger this$1;

					public void reportProgress(String str)
					{
						updateReporter.appendDetailMessage(format(checker, (new StringBuilder()).append("    ").append(str).toString()));
					}


// JavaClassFileOutputException: Invalid index accessing method local variables table of <init>
				});
			}

		}
	}


	private static final LogIDs LOGID;
	public static final long AUTO_UPDATE_CHECK_PERIOD = 0x4ef6d80L;
	private static final String MSG_PREFIX = "UpdateMonitor.messagebox.";
	private static UpdateMonitor singleton;
	private static AEMonitor class_mon = new AEMonitor("UpdateMonitor:class");
	private AzureusCore azCore;
	private UpdateWindow current_update_window;
	private UpdateCheckInstance current_update_instance;
	private long last_recheck_time;

	public static UpdateMonitor getSingleton(AzureusCore core)
	{
		UpdateMonitor updatemonitor;
		class_mon.enter();
		if (singleton == null)
			singleton = new UpdateMonitor(core);
		updatemonitor = singleton;
		class_mon.exit();
		return updatemonitor;
		Exception exception;
		exception;
		class_mon.exit();
		throw exception;
	}

	protected UpdateMonitor(AzureusCore _azureus_core)
	{
		azCore = _azureus_core;
		PluginInterface defPI = azCore.getPluginManager().getDefaultPluginInterface();
		UpdateManager um = defPI.getUpdateManager();
		um.addListener(new UpdateManagerListener() {

			final UpdateMonitor this$0;

			public void checkInstanceCreated(UpdateCheckInstance instance)
			{
				instance.addListener(UpdateMonitor.this);
				if (!instance.isLowNoise())
					new updateStatusChanger(instance);
			}

			
			{
				this$0 = UpdateMonitor.this;
				super();
			}
		});
		um.addVerificationListener(new UpdateManagerVerificationListener() {

			final UpdateMonitor this$0;

			public boolean acceptUnVerifiedUpdate(Update update)
			{
				UIFunctions uiFunctions = UIFunctionsManager.getUIFunctions();
				if (uiFunctions != null)
				{
					String title = MessageText.getString("UpdateMonitor.messagebox.accept.unverified.title");
					String text = MessageText.getString("UpdateMonitor.messagebox.accept.unverified.text", new String[] {
						update.getName()
					});
					return uiFunctions.promptUser(title, text, new String[] {
						MessageText.getString("Button.yes"), MessageText.getString("Button.no")
					}, 1, "UpdateMonitor.messagebox.accept.unverified", MessageText.getString("MessageBoxWindow.nomoreprompting"), false, 0) == 0;
				} else
				{
					return false;
				}
			}

			public void verificationFailed(Update update, Throwable cause)
			{
				String cause_str = Debug.getNestedExceptionMessage(cause);
				UIFunctions uiFunctions = UIFunctionsManager.getUIFunctions();
				if (uiFunctions != null)
				{
					String title = MessageText.getString("UpdateMonitor.messagebox.verification.failed.title");
					String text = MessageText.getString("UpdateMonitor.messagebox.verification.failed.text", new String[] {
						update.getName(), cause_str
					});
					uiFunctions.promptUser(title, text, new String[] {
						MessageText.getString("Button.ok")
					}, 0, null, null, false, 0);
				}
			}

			
			{
				this$0 = UpdateMonitor.this;
				super();
			}
		});
		SimpleTimer.addPeriodicEvent("UpdateMon:autocheck", 0x4ef6d80L, new TimerEventPerformer() {

			final UpdateMonitor this$0;

			public void perform(TimerEvent ev)
			{
				performAutoCheck(false);
			}

			
			{
				this$0 = UpdateMonitor.this;
				super();
			}
		});
		DelayedTask delayed_task = UtilitiesImpl.addDelayedTask("Update Check", new Runnable() {

			final UpdateMonitor this$0;

			public void run()
			{
				if (!Constants.isWindowsVista && !SystemProperties.isJavaWebStartInstance())
				{
					String app_str = SystemProperties.getApplicationPath();
					if (!(new File(app_str)).canWrite())
					{
						final UIFunctions uiFunctions = UIFunctionsManager.getUIFunctions();
						if (uiFunctions != null)
						{
							if (app_str.endsWith(File.separator))
								app_str = app_str.substring(0, app_str.length() - 1);
							final String f_app_str = app_str;
							Utils.execSWTThread(new Runnable() {

								final UIFunctions val$uiFunctions;
								final String val$f_app_str;
								final 4 this$1;

								public void run()
								{
									UIFunctionsUserPrompter prompt = uiFunctions.getUserPrompter(MessageText.getString("updater.cant.write.to.app.title"), MessageText.getString("updater.cant.write.to.app.details", new String[] {
										f_app_str
									}), new String[] {
										MessageText.getString("Button.ok")
									}, 0);
									prompt.setIconResource("warning");
									prompt.setRememberID("UpdateMonitor.can.not.write.to.app.dir.2", false);
									prompt.setRememberText(MessageText.getString("MessageBoxWindow.nomoreprompting"));
									prompt.open();
								}

					
					{
						this$1 = 4.this;
						uiFunctions = uifunctions;
						f_app_str = s;
						super();
					}
							}, true);
						}
					}
				}
				performAutoCheck(true);
			}

			
			{
				this$0 = UpdateMonitor.this;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -