Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3808846
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T15:12:45+00:00 2026-05-19T15:12:45+00:00

We are using Eclipse API in our RAP application.This uses Eclipse Modeling Frame Work.

  • 0

We are using Eclipse API in our RAP application.This uses Eclipse Modeling Frame Work.
When a page gets edited, Model Becomes Dirty and as a Result,Save Button gets Enabled.

In our editor pages, when ever there is an error in the Page, we set the Validation flag of the Editor page to false, which would in turn display red colored marks on the page.Then usually save button is also becoming enabled.

But, I want to change this behavior.When some error mark appears on the page, I don’t want to get the save button enabled,.It shouldn’t allow the user to save the model in the error stage.
The save button should be disabled, How can I achieve this.
Kindly clear my doubt.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T15:12:46+00:00Added an answer on May 19, 2026 at 3:12 pm

    The editor generated by EMF uses a commandstacklistener to fire a PROP_DIRTY to the editor. If this property is fired, the underlying framework will ask the editors #isDirty Method for the dirty state. This is the place where you can implement your logic.

    @Override
    public boolean isDirty() {
        Diagnostic diagnostic = validateMyModel();
        return ((BasicCommandStack)editingDomain.getCommandStack()).isSaveNeeded() && diagnostic.getSeverity() == Diagnostic.OK;
    }
    

    This case doesn’t cover the usecase, that the editor could have been already dirty when the user makes a not-valid edit on the model.

    But that is not the best way IMHO. Because if the user closes the editor all changes of the model are lost, without any notification (because of the missing dirty-flag). So he probably did 100 valid modifications, 1 invalid and loses his changed model.

    A better way is to show a warning-message if the user wants to save the dialog. If there are errors in the dialog the editor cannot change its state from dirty to not-dirty and the user has to

    • correct all erros or
    • close the editor and looses all his changens

    To achieve that you have to implement in your doSave(IProgressMonitor progressMonitor) method a dialog to show the errors. The more tricky part is to override the default-behavior of closing a dirty editor. The workbench will show a dialog with, Yes, No and Cancel
    To override this behavior you have to implement the interface org.eclipse.ui.ISaveablePart2 in your editor to override the promptToSaveOnClose() method. In this method there must be again your logic that checks for errors in the model. If there are errors, this method has to return ISaveablePart2.CANCEL so that editor is not closable as long as there are errors in the dirty model.

    HTH Tom

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Eclipse WTP plugin to generate the stub from this WSDL: https://api.sandbox.ebay.com/wsapi?wsdl
I am writing a RAP application using Eclipse RAP. The client may be any
I'm using eclipse. In the WEB-INF/lib folder I have the following jars. jstl-api-1.2.jar jstl-impl-1.2.jar
When using Eclipse PDT with XDebug to debug a PHP web application, is there
I developed a Blackberry application using Eclipse. The application is working fine in the
I have created a web application using Jersey and Dynamic Web Project of Eclipse.
I am working an application with JXL API and when i tried compiling using
I am following this tutorial using eclipse EE : hibernate-tutorial-for-begin . There are the
Well am using eclipse to make an android app which accesses google calendar API
I'm working in a java project using eclipse, eclipseLink, java persistence API (JPA) and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.