Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » OleControlSite.isDirty() returns true even after OleControlSite.save(..) is called(OleControlSite.isDirty() returns true even after OleControlSite.save(excelFile, true) returns true)
icon5.gif  OleControlSite.isDirty() returns true even after OleControlSite.save(..) is called [message #780703] Thu, 19 January 2012 01:52
Suraj Varghese is currently offline Suraj Varghese
Messages: 4
Registered: November 2011
Junior Member
Hi All,

I am developing a multi-page editor (extending MultiPageEditorPart) having 2 pages.
For editing the source code, a text editor and an excel sheet is provided in the 2 pages.
I have managed to embed the excel sheet and all synchronization with the other page has also been taken care of.
Now, if I am on the text editor and I click on the "save" button then the source code gets saved successfully and the "save" button gets disabled as well.
However, If I am on the excel sheet page of the editor and I click on "save" then the source code gets saved successfully but the "save" button remains enabled.

See the below code.

//Components are created
//
...
OleFrame excelFrame = new OleFrame(composite, SWT.NONE);

File excelFile = new File("D:\\ExcelSheet1.xls");

OleControlSite excelControlSite = new OleControlSite(excelFrame, SWT.NONE, excelFile);
excelControlSite.doVerb(OLE.OLEIVERB_UIACTIVATE);
...
//

//Added an OLE Listener to identify a change in the excel file
//
...
excelControlSite.addEventListener(automation, eventSinkId, eventID, listener);
...
//

//Excel file is saved
//
...
boolean isSaved = excelControlSite.save(excelFile, true);
boolean isDirty = excelControlSite.isDirty();
...
//

Now, variable isSaved holds value as true which is as expected and the Excel File has also been saved successfully.
However, excelControlSite.isDirty() still returns true which should have returned false since the file has been saved.

Due to this the save button remains enabled.

Has anyone come across a similar problem?
Any idea how to tackle this issue?

Thanks and Regards,
Suraj
Previous Topic:Add WindowBuilder TabItem at Runtime
Next Topic:OleControlSite.isDirty() returns true even after OleControlSite.save(..) is called
Goto Forum:
  


Current Time: Wed Jul 30 21:28:24 EDT 2014

Powered by FUDForum. Page generated in 0.05721 seconds