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

📄 configsectioninterfacepassword.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:   ConfigSectionInterfacePassword.java

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

import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
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.ui.swt.Messages;
import org.gudy.azureus2.ui.swt.config.PasswordParameter;
import org.gudy.azureus2.ui.swt.plugins.UISWTConfigSection;

public class ConfigSectionInterfacePassword
	implements UISWTConfigSection
{

	private static final String LBLKEY_PREFIX = "ConfigView.label.";
	private final int REQUIRED_MODE = 0;
	Label passwordMatch;

	public ConfigSectionInterfacePassword()
	{
	}

	public String configSectionGetParentSection()
	{
		return "style";
	}

	public String configSectionGetName()
	{
		return "interface.password";
	}

	public void configSectionSave()
	{
	}

	public void configSectionDelete()
	{
	}

	public int maxUserMode()
	{
		return 0;
	}

	public Composite configSectionCreate(Composite parent)
	{
		Composite cSection = new Composite(parent, 0);
		GridData gridData = new GridData(272);
		cSection.setLayoutData(gridData);
		GridLayout layout = new GridLayout();
		layout.marginWidth = 0;
		layout.numColumns = 2;
		cSection.setLayout(layout);
		Label label = new Label(cSection, 0);
		Messages.setLanguageText(label, "ConfigView.label.password");
		gridData = new GridData();
		gridData.widthHint = 150;
		PasswordParameter pw1 = new PasswordParameter(cSection, "Password");
		pw1.setLayoutData(gridData);
		Text t1 = (Text)pw1.getControl();
		label = new Label(cSection, 0);
		Messages.setLanguageText(label, "ConfigView.label.passwordconfirm");
		gridData = new GridData();
		gridData.widthHint = 150;
		PasswordParameter pw2 = new PasswordParameter(cSection, "Password Confirm");
		pw2.setLayoutData(gridData);
		Text t2 = (Text)pw2.getControl();
		label = new Label(cSection, 0);
		Messages.setLanguageText(label, "ConfigView.label.passwordmatch");
		passwordMatch = new Label(cSection, 0);
		gridData = new GridData();
		gridData.widthHint = 150;
		passwordMatch.setLayoutData(gridData);
		refreshPWLabel();
		t1.addModifyListener(new ModifyListener() {

			final ConfigSectionInterfacePassword this$0;

			public void modifyText(ModifyEvent e)
			{
				refreshPWLabel();
			}

			
			{
				this$0 = ConfigSectionInterfacePassword.this;
				super();
			}
		});
		t2.addModifyListener(new ModifyListener() {

			final ConfigSectionInterfacePassword this$0;

			public void modifyText(ModifyEvent e)
			{
				refreshPWLabel();
			}

			
			{
				this$0 = ConfigSectionInterfacePassword.this;
				super();
			}
		});
		return cSection;
	}

	private void refreshPWLabel()
	{
		if (passwordMatch == null || passwordMatch.isDisposed())
			return;
		byte password[] = COConfigurationManager.getByteParameter("Password", "".getBytes());
		COConfigurationManager.setParameter("Password enabled", false);
		if (password.length == 0)
		{
			passwordMatch.setText(MessageText.getString("ConfigView.label.passwordmatchnone"));
		} else
		{
			byte confirm[] = COConfigurationManager.getByteParameter("Password Confirm", "".getBytes());
			if (confirm.length == 0)
			{
				passwordMatch.setText(MessageText.getString("ConfigView.label.passwordmatchno"));
			} else
			{
				boolean same = true;
				for (int i = 0; i < password.length; i++)
					if (password[i] != confirm[i])
						same = false;

				if (same)
				{
					passwordMatch.setText(MessageText.getString("ConfigView.label.passwordmatchyes"));
					COConfigurationManager.setParameter("Password enabled", true);
				} else
				{
					passwordMatch.setText(MessageText.getString("ConfigView.label.passwordmatchno"));
				}
			}
		}
	}

}

⌨️ 快捷键说明

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