Bug 157793 [PropertiesDialog] 'Resource' and 'Project References' property page fail if modifying closed project
I20060919-0010. The 'Resource' and the 'Project References' property page fail if modifying closed project 1. create a simple project and close it 2. context menu > Properties 3. change some preferences (e.g. the encoding) 4. click OK ==> !ENTRY org.eclipse.core.resources 4 4 2006-09-19 14:27:10.024 !MESSAGE Exception occurred while saving project preferences: /Simple Closed/.settings/org.eclipse.core.runtime.prefs. !STACK 1 org.eclipse.core.internal.resources.ResourceException: Resource '/Simple Closed' is not open. at org.eclipse.core.internal.resources.Project.checkAccessible(Project.java:145) at org.eclipse.core.internal.resources.Folder.assertCreateRequirements(Folder.java:32) at org.eclipse.core.internal.resources.Folder.create(Folder.java:88) at org.eclipse.core.internal.resources.ProjectPreferences$2.run(ProjectPreferences.java:551) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1737) at org.eclipse.core.internal.resources.ProjectPreferences.save(ProjectPreferences.java:566) at org.eclipse.core.internal.preferences.EclipsePreferences.flush(EclipsePreferences.java:352) at org.eclipse.core.internal.resources.ProjectPreferences.flush(ProjectPreferences.java:364) at org.eclipse.ui.internal.ide.LineDelimiterEditor.store(LineDelimiterEditor.java:270) at org.eclipse.ui.internal.ide.dialogs.ResourceInfoPage.performOk(ResourceInfoPage.java:569) at org.eclipse.jface.preference.PreferenceDialog$11.run(PreferenceDialog.java:889) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.core.runtime.Platform.run(Platform.java:850) at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:149) at org.eclipse.jface.preference.PreferenceDialog.okPressed(PreferenceDialog.java:869) at org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog.okPressed(FilteredPreferenceDialog.java:377) at org.eclipse.jface.preference.PreferenceDialog.buttonPressed(PreferenceDialog.java:230) at org.eclipse.jface.dialogs.Dialog$3.widgetSelected(Dialog.java:638) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:90) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3390) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3009) at org.eclipse.jface.window.Window.runEventLoop(Window.java:820) at org.eclipse.jface.window.Window.open(Window.java:796) at org.eclipse.ui.dialogs.PropertyDialogAction.run(PropertyDialogAction.java:156) at org.eclipse.jface.action.Action.runWithEvent(Action.java:499) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:539) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:400) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3390) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3009) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:104) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:74) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:348) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:165) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:341) at org.eclipse.core.launcher.Main.basicRun(Main.java:285) at org.eclipse.core.launcher.Main.run(Main.java:987) at org.eclipse.core.launcher.Main.main(Main.java:962) !SUBENTRY 1 org.eclipse.core.resources 4 372 2006-09-19 14:27:10.024 !MESSAGE Resource '/Simple Closed' is not open. !ENTRY org.eclipse.ui.ide 4 4 2006-09-19 14:27:10.034 !MESSAGE Exception occurred while saving project preferences: /Simple Closed/.settings/org.eclipse.core.runtime.prefs. !ENTRY org.eclipse.ui.ide 4 4 2006-09-19 14:27:10.034 !MESSAGE Exception occurred while saving project preferences: /Simple Closed/.settings/org.eclipse.core.runtime.prefs. !STACK 0 org.osgi.service.prefs.BackingStoreException: Exception occurred while saving project preferences: /Simple Closed/.settings/org.eclipse.core.runtime.prefs. at org.eclipse.core.internal.resources.ProjectPreferences.save(ProjectPreferences.java:574) at org.eclipse.core.internal.preferences.EclipsePreferences.flush(EclipsePreferences.java:352) at org.eclipse.core.internal.resources.ProjectPreferences.flush(ProjectPreferences.java:364) at org.eclipse.ui.internal.ide.LineDelimiterEditor.store(LineDelimiterEditor.java:270) at org.eclipse.ui.internal.ide.dialogs.ResourceInfoPage.performOk(ResourceInfoPage.java:569) at org.eclipse.jface.preference.PreferenceDialog$11.run(PreferenceDialog.java:889) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.core.runtime.Platform.run(Platform.java:850) at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:149) at org.eclipse.jface.preference.PreferenceDialog.okPressed(PreferenceDialog.java:869) at org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog.okPressed(FilteredPreferenceDialog.java:377) at org.eclipse.jface.preference.PreferenceDialog.buttonPressed(PreferenceDialog.java:230) at org.eclipse.jface.dialogs.Dialog$3.widgetSelected(Dialog.java:638) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:90) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3390) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3009) at org.eclipse.jface.window.Window.runEventLoop(Window.java:820) at org.eclipse.jface.window.Window.open(Window.java:796) at org.eclipse.ui.dialogs.PropertyDialogAction.run(PropertyDialogAction.java:156) at org.eclipse.jface.action.Action.runWithEvent(Action.java:499) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:539) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:400) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3390) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3009) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:104) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:74) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:348) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:165) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:341) at org.eclipse.core.launcher.Main.basicRun(Main.java:285) at org.eclipse.core.launcher.Main.run(Main.java:987) at org.eclipse.core.launcher.Main.main(Main.java:962)
bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/dialogs/ResourceInfoPage.java
private void createSeparator(Composite composite) {
		Label separator = new Label(composite, SWT.SEPARATOR | SWT.HORIZONTAL);
		GridData gridData = new GridData();
		gridData.horizontalAlignment = GridData.FILL;
		gridData.grabExcessHorizontalSpace = true;
		separator.setLayoutData(gridData);
	}
	/**
	 * Create the group that shows the read only state and the timestamp.
	 * 
	 * @param parent
	 *            the composite the group will be created in
	 * @param resource
	 *            the resource the information is being taken from.
	 */
	private void createStateGroup(Composite parent, IResource resource) {
		Font font = parent.getFont();
		Composite composite = new Composite(parent, SWT.NULL);
		GridLayout layout = new GridLayout();
		layout.numColumns = 2;
		layout.marginWidth = 0;
		layout.marginHeight = 0;
		composite.setLayout(layout);
		GridData data = new GridData();
		data.horizontalAlignment = GridData.FILL;
		composite.setLayoutData(data);
		composite.setFont(font);
		Label timeStampLabel = new Label(composite, SWT.NONE);
		timeStampLabel.setText(TIMESTAMP_TITLE);
		timeStampLabel.setFont(font);