JanKoehnlein / FXDiagram

JavaFX diagram
Apache License 2.0
74 stars 21 forks source link

[eclipse] Save diagram fails #47

Closed ralfellner closed 8 years ago

ralfellner commented 8 years ago

I'm using version 0.25.0-SNAPSHOT of FXDiagram with Eclipse. I get the following error when saving an untitled diagram to a *.fxd file:

Caused by: java.lang.IllegalArgumentException: Path must include project and resource name: /Untitled.fxd at org.eclipse.core.runtime.Assert.isLegal(Assert.java:63) at org.eclipse.core.internal.resources.Workspace.newResource(Workspace.java:2075) at org.eclipse.core.internal.resources.Container.getFile(Container.java:192) at de.fxdiagram.eclipse.actions.EclipseSaveAction.doSave(EclipseSaveAction.java:83) at de.fxdiagram.eclipse.actions.EclipseSaveAction.lambda$0(EclipseSaveAction.java:64)

The problem is caused by an incorrectly constructed default file name in EclipseSaveAction:

workspaceDir.getFile(new Path(root.fileName)) creates a file directly within the workspace. However, Eclipse requires files to be in a project. I think the issue should be fixed by using the save dialog for eclipse resources as in #41.

JanKoehnlein commented 8 years ago

Fixed with #41.