---
title: "保存dialog的位置和大小"
author: "xmind"
date: "2015-09-08T11:04:29Z"
tags: []
categories: ["编程语言"]
slug: "dialog"
draft: false
lastmod: "2015-09-08T11:04:29Z"
id: 2241579
url: "https://xmind.iteye.com/blog/2241579"
---

```
/*
	@Override
	protected IDialogSettings getDialogBoundsSettings() {
		IDialogSettings dialogSettings = Activator.getDefault().getDialogSettings();
		String dialogKey = EventSearchDialog.class.getCanonicalName();
		IDialogSettings boundsSettings = dialogSettings.getSection(dialogKey);
		if (boundsSettings == null) {
			boundsSettings = dialogSettings.addNewSection(dialogKey);
		}
		return boundsSettings;
	}
*/
```

 

不管使用JFace的dialog，或者SWT的dialog。覆盖getDialogBoundsSettings方法就行了。