Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Dragging Editor Disposes it
Dragging Editor Disposes it [message #1003893] Tue, 22 January 2013 07:44 Go to next message
S. SchulzFriend
Messages: 72
Registered: September 2011
Member
Hello!

We have a problem with saving / restoring the workbench. It's necessary to do this user-based, so we copied Workbench.restoreState() and Workbench.saveState() and added a mechanism for storing it for each individual user.

That works so far. Now there is a problem: If you drag the editor, its future outline is shown way of where it should be. Except for the place where it already is, there is no valid place, because if you drop it, the editor just vanishes. There is no way to get it back, either, only restarting the application will help.

I added a picture showing the invalid outline of the editor.

The error can be tracked back to the following lines:

IMemento[] children = memento.getChildren(IWorkbenchConstants.TAG_WINDOW);
IWorkbenchWindow[] windows = workbench.getWorkbenchWindows();

for (int nX = 0; nX < windows.length; nX++) {
	WorkbenchWindow window = (WorkbenchWindow) windows[nX];
	window.restoreState(children[nX], null);
}


I can't figure out why this problem persists. But (this is maybe related) the application is not able to set its window's bounds correctly, even though WorkbenchWindow.restoreState() seems to be able to do this normally.

Has anyone an idea what to do about this problem? Or maybe just a hint how to track the error down? Any help is appreciated.

Thanks for your time,

S. Schulz
Re: Dragging Editor Disposes it [message #1005994 is a reply to message #1003893] Tue, 29 January 2013 13:59 Go to previous message
S. SchulzFriend
Messages: 72
Registered: September 2011
Member
I was advised that someone might be able to help me if I provided a minimal project or other steps to reproduce this strange behavior.

So here is a sample project (it's the mail demo with the view made into an editor and my custom class "WorkbenchMemory" for storing / restoring the workbench state).

To reproduce, click on "Bug->save" and then "Bug->restore", then open the editor and try dragging it. If you release the mouse button, the editor will get disposed.

Even though every advice is appreciated, I would especially like to know where the platform gets the editor's shadow (the position where to drop it to) from, because that seems to be the problem.
Previous Topic:RCP EventBus?
Next Topic:KeyBinding for delete
Goto Forum:
  


Current Time: Fri Apr 26 05:44:55 GMT 2024

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

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

Back to the top