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

📄 oldzdj.java

📁 有限自动机输入,转换,识别,图形显示与化简
💻 JAVA
字号:
package cn.work.zdj.ui;

import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.ui.part.ViewPart;

import cn.work.zdj.sys.AutoMachineFactory;

public class OldZdj extends ViewPart{
	private static TableViewer tableViewer;
	
	public OldZdj() {
		// TODO 自动生成构造函数存根
	}
	
	public TableViewer getTableViewer() {
		return tableViewer;
	}

	@Override
	public void createPartControl(Composite parent) {
		// TODO 自动生成方法存根
		tableViewer = new TableViewer(parent,SWT.SINGLE|SWT.H_SCROLL);
		tableViewer.setUseHashlookup(true);
		
		final Table table = tableViewer.getTable();
		table.setHeaderVisible(true);
		table.setLinesVisible(true);
		table.setLayoutData(new GridData(GridData.FILL_BOTH));
		TableColumn tableColumn = new TableColumn(table,SWT.NONE);
		tableColumn.setText("已输入自动机名称");
		tableColumn.setWidth(115);
		
		TableColumn tableColumn2 = new TableColumn(table,SWT.NONE);
		tableColumn2.setText("类型");
		tableColumn2.setWidth(50);
		tableViewer.setContentProvider(new ZdjContentProvider());
		tableViewer.setLabelProvider(new ZdjLabelProvider());
		
		getViewSite().setSelectionProvider(tableViewer);
	}

	@Override
	public void setFocus() {
		// TODO 自动生成方法存根

	}

	public static void selectionChanged() {
		// TODO 自动生成方法存根
		tableViewer.setInput(AutoMachineFactory.getInstance().getMachines());
		tableViewer.getTable().select(0);
		//tableViewer.getTable().select(0);
		//MessageDialog.openError(null,"提示",AutoMachineFactory.getInstance().getMachines().toString());
	}

}

⌨️ 快捷键说明

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