亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? linkexampler.java

?? 開源的關于SWT開發的圖形應用庫
?? JAVA
字號:
package com.swtplus.gallery;

import org.eclipse.swt.SWT;
import org.eclipse.swt.SWTException;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.FontDialog;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.MessageBox;
import org.eclipse.swt.widgets.Text;

import com.swtplus.utility.Styler;
import com.swtplus.widgets.PCombo;
import com.swtplus.widgets.PGroup;
import com.swtplus.widgets.PLink;
import com.swtplus.widgets.combo.ColorComboStrategy;
import com.swtplus.widgets.combo.ListComboStrategy;
import com.swtplus.widgets.combo.NamedRGB;
import com.swtplus.widgets.group.SimpleGroupStrategy;

public class LinkExampler extends Composite implements IWidgetExampler {
	
	Composite exampleArea;
	PLink link;
	private Button underlineActive;
	private Button underlineAlways;
	private Button underlineNever;
	private Button wrap;
	private Text t;
	private PCombo ccombo;
	private Button focus;
	private Button focusActive;
	
	private Font font;
	
	private Image browsedImage;
	private ColorComboStrategy foregroundComboStrat;
	private PCombo foregroundCombo;
	private ColorComboStrategy backgroundComboStrat;
	private PCombo backgroundCombo;
	private ColorComboStrategy activeComboStrat;
	private PCombo activeCombo;
	private boolean firstCreate = true;

	public LinkExampler(Composite c) {
		super(c, SWT.NONE);

		Styler colorStyler = new Styler();
		colorStyler.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
		
		Styler borderStyler = new Styler();
		borderStyler.setBorderColor(Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW));
		
		SelectionListener sListener = new SelectionListener(){
			public void widgetSelected(SelectionEvent arg0) {
				recreate();
			}
			public void widgetDefaultSelected(SelectionEvent arg0) {
			}};
		
		
        this.setLayout(new FillLayout());
		final Composite container = new Composite (this,SWT.NONE);
		container.setBackground(c.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
		
		container.setLayout(new GridLayout());
		
		
		SimpleGroupStrategy sgs = new SimpleGroupStrategy(SWT.NONE);
		PGroup sgStyles = new PGroup(container,sgs);
		sgStyles.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
		sgStyles.setText("Styles");
		colorStyler.add(sgStyles);
		colorStyler.add(sgStyles.getBody());
		
		sgStyles.getBody().setLayout(new GridLayout());
		
		underlineActive = new Button(sgStyles.getBody(),SWT.RADIO | SWT.FLAT);
		underlineActive.setText("PLink.UNDERLINE_ACTIVE");
		underlineActive.setSelection(true);
		colorStyler.add(underlineActive);
		underlineActive.addSelectionListener(sListener);

		underlineAlways = new Button(sgStyles.getBody(),SWT.RADIO | SWT.FLAT);
		underlineAlways.setText("PLink.UNDERLINE_ALWAYS");
		colorStyler.add(underlineAlways);
		underlineAlways.addSelectionListener(sListener);

		underlineNever = new Button(sgStyles.getBody(),SWT.RADIO | SWT.FLAT);
		underlineNever.setText("PLink.UNDERLINE_NEVER");
		colorStyler.add(underlineNever);
		underlineNever.addSelectionListener(sListener);
		
		wrap = new Button(sgStyles.getBody(),SWT.CHECK | SWT.FLAT);
		wrap.setText("PLink.WRAP (adds width hint to example's layout data)");
		colorStyler.add(wrap);
		wrap.addSelectionListener(sListener);
		
		
		SimpleGroupStrategy sgs2 = new SimpleGroupStrategy(SWT.NONE);
		PGroup sgColors = new PGroup(container,sgs2);
		sgColors.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
		sgColors.setText("Colors");
		colorStyler.add(sgColors);
		colorStyler.add(sgColors.getBody());
		
		sgColors.getBody().setLayout(new GridLayout(2,false));
		
		c = sgColors.getBody();
		
		Label colorForegroundLabel = new Label(c,SWT.NONE);
		colorForegroundLabel.setText("Foreground Color:");
		colorStyler.add(colorForegroundLabel);
		
		foregroundComboStrat = new ColorComboStrategy(ColorComboStrategy.SHOW_DEFAULT | ColorComboStrategy.SHOW_SWTPALETTE);
		foregroundCombo = new PCombo(c,PCombo.READ_ONLY | PCombo.FLAT,foregroundComboStrat);
		GridData gd = new GridData(GridData.FILL_HORIZONTAL);
		foregroundCombo.setLayoutData(gd);
		borderStyler.add(foregroundCombo);
		foregroundCombo.addModifyListener(new ModifyListener() {
			public void modifyText(ModifyEvent e) {
				recreate();
			}		
		});

		Label backLabel = new Label(c,SWT.NONE);
		backLabel.setText("Background Color:");
		colorStyler.add(backLabel);
		
		backgroundComboStrat = new ColorComboStrategy(ColorComboStrategy.SHOW_DEFAULT | ColorComboStrategy.SHOW_SWTPALETTE);
		backgroundCombo = new PCombo(c,PCombo.READ_ONLY | PCombo.FLAT,backgroundComboStrat);
		gd = new GridData(GridData.FILL_HORIZONTAL);
		backgroundCombo.setLayoutData(gd);
		borderStyler.add(backgroundCombo);
		backgroundCombo.addModifyListener(new ModifyListener() {
			public void modifyText(ModifyEvent e) {
				recreate();
			}		
		});

		
		Label activeLabel = new Label(c,SWT.NONE);
		activeLabel.setText("Active Color:");
		colorStyler.add(activeLabel);
		
		activeComboStrat = new ColorComboStrategy(ColorComboStrategy.SHOW_DEFAULT | ColorComboStrategy.SHOW_SWTPALETTE);
		activeCombo = new PCombo(c,PCombo.READ_ONLY | PCombo.FLAT,activeComboStrat);
		gd = new GridData(GridData.FILL_HORIZONTAL);
		activeCombo.setLayoutData(gd);
		borderStyler.add(activeCombo);
		activeCombo.addModifyListener(new ModifyListener() {
			public void modifyText(ModifyEvent e) {
				recreate();
			}		
		});
		
		
		SimpleGroupStrategy sgs3 = new SimpleGroupStrategy(SWT.NONE);
		PGroup sgImageText = new PGroup(container,sgs3);
		sgImageText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
		sgImageText.setText("Images and Text");
		colorStyler.add(sgImageText);
		colorStyler.add(sgImageText.getBody());	
		sgImageText.getBody().setLayout(new GridLayout(3,false));
		
		Label l = new Label(sgImageText.getBody(),SWT.NONE);
		l.setText("Text:");
		colorStyler.add(l);
		
		t = new Text(sgImageText.getBody(),SWT.NO_FOCUS);
		t.setText("Example of PLink");
		borderStyler.add(t);
		t.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

		
		Button apply = new Button(sgImageText.getBody(),SWT.PUSH | SWT.FLAT);
		apply.setText("Apply");
		apply.addSelectionListener(sListener);
		
		l = new Label(sgImageText.getBody(),SWT.NONE);
		l.setText("Font:");
		colorStyler.add(l);
		
		Button fontButton = new Button(sgImageText.getBody(),SWT.PUSH | SWT.FLAT);
		fontButton.setText("Change Font...");
		fontButton.addSelectionListener(new SelectionListener(){
			public void widgetDefaultSelected(SelectionEvent arg0) {
			}
			public void widgetSelected(SelectionEvent arg0) {
				FontDialog fd = new FontDialog(Display.getCurrent().getActiveShell());
				FontData fds = fd.open();
				if (fds != null){
					if (font != null)
						font.dispose();

					font = new Font(Display.getCurrent(),fds);
					recreate();
				}
			}});
		
		new Label(sgImageText.getBody(),SWT.NONE);
		
		l = new Label(sgImageText.getBody(),SWT.NONE);
		l.setText("Images:");
		colorStyler.add(l);
		
		ListComboStrategy imageStrategy = new ListComboStrategy(SWT.NONE);
		ccombo = new PCombo(sgImageText.getBody(),PCombo.READ_ONLY | PCombo.FLAT,imageStrategy);
		gd = new GridData(GridData.FILL_HORIZONTAL);
		gd.horizontalSpan = 2;
		ccombo.setLayoutData(gd);
		borderStyler.add(ccombo);
		
		imageStrategy.getList().add("(None)");
		imageStrategy.getList().add("Flashlight Off/Flashlight On When Active");
		imageStrategy.getList().add("Browse...");
		
		ccombo.setValue("Flashlight Off/Flashlight On When Active");
		
		ccombo.addSelectionListener(new SelectionListener(){
			public void widgetSelected(SelectionEvent arg0) {
				if (!ccombo.getValue().equals("Browse..."))
					return;
				
				if (browsedImage != null){
					browsedImage.dispose();
					browsedImage = null;
				}
				
				FileDialog fd = new FileDialog(Display.getCurrent().getActiveShell(),SWT.OPEN);
				String file = fd.open();
				
				if (file != null){
					
					try {
						browsedImage = new Image(Display.getCurrent(),file);
					} catch (SWTException e) {
						MessageBox mb = new MessageBox(Display.getCurrent().getActiveShell());
						mb.setText("Error");
						mb.setMessage(e.toString());
						mb.open();
					}
				}
			}
			public void widgetDefaultSelected(SelectionEvent arg0) {
			}});
		
		ccombo.addSelectionListener(sListener);
		
		new Label(sgImageText.getBody(),SWT.NONE);
		
		
		
		SimpleGroupStrategy sgs4 = new SimpleGroupStrategy(SWT.NONE);
		PGroup sgOther = new PGroup(container,sgs4);
		sgOther.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
		sgOther.setText("Other Options");
		colorStyler.add(sgOther);
		colorStyler.add(sgOther.getBody());	
		sgOther.getBody().setLayout(new GridLayout(2,false));
		
		
		focus = new Button(sgOther.getBody(),SWT.CHECK | SWT.FLAT);
		focus.setText("Show Focus");
		focus.setSelection(true);
		colorStyler.add(focus);
		gd = new GridData();
		gd.horizontalSpan =2;
		focus.setLayoutData(gd);
		focus.addSelectionListener(sListener);
		
		focusActive = new Button(sgOther.getBody(),SWT.CHECK | SWT.FLAT);
		focusActive.setText("Show Active when Focused");
		focusActive.setSelection(true);
		colorStyler.add(focusActive);
		focusActive.addSelectionListener(sListener);
		

		
		colorStyler.style();
		borderStyler.style();
		
		//recreate();
	}

	private void recreate() {
		
		if (link != null && !link.isDisposed()){
			link.getActiveColor().dispose();
			link.getForeground().dispose();
			link.getBackground().dispose();			
			link.dispose();

		}
		
		int style = 0;
		
		if (underlineActive.getSelection())
			style = style | PLink.UNDERLINE_ACTIVE;

		if (underlineAlways.getSelection())
			style = style | PLink.UNDERLINE_ALWAYS;

		if (underlineNever.getSelection())
			style = style | PLink.UNDERLINE_NEVER;

		if (wrap.getSelection())
			style = style | PLink.WRAP;
		
		link = new PLink(exampleArea,style);

		GridData gd = new GridData(SWT.CENTER,SWT.TOP,true,true);
		gd.verticalIndent = 100;
		if (wrap.getSelection()){
			gd.widthHint = 150;
		}
		link.setLayoutData(gd);
		
		if (firstCreate ){
			foregroundComboStrat.setDefaultRGB(link.getForeground().getRGB());
			foregroundCombo.setValue(new NamedRGB("Default",link.getForeground().getRGB()));
			backgroundComboStrat.setDefaultRGB(link.getBackground().getRGB());
			backgroundCombo.setValue(new NamedRGB("Default",link.getBackground().getRGB()));

			activeComboStrat.setDefaultRGB(link.getActiveColor().getRGB());
			activeCombo.setValue(new NamedRGB("Default",link.getActiveColor().getRGB()));

		} else {
			link.setForeground(new Color(Display.getCurrent(), ((NamedRGB)foregroundCombo.getValue()).getRGB()));
			link.setBackground(new Color(Display.getCurrent(), ((NamedRGB)backgroundCombo.getValue()).getRGB()));
			link.setActiveColor(new Color(Display.getCurrent(), ((NamedRGB)activeCombo.getValue()).getRGB()));
		}
		
		link.setText(t.getText());
		
		if (font != null)
			link.setFont(font);
		
		if (!ccombo.getValue().equals("(None)")){
			if (!ccombo.getValue().equals("Browse...")){
				link.setImage(GalleryImageRegistry.getImage(this.getClass(),"find_off.png"));
				link.setActiveImage(GalleryImageRegistry.getImage(this.getClass(),"find.gif"));
			} else {
				link.setImage(browsedImage);
			}
		}
		
		link.setShowActiveWhenFocused(focusActive.getSelection());
		link.setShowFocus(focus.getSelection());
		exampleArea.layout();
		
	}

	public void setExampleArea(Composite area) {
		exampleArea = area;		
		area.setLayout(new GridLayout(1,false));
		
		recreate();
		
		firstCreate = false;
	}

	public void dispose() {
		super.dispose();
		if (link != null && !link.isDisposed()){
			link.getActiveColor().dispose();
			link.getForeground().dispose();
			link.getBackground().dispose();			
			link.dispose();

		}
	}
	
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久精品噜噜噜成人88aⅴ| 国产成a人亚洲精| 日韩国产欧美在线观看| 精品亚洲国产成人av制服丝袜| 国产一区二区三区av电影| 懂色av一区二区在线播放| 色域天天综合网| 日韩欧美国产综合一区 | 91麻豆精品91久久久久久清纯| 制服视频三区第一页精品| 久久精品在线免费观看| 一区二区视频免费在线观看| 亚洲一区二区三区四区五区黄| 免费成人你懂的| 91视视频在线直接观看在线看网页在线看| 欧美区一区二区三区| 欧美国产综合一区二区| 亚洲午夜精品在线| 国产超碰在线一区| 91精品蜜臀在线一区尤物| 日韩一区在线看| 国产精品亚洲午夜一区二区三区| 国产成人超碰人人澡人人澡| 欧美视频完全免费看| 中文字幕精品一区二区精品绿巨人 | 色国产精品一区在线观看| 欧美精品一区二区三区在线 | 亚洲国产成人va在线观看天堂| 国产精品456露脸| 日韩亚洲欧美一区二区三区| 亚洲一区二区三区自拍| 成人h精品动漫一区二区三区| 日韩一级高清毛片| 亚洲欧美二区三区| 99r精品视频| 国产日韩av一区二区| 美女一区二区三区| 在线成人小视频| 亚洲成a天堂v人片| 97se亚洲国产综合在线| 国产精品久久久久影院亚瑟| 激情综合网激情| 精品国产91乱码一区二区三区 | 亚洲成av人片www| 欧美在线短视频| 怡红院av一区二区三区| 成人爱爱电影网址| 综合婷婷亚洲小说| 色呦呦国产精品| 伊人一区二区三区| 欧美伊人久久久久久久久影院| 亚洲私人黄色宅男| 色天使色偷偷av一区二区| 亚洲精品国产一区二区精华液 | 福利一区二区在线观看| 久久久国产精品午夜一区ai换脸| 久久av老司机精品网站导航| 91精品婷婷国产综合久久| 欧美aaaaaa午夜精品| 91精品视频网| 国产精品自在欧美一区| 久久久亚洲高清| 丰满放荡岳乱妇91ww| 一区二区三区在线免费视频 | 亚洲婷婷在线视频| www.在线成人| 伊人性伊人情综合网| 91精品视频网| 国产乱对白刺激视频不卡| 久久久电影一区二区三区| 成人永久看片免费视频天堂| 成人欧美一区二区三区黑人麻豆 | 色婷婷激情久久| 五月婷婷色综合| 精品不卡在线视频| 91污片在线观看| 亚洲大尺度视频在线观看| 欧美一区二区三区啪啪| 国内精品免费**视频| 中文字幕日韩精品一区| av亚洲精华国产精华精| 亚洲国产色一区| 国产欧美一区二区精品秋霞影院| 成人免费毛片片v| 石原莉奈在线亚洲三区| 日本一区二区不卡视频| 国产精品国产三级国产aⅴ无密码| 欧洲日韩一区二区三区| 国产成人在线视频网址| 免费高清成人在线| 亚洲mv在线观看| 一区二区三区中文字幕精品精品| 久久久久久麻豆| 日韩欧美卡一卡二| 欧美日韩一区二区三区四区| 不卡视频在线看| 成人综合激情网| 国产一区视频导航| 免费国产亚洲视频| 亚洲超碰97人人做人人爱| 成人欧美一区二区三区黑人麻豆| 国产亚洲美州欧州综合国| 欧美一区二区精美| 欧美电影在哪看比较好| 欧美三级三级三级| 欧美色图激情小说| 91国产精品成人| 色94色欧美sute亚洲线路一ni| 成人h版在线观看| 成人av在线看| 成人黄色在线网站| 成人免费高清在线观看| 成人一区二区三区视频| 国产**成人网毛片九色| 成人午夜激情片| 91蜜桃网址入口| 在线精品视频一区二区| 欧美色偷偷大香| 欧美日韩三级视频| 欧美丰满少妇xxxbbb| 91精品国产一区二区三区香蕉| 7777精品伊人久久久大香线蕉经典版下载 | 欧美亚洲国产bt| 欧美午夜在线观看| 欧美性色黄大片手机版| 欧美色涩在线第一页| 欧美人妖巨大在线| 欧美一区日本一区韩国一区| 欧美一区二视频| 久久久影视传媒| 中文字幕中文字幕中文字幕亚洲无线| 国产精品欧美久久久久一区二区| 中文字幕av免费专区久久| 日韩理论片网站| 日韩影视精彩在线| 国产一区二区在线观看视频| 国产成人啪午夜精品网站男同| 波多野结衣一区二区三区 | 51久久夜色精品国产麻豆| 日韩免费在线观看| 久久久99免费| 亚洲免费观看高清完整版在线观看熊| 亚洲一区二区三区四区在线免费观看| 无码av中文一区二区三区桃花岛| 美女免费视频一区二区| 成人一区在线观看| 欧美日韩国产小视频| 久久久久久麻豆| 亚洲国产成人porn| 国产成人自拍高清视频在线免费播放| 一本久久精品一区二区| 欧美一级日韩一级| 国产精品国产三级国产有无不卡 | 欧美最猛黑人xxxxx猛交| 日韩一区二区三区在线| 国产精品无遮挡| 欧美a级一区二区| 91一区二区在线| 精品国产凹凸成av人导航| 亚洲男人电影天堂| 激情综合一区二区三区| 在线视频一区二区免费| www日韩大片| 爽爽淫人综合网网站| 成人免费福利片| 精品成a人在线观看| 亚洲国产视频在线| 99久久99久久综合| 26uuu久久综合| 午夜精品一区二区三区电影天堂| 从欧美一区二区三区| 精品日韩在线观看| 亚洲成人7777| 色诱亚洲精品久久久久久| 国产亚洲1区2区3区| 99久久精品国产一区二区三区| 在线播放日韩导航| 日韩码欧中文字| 懂色av一区二区夜夜嗨| 精品久久久久久久久久久院品网| 午夜久久久久久| 日本丶国产丶欧美色综合| 国产精品久久久久国产精品日日| 美日韩一级片在线观看| 欧美日韩国产123区| 亚洲综合色成人| 色域天天综合网| 亚洲美女一区二区三区| 丰满放荡岳乱妇91ww| 久久久久久免费网| 国产精品一区免费在线观看| 日韩精品一区二区三区三区免费| 石原莉奈在线亚洲三区| 欧美日韩国产系列| 丝袜美腿亚洲综合| 欧美二区三区的天堂| 丝袜亚洲另类欧美综合| 91麻豆精品国产91久久久久| 亚洲第一搞黄网站| 678五月天丁香亚洲综合网|