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

📄 clipboardcopy.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:   ClipboardCopy.java

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

import org.eclipse.swt.dnd.*;
import org.eclipse.swt.events.*;
import org.eclipse.swt.widgets.*;
import org.gudy.azureus2.core3.internat.MessageText;

// Referenced classes of package org.gudy.azureus2.ui.swt.mainwindow:
//			SWTThread

public class ClipboardCopy
{
	public static interface copyToClipProvider
	{

		public abstract String getText();
	}


	public ClipboardCopy()
	{
	}

	public static void copyToClipBoard(String data)
	{
		(new Clipboard(SWTThread.getInstance().getDisplay())).setContents(new Object[] {
			data
		}, new Transfer[] {
			TextTransfer.getInstance()
		});
	}

	public static void addCopyToClipMenu(Control control, copyToClipProvider provider)
	{
		control.addMouseListener(new MouseAdapter(control, provider) {

			final Control val$control;
			final copyToClipProvider val$provider;

			public void mouseDown(MouseEvent e)
			{
				if (control.isDisposed())
					return;
				final String text = provider.getText();
				if (control.getMenu() != null || text == null || text.length() == 0)
					return;
				if (e.button != 3 && (e.button != 1 || e.stateMask != 0x40000))
				{
					return;
				} else
				{
					final Menu menu = new Menu(control.getShell(), 8);
					MenuItem item = new MenuItem(menu, 0);
					item.setText(MessageText.getString("ConfigView.copy.to.clipboard.tooltip"));
					item.addSelectionListener(new SelectionAdapter() {

						final String val$text;
						final 1 this$0;

						public void widgetSelected(SelectionEvent arg0)
						{
							(new Clipboard(control.getDisplay())).setContents(new Object[] {
								text
							}, new Transfer[] {
								TextTransfer.getInstance()
							});
						}

					
					{
						this$0 = 1.this;
						text = s;
						super();
					}
					});
					control.setMenu(menu);
					menu.addMenuListener(new MenuAdapter() {

						final Menu val$menu;
						final 1 this$0;

						public void menuHidden(MenuEvent arg0)
						{
							if (control.getMenu() == menu)
								control.setMenu(null);
						}

					
					{
						this$0 = 1.this;
						menu = menu1;
						super();
					}
					});
					menu.setVisible(true);
					return;
				}
			}

			
			{
				control = control1;
				provider = copytoclipprovider;
				super();
			}
		});
	}
}

⌨️ 快捷键说明

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