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

📄 languagepanel.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:   LanguagePanel.java

package org.gudy.azureus2.ui.swt.config.wizard;

import com.aelitis.azureus.ui.UIFunctions;
import com.aelitis.azureus.ui.UIFunctionsManager;
import java.util.Locale;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.FontData;
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.DisplayFormatters;
import org.gudy.azureus2.ui.swt.Messages;
import org.gudy.azureus2.ui.swt.wizard.*;

// Referenced classes of package org.gudy.azureus2.ui.swt.config.wizard:
//			ConfigureWizard, WelcomePanel

public class LanguagePanel extends AbstractWizardPanel
{

	public LanguagePanel(Wizard wizard, IWizardPanel previousPanel)
	{
		AbstractWizardPanel(wizard, previousPanel);
	}

	public void show()
	{
		wizard.setTitleAsResourceID("configureWizard.welcome.title");
		Composite rootPanel = wizard.getPanel();
		GridLayout layout = new GridLayout();
		layout.numColumns = 1;
		rootPanel.setLayout(layout);
		final Label lblChoose = new Label(rootPanel, 64);
		setChooseLabel(lblChoose);
		GridData gridData = new GridData(768);
		lblChoose.setLayoutData(gridData);
		final List lstLanguage = new List(rootPanel, 2564);
		gridData = new GridData(1808);
		gridData.heightHint = 200;
		lstLanguage.setLayoutData(gridData);
		final Locale locales[] = MessageText.getLocales();
		int iUsingLocale = -1;
		for (int i = 0; i < locales.length; i++)
		{
			Locale locale = locales[i];
			lstLanguage.add(buildName(locale));
			if (MessageText.isCurrentLocale(locale))
				iUsingLocale = i;
		}

		lstLanguage.select(iUsingLocale);
		lstLanguage.addListener(13, new Listener() );
		FontData fontData[] = lstLanguage.getFont().getFontData();
		for (int i = 0; i < fontData.length; i++)
			if (fontData[i].getHeight() < 10)
				fontData[i].setHeight(10);

		final Font font = new Font(rootPanel.getDisplay(), fontData);
		lstLanguage.setFont(font);
		lstLanguage.getShell().addListener(22, new Listener() {

			final List val$lstLanguage;
			final LanguagePanel this$0;

			public void handleEvent(Event event)
			{
				lstLanguage.showSelection();
			}

			
			{
				this$0 = LanguagePanel.this;
				lstLanguage = list;
				Object();
			}
		});
		lstLanguage.addDisposeListener(new DisposeListener() {

			final Font val$font;
			final LanguagePanel this$0;

			public void widgetDisposed(DisposeEvent e)
			{
				if (font != null && !font.isDisposed())
					font.dispose();
			}

			
			{
				this$0 = LanguagePanel.this;
				font = font1;
				Object();
			}
		});
	}

	private void setChooseLabel(Label lblChoose)
	{
		String sLocaleChooseString = MessageText.getString("ConfigureWizard.language.choose");
		String sDefChooseString = MessageText.getDefaultLocaleString("ConfigureWizard.language.choose");
		if (sLocaleChooseString.equals(sDefChooseString))
			lblChoose.setText(sLocaleChooseString);
		else
			lblChoose.setText((new StringBuilder()).append(sLocaleChooseString).append("\n").append(sDefChooseString).toString());
	}

	private String buildName(Locale locale)
	{
		StringBuffer sName = new StringBuffer();
		String sName1 = locale.getDisplayLanguage(locale);
		String sName2 = locale.getDisplayLanguage();
		sName.append(sName1);
		if (!sName1.equals(sName2))
			sName.append("/").append(sName2);
		sName1 = locale.getDisplayCountry(locale);
		sName2 = locale.getDisplayCountry();
		if (sName1.length() > 0 || sName2.length() > 0)
		{
			sName.append(" (");
			if (sName1.length() > 0)
				sName.append(sName1);
			if (sName2.length() > 0 && !sName1.equals(sName2))
				sName.append("/").append(sName2);
			sName1 = locale.getDisplayVariant(locale);
			sName2 = locale.getDisplayVariant();
			if (sName1.length() > 0 || sName2.length() > 0)
			{
				sName.append(", ");
				if (sName1.length() > 0)
					sName.append(sName1);
				if (sName2.length() > 0 && !sName1.equals(sName2))
					sName.append("/").append(sName2);
			}
			sName.append(")");
		}
		return sName.toString();
	}

	public boolean isNextEnabled()
	{
		return true;
	}

	public IWizardPanel getNextPanel()
	{
		return new WelcomePanel((ConfigureWizard)wizard, this);
	}



}

⌨️ 快捷键说明

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