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

  • Home
  • SEARCH
  • 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 8888061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:57:20+00:00 2026-06-14T21:57:20+00:00

Currently I am working on RCP application with view part . In application, user

  • 0

Currently I am working on RCP application with view part.
In application, user can able to open multiple instances of same view part.
I am able to handle view parts close operation with menu selection.
But I am unaware of handling the ‘X’ i.e tab close operation.

I tried with adding IPartListener object to the view part object,(I refereed this link ),but in its partClosed() method I am facing 2 issues,

  1. I am not able to get the current instance of view part object.
  2. The partClosed() method only gets called after closing the tab, so I am not able to show the confirmation for closing the tab.

What approach should I use to resolve above two questions.

Any help is appreciated.

Best regards,

Mandar

  • 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-06-14T21:57:21+00:00Added an answer on June 14, 2026 at 9:57 pm

    You may consider to implement the interface ISaveablePart2 to your ViewPart. This interface is responsible to prompt the user if the part should be closed or not. Furthermore it decides what to do with the unsaved data.

    You can promt the user if the view should be closed with a custom dialog in the method promptToSaveOnClose().

    @Override
    public boolean isDirty() {
        return true;
    }
    
    @Override
    public int promptToSaveOnClose() {
        boolean close = MessageDialog.openConfirm(
                Display.getCurrent().getActiveShell(), "Close?", "Really?");
    
        if(close)
            return YES;
        return CANCEL;
    }
    

    Eclispe API: ISaveablePart2

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

Sidebar

Related Questions

I am working on an RCP application. Currently, I am stuck on trying to
Currently working in Java, i'd like to be able to select part of an
Am currently working on an application that requires users to submit posts and comments
i'm currently working on a Eclipse RCP Project. I have a Plugin Fragment where
Currently working on database part of android project. The main aim of the project
Currently working on a Spring 2.5 web application, looks as if the business has
Currently working through a Teach Yourself WPF tutorial. Usually I can mentally convert from
I currently working on DOM and i wonder how can change the place of
I'm currently working on a consumer mobile application project and have read that 40%
Am currently working on a web application which receives the encoded text from the

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.