Save a diagram when select other [message #556533] |
Wed, 01 September 2010 12:39  |
Eclipse User |
|
|
|
Hi I´m making a gmf editor which has diferent types of diagrams that are oppened by double clicking.
When I change from one diagram to another, the chenges made aren´t saved. I want to make my my editor save the diagram changes automatically when I change to another diagram page.
Anybody know how to do this?
Thanks in advance, Pablo.
|
|
|
|
|
|
|
|
Re: Save a diagram when select other [message #556812 is a reply to message #556721] |
Thu, 02 September 2010 13:00   |
Eclipse User |
|
|
|
Hello, thaks yor the last reply.
This is my partDeactivated method():
public void partDeactivated(IWorkbenchPart part) {
// TODO Auto-generated method stub
if (part instanceof MMSCXMLWebSecundario.diagram.part.MMSCXMLWebDiagramEditor) {
try {
((MMSCXMLWebSecundario.diagram.part.MMSCXMLWebDiagramEditor) part)
.doSaveAs();
} catch (Exception e) {
System.out.println(e);
}
System.out.println("Autoguardado");
}
}
I have done the "autoSave" but there´s another problem now:
I would like that my editor save when I change from one diagram to another, but with this implementation, when I change the current editor appears a SaveAs dialog instead of autosave.
The problem with the SaveAs is that, I can´t select the same file name, because the file is opened, and I hav to put a new file name each time.
I,ve been looking to the XXXDiagramEditor Class, and I´ve not found any method to do a "Simple Save" only SaveAs().
Do you know how to do an autoSave, without showing any dialog.
Thanks again, Pablo
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.11674 seconds