I just wanted to post an update on this in case it helps anyone else.
The trick below appears to work fine on windows platforms -- even x64
with a 64-bit JDK and 64-bit eclipse.
However, on MacOS, it fails. If you try to open design view, you'll
see a grey screen with the warning:
Design mode: Error during component layout. Choose Design > Refresh to
refresh design mode.
Obviously doing refresh doesn't fix anything. Looking in eclipse log
files I see this stack trace happens several times:
!ENTRY org.eclipse.ui 4 0 2010-07-16 12:36:56.581
!MESSAGE Unhandled event loop exception
!STACK 0
org.eclipse.swt.SWTException: Failed to execute runnable
(org.eclipse.swt.SWTException: Graphic is disposed)
at org.eclipse.swt.SWT.error(SWT.java:3884)
at org.eclipse.swt.SWT.error(SWT.java:3799)
at
org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:137)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3342)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3071)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at
org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
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:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
Caused by: org.eclipse.swt.SWTException: Graphic is disposed
at org.eclipse.swt.SWT.error(SWT.java:3884)
at org.eclipse.swt.SWT.error(SWT.java:3799)
at org.eclipse.swt.SWT.error(SWT.java:3770)
at org.eclipse.swt.graphics.Image.getImageData(Image.java:629)
at
org.eclipse.jface.resource.ImageDataImageDescriptor.<init>(ImageDataImageDescriptor.java:36)
at
org.eclipse.jface.resource.ImageDescriptor.createFromImage(ImageDescriptor.java:104)
at
com.adobe.flexide.editorcore.ui.FlexImageDatabase.getOverlayImage(FlexImageDatabase.java:251)
at
com.adobe.flexide.editorcore.ui.SharedImages.getProblemDecoratedImage(SharedImages.java:169)
at
com.adobe.flexbuilder.editorcore.editor.CodeAndDesignEditor$5.run(CodeAndDesignEditor.java:1269)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at
org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
... 22 more
Not knowing too much about the internals of SWT, some googling seemed
to indicate that FlashBuilder on MacOS is only supported for 32-bit
JVM.
I'm using eclipse 3.5 carbon galileo SR2, by the way on Mac OS 10.6.
So, I tried adding -d32 to Eclipse.app/Content/MacOS/eclipse.ini
It took the property, but it still doesn't fix the problem. Some
combo of the right eclipse and the right JVM on MacOS might work here.
I have another standard FB project that works just fine in the same
Eclipse instance using the FB plugin. It is just this flexmojos
project can't handle design view properly for whatever reason...still
trying to track it down.
.project file generated from flexmojos:flexbuilder ->
<projectDescription>
<name>axeda-prov-ui</name>
<comment/>
<projects/>
<buildSpec>
<buildCommand>
<name>org.maven.ide.eclipse.maven2Builder</name>
</buildCommand>
<buildCommand>
<name>com.adobe.flexbuilder.project.flexbuilder</name>
</buildCommand>
</buildSpec>
<natures>
<nature>org.maven.ide.eclipse.maven2Nature</nature>
<nature>com.adobe.flexbuilder.project.flexnature</nature>
<nature>com.adobe.flexbuilder.project.actionscriptnature</nature>
</natures>
</projectDescription>
.settings/com.adobe.flexbuilder.project.prefs ->
#Fri Jul 16 09:53:31 EDT 2010
eclipse.preferences.version=1
upgradeSDK/fb4=
.settings/org.eclipse.core.resources.prefs ->
#Fri Jul 16 09:36:59 EDT 2010
eclipse.preferences.version=1
encoding/<project>=UTF-8
I'm investigating the differences between .classpath of standard
FlashBuilder project that works and flexmojos generated project that
doesn't.
Hope this helps someone...
Regards,
Davis
On Mon, Jun 28, 2010 at 7:22 AM, Davis Ford
<[email protected]> wrote:
> Hi Lance,
>
> Here is how I fix it:
>
> 1) Open Flex Build Path
> 2) Select Flex SDK
> 3) Press Remove button
> 4) Press Add Flex SDK button
> 5) Press Ok
> 6) Refresh design view
>
> I had thought that I had done this and it did not work, but I went
> back and tried it again and it does work.
>
> Everytime I run the flexmojos:flexbuilder command -- I have to do this again.
>
> I should just look at the .classpath file before and after and I can
> tell you exactly what the difference is.
>
> Regards,
> Davis
>
> On Thu, Jun 24, 2010 at 12:39 PM, Dtornkaew <[email protected]> wrote:
>> David,
>>
>> I am still working on a set of tests for this. Writing automated tests
>> for Design View to make sure its doesn't broken is going to be a
>> challenge.
>>
>> Can you elaborate on what you mean by "persistent enough". I hope to
>> make this just work and in a number of smaller tests Design View has
>> worked for me. If there are specific issues you have let me know so I
>> can try to address them.
>>
>> Thanks!
>> Lance
>>
>> On Jun 23, 11:08 am, Davis Ford <[email protected]> wrote:
>>> Actually, it seems this hack does work again in FB4 if you are
>>> persistent enough.
>>>
>>> On Wed, Jun 23, 2010 at 10:51 AM, Davis Ford
>>>
>>>
>>>
>>>
>>>
>>> <[email protected]> wrote:
>>> > Thanks, Lance.
>>>
>>> > Design View in FB3 works with a manual hack. After you run
>>> > flexmojos:flexbuilder and import the project, Go to the build path,
>>> > remove the Flex SDK, and then add it again -- then refresh the design
>>> > view and it comes up. That seems to resolve the issue. Perhaps
>>> > something about the cp ordering that gets re-adjusted when you do
>>> > that.
>>>
>>> > Unfortunately, the same trick does not work in FB4, it seems.
>>> > Although I did have a very simple sample project where it appeared
>>> > that design view initially worked in FB4, now it no longer works, and
>>> > I can't resolve why or what changed. All I get is "This component is
>>> > based on Application, which is not supported in Design mode. Switch
>>> > to source mode to edit it."
>>>
>>> > On Tue, Jun 22, 2010 at 5:05 PM, Dtornkaew <[email protected]> wrote:
>>> >> Design View has never worked for me in Flex or Flash Builder when
>>> >> using flexmojos:flexbuilder goal.
>>>
>>> >> I have been working for a while to find a good fix for this.
>>> >> Unfortunately I haven't found a "nice" fix but I have fixed it on a
>>> >> patched version of FlexMojos located
>>> >> herehttp://github.com/llinder/FlexMojos.
>>> >> For those that are interested in what I have found and what I mean by
>>> >> not a "nice" fix feel free to ask and I will elaborate.
>>>
>>> >> If you are interested in trying it out you will need to pull the
>>> >> source and build from scratch.
>>>
>>> >> There are 2 goals, flexmojos:flexbuilder and flexmojos:flashbuilder.
>>> >> The code base is nearly the same. The main difference is in the
>>> >> template files and in memory data structure that describes the default
>>> >> state of Flex and Flash Builder projects.
>>>
>>> >> Lance
>>>
>>> >> On Jun 22, 1:45 pm, Davis Ford <[email protected]> wrote:
>>> >>> If I create a project via:
>>>
>>> >>> $ flexmojos:flexbuilder
>>>
>>> >>> Then import it into FB4, it imports ok, but if I try to open the
>>> >>> application.mxml in design mode it says:
>>>
>>> >>> "This component is based on Application, which is not supported in
>>> >>> Design mode. Switch to source mode to edit it."
>>>
>>> >>> Anyone seen this? Have any idea for a workaround?
>>>
>>> >>> pom looks like this:
>>>
>>> >>> <flexmojos.version>3.6.1</flexmojos.version>
>>> >>> <flex.sdk.version>4.1.0.16248</flex.sdk.version>
>>>
>>> >>> <dependency>
>>> >>> <groupId>com.adobe.flex.framework</groupId>
>>> >>> <artifactId>flex-framework</artifactId>
>>> >>> <version>${flex.sdk.version}</version>
>>> >>> <type>pom</type>
>>> >>> <scope>compile</scope>
>>> >>> </dependency>
>>>
>>> >>> <plugins>
>>> >>> <plugin>
>>> >>>
>>> >>> <groupId>org.sonatype.flexmojos</groupId>
>>> >>>
>>> >>> <artifactId>flexmojos-maven-plugin</artifactId>
>>> >>> <version>${flexmojos.version}</version>
>>> >>> <dependencies>
>>> >>> <dependency>
>>> >>>
>>> >>> <groupId>com.adobe.flex</groupId>
>>> >>>
>>> >>> <artifactId>compiler</artifactId>
>>> >>>
>>> >>> <version>${flex.sdk.version}</version>
>>> >>> <type>pom</type>
>>> >>> </dependency>
>>> >>> </dependencies>
>>>
>>> >> --
>>> >> You received this message because you are subscribed to the Google
>>> >> Groups "Flex Mojos" group.
>>> >> To post to this group, send email to [email protected]
>>> >> To unsubscribe from this group, send email to
>>> >> [email protected]
>>> >> For more options, visit this group at
>>> >>http://groups.google.com/group/flex-mojos
>>>
>>> >>http://flexmojos.sonatype.org/
>>>
>>> > --
>>> > Zeno Consulting, Inc.
>>> > home:http://www.zenoconsulting.biz
>>> > blog:http://zenoconsulting.wikidot.com
>>> > p: 248.894.4922
>>> > f: 313.884.2977
>>>
>>> --
>>> Zeno Consulting, Inc.
>>> home:http://www.zenoconsulting.biz
>>> blog:http://zenoconsulting.wikidot.com
>>> p: 248.894.4922
>>> f: 313.884.2977
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Flex Mojos" group.
>> To post to this group, send email to [email protected]
>> To unsubscribe from this group, send email to
>> [email protected]
>> For more options, visit this group at
>> http://groups.google.com/group/flex-mojos
>>
>> http://flexmojos.sonatype.org/
>>
>
>
>
> --
> Zeno Consulting, Inc.
> home: http://www.zenoconsulting.biz
> blog: http://zenoconsulting.wikidot.com
> p: 248.894.4922
> f: 313.884.2977
>
--
Zeno Consulting, Inc.
home: http://www.zenoconsulting.biz
blog: http://zenoconsulting.wikidot.com
p: 248.894.4922
f: 313.884.2977
--
You received this message because you are subscribed to the Google
Groups "Flex Mojos" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/flex-mojos
http://flexmojos.sonatype.org/