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

📄 associationchecker.java

📁 java 文件下载器。可自定义
💻 JAVA
字号:
// 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:   AssociationChecker.java

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

import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.*;
import org.gudy.azureus2.core3.config.COConfigurationManager;
import org.gudy.azureus2.core3.internat.MessageText;
import org.gudy.azureus2.core3.util.AERunnable;
import org.gudy.azureus2.core3.util.Debug;
import org.gudy.azureus2.platform.*;
import org.gudy.azureus2.plugins.platform.PlatformManagerException;
import org.gudy.azureus2.ui.swt.Messages;
import org.gudy.azureus2.ui.swt.Utils;
import org.gudy.azureus2.ui.swt.mainwindow.SWTThread;

public class AssociationChecker
{

	protected PlatformManager platform;
	protected Display display;
	protected Shell shell;

	public static void checkAssociations()
	{
		try
		{
			PlatformManager platform = PlatformManagerFactory.getPlatformManager();
			if (platform.hasCapability(PlatformManagerCapabilities.RegisterFileAssociations) && COConfigurationManager.getBooleanParameter("config.interface.checkassoc") && !platform.isApplicationRegistered())
				new AssociationChecker(platform);
		}
		catch (Throwable e) { }
	}

	protected AssociationChecker(PlatformManager _platform)
	{
		platform = _platform;
		display = SWTThread.getInstance().getDisplay();
		if (display.isDisposed())
		{
			return;
		} else
		{
			Utils.execSWTThread(new AERunnable() {

				final AssociationChecker this$0;

				public void runSupport()
				{
					check();
				}

			
			{
				this$0 = AssociationChecker.this;
				AERunnable();
			}
			});
			return;
		}
	}

	protected void check()
	{
		if (display.isDisposed())
		{
			return;
		} else
		{
			shell = new Shell(display, 0x10860);
			Utils.setShellIcon(shell);
			shell.setText(MessageText.getString("dialog.associations.title"));
			GridLayout layout = new GridLayout();
			layout.numColumns = 3;
			shell.setLayout(layout);
			Label user_label = new Label(shell, 0);
			Messages.setLanguageText(user_label, "dialog.associations.prompt");
			GridData gridData = new GridData(1808);
			gridData.horizontalSpan = 3;
			user_label.setLayoutData(gridData);
			final Button checkBox = new Button(shell, 32);
			checkBox.setSelection(true);
			gridData = new GridData(1808);
			gridData.horizontalSpan = 3;
			checkBox.setLayoutData(gridData);
			Messages.setLanguageText(checkBox, "dialog.associations.askagain");
			Label labelSeparator = new Label(shell, 258);
			gridData = new GridData(768);
			gridData.horizontalSpan = 3;
			labelSeparator.setLayoutData(gridData);
			new Label(shell, 0);
			Button bYes = new Button(shell, 8);
			bYes.setText(MessageText.getString("Button.yes"));
			gridData = new GridData(896);
			gridData.grabExcessHorizontalSpace = true;
			gridData.widthHint = 70;
			bYes.setLayoutData(gridData);
			bYes.addListener(13, new Listener() {

				final Button val$checkBox;
				final AssociationChecker this$0;

				public void handleEvent(Event e)
				{
					close(true, checkBox.getSelection());
				}

			
			{
				this$0 = AssociationChecker.this;
				checkBox = button;
				Object();
			}
			});
			Button bNo = new Button(shell, 8);
			bNo.setText(MessageText.getString("Button.no"));
			gridData = new GridData(128);
			gridData.grabExcessHorizontalSpace = false;
			gridData.widthHint = 70;
			bNo.setLayoutData(gridData);
			bNo.addListener(13, new Listener() {

				final Button val$checkBox;
				final AssociationChecker this$0;

				public void handleEvent(Event e)
				{
					close(false, checkBox.getSelection());
				}

			
			{
				this$0 = AssociationChecker.this;
				checkBox = button;
				Object();
			}
			});
			bYes.setFocus();
			shell.setDefaultButton(bYes);
			shell.addListener(31, new Listener() {

				final AssociationChecker this$0;

				public void handleEvent(Event e)
				{
					if (e.character == '\033')
						close(false, true);
				}

			
			{
				this$0 = AssociationChecker.this;
				Object();
			}
			});
			shell.pack();
			Utils.centreWindow(shell);
			shell.open();
			return;
		}
	}

	protected void close(boolean ok, boolean check_on_startup)
	{
		if (check_on_startup != COConfigurationManager.getBooleanParameter("config.interface.checkassoc"))
		{
			COConfigurationManager.setParameter("config.interface.checkassoc", check_on_startup);
			COConfigurationManager.save();
		}
		if (ok)
			try
			{
				platform.registerApplication();
			}
			catch (PlatformManagerException e)
			{
				Debug.printStackTrace(e);
			}
		shell.dispose();
	}
}

⌨️ 快捷键说明

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