Subversion Repositories general

Compare Revisions

No changes between revisions

Ignore whitespace Rev 149 → Rev 150

/sun/xmleditor/trunk/src/control/OtherGUIActions.java
0,0 → 1,80
/*
* Created on 02.07.2003
*
* To change the template for this generated file go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
package src.control;
 
/**
* @author Holgerchen
*
* To change the template for this generated type comment go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
 
import java.awt.event.*;
import javax.swing.*;
import java.io.*;
 
public class OtherGUIActions implements ActionListener
{
 
public OtherGUIActions()
{
}
 
public void actionPerformed(ActionEvent e) {
 
if (e.getActionCommand() == "Save document") {
JFrame x = new JFrame();
JFileChooser fileChooser = new JFileChooser();
int returnValue = fileChooser.showSaveDialog(x);
x.show();
if (returnValue == JFileChooser.APPROVE_OPTION) {
File saveFile = fileChooser.getSelectedFile();
// src.document.OurDocument.saveDocument(src.parser.Parser.getDocument(), saveFile);
}
}
 
if (e.getActionCommand() == "Exit") {
if (quitConfirmed() == true) {
System.exit(0);
}
}
}
public boolean quitConfirmed()
{
JFrame frame = new JFrame();
String s1 = "Quit";
String s2 = "Cancel";
Object[] options = {s1, s2};
int n = JOptionPane.showOptionDialog(frame,
"Do you really want to quit?",
"Quit Confirmation",
JOptionPane.YES_NO_OPTION,
JOptionPane.QUESTION_MESSAGE,
null,
options,
s1);
if (n == JOptionPane.YES_OPTION)
{
return true;
}
else
{
return false;
}
}
/* if (e.getActionCommand() == "validate")
{
Validator myValidator = new Validator(myGui.getLogInterface());
}*/
}
 
 
 
Property changes:
Added: svn:keywords
+LastChangedDate LastChangedRevision LastChangedBy HeadURL Id
\ No newline at end of property