Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » problem opening a new editor on double click
problem opening a new editor on double click [message #115945] Mon, 02 April 2007 06:50 Go to next message
Eclipse UserFriend
Originally posted by: bhatia1984.yahoo.com

hiiii

I am trying to open a new editor on double click of diagram element.I am
able to do that but the problen is when i reopen that editor again on
double click a new editor window gets open even if the previous window
which gets open on double click is already open.

i am not able to figure what went wrong

pls help me

Thanks

varun Bhatia
Re: problem opening a new editor on double click [message #115977 is a reply to message #115945] Mon, 02 April 2007 07:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Stefan.Warwas.freenet.de

Hi,

there was a discussion about this problem 1 or 2 weeks ago. I can not
remember the name of the thread but somebody provided a simple solution
for it.

Regards,

Stefan


varun schrieb:
> hiiii
>
> I am trying to open a new editor on double click of diagram element.I am
> able to do that but the problen is when i reopen that editor again on
> double click a new editor window gets open even if the previous window
> which gets open on double click is already open.
>
> i am not able to figure what went wrong
>
> pls help me
>
> Thanks
> varun Bhatia
>
Re: problem opening a new editor on double click [message #115990 is a reply to message #115977] Mon, 02 April 2007 07:23 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bhatia1984.yahoo.com

hi stefan

I know there was disussion on this topic but i am not able to find that &
my editor was not showing that strange behaviour before. But today when i
started my editor again it showing that strange behaviour.Cn u pls help me.

thanks
Varun
Re: problem opening a new editor on double click [message #116003 is a reply to message #115990] Mon, 02 April 2007 08:17 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Stefan.Warwas.freenet.de

Hi,

here is the message you are looking for:

http://dev.eclipse.org/newslists/news.eclipse.modeling.gmf/m sg04712.html

Regards,

Stefan


varun schrieb:
> hi stefan
>
> I know there was disussion on this topic but i am not able to find that
> & my editor was not showing that strange behaviour before. But today
> when i started my editor again it showing that strange behaviour.Cn u
> pls help me.
>
> thanks
> Varun
>
Re: problem opening a new editor on double click [message #116015 is a reply to message #116003] Mon, 02 April 2007 10:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bhatia1984.yahoo.com

hi stefan

Thanks for ur help.I have made the changes bt i am getting exception now &
one thing i want to know that why that is happening now when this bug is
fixed.

Also one more thing it was not happeing before but today when i again open
my editor to work on it this bug came.

This is the exception i am getting now on double click:

org.eclipse.core.runtime.CoreException: ERROR
at
org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.Di agramDocumentEditor.createPartControl(DiagramDocumentEditor. java:1458)
at
org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.java:596)
at
org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:372)
at
org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:566)
at
org.eclipse.ui.internal.EditorReference.getEditor(EditorRefe rence.java:214)
at
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage.java:2588)
at
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2521)
at
org.eclipse.ui.internal.WorkbenchPage.access$10(WorkbenchPag e.java:2513)
at org.eclipse.ui.internal.WorkbenchPage$9.run(WorkbenchPage.ja va:2498)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:67)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2493)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2470)
at
com.siemens.ctindia.gmf.tde.packages.diagram.edit.policies.O penDiagramEditPolicy$OpenDiagramCommand.doExecuteWithResult( OpenDiagramEditPolicy.java:121)
at
org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTr ansactionalCommand.doExecute(AbstractTransactionalCommand.ja va:246)
at
org.eclipse.emf.workspace.AbstractEMFOperation.execute(Abstr actEMFOperation.java:127)
at
org.eclipse.core.commands.operations.DefaultOperationHistory .execute(DefaultOperationHistory.java:509)
at
org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack .execute(DiagramCommandStack.java:205)
at
org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack .execute(DiagramCommandStack.java:168)
at
org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack .execute(DiagramCommandStack.java:155)
at
org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPa rt.performRequest(GraphicalEditPart.java:1060)
at
org.eclipse.gef.tools.SelectEditPartTracker.performOpen(Sele ctEditPartTracker.java:187)
at
org.eclipse.gef.tools.SelectEditPartTracker.handleDoubleClic k(SelectEditPartTracker.java:131)
at
org.eclipse.gef.tools.AbstractTool.mouseDoubleClick(Abstract Tool.java:944)
at
org.eclipse.gef.tools.SelectionTool.mouseDoubleClick(Selecti onTool.java:501)
at org.eclipse.gef.EditDomain.mouseDoubleClick(EditDomain.java: 204)
at
org.eclipse.gef.ui.parts.DomainEventDispatcher.dispatchMouse DoubleClicked(DomainEventDispatcher.java:285)
at
org.eclipse.draw2d.LightweightSystem$EventHandler.mouseDoubl eClick(LightweightSystem.java:508)
at
org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:141)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3348)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2968)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1914)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:419)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplicatio n.java:95)
at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:78)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:92)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:68)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:400)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336 )
at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.Main.main(Main.java:952)


Thanks
Varun Bhatia
Re: problem opening a new editor on double click [message #116119 is a reply to message #115945] Mon, 02 April 2007 12:06 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello varun,

This problem was fixed in the latest GMF builds. Wait till GMF M6 and this
proble should gone.

-----------------
Alex Shatalin
Re: problem opening a new editor on double click [message #116130 is a reply to message #116119] Mon, 02 April 2007 12:10 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bhatia1984.yahoo.com

hiiii

Thanks Alex but can u tell me how can i do it it manually. I have tried to
do it by reading the above thread but i am getting exception.

I have to do it urgently
Pls help me

Thanks
varun
Re: problem opening a new editor on double click [message #116144 is a reply to message #116130] Mon, 02 April 2007 12:33 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello varun,

You can see diff between 1.7 and 1.8 revisions of EcoreMatchingStrategy from
Ecore diagram example - this is the changes you have to introduce into your
generated diagramming code.

-----------------
Alex Shatalin
Re: problem opening a new editor on double click [message #116378 is a reply to message #116144] Tue, 03 April 2007 04:29 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bhatia1984.yahoo.com

hiiii

Alex i didnt get u what u r trying to say.Can u explain in some detail.

Thanks
varun
Re: problem opening a new editor on double click [message #116381 is a reply to message #116378] Tue, 03 April 2007 08:04 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello varun,

- Open CVS and download Ecore diagram sample sources from there
- Open EcoreMatchingStrategy class - the class was re-generated with new
templates to correct the problem
- open CVS history for this class and see whan was changed from v1.7 to v1.8
- this is a fix for the problem. You should do the same in ???MatchingStrategy.

-----------------
Alex Shatalin
Re: problem opening a new editor on double click [message #120056 is a reply to message #116381] Wed, 18 April 2007 04:32 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bhatia1984.yahoo.com

hi alex

Sorry for such a late reply.
I am not able to connect to cvs using eclipse due to firewall.so i just
want to know in which cvs & in whcih proj i can find ecore diagarm sample
source.
Pls help me

Thanks
varun
Re: problem opening a new editor on double click [message #120599 is a reply to message #116381] Thu, 19 April 2007 09:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bhatia1984.yahoo.com

hi alex

I have made the changes in my matching startegy class but still i am
getting the same problem.

Does i have to make any other changes??

Thanks
varun
Re: problem opening a new editor on double click [message #120661 is a reply to message #120599] Thu, 19 April 2007 10:58 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello varun,

> Does i have to make any other changes??
Try debugging your matching startegy. Idea of this class is to match two
different editors and if you areusing older verrsions of GMF then different
parameters could be passes to this method, but in general you should still
match them.

-----------------
Alex Shatalin
Re: problem opening a new editor on double click [message #120672 is a reply to message #115945] Thu, 19 April 2007 11:17 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bhatia1984.yahoo.com

hi alex

i am once again reframing my ques so that i am able to explain myself
better.

My ques was ...
after generating diagram code i invoke an instance of eclipse application.
then i open my gmf editor.on double click of a daiagram element i open
another eitor.

Now i close the eclipse apllication.

Now i once againg invoke eclipse application.
Now what i found is that on both the editor diagarm element of former
editor (i.e editor from which i invoke double click) will be there & now
when i double click on the diagarm element of the editor a new editor gets
opened having diagarm element of later editor.

pls help me.
i have to do it urgently

Thanks
Varun
Re: problem opening a new editor on double click [message #121261 is a reply to message #120672] Mon, 23 April 2007 13:02 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bhatia1984.yahoo.com

hiiiii

pls reply to my ques.

Thanks
varun
Re: problem opening a new editor on double click [message #121293 is a reply to message #121261] Mon, 23 April 2007 13:36 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello varun,

Try debugging your matching startegy. Idea of this class is to match two
different editors and if you areusing older verrsions of GMF then different
parameters could be passes to this method, but in general you should still
match them.

-----------------
Alex Shatalin
Re: problem opening a new editor on double click [message #121439 is a reply to message #121293] Tue, 24 April 2007 09:02 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bhatia1984.yahoo.com

hi alex

i hv checked my ???matchingstrategy class after making the changes u told
earlier in matching strategy class.

what i am getting in matches(IEditorReference editorRef, IEditorInput
input)

here input is of type :- DiagramEditorInput whereas

editorInput = editorRef.getEditorInput();

this line return editor input as of type :- FileEditorInput.

so it doesnt enter into the loop :

if (editorInput instanceof URIEditorInput && input instanceof
URIEditorInput)
{
}
& always false is returned.

also this is what is written in my doexecutewithresult method in
opendiagram policy

protected CommandResult doExecuteWithResult(IProgressMonitor monitor,
IAdaptable info) throws ExecutionException {
try {
Diagram diagram = getDiagramToOpen();
if (diagram == null) {
diagram = intializeNewDiagram();
}

final DiagramEditorInput editorInput = new DiagramEditorInput(
diagram);
IWorkbenchPage page = PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getActivePage();

page.openEditor(editorInput, getEditorID());
return CommandResult.newOKCommandResult();
} catch (Exception ex) {
throw new ExecutionException("Can't open diagram", ex);
}

thanks
varun
Re: problem opening a new editor on double click [message #121515 is a reply to message #121439] Tue, 24 April 2007 11:41 Go to previous message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello varun,

So, once more: you are using old version of GMF and in new version all these
problems are corrected.

If you still going to modify existing code manually then you have to implement
matches() method of the matching strategy to return "true" if
editorRef referencing editor openned upon the editorInput equals to the input
and "false" otherwise. That's it.
-----------------
Alex Shatalin
Previous Topic:Possible to map this metamodel with GMF?
Next Topic:GMF limitation, a bug, or is it me?
Goto Forum:
  


Current Time: Fri Jul 19 07:24:30 GMT 2024

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

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

Back to the top