OleControlSite.isDirty() returns true even after OleControlSite.save(..) is called [message #780703] |
Thu, 19 January 2012 06:52 |
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
|
|
|
Powered by
FUDForum. Page generated in 0.02920 seconds