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

📄 configshell.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:   ConfigShell.java

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

import com.aelitis.azureus.core.AzureusCoreFactory;
import com.aelitis.azureus.ui.swt.UIFunctionsManagerSWT;
import com.aelitis.azureus.ui.swt.UIFunctionsSWT;
import org.eclipse.swt.events.*;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
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.ui.swt.Utils;
import org.gudy.azureus2.ui.swt.components.shell.ShellFactory;

// Referenced classes of package org.gudy.azureus2.ui.swt.views:
//			ConfigView

public class ConfigShell
{

	private static ConfigShell instance;
	private Shell shell;
	private ConfigView configView;

	public static ConfigShell getInstance()
	{
		if (null == instance)
			instance = new ConfigShell();
		return instance;
	}

	private ConfigShell()
	{
	}

	public void open(String section)
	{
		if (null != shell && !shell.isDisposed())
		{
			configView.selectSection(section);
			if (shell.getMinimized())
				shell.setMinimized(false);
			shell.forceActive();
			shell.forceFocus();
		} else
		{
			shell = ShellFactory.createMainShell(1136);
			shell.setLayout(new GridLayout());
			shell.setText(MessageText.getString(MessageText.resolveLocalizationKey("ConfigView.title.full")));
			Utils.setShellIcon(shell);
			configView = new ConfigView(AzureusCoreFactory.getSingleton());
			configView.initialize(shell);
			configView.selectSection(section);
			if (null == COConfigurationManager.getStringParameter("options.rectangle", null))
			{
				Rectangle shellBounds = shell.getMonitor().getBounds();
				Point size = new Point((shellBounds.width * 10) / 11, (shellBounds.height * 10) / 11);
				if (size.x > 1400)
					size.x = 1400;
				if (size.y > 700)
					size.y = 700;
				shell.setSize(size);
				Utils.centerWindowRelativeTo(shell, getMainShell());
			}
			Utils.linkShellMetricsToConfig(shell, "options");
			shell.addListener(21, new Listener() {

				final ConfigShell this$0;

				public void handleEvent(Event event)
				{
					configView.save();
					event.doit = true;
				}

			
			{
				this$0 = ConfigShell.this;
				super();
			}
			});
			shell.addTraverseListener(new TraverseListener() {

				final ConfigShell this$0;

				public void keyTraversed(TraverseEvent e)
				{
					if (e.detail == 2)
						shell.dispose();
				}

			
			{
				this$0 = ConfigShell.this;
				super();
			}
			});
			shell.addDisposeListener(new DisposeListener() {

				final ConfigShell this$0;

				public void widgetDisposed(DisposeEvent arg0)
				{
					close();
				}

			
			{
				this$0 = ConfigShell.this;
				super();
			}
			});
			shell.open();
		}
	}

	private void close()
	{
		configView.delete();
		shell = null;
		configView = null;
	}

	private Shell getMainShell()
	{
		UIFunctionsSWT uiFunctions = UIFunctionsManagerSWT.getUIFunctionsSWT();
		if (null != uiFunctions)
			return uiFunctions.getMainShell();
		else
			throw new IllegalStateException("No instance of UIFunctionsSWT found; the UIFunctionsManager might not have been initialized properly");
	}



}

⌨️ 快捷键说明

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