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

📄 twistiesection.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:   TwistieSection.java

package org.gudy.azureus2.ui.swt;

import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;

// Referenced classes of package org.gudy.azureus2.ui.swt:
//			ITwistieConstants, TwistieLabel, ITwistieListener

public class TwistieSection extends Composite
	implements ITwistieConstants
{
	private class TwistieContentPanel extends Composite
	{

		final TwistieSection this$0;

		private void _setLayoutData(GridData gData)
		{
			super.setLayoutData(gData);
		}

		public void setLayoutData(Object layoutData)
		{
			throw new IllegalArgumentException("This is a managed class therefore overriding its LayoutData is an illegal operation");
		}


		public TwistieContentPanel(Composite parent, int style)
		{
			this$0 = TwistieSection.this;
			super(parent, style);
			setBackgroundMode(2);
		}
	}


	private TwistieContentPanel content;
	private TwistieLabel label;

	public TwistieSection(Composite parent, int style)
	{
		super(parent, 0);
		content = null;
		label = null;
		setBackgroundMode(2);
		GridLayout gLayout = new GridLayout();
		gLayout.marginHeight = 0;
		gLayout.marginWidth = 0;
		gLayout.verticalSpacing = 0;
		setLayout(gLayout);
		label = new TwistieLabel(this, style);
		label.setLayoutData(new GridData(4, 0x1000000, true, false));
		content = new TwistieContentPanel(this, 0);
		final GridData gDataExpanded = new GridData(4, 4, true, true);
		gDataExpanded.horizontalIndent = 10;
		final GridData gDataCollapsed = new GridData(4, 4, true, false);
		gDataCollapsed.heightHint = 0;
		content._setLayoutData(!label.isCollapsed() ? gDataExpanded : gDataCollapsed);
		label.addTwistieListener(new ITwistieListener() {

			final GridData val$gDataCollapsed;
			final GridData val$gDataExpanded;
			final TwistieSection this$0;

			public void isCollapsed(boolean value)
			{
				content._setLayoutData(!value ? gDataExpanded : gDataCollapsed);
				layout(true, true);
			}

			
			{
				this$0 = TwistieSection.this;
				gDataCollapsed = griddata;
				gDataExpanded = griddata1;
				super();
			}
		});
	}

	public Composite getContent()
	{
		return content;
	}

	public void setBackground(Color color)
	{
		if (null != label && !label.isDisposed())
			label.setBackground(color);
		if (null != content && !content.isDisposed())
			content.setBackground(color);
		super.setBackground(color);
	}

	public void setForeground(Color color)
	{
		if (null != label && !label.isDisposed())
			label.setForeground(color);
		if (null != content && !content.isDisposed())
			content.setForeground(color);
		super.setForeground(color);
	}

	public void setEnabled(boolean enabled)
	{
		if (null != label && !label.isDisposed())
			label.setEnabled(enabled);
		super.setEnabled(enabled);
	}

	public void addTwistieListener(ITwistieListener listener)
	{
		if (null != label && !label.isDisposed())
			label.addTwistieListener(listener);
	}

	public void removeTwistieListener(ITwistieListener listener)
	{
		if (null != label && !label.isDisposed())
			label.removeTwistieListener(listener);
	}

	public void setDescription(String string)
	{
		if (null != label && !label.isDisposed())
			label.setDescription(string);
	}

	public void setTitle(String string)
	{
		if (null != label && !label.isDisposed())
			label.setTitle(string);
	}

	public void setToolTipText(String string)
	{
		if (null != label && !label.isDisposed())
			label.setToolTipText(string);
	}

	public void setTwistieForeground(Color color)
	{
		if (null != label && !label.isDisposed())
			label.setTwistieForeground(color);
	}

}

⌨️ 快捷键说明

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