Understanding Product Editor Validation

View: New views
4 Messages — Rating Filter:   Alert me  

Understanding Product Editor Validation

by Martin.Scheerer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hello PDE-UI Team,

I am currently developing an eclipse forms application. I need some input validation like in the Product Editor. I looked at the code and I understand most of it, but I can not find the lines where the Error/Warning messages are created.

As an example:
In class WindowImagesSection in method createClient() all the inputs for different image file names are generated. Subclasses of AbstractFormValidator check their content. When there is no such file a error message is displayed. But where is the code to display the message (it smoothly fades in just where the page heading is, very nice ;-) ? I know how the String is constructed but I can not find the graphical representation an the logic triggering the display...

I hope my question is not completely off-topic...

Thank you,

Martin
_______________________________________________
pde-ui-dev mailing list
pde-ui-dev@...
https://dev.eclipse.org/mailman/listinfo/pde-ui-dev

Re: Understanding Product Editor Validation

by Brian Bauman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


The validating builders create an ErrorReporter to report errors.  For example, the Manifest validation builder creates a ManifestErrorReporter.  I believe all our ErrorReporters inherit from XMLErrorReporter (I know most do).  This XMLErrorReporter class contains a few "report" functions.  These function will go through and place a marker on the file/resource being validated.  

From here, the Platform will handle the UI rendering of the error/warning.  PDE never really triggers the display, only creates an IMarker on the resource and the Platform takes care of the rest.

Hope this helps

Brian Bauman
    IBM Software Group - Austin, TX
    Eclipse Committer
    baumanbr@...
    (512) 838 -2938 (T/L 678-2938)



Martin.Scheerer@...
Sent by: pde-ui-dev-bounces@...

08/28/2006 07:23 AM
Please respond to
"Eclipse PDE UI developers list." <pde-ui-dev@...>

To
pde-ui-dev@...
cc
Subject
[pde-ui-dev] Understanding Product Editor Validation






Hello PDE-UI Team,


I am currently developing an eclipse forms application. I need some input validation like in the Product Editor. I looked at the code and I understand most of it, but I can not find the lines where the Error/Warning messages are created.


As an example:
In class
WindowImagesSection in method createClient() all the inputs for different image file names are generated. Subclasses of AbstractFormValidator check their content. When there is no such file a error message is displayed. But where is the code to display the message (it smoothly fades in just where the page heading is, very nice ;-) ? I know how the String is constructed but I can not find the graphical representation an the logic triggering the display...

I hope my question is not completely off-topic...


Thank you,


Martin
_______________________________________________
pde-ui-dev mailing list
pde-ui-dev@...
https://dev.eclipse.org/mailman/listinfo/pde-ui-dev


_______________________________________________
pde-ui-dev mailing list
pde-ui-dev@...
https://dev.eclipse.org/mailman/listinfo/pde-ui-dev

Re: Understanding Product Editor Validation

by Janek Lasocki-Biczysko :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Martin,

Take a look at IEditorValidationStack#top() and its implementation in
EditorValidationStack#top()
The actual call that you are probably looking for (that slides up the
message) is Form#setMessage(String message, int Severity)
where Form is retreived from an IFormPage (see
EditorValidationStack#getForm(IEditorValidator validator) for an example)

Good luck and feel free to post any follow ups,

P.S If you follow the code we use in PDE (see PDEFormEditor for
IEditorValidationStack and use FormEntry objects for your fields) you
shouldn't have to call setMessage yourself as it will be called
automatically if your FormEntrys are set with IEditorValidators.

Janek Lasocki-Biczysko
IBM,  Eclipse Platform Developer


                                                                           
             Martin.Scheerer@e                                            
             sa.int                                                        
             Sent by:                                                   To
             pde-ui-dev-bounce         pde-ui-dev@...              
             s@...                                              cc
                                                                           
                                                                   Subject
             08/28/2006 08:23          [pde-ui-dev] Understanding Product  
             AM                        Editor Validation                  
                                                                           
                                                                           
             Please respond to                                            
              "Eclipse PDE UI                                              
             developers list."                                            
             <pde-ui-dev@eclip                                            
                  se.org>                                                  
                                                                           
                                                                           





Hello PDE-UI Team,

I am currently developing an eclipse forms application. I need some input
validation like in the Product Editor. I looked at the code and I
understand most of it, but I can not find the lines where the Error/Warning
messages are created.

As an example:
In class WindowImagesSection in method createClient() all the inputs for
different image file names are generated. Subclasses of
AbstractFormValidator check their content. When there is no such file a
error message is displayed. But where is the code to display the message
(it smoothly fades in just where the page heading is, very nice ;-) ? I
know how the String is constructed but I can not find the graphical
representation an the logic triggering the display...

I hope my question is not completely off-topic...

Thank you,

Martin _______________________________________________
pde-ui-dev mailing list
pde-ui-dev@...
https://dev.eclipse.org/mailman/listinfo/pde-ui-dev


_______________________________________________
pde-ui-dev mailing list
pde-ui-dev@...
https://dev.eclipse.org/mailman/listinfo/pde-ui-dev

Re: Understanding Product Editor Validation

by gm-mrktc :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Janek,

This is all great stuff and certainly applicable to anyone doing forms
validation in the RCP.  Is there any chance that these classes might be
factored out into a "lighter weight" plugin so that we don't have to include
the entire PDE just to get forms validation?  Alternatively, could they be
folded into one of the other, lower-level UI plugins?

Thanks.

graham

--
Marketcetera Trading Platform
download.run.trade.
www.marketcetera.org

Janek Lasocki-Biczysko wrote:
Hello Martin,

Take a look at IEditorValidationStack#top() and its implementation in
EditorValidationStack#top()
The actual call that you are probably looking for (that slides up the
message) is Form#setMessage(String message, int Severity)
where Form is retreived from an IFormPage (see
EditorValidationStack#getForm(IEditorValidator validator) for an example)

Good luck and feel free to post any follow ups,

P.S If you follow the code we use in PDE (see PDEFormEditor for
IEditorValidationStack and use FormEntry objects for your fields) you
shouldn't have to call setMessage yourself as it will be called
automatically if your FormEntrys are set with IEditorValidators.

Janek Lasocki-Biczysko
IBM,  Eclipse Platform Developer