Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » MultiPageEditor - working with many files, marking MPE as dirty throw exception
MultiPageEditor - working with many files, marking MPE as dirty throw exception [message #901717] Tue, 14 August 2012 10:15 Go to next message
cyriel cysiek is currently offline cyriel cysiekFriend
Messages: 4
Registered: August 2012
Junior Member
Hi all,
I've got MultiPageEditor in which i've got 5 pages. On first page
there is an editor which extends GraphicalEditor(geEx), on second there are
2(logicInputEditor, logicOutputEditor) GroovyEditor's org.codehaus.groovy.eclipse.editor.GroovyEditor).
geEx is working with one file(e.g. first.qwe) and
logicEditors are working with 2 other files(in.groovy, out.groovy). In
geEx there is a code:
@Override
        public void commandStackChanged(EventObject event) {
                firePropertyChange(IEditorPart.PROP_DIRTY);
                super.commandStackChanged(event);
        }

When I edit file first.qwe MultiPageEditor know that something has
been modified and marks it and allow to save file - everything is
fine.

I add listeners to GrooveEditors:
logicInputEditor.addPropertyListener(new IPropertyListener() {
                         @Override
                         public void propertyChanged(Object source, int propId) {
                                 if (propId == IEditorPart.PROP_DIRTY){
                                         firePropertyChange(IEditorPart.PROP_DIRTY);

                                 }
                         }
                 });

I can't override commandStackChanged function, because GrooveEditor doesn't implement CommandStackListener.

Each time I edit something in one of GroovyEditors, the MultiPageEditor is changing its state to dirty - that's what i wanted, but also exception is printed on console. So - it's working as i want, but throwing and catching exception each time user type someting in editor is propably very


The message is:
Quote:
Problem trying to determine classpath of project Test:
Java Model Exception: Java Model Status [Test does not exist]
at org.eclipse.jdt.internal.core.JavaElement.newNotPresentException(JavaElement.java:495)
at org.eclipse.jdt.internal.core.JavaModelManager.getPerProjectInfoCheckExistence(JavaModelManager.java:2287)
at org.eclipse.jdt.internal.core.JavaProject.getPerProjectInfo(JavaProject.java:1914)
at org.eclipse.jdt.internal.core.JavaProject.getOutputLocation(JavaProject.java:1741)
at org.eclipse.jdt.core.util.CompilerUtils.calculateClasspath(CompilerUtils.java:209)
at org.eclipse.jdt.core.util.CompilerUtils.setGroovyClasspath(CompilerUtils.java:152)
at org.eclipse.jdt.core.util.CompilerUtils.setGroovyClasspath(CompilerUtils.java:117)
at org.codehaus.jdt.groovy.model.GroovyCompilationUnit.buildStructure(GroovyCompilationUnit.java:260)
at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:258)
at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:526)
at org.eclipse.jdt.internal.core.CompilationUnit.makeConsistent(CompilationUnit.java:1100)
at org.codehaus.jdt.groovy.model.GroovyReconcileWorkingCopyOperation.makeConsistent(GroovyReconcileWorkingCopyOperation.java:60)
at org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation.executeOperation(ReconcileWorkingCopyOperation.java:89)
at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:728)
at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:788)
at org.codehaus.jdt.groovy.model.GroovyCompilationUnit.reconcile(GroovyCompilationUnit.java:423)
at org.eclipse.jdt.internal.core.CompilationUnit.reconcile(CompilationUnit.java:1231)
at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:133)
at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.access$0(JavaReconcilingStrategy.java:108)
at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy$1.run(JavaReconcilingStrategy.java:89)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:87)
at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:151)
at org.eclipse.jdt.internal.ui.text.CompositeReconcilingStrategy.reconcile(CompositeReconcilingStrategy.java:86)
at org.eclipse.jdt.internal.ui.text.JavaCompositeReconcilingStrategy.reconcile(JavaCompositeReconcilingStrategy.java:104)
at org.eclipse.jface.text.reconciler.MonoReconciler.process(MonoReconciler.java:77)
at org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:206)

or:
Quote:

!ENTRY org.eclipse.jdt.core 4 4 2012-08-13 20:33:29.402
!MESSAGE Problem with build structure for in.groovy
!STACK 1
Java Model Exception: Java Model Status [Test does not exist]
at org.eclipse.jdt.internal.core.JavaElement.newJavaModelException(JavaElement.java:505)
at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:246)
at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:526)
at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:255)
at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:241)
at org.eclipse.jdt.internal.core.JavaProject.getJavaProjectElementInfo(JavaProject.java:1646)
at org.eclipse.jdt.internal.core.JavaProject.newNameLookup(JavaProject.java:2334)
at org.eclipse.jdt.internal.core.SearchableEnvironment.<init>(SearchableEnvironment.java:59)
at org.eclipse.jdt.internal.core.SearchableEnvironment.<init>(SearchableEnvironment.java:66)
at org.eclipse.jdt.internal.core.CancelableNameEnvironment.<init>(CancelableNameEnvironment.java:26)
at org.eclipse.jdt.internal.core.CompilationUnitProblemFinder.process(CompilationUnitProblemFinder.java:178)
at org.codehaus.jdt.groovy.model.GroovyCompilationUnit.buildStructure(GroovyCompilationUnit.java:338)
at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:258)
at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:526)
at org.eclipse.jdt.internal.core.CompilationUnit.makeConsistent(CompilationUnit.java:1100)
at org.codehaus.jdt.groovy.model.GroovyReconcileWorkingCopyOperation.makeConsistent(GroovyReconcileWorkingCopyOperation.java:60)
at org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation.executeOperation(ReconcileWorkingCopyOperation.java:89)
at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:728)
at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:788)
at org.codehaus.jdt.groovy.model.GroovyCompilationUnit.reconcile(GroovyCompilationUnit.java:423)
at org.eclipse.jdt.internal.core.CompilationUnit.reconcile(CompilationUnit.java:1231)
at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:133)
at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.access$0(JavaReconcilingStrategy.java:108)
at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy$1.run(JavaReconcilingStrategy.java:89)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:87)
at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:151)
at org.eclipse.jdt.internal.ui.text.CompositeReconcilingStrategy.reconcile(CompositeReconcilingStrategy.java:86)
at org.eclipse.jdt.internal.ui.text.JavaCompositeReconcilingStrategy.reconcile(JavaCompositeReconcilingStrategy.java:104)
at org.eclipse.jface.text.reconciler.MonoReconciler.process(MonoReconciler.java:77)
at org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:206)
!SUBENTRY 1 org.eclipse.jdt.core 4 969 2012-08-13 20:33:29.402
!MESSAGE Test does not exist



The question is - how i can fix this? How should i send 'message' to MultiPageEditor, that one of GroovyEditors is 'dirty'?


Sory for my english Smile
Re: MultiPageEditor - working with many files, marking MPE as dirty throw exception [message #902097 is a reply to message #901717] Wed, 15 August 2012 20:00 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4435
Registered: July 2009
Senior Member

On 8/14/2012 6:15 AM, cyriel cysiek wrote:
> The question is - how i can fix this? How should i send 'message' to
> MultiPageEditor, that one of GroovyEditors is 'dirty'?

I don't think the exception is related to the editor being 'dirty' or
not, but something about the kind of project your file is in. You'll
want to ask the developers of the Groovy editor you've mentioned. It is
not part of the Web Tools Platform.

--
---
Nitin Dahyabhai
Eclipse WTP Source Editing and JSDT
IBM Rational


_
Nitin Dahyabhai
Eclipse Web Tools Platform
Re: MultiPageEditor - working with many files, marking MPE as dirty throw exception [message #902193 is a reply to message #902097] Thu, 16 August 2012 09:44 Go to previous message
cyriel cysiek is currently offline cyriel cysiekFriend
Messages: 4
Registered: August 2012
Junior Member
Nitin Dahyabhai wrote on Wed, 15 August 2012 16:00

I don't think the exception is related to the editor being 'dirty' or
not, but something about the kind of project your file is in. You'll
want to ask the developers of the Groovy editor you've mentioned. It is
not part of the Web Tools Platform.

I've already asked Smile Your answer gave me a hint - i've changed editor type from GroovyEditor to TextEditor and everything is fine without any exception. It seems that propably it's bug in GroovyEditor(or GroovyEditor handles editor state in different way).
Thanks for your answer - it's not solution for my problem, but now I am one step closer to it(at least I hope so Wink) Smile
By the way - where can i find example of using 2 or more editors working on different files and handling state dirty/not dirty in MultiPageEditor? Any example or even plugin source will be a great help for me.

Previous Topic:Embedded SVG in HTML5 has Validation Warnings
Next Topic:Using the XML Catalog outside WTP
Goto Forum:
  


Current Time: Thu Apr 25 22:02:08 GMT 2024

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

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

Back to the top