`
sunway
  • 浏览: 114736 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

记录swt对话框上次打开的地址

阅读更多
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Set;

import org.dom4j.Attribute;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.Element;
import org.dom4j.Node;
import org.dom4j.io.SAXReader;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.jface.dialogs.DialogSettings;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.viewers.CellEditor;
import org.eclipse.jface.viewers.CheckboxCellEditor;
import org.eclipse.jface.viewers.CheckboxTableViewer;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
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.Control;
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.Text;

import utils.system;


/**
 * 扩展属性过滤对话框
 * 
 * @author sunway
 * 
 */
public class ExtendedAttributeFilterDialog extends WorkflowDialog implements
		SelectionListener, ISelectionChangedListener {

	private ExtendedAttributes resultExtendedAttributes;
	private ExtendedAttributes sourceExtendedAttributes;
	private TableViewer tableViewer;
	private CheckboxTableViewer ctv;
	private Table table;
	private GridData gridData;
	private Button openBtn;
	private String fileFullPath;
	private Text fileFullPathText;
	private String lastFileFullPath = "";
	private String projectPath= "";

	/**
	 * 创建c:\temp\opendDialogPath.xml文件
	 * 
	 * @return
	 */
	private File getDialogConfigFile() {
		String parent = getProjectPath() + File.separator + ".settings";
		File dir = new File(parent);
		File file = new File(parent + File.separator
				+ "opendDialogPath.xml");
		try {
			if (!dir.exists()) {
				if (dir.mkdir()) {
					if (!file.exists()) {
						file.createNewFile();

					}
				}

			}
			if (!file.exists()) {
				file.createNewFile();

			}
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return file;

	}

	public String getLastFileFullPath() {
		return this.lastFileFullPath;
	}

	public void setFileFullPath(String fileFullPath) {
		this.fileFullPath = fileFullPath;
	}

	public ExtendedAttributes getSourceExtendedAttributes() {
		return sourceExtendedAttributes;
	}

	public void setSourceExtendedAttributes(
			ExtendedAttributes sourceExtendedAttributes) {
		this.sourceExtendedAttributes = sourceExtendedAttributes;
	}

	public ExtendedAttributes getResultExtendedAttributes() {
		return resultExtendedAttributes;
	}

	public ExtendedAttributeFilterDialog(Shell parentShell) {
		super(parentShell);
		// TODO Auto-generated constructor stub
	}

	protected Control createDialogArea(Composite parent) {
		setTitle(DialogMessages
				.getString("ExtendedAttributeFilterDialog.title")); //$NON-NLS-1$
		setMessage(DialogMessages
				.getString("ExtendedAttributeFilterDialog.message")); //$NON-NLS-1$
		setHelpAvailable(false);
		Composite container = (Composite) super.createDialogArea(parent);

		createDialogContext(container);
		this.initTableViewer();

		return container;
	}

	private void createDialogContext(Composite parent) {
		Composite container = new Composite(parent, SWT.NONE);
		GridData gdGroup = new GridData(GridData.FILL_BOTH);
		// gdGroup.widthHint = 600;
		container.setLayoutData(gdGroup);
		GridLayout gridLayout = new GridLayout();
		gridLayout.verticalSpacing = 4;
		gridLayout.numColumns = 2;
		gridLayout.marginWidth = 10;
		gridLayout.marginTop = 10;
		container.setLayout(gridLayout);

		Group group = new Group(container, SWT.NONE);
		GridLayout gl = new GridLayout();
		gl.numColumns = 2;
		gl.marginWidth = 10;
		group.setLayout(gl);
		group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
		group.setText(DialogMessages
				.getString("ExtendedAttributeFilterDialog.xpdlFile"));//$NON-NLS-1$

		openBtn = new Button(group, SWT.OPEN);
		openBtn.setText(DialogMessages
				.getString("ExtendedAttributeFilterDialog.browserButton"));//$NON-NLS-1$
		openBtn.addSelectionListener(this);

		fileFullPathText = new Text(group, SWT.BORDER);
		fileFullPathText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
		// 默认选中上次打开的页面
		String fullPath = loadFileFullPath();
		if (fullPath == null || fullPath == "" || fullPath.equals("")) {
			fileFullPathText.setText(fileFullPath);
		} else {
			fileFullPathText.setText(fullPath);
		}
		fileFullPathText.addSelectionListener(this);

		tableViewer = new TableViewer(container, SWT.CHECK | SWT.MULTI
				| SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL | SWT.FULL_SELECTION);
		// checkboxViewer
		ctv = new CheckboxTableViewer(tableViewer.getTable());
		ctv.setContentProvider(new ExtendedAttributeFilterContentProvider());
		ctv.setLabelProvider(new ExtendedAttributeFilterLabelProvider());
		ctv.addSelectionChangedListener(this);
		ctv
				.setColumnProperties(new String[] {
						DialogMessages
								.getString("ExtendedAttributeFilterDialog.nameColumnProperties"), DialogMessages.getString("ExtendedAttributeFilterDialog.valueColumnProperties") }); //$NON-NLS-1$ //$NON-NLS-2$

		table = tableViewer.getTable();
		table.setLinesVisible(true);
		table.setHeaderVisible(true);
		gridData = new GridData(GridData.FILL_BOTH);
		gridData.horizontalSpan = 2;
		table.setLayoutData(gridData);
	}

	private void initTableViewer() {
		// TODO Auto-generated method stub
		final TableColumn nameCol = new TableColumn(table, SWT.NONE);
		nameCol.setText(DialogMessages
				.getString("ExtendedAttributeFilterDialog.nameTableColumn")); //$NON-NLS-1$
		nameCol.setWidth((getInitialSize().x - 35) / 2);

		final TableColumn valueCol = new TableColumn(table, SWT.NONE);
		valueCol.setText(DialogMessages
				.getString("ExtendedAttributeFilterDialog.valueTableColumn")); //$NON-NLS-1$
		valueCol.setWidth((getInitialSize().x - 35) / 2);

		CellEditor[] cellEditor = new CellEditor[table.getColumnCount() + 1];
		cellEditor[table.getColumnCount() - 1] = new CheckboxCellEditor(
				tableViewer.getTable());

		this.ctv.setCellEditors(cellEditor);
		this.table.setHeaderVisible(true);
		this.table.setLinesVisible(true);
		this.ctv.addSelectionChangedListener(this);
		this.ctv.setColumnProperties(new String[] { "name", "value" });
		String filePath = this.fileFullPathText.getText();
		if (filePath.endsWith("xml")) {// 简单处理
			this.ctv.setInput(getExtendedAttributes(filePath));

		} else {
			this.ctv
					.setInput(filterConfigExtendedAttributes(filterDuplicateExtendedAttributes(getExtendedAttributes(filePath))));
		}
	}

	@Override
	protected void createButtonsForButtonBar(Composite parent) {
		// TODO Auto-generated method stub
		super.createButtonsForButtonBar(parent);
		dialogChanged();
		setErrorMessage(null);
	}

	@Override
	protected Point getInitialSize() {
		return new Point(520, 560);
	}

	@Override
	protected void configureShell(Shell newShell) {
		// TODO Auto-generated method stub
		super.configureShell(newShell);
		newShell.setText(DialogMessages
				.getString("ExtendedAttributeFilterDialog.shellText")); //$NON-NLS-1$
	}


	@Override
	protected void buttonPressed(int buttonId) {
		// TODO Auto-generated method stub
		this.resultExtendedAttributes = (ExtendedAttributes) this.sourceExtendedAttributes
				.clone();
		this.resultExtendedAttributes.clear();
		if (buttonId == IDialogConstants.OK_ID) {
			Object[] object = ctv.getCheckedElements();
			if (object.length > 0) {
				for (int i = 0, n = object.length; i < n; i++) {
					ExtendedAttribute bean = (ExtendedAttribute) object[i];
					this.resultExtendedAttributes.add(bean);
				}

			}
		}
		// 保存上次打开的文件路径
		saveFileFullPath();
		super.buttonPressed(buttonId);
	}

	private IDialogSettings getDialogTopSettings() {
		IDialogSettings settings = new DialogSettings("root");
		try {
			File file = getDialogConfigFile();
			settings.load(file.getAbsolutePath());
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return settings;

	}

	/**
	 * 从c:\temp\dialogPath.xml文件中取出上次打开的文件路径
	 * 
	 * @return
	 */
	private String loadFileFullPath() {
		// TODO Auto-generated method stub
		String result = "";
		IDialogSettings topSettings = getDialogTopSettings();
		IDialogSettings settings = topSettings.getSection("Dialog");
		if (settings == null) {
			return result;
		} else {
			result = settings.get("path");
		}
		return result;
	}

	/**
	 * 保存上次打开的对话框路径到c:\temp\dialogPath.xml文件中
	 */
	private void saveFileFullPath() {
		// TODO Auto-generated method stub
		IDialogSettings topSettings = getDialogTopSettings();
		IDialogSettings settings = topSettings.getSection("Dialog");
		if (settings == null) {
			settings = topSettings.addNewSection("Dialog");
		}

		settings.put("path", this.fileFullPathText.getText());
		try {
			topSettings.save(getDialogConfigFile().getAbsolutePath());
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}


	public void widgetDefaultSelected(SelectionEvent e) {
		// TODO Auto-generated method stub

	}

	public void widgetSelected(SelectionEvent e) {
		// TODO Auto-generated method stub
		if (e.getSource().equals(this.openBtn)) {
			// 打开文件选择对话框
			FileDialog fd = new FileDialog(WorkflowProjectUtils
					.getActiveShell(), SWT.OPEN);
			fd.setFilterExtensions(new String[] { "*.xpdl", "*.xml" });
			String fileFullPath = fd.open();
			fileFullPathText.setText(fileFullPath);

			if (fileFullPath.endsWith("xml")) {// 简单处理
				this.ctv.setInput(getExtendedAttributes(fileFullPath));
			} else
				this.ctv
						.setInput(filterConfigExtendedAttributes(filterDuplicateExtendedAttributes(getExtendedAttributes(this.fileFullPathText
								.getText()))));
		}
		if (e.getSource().equals(this.fileFullPathText)) {
			// 先过滤掉重复的扩展属性
			this.ctv
					.setInput(filterConfigExtendedAttributes(filterDuplicateExtendedAttributes(getExtendedAttributes(this.fileFullPathText
							.getText()))));
		}
	}

	public void selectionChanged(SelectionChangedEvent event) {
		// TODO Auto-generated method stub

	}

	/**
	 * 过滤掉配置文件里有的ExtendedAttribute
	 */
	private ExtendedAttributes filterConfigExtendedAttributes(
			ExtendedAttributes parent) {
		if (parent != null) {
			ExtendedAttributes result = (ExtendedAttributes) parent.clone();
			Set<String> set = WorkflowProjectUtils
					.getConfigExtendedAttributesName();
			Iterator<ExtendedAttribute> extendedAttributeIt = result
					.toElements().iterator();
			while (extendedAttributeIt.hasNext()) {
				ExtendedAttribute extendedAttribute = extendedAttributeIt
						.next();
				if (set.contains(extendedAttribute.getName())) {
					// 删除这个ExtendedAttribute
					result.remove(extendedAttribute);
				}
			}
			return result;
		}
		return null;
	}

	/**
	 * 过滤掉一个ExtendedAttributes重复的ExtendedAttribute
	 */
	private ExtendedAttributes filterDuplicateExtendedAttributes(
			ExtendedAttributes parent) {
		if (parent != null) {
			try {
				ArrayList<ExtendedAttribute> extendedAttributeList = parent
						.toElements();
				Iterator<ExtendedAttribute> extendedAttributeIt = extendedAttributeList
						.iterator();

				ExtendedAttributes extendedAttributes = (ExtendedAttributes) parent
						.clone();
				extendedAttributes.clear();
				while (extendedAttributeIt.hasNext()) {
					ExtendedAttribute extendedAttribute = extendedAttributeIt
							.next();
					if (!extendedAttributes.contains(extendedAttribute)) {
						extendedAttributes.add(extendedAttribute);
					}
				}
				return extendedAttributes;

			} catch (Exception ex) {
				// TODO: handle exception
				ex.printStackTrace();
			}

		}
		return null;
	}

	/**
	 * 向一个ExtendedAttributes里添加另一个ExtendedAttributes的所有元素
	 */
	private ExtendedAttributes addExtendedAttributes(ExtendedAttributes parent,
			ExtendedAttributes children) {
		if (children != null) {
			ArrayList<ExtendedAttribute> extendedAttributeList = children
					.toElements();
			Iterator<ExtendedAttribute> extendedAttributeIt = extendedAttributeList
					.iterator();
			while (extendedAttributeIt.hasNext()) {
				parent.add(extendedAttributeIt.next());
			}
		}
		return parent;
	}

	/**
	 * 根据文件路径得到所有的扩展属性
	 * 
	 * @param fileFullPath
	 * @return
	 */
	public ExtendedAttributes getExtendedAttributes(String fileFullPath) {
		ExtendedAttributes parent = null;
		if (fileFullPath.endsWith("xpdl")) {
			Package pkg = XpdlUtils.loadPageckFromFile(fileFullPath, null);
			if (pkg == null || pkg.equals("")) {
				return null;
			}

			// 如果是包的扩展属性
			if (getSourceExtendedAttributes().getParent() instanceof Package) {
				parent = (ExtendedAttributes) pkg.getExtendedAttributes()
						.clone();
			}
			// 如果是流程的扩展属性
			if (getSourceExtendedAttributes().getParent() instanceof WorkflowProcess) {
				WorkflowProcesses workflowProcesses = pkg
						.getWorkflowProcesses();
				ArrayList<WorkflowProcess> arrayList = workflowProcesses
						.toElements();
				Iterator<WorkflowProcess> it = arrayList.iterator();
				ExtendedAttributes workflowProcessParent = null;
				while (it.hasNext()) {
					WorkflowProcess workflowProcess = it.next();
					ExtendedAttributes extendedAttributes = workflowProcess
							.getExtendedAttributes();
					if (workflowProcessParent == null) {
						workflowProcessParent = (ExtendedAttributes) extendedAttributes
								.clone();
					} else {
						// workflowProcessParent.add(extendedAttributes);
						addExtendedAttributes(workflowProcessParent,
								extendedAttributes);

					}
				}
				if (workflowProcessParent != null) {
					parent = (ExtendedAttributes) workflowProcessParent.clone();
				}
			}

			// 如果是活动的扩展属性
			if (getSourceExtendedAttributes().getParent() instanceof Activity) {
				WorkflowProcesses workflowProcesses = pkg
						.getWorkflowProcesses();
				ArrayList<WorkflowProcess> arrayList = workflowProcesses
						.toElements();
				Iterator<WorkflowProcess> it = arrayList.iterator();
				ExtendedAttributes workflowProcessParent = null;
				while (it.hasNext()) {
					WorkflowProcess workflowProcess = it.next();

					Activities activities = workflowProcess.getActivities();
					ArrayList<Activity> activityArrayList = activities
							.toElements();
					Iterator<Activity> activityIt = activityArrayList
							.iterator();
					ExtendedAttributes activityParent = null;
					while (activityIt.hasNext()) {
						Activity activity = activityIt.next();
						ExtendedAttributes extendedAttributes = activity
								.getExtendedAttributes();
						if (activityParent == null) {
							activityParent = (ExtendedAttributes) extendedAttributes
									.clone();
						} else {
							addExtendedAttributes(activityParent,
									extendedAttributes);
						}

					}
					if (workflowProcessParent == null) {
						if (activityParent != null) {
							workflowProcessParent = (ExtendedAttributes) activityParent
									.clone();
						}

					} else {
						addExtendedAttributes(workflowProcessParent,
								activityParent);
					}

				}
				if (workflowProcessParent != null) {
					parent = (ExtendedAttributes) workflowProcessParent.clone();

				}
			}
			// 如果是转移的扩展属性
			if (getSourceExtendedAttributes().getParent() instanceof Transition) {
				WorkflowProcesses workflowProcesses = pkg
						.getWorkflowProcesses();
				ArrayList<WorkflowProcess> arrayList = workflowProcesses
						.toElements();
				Iterator<WorkflowProcess> it = arrayList.iterator();
				ExtendedAttributes workflowProcessParent = null;
				while (it.hasNext()) {
					WorkflowProcess workflowProcess = it.next();
					Transitions transitions = workflowProcess.getTransitions();
					ArrayList<Transition> transitionArrayList = transitions
							.toElements();
					Iterator<Transition> transitionIt = transitionArrayList
							.iterator();
					ExtendedAttributes transitionParent = null;
					while (transitionIt.hasNext()) {
						Transition transition = transitionIt.next();
						ExtendedAttributes extendedAttributes = transition
								.getExtendedAttributes();
						if (transitionParent == null) {
							transitionParent = (ExtendedAttributes) extendedAttributes
									.clone();
						} else {
							addExtendedAttributes(transitionParent,
									extendedAttributes);
						}
					}
					if (workflowProcessParent == null) {
						if (transitionParent != null) {
							workflowProcessParent = (ExtendedAttributes) transitionParent
									.clone();
						}

					} else {
						addExtendedAttributes(workflowProcessParent,
								transitionParent);
					}
				}
				if (workflowProcessParent != null) {
					parent = (ExtendedAttributes) workflowProcessParent.clone();
				}

			}
			// 如果是参与者的扩展属性
			if (getSourceExtendedAttributes().getParent() instanceof Participant) {
				WorkflowProcesses workflowProcesses = pkg
						.getWorkflowProcesses();
				ArrayList<WorkflowProcess> arrayList = workflowProcesses
						.toElements();
				Iterator<WorkflowProcess> it = arrayList.iterator();
				ExtendedAttributes workflowProcessParent = null;
				while (it.hasNext()) {
					WorkflowProcess workflowProcess = it.next();
					Participants participants = workflowProcess
							.getParticipants();
					ArrayList<Participant> participantArrayList = participants
							.toElements();
					Iterator<Participant> participantIt = participantArrayList
							.iterator();
					ExtendedAttributes participantParent = null;
					while (participantIt.hasNext()) {
						Participant participant = participantIt.next();
						ExtendedAttributes extendedAttributes = participant
								.getExtendedAttributes();
						if (participantParent == null) {
							participantParent = (ExtendedAttributes) extendedAttributes
									.clone();
						} else {
							addExtendedAttributes(participantParent,
									extendedAttributes);
						}
					}
					if (workflowProcessParent == null) {
						if (participantParent != null) {
							workflowProcessParent = (ExtendedAttributes) participantParent
									.clone();
						}

					} else {
						addExtendedAttributes(workflowProcessParent,
								participantParent);
					}
				}
				if (workflowProcessParent != null) {
					parent = (ExtendedAttributes) workflowProcessParent.clone();
				}
			}
			// 如果是数据类型的扩展属性
			if (getSourceExtendedAttributes().getParent() instanceof DataField) {
				// 如果是包级的数据类型
				if (getSourceExtendedAttributes().getParent().getParent()
						.getParent() instanceof Package) {
					DataFields dataFields = pkg.getDataFields();
					ArrayList<DataField> dataFieldArrayList = dataFields
							.toElements();
					Iterator<DataField> dataFieldIt = dataFieldArrayList
							.iterator();
					ExtendedAttributes dataFieldParent = null;
					while (dataFieldIt.hasNext()) {
						DataField dataField = dataFieldIt.next();
						ExtendedAttributes extendedAttributes = dataField
								.getExtendedAttributes();
						if (dataFieldParent == null) {
							dataFieldParent = (ExtendedAttributes) extendedAttributes
									.clone();
						} else {
							addExtendedAttributes(dataFieldParent,
									extendedAttributes);
						}
					}

					if (dataFieldParent != null) {
						parent = (ExtendedAttributes) dataFieldParent.clone();
					}
				}
				// 如果是流程级的数据类型
				if (getSourceExtendedAttributes().getParent().getParent()
						.getParent() instanceof WorkflowProcess) {
					WorkflowProcesses workflowProcesses = pkg
							.getWorkflowProcesses();
					ArrayList<WorkflowProcess> arrayList = workflowProcesses
							.toElements();
					Iterator<WorkflowProcess> it = arrayList.iterator();
					ExtendedAttributes workflowProcessParent = null;
					while (it.hasNext()) {
						WorkflowProcess workflowProcess = it.next();
						DataFields dataFields = workflowProcess.getDataFields();
						ArrayList<DataField> dataFieldArrayList = dataFields
								.toElements();
						Iterator<DataField> dataFieldIt = dataFieldArrayList
								.iterator();
						ExtendedAttributes dataFieldParent = null;
						while (dataFieldIt.hasNext()) {
							DataField dataField = dataFieldIt.next();
							ExtendedAttributes extendedAttributes = dataField
									.getExtendedAttributes();
							if (dataFieldParent == null) {
								dataFieldParent = (ExtendedAttributes) extendedAttributes
										.clone();
							} else {
								addExtendedAttributes(dataFieldParent,
										extendedAttributes);
							}
						}
						if (workflowProcessParent == null) {
							if (dataFieldParent != null) {
								workflowProcessParent = (ExtendedAttributes) dataFieldParent
										.clone();
							}

						} else {
							addExtendedAttributes(workflowProcessParent,
									dataFieldParent);
						}
					}
					if (workflowProcessParent != null) {
						parent = (ExtendedAttributes) workflowProcessParent
								.clone();
					}
				}

			}
		}
		// 如果打开的是xml文件
		if (fileFullPath.endsWith("xml")) {
			try {
				parent = (ExtendedAttributes) this.sourceExtendedAttributes
						.clone();
				parent.clear();

				SAXReader reader = new SAXReader();
				Document document = reader.read(new File(fileFullPath));

				Node root = document
						.selectSingleNode("//beans/bean/property/props");
				List<Element> list = root.selectNodes(".//prop");

				Iterator<Element> it = list.iterator();
				while (it.hasNext()) {
					Element element = it.next();
					Attribute attribute = element.attribute("key");
					String value = attribute.getValue();
					ExtendedAttribute extendedAttribute = new ExtendedAttribute(
							parent);
					extendedAttribute.setName("URL");
					extendedAttribute.setVValue(value.substring(1));// 去掉开始的斜杠
					parent.add(extendedAttribute);
				}
			} catch (DocumentException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}

		}

		return parent;
	}

	@Override
	protected void dialogChanged() {
		// TODO Auto-generated method stub

	}

	public void setProjectPath(String projectPath) {
		// TODO Auto-generated method stub
		this.projectPath = projectPath;
	}

	public String getProjectPath() {
		return projectPath;
	}

}

 

分享到:
评论
1 楼 zhaofangtao 2009-05-20  
hi
你这个示例是在 3.2还是3.4的??

我的3.4里怎么没有
org.eclipse.jface.viewers.CellEditor;
org.eclipse.jface.viewers.ICellModifier;
呢?

相关推荐

    SWT 弹出对话框 可以选择的图标种类

    SWT(Standard Widget Toolkit)是Java编程中用于创建图形用户界面(GUI)的一种库,它为开发者提供了丰富的控件和对话框。在SWT中,`MessageBox`是一个用于显示简单的消息对话框的类,通常用来向用户显示警告、确认...

    SWT或Applet打开Office文件

    2. **SWT或Applet客户端**:在SWT应用中,你可以创建一个按钮或菜单项,当用户点击时触发文件选择对话框,获取到本地文件路径后,发送请求到服务器端。在Applet中,用户可能需要通过上传文件的方式,或者通过JNLP...

    Eclipse SWT 黑客帝国炫酷动态背景登录对话框

    在这个项目"黑客帝国炫酷动态背景登录对话框"中,开发者利用Eclipse SWT和JFace的技术,创造了一个独特的登录对话框。对话框的背景不再是静态的,而是动态的黑客帝国风格的字符雨效果,这种效果通常由快速下落的绿色...

    JAVA.SWTJFace JFace篇之向导式对话框.wps

    主要讲述了Jface向导式对话框的编写及代码。能够正确的运行在Eclipse中,希望能帮有所帮助

    swt-64.rar_64位swt_64的SWT_SWT64_swt.jar 64位_swt64位

    此外,SWT还支持事件处理、布局管理以及对话框等特性,使得开发者可以方便地构建复杂的用户界面。 为了在64位Java环境中使用这个库,开发人员需要确保他们的Java开发环境(JDK)也是64位的,因为32位的JDK无法识别...

    在swt开发中实现的一个小小的日历对话框

    ### 在SWT开发中实现的日历对话框 #### 概述 SWT(Standard Widget Toolkit)是Eclipse平台上的一种用于创建图形用户界面的工具包。它提供了丰富的组件库,允许开发者构建高性能、外观本地化的应用程序。本文将...

    jface对话框

    swt、jface对话框

    swt 使用基本控件与对话框

    第4章 使用基本控件与对话框.pdf 第4章 使用基本控件与对话框.pdf eclipse插件开发笔记,使用基本控件与对话框

    SWT视频播放器

    5. **文件选择对话框**:为了打开视频文件,播放器通常会提供一个文件选择对话框。在SWT中,可以使用FileDialog类来实现这一功能。 6. **多线程处理**:为了保证界面的响应性,视频播放通常在后台线程进行,防止...

    使Excel嵌入到SWT窗口中

    使Excel嵌入到SWT窗口中 知识点一:Eclipse版本和jdk版本的选择 在本例中,我们使用的是Eclipse 3.3.1版本和jdk 5.0版本。Eclipse是一个开源的集成开发环境(IDE),它支持多种编程语言,包括Java、C++、Python等...

    SWT源码 swt.jar

    3. 功能丰富:SWT提供了丰富的GUI组件,包括表、树、菜单、对话框等,满足大多数GUI需求。 4. 良好的事件处理机制:SWT支持事件驱动编程,允许开发者响应用户的操作。 5. 跨平台:虽然SWT依赖于特定操作系统的库,但...

    SWT配置 SWT配置 SWT配置 SWT配置 SWT配置

    - **打开运行配置对话框**:通过菜单`Run` -&gt; `Run Configurations...`访问运行配置。 - **创建新的Java应用程序配置**:选择`Java Application`类别,点击`New`按钮创建新配置。 - **指定VM Arguments**:在配置...

    SWT界面设计PDF

    你将学习如何导入和使用SWT库,创建窗口和对话框,以及添加各种控件。这份教程还会讲解如何通过布局管理器组织控件,以达到理想的界面效果,以及如何编写事件处理器来响应用户的操作。 在学习SWT时,关键概念包括:...

    swt高级密笈源码swt

    4. **对话框**:SWT提供了诸如消息对话框(MessageDialog)、输入对话框(InputDialog)和文件选择对话框(FileDialog)等,学习如何创建和使用这些对话框,可以增强应用的交互性。 5. **拖放操作**:SWT支持拖放...

    swt小技巧,SWT的SHELL样式

    例如,在创建一个模态对话框时,我们可以使用`SWT.APPLICATION_MODAL`样式,并结合其他样式如`SWT.TITLE`和`SWT.CLOSE`等。 以下是一个简单的示例代码片段,展示了如何创建一个具有标题栏和关闭按钮的模态对话框: ...

    最全的SWT示例(绝对最全),上次文件损坏了,重传个

    这是我找到的最全的SWT示例,即使在官方网站上也非常难找,示例包括以下内容:SWT模式窗体,SWT浏览器,SWT树,SWT工具条,SWT画图工具,SWT图形,SWT各种布局,SWT剪贴板,SWT快捷键,SWT菜单,SWT文本编辑器,SWT...

    Eclipse SWT 开发参考

    - **PrintDialog控件**:用于打开打印设置对话框。 - **CCombo组件**:一种增强型的组合框组件。 - **TableEditor组件**:用于编辑表格中的单元格。 #### 5. SWT的组件布局 SWT提供了多种布局管理器,如: - **...

    SWT 插件包 (windows 环境)

    SWT提供了丰富的控件集合,如对话框、表单、菜单等,同时支持事件处理和布局管理。SWT与Eclipse的JFace库结合使用时,可以进一步简化UI开发,因为JFace提供了更高级别的抽象,简化了控件的创建和数据绑定。 **Java...

    SWT编程开发学习资料

    3. **对话框和Shell**:Shell是SWT应用程序的基本窗口,而对话框则包括消息对话框、输入对话框、文件选择对话框等,它们是用户交互的重要部分。学习如何创建和使用这些元素对于开发完整的应用程序至关重要。 4. **...

    SWT 案例之学习精华

    5. **对话框**:SWT提供了一些预定义的对话框,如MessageDialog、FileDialog等,用于提示用户信息、打开或保存文件等。这些对话框可以方便地集成到应用中,增强用户体验。 6. **拖放功能**:SWT支持拖放操作,允许...

Global site tag (gtag.js) - Google Analytics