Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Workbench not persisted under Mac
Workbench not persisted under Mac [message #1407727] Wed, 13 August 2014 09:55 Go to next message
Marina Knieling is currently offline Marina KnielingFriend
Messages: 83
Registered: February 2013
Member
Hey guys,

I have a very basic E4 application (3-column layout, empty parts) which
starts under all platforms (Win 7 64, Ubuntu 14.04, Mac OS X) and looks
the same.

However, among some DnD problems I noticed that the workbench is not
persisted under Mac OS X. The org.eclipse.e4.ui.workbench folder is not
created under the .metadata/.plugins directory and so there is no
workbench.xmi file.

In my arguments I have -persistState and this works under Windows and
Ubuntu. I already tried to use a different folder with -data flag which
resulted in an IllegalStateException on startup. I also tried setting
full rights on group level to the .plugins folder (just in case the
application isn't allowed to create a folder there) but this didn't help
either.

I had a look at eclipse Kepler configuration and it seems like
persisting the workbench is working there. The o.e.e4.ui.workbench
folder exists and there is a workbench.xmi file in it which gets updated
on shutdown of eclipse Kepler.

Are there any special settings I need to set on the Mac or in my
application in order to make workbench persistence work or is this a bug?

Thanks in advance

Marina Knieling
Re: Workbench not persisted under Mac [message #1407846 is a reply to message #1407727] Wed, 13 August 2014 15:46 Go to previous messageGo to next message
Eclipse UserFriend
There are no special settings required for the Mac. Look at your <product>.ini file and the configuration/config.ini and verify that the arguments and settings are what you expect. And look at your .product definition file to ensure you haven't set some platform-specific settings there.

We'll need more detail (e.g., configuration information above, plus about the IllegalSateException from -data). But before you do, try using the Eclipse 4 Model Editor (which includes the Eclipse 4 Tools) to create a dummy application (Eclipse 4 > Eclipse 4 Application Project) and verify that it doesn't work either.

Note: The directory should be org.eclipse.e4.workbench, not .ui.workbench.

Brian.
Re: Workbench not persisted under Mac [message #1408149 is a reply to message #1407846] Thu, 14 August 2014 10:54 Go to previous messageGo to next message
Marina Knieling is currently offline Marina KnielingFriend
Messages: 83
Registered: February 2013
Member
Hi Brian,

1) There aren't any platform-specific settings there. I just switched
-clearPersistedState for -persistState in the "All Platforms" tab. The
macosx launching tab includes the -XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts for VM Arguments, but this
seems to be ok.

The <product>.ini file includes the mentioned -persistState and the
other two arguments preceded by -vmargs, so this looks ok. config.ini
also looks correct.

Note: I'm using the delta pack to compile for Mac.

2) I created the dummy application with sample content (on Kepler on Mac
this time) and persistence worked there (out of Eclipse and exported as
product as well).

I customized some parts of the application:

1) I wrote my own Menu and MenuItem renderer. Any chance I did something
wrong there that might suppress workbench persistence under mac?

2) In addition there is a fragment.e4xmi that contributes a whole
perspective to the model.

3) I've overwritten dndaddon and minmaxaddon (copied the original code
and made some minor changes).

Everything else is 'standard' e4 and I can't think of anything that
might be the source of evil ;-)

Concerning the IllegalStateException: I'll switch to the Mac and then
copy the stacktrace here (I'm under Windows right now).

Marina

On 13.08.2014 17:46, Brian de Alwis wrote:
> There are no special settings required for the Mac. Look at your
> <product>.ini file and the configuration/config.ini and verify that the
> arguments and settings are what you expect. And look at your .product
> definition file to ensure you haven't set some platform-specific
> settings there.
>
> We'll need more detail (e.g., configuration information above, plus
> about the IllegalSateException from -data). But before you do, try
> using the Eclipse 4 Model Editor (which includes the Eclipse 4 Tools) to
> create a dummy application (Eclipse 4 > Eclipse 4 Application Project)
> and verify that it doesn't work either.
>
> Note: The directory should be org.eclipse.e4.workbench, not .ui.workbench.
>
> Brian.
Re: Workbench not persisted under Mac [message #1408199 is a reply to message #1408149] Thu, 14 August 2014 13:26 Go to previous messageGo to next message
Eclipse UserFriend
It sounds like an exception might be eaten. I'd suggest you try attaching Eclipse to your running instance and put a breakpoint in E4Application#saveModel(). Try stepping through and see what's happening.

Brian.
Re: Workbench not persisted under Mac [message #1408516 is a reply to message #1408199] Fri, 15 August 2014 08:57 Go to previous messageGo to next message
Marina Knieling is currently offline Marina KnielingFriend
Messages: 83
Registered: February 2013
Member
Hi Brian,

it seems like saveAndRestore variable in ResourceHandler is false, although -persistState is set in <product>.ini.

Is there any way I can see how the arguments are read and how/where they are injected in the ResourceHandler?

BTW: target platform is Luna

<product>.ini looks like this ( at the moment with the debug flags set):

-startup
../../../plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar
--launcher.library
../../../plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_1.1.200.v20140603-1326
-persistState
-vmargs
-Xdebug
-agentlib:jdwp=transport=dt_socket,server=y,address=8000
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts

Any ideas on what might have gone wrong?

Marina
Re: Workbench not persisted under Mac [message #1408534 is a reply to message #1408516] Fri, 15 August 2014 09:51 Go to previous messageGo to next message
Marina Knieling is currently offline Marina KnielingFriend
Messages: 83
Registered: February 2013
Member
Hi again,

a colleague found out that setting -DpersistState=true in the product
file in the VM arguments works. This flag seems to default to true under
Windows but not under Mac. Not setting -persistState (in the normal way)
persists the workbench under Windows anyways, but not under Mac.

Is this a known bug or a feature? :-)

Marina

On 15.08.2014 10:57, Marina Knieling wrote:
> Hi Brian,
>
> it seems like saveAndRestore variable in ResourceHandler is false,
> although -persistState is set in <product>.ini.
>
> Is there any way I can see how the arguments are read and how/where they
> are injected in the ResourceHandler?
>
> BTW: target platform is Luna
>
> <product>.ini looks like this ( at the moment with the debug flags set):
>
> -startup
> ./../../plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar
> --launcher.library
> ./../../plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_1.1.200.v20140603-1326
>
> -persistState
> -vmargs
> -Xdebug
> -agentlib:jdwp=transport=dt_socket,server=y,address=8000
> -XstartOnFirstThread
> -Dorg.eclipse.swt.internal.carbon.smallFonts
>
> Any ideas on what might have gone wrong?
>
> Marina
Re: Workbench not persisted under Mac [message #1408674 is a reply to message #1408534] Fri, 15 August 2014 19:02 Go to previous messageGo to next message
Eclipse UserFriend
Marina Knieling wrote on Fri, 15 August 2014 05:51

a colleague found out that setting -DpersistState=true in the product
file in the VM arguments works. This flag seems to default to true under
Windows but not under Mac. Not setting -persistState (in the normal way)
persists the workbench under Windows anyways, but not under Mac.


-persistState takes an argument, true or false. That you're not providing one means that the behaviour is undefined, and likely false. See the code in E4Application#loadApplicationModel() around line 389:

// Save and restore
boolean saveAndRestore;
String value = getArgValue(IWorkbench.PERSIST_STATE, appContext, false);

saveAndRestore = value == null || Boolean.parseBoolean(value);


I don't know why your model was persisting under Windows -- that's more of a bug!

Brian.
Re: Workbench not persisted under Mac [message #1409511 is a reply to message #1408674] Mon, 18 August 2014 09:36 Go to previous message
Marina Knieling is currently offline Marina KnielingFriend
Messages: 83
Registered: February 2013
Member
On 15.08.2014 21:02, Brian de Alwis wrote:
> -persistState takes an argument, true or false. That you're not
> providing one means that the behaviour is undefined, and likely false.

Didn't know that. Is this documented somewhere? As -clearPersistedState
doesn't take an argument, I thought it's the same with -persistState.

Thanks for your help, it works now.
Previous Topic:Does e4 use a different SelectionService?
Next Topic:Running exported E4 app outside of it's directory causes widgets lacking
Goto Forum:
  


Current Time: Wed Apr 24 15:11:52 GMT 2024

Powered by FUDForum. Page generated in 0.04471 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top