TextEditor [message #212971] |
Thu, 18 March 2004 10:54  |
Eclipse User |
|
|
|
Originally posted by: crscca.bol.net.in
Hi,
I am extending from org.eclipse.ui.editors.text.TextEditor.
At any time the user needs to save the contents afetr making changes the
user presses save in the appropriate menu.
Before the actual save I wish to intervene and make some checks.
Q1) How do I get the content that corresponds to what is being displayed
in the editor(- thats the text I need to validate before it actually gets
saved)?
I presume I must do all this inside the doSave(IProgressMonitor monitor)
method.
Q2) Should I use the documentProvider?How exactly?
Raster
|
|
|
|
|
Re: TextEditor [message #213645 is a reply to message #213076] |
Fri, 19 March 2004 12:22   |
Eclipse User |
|
|
|
Originally posted by: crscca.bol.net.in
Thanks that worked. I am now displaying a messagebox wherein I am giving
the user a warning and allowing the user to save if the user insists.
Q1) What are these methods meant for-"createStatusControl,
doRevertToSaved, sanityCheckState, updatePartControl, updateStatusField,
validateState, updateState, safelySanityCheckState,
handleExceptionOnSave"?
Q2) I am not using these methods should I? Am I missing out on something?
Tom Eicher wrote:
> TextEditor yourEditor;
> IDocument document=
> yourEditor.getDocumentProvider()
> .getDocument(yourEditor.getEditorInput());
> then, look at the document.
> -tom
> Raster wrote:
> > Hi,
> >
> > I am extending from org.eclipse.ui.editors.text.TextEditor.
> > At any time the user needs to save the contents afetr making changes the
> > user presses save in the appropriate menu.
> > Before the actual save I wish to intervene and make some checks.
> >
> > Q1) How do I get the content that corresponds to what is being displayed
> > in the editor(- thats the text I need to validate before it actually gets
> > saved)?
> >
> > I presume I must do all this inside the doSave(IProgressMonitor monitor)
> > method.
> >
> > Q2) Should I use the documentProvider?How exactly?
> >
> > Raster
> >
|
|
|
Re: TextEditor [message #307244 is a reply to message #213645] |
Thu, 17 August 2006 09:10  |
Eclipse User |
|
|
|
Raster wrote:
>Thanks that worked. I am now displaying a messagebox wherein I am giving
>the user a warning and allowing the user to save if the user insists.
>
>Q1) What are these methods meant for-"createStatusControl,
>doRevertToSaved, sanityCheckState, updatePartControl, updateStatusField,
>validateState, updateState, safelySanityCheckState,
>handleExceptionOnSave"?
>
>
Read the Javadoc.
>Q2) I am not using these methods should I? Am I missing out on something?
>
>
Read the Javadoc and find out it applies to your code.
Dani
>
>
>Tom Eicher wrote:
>
>
>
>>TextEditor yourEditor;
>>
>>
>
>
>
>>IDocument document=
>> yourEditor.getDocumentProvider()
>> .getDocument(yourEditor.getEditorInput());
>>
>>
>
>
>
>>then, look at the document.
>>
>>
>
>
>
>>-tom
>>
>>
>
>
>
>>Raster wrote:
>>
>>
>>>Hi,
>>>
>>>I am extending from org.eclipse.ui.editors.text.TextEditor.
>>>At any time the user needs to save the contents afetr making changes the
>>>user presses save in the appropriate menu.
>>>Before the actual save I wish to intervene and make some checks.
>>>
>>>Q1) How do I get the content that corresponds to what is being displayed
>>>in the editor(- thats the text I need to validate before it actually gets
>>>saved)?
>>>
>>>I presume I must do all this inside the doSave(IProgressMonitor monitor)
>>>method.
>>>
>>>Q2) Should I use the documentProvider?How exactly?
>>>
>>>Raster
>>>
>>>
>>>
>
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.06591 seconds