alexroldugin / spray

Automatically exported from code.google.com/p/spray
0 stars 0 forks source link

Editing .shape file results in opening the generated .svg file #224

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hello,
i've got a really annoying problem when editing my shape file.
Everytime i type a single letter (without saving) the svg files in the folder 
"shapepreviews/svg/" are regenerated. This has the affect that i get a dialog 
for Downloading or Opening the file.
After that the Focus of my cursor isnt in the shape editor anymore and i have 
to click into the right place in the editor to complete my editing. 

What steps will reproduce the problem?
1. Create Eclipse Project with your own MetaModel like described in the 
User-Guide
2. Create Eclipse Spray-Project using that MetaModel like described in the 
User-Guide
3. Edit the .shape file (typing a single letter is enough)

What is the expected output? What do you see instead?
Expected output: 
 - A Hover of the shape wich is on focus (if this feature is allready existing in the version of spray i use, see below)
 - Nothing (if the hover feature isnt available in the version of spray that i use)

What version of the product are you using? On what operating system?
OS: Windows 7 Professional SP1 64-Bit Architecture

Eclipse: Fresh copy of eclipse-jee-juno-SR1-win32-x86_64

Runtime-JRE of Eclipse: JDK 1.7

JRE System Library of Spray and MetaModel Projects: JDK 1.5.0_22

Spray 3rdParty: 
https://spray.ci.cloudbees.com/job/spray-ci-targetplatform/lastSuccessfulBuild/a
rtifact/releng/org.eclipselabs.spray.repository/target/repository/  (at the 
time i installed it was Build #13, i really installed the dependencies, cause i 
had a fresh Eclipse Juno)

Spray SDK Feature: version 
0.5.0.201211192306  https://spray.ci.cloudbees.com/job/spray-assembly-build/lastS
uccessfulBuild/artifact/releng/org.eclipselabs.spray.updatesite/target/repositor
y/  (at the time i installed it was Build #97)

Please provide any additional information below.
In the "shapepreviews" folder there is a subfolder "svg" wich contains the 
shape previews as svg file, but there is no subfolder "png" wich should contain 
the shape previews as png files (as i read)

Thank you for your help

Original issue reported on code.google.com by Nosezeic...@gmail.com on 5 Dec 2012 at 5:06

GoogleCodeExporter commented 8 years ago
When saving the shape model file, for each shape definition a SVG file is 
generated. 
When hovering is triggered inside the Shape DSL Editor the before generated SVG 
file is used to generate a png file (as the Eclipse SWT Browser is not able to 
interpret SVG).  

So by unknown causes the png is not generated in your (although I never 
discovered the behavior with the pop dialog). Anyway I will handle this 
exception by only support png file references inside the hover and in any other 
case no image will be linked.

Original comment by de.abg.r...@gmail.com on 5 Dec 2012 at 7:20

GoogleCodeExporter commented 8 years ago
With the last build 
(https://spray.ci.cloudbees.com/job/spray-assembly-build/109/) I tried to fix 
it. But I am not sure if it works.

Original comment by de.abg.r...@gmail.com on 6 Dec 2012 at 8:15

GoogleCodeExporter commented 8 years ago
I tried out the build #109 (with workaround to install it, see Section "Please 
provide any additional information below" in this issue 
https://code.google.com/a/eclipselabs.org/p/spray/issues/detail?id=225 )

Problem is still the same (Download Pop-up Dialog). I dont have a folder 
"shapepreviews/png" only one for the svg's.

A colleague of me doesn't have this problem. he has the same Eclipse 
configuration as me. Maybe it is an Problem with my OS ?

Original comment by Nosezeic...@gmail.com on 6 Dec 2012 at 6:48

GoogleCodeExporter commented 8 years ago
I do not have the problem either,  and I am using Window7, 64 bit as well. 
Likely it is not your OS.

Original comment by joswar...@gmail.com on 6 Dec 2012 at 6:52

GoogleCodeExporter commented 8 years ago
It could be an issue with the configured browser in Eclipse, so a different 
browser engine is used as usual.

Could you please post an screenshot of this download popup?

Original comment by de.abg.r...@gmail.com on 6 Dec 2012 at 8:34

GoogleCodeExporter commented 8 years ago
The Download dialoag even pops up when i open my .shape file

Original comment by Nosezeic...@gmail.com on 6 Dec 2012 at 9:04

Attachments:

GoogleCodeExporter commented 8 years ago
I tried to associate .svg files to a batch file wich does nothing as a 
workaround. thats why the type is listed as Windows-Batchdatei (Batchfile). But 
this didnt help either, the download dialog still asks me if i want to download 
or open the file.

Original comment by Nosezeic...@gmail.com on 6 Dec 2012 at 9:12

GoogleCodeExporter commented 8 years ago
Found the place where preview.svg comes from, in ShapeOutlinePage

    @Override
    public void createControl(Composite parent) {
        browser = new Browser(parent, SWT.NORMAL);
        stateLocation = ShapeActivator.getInstance().getStateLocation().append("preview.svg");
        if (!stateLocation.toFile().exists()) {
            try {
                FileWriter fw = new FileWriter(stateLocation.toFile());
                fw.append("");
                fw.flush();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        super.createControl(parent);
    }

So its not a problem of the shape hover but of the outline view. Maybe it helps 
as a workaround to close the outline view.

Original comment by de.abg.r...@gmail.com on 6 Dec 2012 at 9:31

GoogleCodeExporter commented 8 years ago
Thank you, closing the outline view solved the problem :)

Original comment by Nosezeic...@gmail.com on 6 Dec 2012 at 9:33