288 |
288 |
*/
|
289 |
289 |
public void execute(String actionCommand) {
|
290 |
290 |
if (actionCommand.equals("NUEVO")) {
|
|
291 |
projectPath=null;
|
291 |
292 |
//Si est? modificado se pregunta si se quiere guardar el anterior
|
292 |
293 |
int answer = askSave();
|
293 |
294 |
if (answer == JOptionPane.CANCEL_OPTION) {
|
... | ... | |
299 |
300 |
ProjectDocument.initializeNUMS();
|
300 |
301 |
PluginServices.getMDIManager().closeAllWindows();
|
301 |
302 |
setProject(ProjectFactory.createProject());
|
302 |
|
|
|
303 |
|
303 |
304 |
// p.setModified(true);
|
304 |
305 |
getProjectFrame().setProject(p);
|
305 |
306 |
showProjectWindow();
|
... | ... | |
307 |
308 |
} else if (actionCommand.equals("ABRIR")) {
|
308 |
309 |
//Si est? modificado se pregunta si se quiere guardar el anterior
|
309 |
310 |
int answer = askSave();
|
310 |
|
|
|
311 |
|
311 |
312 |
if (answer == JOptionPane.CANCEL_OPTION) { // ? don't ask me why
|
312 |
313 |
ProjectDocument.initializeNUMS();
|
313 |
314 |
return;
|
... | ... | |
337 |
338 |
getProjectFrame().setProject(p);
|
338 |
339 |
PluginServices.getMainFrame().setTitle(p.getName());
|
339 |
340 |
getProjectFrame().refreshControls();
|
340 |
|
|
|
341 |
|
341 |
342 |
//jaume p.setModified(true);
|
342 |
343 |
p.restoreWindowProperties();
|
343 |
344 |
}
|
... | ... | |
664 |
665 |
|
665 |
666 |
public boolean isReadyToTerminate() {
|
666 |
667 |
int answer = askSave();
|
667 |
|
|
|
668 |
|
668 |
669 |
if (answer == JOptionPane.CANCEL_OPTION) {
|
669 |
670 |
// the user doesn't want to close the application
|
670 |
671 |
// so quit will be canceled.
|
... | ... | |
679 |
680 |
JOptionPane.YES_NO_OPTION);
|
680 |
681 |
ready = (sel == JOptionPane.YES_OPTION);
|
681 |
682 |
}
|
682 |
|
|
|
683 |
|
683 |
684 |
return ready;
|
684 |
685 |
} else if (answer == JOptionPane.NO_OPTION) {
|
685 |
686 |
// the user doesn't care about the current state of the project
|
... | ... | |
689 |
690 |
return false;
|
690 |
691 |
}
|
691 |
692 |
}
|
692 |
|
|
|
693 |
|
693 |
694 |
//Finalizar y preguntar si se quiere guardar el proyecto o cancelar.
|
694 |
695 |
public void terminate() {
|
695 |
696 |
// long t1,t2;
|
... | ... | |
713 |
714 |
ProjectTableFactory.register();
|
714 |
715 |
ProjectMapFactory.register();
|
715 |
716 |
}
|
716 |
|
|
|
717 |
|
717 |
718 |
private void initializeDocumentActionsExtensionPoint() {
|
718 |
719 |
ExtensionPoints extensionPoints = ExtensionPointsSingleton.getInstance();
|
719 |
720 |
if (!extensionPoints.containsKey("DocumentActions_View")) {
|