source: main/trunk/greenstone3/src/java/org/greenstone/admin/gui/SaveChangePrompt.java@ 28862

Last change on this file since 28862 was 10943, checked in by kjdon, 18 years ago

I got rid of all the core files - they were mainly not used. some I have created new versions, or now use teh gs3 version. updated all these files to reflect the changes

  • Property svn:keywords set to Author Date Id Revision
File size: 3.5 KB
Line 
1/**
2 *#########################################################################
3 *
4 * A component of the GAI application, part of the Greenstone digital
5 * library suite from the New Zealand Digital Library Project at the
6 * University of Waikato, New Zealand.
7 *
8 * <BR><BR>
9 *
10 * Author: Chi-Yu Huang, Greenstone Digital Library, University of Waikato
11 *
12 * <BR><BR>
13 *
14 * Copyright (C) 1999 New Zealand Digital Library Project
15 *
16 * <BR><BR>
17 *
18 * This program is free software; you can redistribute it and/or modify
19 * it under the terms of the GNU General Public License as published by
20 * the Free Software Foundation; either version 2 of the License, or
21 * (at your option) any later version.
22 *
23 * <BR><BR>
24 *
25 * This program is distributed in the hope that it will be useful,
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 * GNU General Public License for more details.
29 *
30 * <BR><BR>
31 *
32 * You should have received a copy of the GNU General Public License
33 * along with this program; if not, write to the Free Software
34 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
35 *########################################################################
36 */
37package org.greenstone.admin.gui;
38
39import java.awt.*;
40import java.awt.event.*;
41import java.io.*;
42import java.net.*;
43import javax.swing.*;
44import javax.swing.event.*;
45
46import org.greenstone.admin.gui.ConfPane;
47
48/** This class provides the functionality to show a prompt to save changed file
49 * @author Chi-Yu Huang, Greenstone Digital Library, University of Waikato
50 * @version 1.0
51 */
52public class SaveChangePrompt
53 extends JDialog {
54
55 /** A reference to ourself so any inner-classes can dispose of us. */
56 private SaveChangePrompt prompt = null;
57 private File file = null;
58
59 //A flag showing the saving change status
60 private boolean current_change_saved = false;
61
62 /** The size of the save prompt screen. */
63 static final Dimension SIZE = new Dimension(500, 500);
64
65 // Constructor.
66 public SaveChangePrompt() {
67 super();
68 prompt = this;
69 }
70
71 /** Destructor. */
72 public void destroy() {
73 prompt = null;
74 }
75
76 /** This method causes the Save Change Confirmation Dialog to be displayed.
77 * returns true if it has save the change file that is currently open */
78 // public boolean display(File file) {
79 /*int result = JOptionPane.showConfirmDialog((Component) null, "Do you really want to save the change", "Save Confirmation", JOptionPane.YES_NO_OPTION);
80 if ( result == JOptionPane.YES_OPTION) {
81 ConfPane confPane = new ConfPane();
82 confPane.saveNewConfSetting();
83 confPane.writeConfFile(file);
84 current_change_saved = true;
85 } else if (result == JOptionPane.NO_OPTION) {
86 current_change_saved = false;
87 prompt.dispose();
88 }
89 resultPrompt(current_change_saved);
90 return current_change_saved;*/
91 //}
92
93 /** Shows a save complete prompt.
94 * @param success A <strong>boolean</strong> indicating if the collection was successfully saved
95 */
96 public void resultPrompt(boolean success) {
97 if (success) {
98 JOptionPane.showMessageDialog(prompt,"The build property file has been saved.");
99 } else {
100 JOptionPane.showMessageDialog(prompt, "Cancel saving the change to build property file");
101 }
102 }
103
104 /** Any implementation of ActionListener requires this method so that when an
105 **action is performed the appropriate effect can occur.*/
106 public void actionPerformed(ActionEvent event) {
107 }
108}
Note: See TracBrowser for help on using the repository browser.