Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.eclipseswtchartsettings to .eclipse/org.eclipse.swtchart.extensions/settings/chart.properties #402

Merged
merged 2 commits into from
Jul 16, 2024

Conversation

Mailaender
Copy link
Contributor

Currently, to resolve flathub/com.lablicate.OpenChrom#9 I need to allow writing the whole $HOME folder, which will likely be rejected by the administrators as default permission or flagged as a security problem in the app store. This reuses the existing .eclipse folder to make it easier to locate and avoids the concatenation, which is pretty unreadable and unusual in the English language.

@eselmeister
Copy link
Contributor

This leads to a FileNotFoundException:

java.io.FileNotFoundException: /home/pwenig/.eclipse/swtchart/settings (No such file or directory)
	at java.base/java.io.FileOutputStream.open0(Native Method)
	at java.base/java.io.FileOutputStream.open(FileOutputStream.java:293)
	at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:235)
	at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:123)
	at org.eclipse.jface.preference.PreferenceStore.save(PreferenceStore.java:421)
	at org.eclipse.swtchart.extensions.core.ResourceSupport.savePreferenceStore(ResourceSupport.java:118)
	at org.eclipse.swtchart.extensions.core.SeriesListUI$2.handleEvent(SeriesListUI.java:163)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:91)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5855)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1617)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1643)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1622)
	at org.eclipse.swt.widgets.TableColumn.gtk_size_allocate(TableColumn.java:426)
	at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:2606)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:6162)
	at org.eclipse.swt.internal.gtk3.GTK3.gtk_widget_size_allocate(Native Method)
	at org.eclipse.swt.widgets.Control.setBounds(Control.java:1167)
	at org.eclipse.swt.widgets.Composite.setBounds(Composite.java:1658)
	at org.eclipse.swt.widgets.Table.setBounds(Table.java:3430)
	at org.eclipse.swt.widgets.Control.setBounds(Control.java:1019)
	at org.eclipse.swt.layout.GridLayout.layout(GridLayout.java:697)
	at org.eclipse.swt.layout.GridLayout.layout(GridLayout.java:201)
	at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1877)
	at org.eclipse.swt.widgets.Composite.layout(Composite.java:1179)
	at org.eclipse.swt.widgets.Composite.layout(Composite.java:1131)
	at org.eclipse.swtchart.extensions.core.ExtendedLegendUI.setCompositeVisibility(ExtendedLegendUI.java:519)
	at org.eclipse.swtchart.extensions.core.ExtendedLegendUI.initialize(ExtendedLegendUI.java:114)
	at org.eclipse.swtchart.extensions.core.ExtendedLegendUI.createControl(ExtendedLegendUI.java:109)
	at org.eclipse.swtchart.extensions.core.ExtendedLegendUI.<init>(ExtendedLegendUI.java:85)
	at org.eclipse.swtchart.extensions.core.ScrollableChart.createLegendSection(ScrollableChart.java:1405)
	at org.eclipse.swtchart.extensions.core.ScrollableChart.createControl(ScrollableChart.java:1373)
	at org.eclipse.swtchart.extensions.core.ScrollableChart.<init>(ScrollableChart.java:162)
	at org.eclipse.swtchart.extensions.linecharts.LineChart.<init>(LineChart.java:34)
	at org.eclipse.chemclipse.ux.extension.xxd.ui.charts.ChromatogramChart.<init>(ChromatogramChart.java:58)
	at org.eclipse.chemclipse.ux.extension.xxd.ui.swt.editors.ExtendedChromatogramUI.createChromatogramChart(ExtendedChromatogramUI.java:1600)
	at org.eclipse.chemclipse.ux.extension.xxd.ui.swt.editors.ExtendedChromatogramUI.createChromatogramSection(ExtendedChromatogramUI.java:1244)
	at org.eclipse.chemclipse.ux.extension.xxd.ui.swt.editors.ExtendedChromatogramUI.createControl(ExtendedChromatogramUI.java:1229)
	at org.eclipse.chemclipse.ux.extension.xxd.ui.swt.editors.ExtendedChromatogramUI.<init>(ExtendedChromatogramUI.java:297)
	at org.eclipse.chemclipse.ux.extension.xxd.ui.editors.AbstractChromatogramEditor.createChromatogramPage(AbstractChromatogramEditor.java:487)
	at org.eclipse.chemclipse.ux.extension.xxd.ui.editors.AbstractChromatogramEditor.createEditorPages(AbstractChromatogramEditor.java:482)
	at org.eclipse.chemclipse.ux.extension.xxd.ui.editors.AbstractChromatogramEditor.initialize(AbstractChromatogramEditor.java:273)
	at org.eclipse.chemclipse.ux.extension.xxd.ui.editors.AbstractChromatogramEditor.<init>(AbstractChromatogramEditor.java:150)
	at org.eclipse.chemclipse.ux.extension.xxd.ui.editors.ChromatogramEditor.<init>(ChromatogramEditor.java:28)
	at org.eclipse.chemclipse.ux.extension.xxd.ui.editors.ChromatogramEditorMSD.<init>(ChromatogramEditorMSD.java:32)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
	at org.eclipse.e4.core.internal.di.ConstructorRequestor.execute(ConstructorRequestor.java:43)
	at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:384)
	at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:312)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:203)
	at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:90)
	at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:59)
	at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:42)
	at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer.createWidget(ContributedPartRenderer.java:132)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:991)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:658)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:762)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:727)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:711)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.lambda$0(PartServiceImpl.java:105)
	at org.eclipse.e4.ui.services.internal.events.UIEventHandler.lambda$0(UIEventHandler.java:38)
	at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:183)
	at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:133)
	at org.eclipse.swt.widgets.Display.syncExec(Display.java:5960)
	at org.eclipse.e4.ui.workbench.swt.DisplayUISynchronize.syncExec(DisplayUISynchronize.java:34)
	at org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(UIEventHandler.java:38)
	at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:206)
	at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:201)
	at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
	at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:151)
	at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:131)
	at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:73)
	at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:44)
	at org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:55)
	at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:60)
	at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:424)
	at org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl.setSelectedElementGen(ElementContainerImpl.java:168)
	at org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl.setSelectedElement(ElementContainerImpl.java:187)
	at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.showElementInWindow(ModelServiceImpl.java:654)
	at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.bringToTop(ModelServiceImpl.java:618)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.delegateBringToTop(PartServiceImpl.java:796)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:764)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:686)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:681)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.showPart(PartServiceImpl.java:1262)
	at org.eclipse.e4.ui.internal.workbench.ApplicationPartServiceImpl.showPart(ApplicationPartServiceImpl.java:187)
	at org.eclipse.chemclipse.ux.extension.ui.provider.ISupplierFileEditorSupport.openEditor(ISupplierFileEditorSupport.java:198)
	at org.eclipse.chemclipse.ux.extension.xxd.ui.part.support.SupplierEditorSupport.openEditor(SupplierEditorSupport.java:155)
	at org.eclipse.chemclipse.ux.extension.xxd.ui.part.support.SupplierEditorSupport.openEditor(SupplierEditorSupport.java:187)
	at org.eclipse.chemclipse.ux.extension.ui.provider.AbstractSupplierFileEditorSupport.openEditor(AbstractSupplierFileEditorSupport.java:37)
	at org.eclipse.chemclipse.ux.extension.ui.swt.MultiDataExplorerTreeUI.openEditorWithSupplier(MultiDataExplorerTreeUI.java:543)
	at org.eclipse.chemclipse.ux.extension.ui.swt.MultiDataExplorerTreeUI.openEditor(MultiDataExplorerTreeUI.java:528)
	at org.eclipse.chemclipse.ux.extension.ui.swt.MultiDataExplorerTreeUI.handleDoubleClick(MultiDataExplorerTreeUI.java:151)
	at org.eclipse.chemclipse.ux.extension.ui.swt.MultiDataExplorerTreeUI$2.doubleClick(MultiDataExplorerTreeUI.java:232)
	at org.eclipse.jface.viewers.StructuredViewer$1.run(StructuredViewer.java:779)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:174)
	at org.eclipse.jface.viewers.StructuredViewer.fireDoubleClick(StructuredViewer.java:776)
	at org.eclipse.jface.viewers.AbstractTreeViewer.handleDoubleSelect(AbstractTreeViewer.java:1580)
	at org.eclipse.jface.viewers.StructuredViewer$4.widgetDefaultSelected(StructuredViewer.java:1205)
	at org.eclipse.jface.util.OpenStrategy.fireDefaultSelectionEvent(OpenStrategy.java:271)
	at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:328)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:91)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5855)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1617)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:5065)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4517)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1151)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1042)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:152)
	at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:639)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:546)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:173)
	at org.eclipse.chemclipse.rcp.app.ui.internal.support.ApplicationSupportDefault.start(ApplicationSupportDefault.java:25)
	at org.eclipse.chemclipse.rcp.app.ui.Application.start(Application.java:27)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:208)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:143)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:109)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:439)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:271)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:668)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:605)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1481)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1454)

@eselmeister
Copy link
Contributor

I also recommend to IDN of the package org.eclipse.swtchart.extensions as a folder name in .eclipse to follow the style of all other folders contained. Additionally, I would recommend to rename settings to chart.properties.

@eselmeister
Copy link
Contributor

	public static IPreferenceStore getPreferenceStore() {

		if(preferenceStore == null) {
			/*
			 * SWTChart may be used also in a non Eclipse context.
			 * Hence, a simple file preference store instead of a ScopedPreferenceStore is used.
			 */
			StringBuilder builder = new StringBuilder();
			builder.append(System.getProperty("user.home"));
			builder.append(File.separator);
			builder.append(".eclipse");
			builder.append(File.separator);
			builder.append("org.eclipse.swtchart.extensions");
			/*
			 * Create the directory if necessary.
			 */
			File directory = new File(builder.toString());
			if(!directory.exists()) {
				directory.mkdirs();
			}
			/*
			 * Specify the settings file.
			 */
			builder.append(File.separator);
			builder.append("chart.properties");
			File file = new File(builder.toString());
			try {
				if(!file.exists()) {
					file.createNewFile();
				}
			} catch(IOException e) {
				// Ignore
			}
			/*
			 * Create the preference store
			 */
			if(file.exists()) {
				preferenceStore = new PreferenceStore(file.getAbsolutePath());
			} else {
				preferenceStore = new PreferenceStore();
			}
			//
			PreferenceInitializer preferenceInitializer = new PreferenceInitializer();
			preferenceInitializer.initializeDefaultPreferences();
			/*
			 * Load existing values.
			 */
			try {
				((PreferenceStore)preferenceStore).load();
			} catch(FileNotFoundException e) {
				// Ignore
			} catch(IOException e) {
				e.printStackTrace();
			}
		}
		//
		return preferenceStore;
	}

@Mailaender
Copy link
Contributor Author

Mailaender commented Jul 14, 2024

I created a less verbose version that also fixes #380 because you are calling

IPreferenceStore preferenceStore = ResourceSupport.getPreferenceStore();

which then calls itself again, which causes the exception to be so spammy.

@eselmeister
Copy link
Contributor

Still a FileNotFoundException is thrown by running your code. It only works if the file is already available, which can't be assumed:

java.io.FileNotFoundException: /home/pwenig/.eclipse/org.eclipse.swtchart.extensions/chart.properties (No such file or directory)
	at java.base/java.io.FileInputStream.open0(Native Method)
	at java.base/java.io.FileInputStream.open(FileInputStream.java:216)
	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:111)
	at org.eclipse.jface.preference.PreferenceStore.load(PreferenceStore.java:360)
	at org.eclipse.swtchart.extensions.core.ResourceSupport.getPreferenceStore(ResourceSupport.java:105)
	at org.eclipse.swtchart.extensions.internal.mappings.MappingsIO.restoreSettings(MappingsIO.java:101)
	at org.eclipse.swtchart.extensions.Activator.start(Activator.java:42)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$2.run(BundleContextImpl.java:833)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$2.run(BundleContextImpl.java:1)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:569)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:825)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:775)
	at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:1057)
	at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:387)
	at org.eclipse.osgi.container.Module.doStart(Module.java:639)
	at org.eclipse.osgi.container.Module.start(Module.java:498)
	at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:528)
	at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:122)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:620)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:348)
	at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:414)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass0(BundleLoader.java:520)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:434)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:174)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
	at org.eclipse.chemclipse.ux.extension.xxd.ui.swt.ExtendedScanChartUI.createScanChart(ExtendedScanChartUI.java:826)
	at org.eclipse.chemclipse.ux.extension.xxd.ui.swt.ExtendedScanChartUI.createControl(ExtendedScanChartUI.java:291)
	at org.eclipse.chemclipse.ux.extension.xxd.ui.swt.ExtendedScanChartUI.<init>(ExtendedScanChartUI.java:123)
	at org.eclipse.chemclipse.ux.extension.xxd.ui.parts.ScanChartPart.createControl(ScanChartPart.java:39)
	at org.eclipse.chemclipse.ux.extension.xxd.ui.parts.ScanChartPart.createControl(ScanChartPart.java:1)
	at org.eclipse.chemclipse.ux.extension.xxd.ui.parts.AbstractPart.<init>(AbstractPart.java:27)
	at org.eclipse.chemclipse.ux.extension.xxd.ui.parts.ScanChartPart.<init>(ScanChartPart.java:33)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
	at org.eclipse.e4.core.internal.di.ConstructorRequestor.execute(ConstructorRequestor.java:43)
	at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:384)
	at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:312)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:203)
	at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:90)
	at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:59)
	at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:42)
	at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer.createWidget(ContributedPartRenderer.java:132)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:991)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:658)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:762)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:727)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:711)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.subscribeTopicToBeRendered(PartRenderingEngine.java:160)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)
	at org.eclipse.e4.core.di.internal.extensions.EventObjectSupplier$DIEventHandler.handleEvent(EventObjectSupplier.java:92)
	at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:206)
	at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:201)
	at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
	at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:151)
	at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:131)
	at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:73)
	at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:44)
	at org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:55)
	at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:60)
	at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:424)
	at org.eclipse.e4.ui.model.application.ui.impl.UIElementImpl.setToBeRendered(UIElementImpl.java:316)
	at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.showElementInWindow(ModelServiceImpl.java:649)
	at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.bringToTop(ModelServiceImpl.java:618)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.delegateBringToTop(PartServiceImpl.java:796)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:764)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:686)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:681)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.showPart(PartServiceImpl.java:1262)
	at org.eclipse.e4.ui.internal.workbench.ApplicationPartServiceImpl.showPart(ApplicationPartServiceImpl.java:187)
	at org.eclipse.chemclipse.ux.extension.ui.support.PartSupport.showPart(PartSupport.java:297)
	at org.eclipse.chemclipse.ux.extension.ui.support.PartSupport.setPartVisibility(PartSupport.java:386)
	at org.eclipse.chemclipse.ux.extension.ui.support.PartSupport.togglePartVisibility(PartSupport.java:244)
	at org.eclipse.chemclipse.ux.extension.ui.support.PartSupport.togglePartVisibility(PartSupport.java:447)
	at org.eclipse.chemclipse.ux.extension.xxd.ui.toolbar.AbstractPartHandler.action(AbstractPartHandler.java:128)
	at org.eclipse.chemclipse.ux.extension.xxd.ui.toolbar.AbstractGroupHandler.setPartStatus(AbstractGroupHandler.java:149)
	at org.eclipse.chemclipse.ux.extension.xxd.ui.toolbar.AbstractGroupHandler$1.run(AbstractGroupHandler.java:79)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:132)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:5040)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4520)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1151)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1042)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:152)
	at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:639)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:546)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:173)
	at org.eclipse.chemclipse.rcp.app.ui.internal.support.ApplicationSupportDefault.start(ApplicationSupportDefault.java:25)
	at org.eclipse.chemclipse.rcp.app.ui.Application.start(Application.java:27)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:208)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:143)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:109)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:439)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:271)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:668)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:605)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1481)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1454)

and create the folder when they don't exist.
@Mailaender
Copy link
Contributor Author

Now creating both folder and the file while also avoiding FileAlreadyExistsException.

@Mailaender Mailaender changed the title .eclipseswtchartsettings to .eclipse/swtchart/settings .eclipseswtchartsettings to .eclipse/org.eclipse.swtchart.extensions/settings/chart.properties Jul 15, 2024
@eselmeister eselmeister merged commit 264b763 into eclipse:develop Jul 16, 2024
3 checks passed
@Mailaender Mailaender deleted the patch-1 branch July 16, 2024 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FileNotFoundException $HOME/.eclipseswtchartsettings
2 participants