home *** CD-ROM | disk | FTP | other *** search
/ Symantec Visual Cafe for Java 2.5 / symantec-visual-cafe-2.5-database-dev-edition.iso / DBServ / DSNTool.BIN / DeleteBox.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-02-18  |  3.0 KB  |  82 lines

  1. package dsntool;
  2.  
  3. import java.awt.Button;
  4. import java.awt.Component;
  5. import java.awt.Container;
  6. import java.awt.Dialog;
  7. import java.awt.Font;
  8. import java.awt.Frame;
  9. import java.awt.Label;
  10. import java.awt.LayoutManager;
  11. import java.awt.Rectangle;
  12. import java.awt.Window;
  13. import java.awt.event.ActionEvent;
  14. import java.awt.event.WindowEvent;
  15. import symantec.itools.awt.KeyPressManagerPanel;
  16.  
  17. public class DeleteBox extends Dialog {
  18.    KeyPressManagerPanel kpm;
  19.    Button yesButton;
  20.    Button noButton;
  21.    Label msg;
  22.    Label msg2;
  23.  
  24.    public DeleteBox(Frame var1, String var2) {
  25.       super(var1, "Delete Data Source Name?", true);
  26.       ((Dialog)this).setResizable(false);
  27.       ((Container)this).setLayout((LayoutManager)null);
  28.       ((Component)this).resize(((Container)this).insets().left + ((Container)this).insets().right + 373, ((Container)this).insets().top + ((Container)this).insets().bottom + 135);
  29.       this.kpm = new KeyPressManagerPanel();
  30.       this.kpm.setLayout((LayoutManager)null);
  31.       this.kpm.reshape(0, 0, 373, 135);
  32.       ((Container)this).add(this.kpm);
  33.       this.msg = new Label(var2, 1);
  34.       this.msg.setFont(new Font("Helvetica", 0, 11));
  35.       this.kpm.add(this.msg);
  36.       this.msg.setBounds(((Container)this).insets().left + 90 - var2.length(), ((Container)this).insets().top + 35, 204, 23);
  37.       this.msg2 = new Label("will be deleted.  Are you sure?", 1);
  38.       this.msg2.setFont(new Font("Helvetica", 0, 11));
  39.       this.kpm.add(this.msg2);
  40.       this.msg2.setBounds(((Container)this).insets().left + 84, ((Container)this).insets().top + 55, 204, 23);
  41.       this.noButton = new Button("Keep DSN");
  42.       this.noButton.setActionCommand("button");
  43.       this.noButton.setFont(new Font("Helvetica", 0, 11));
  44.       this.kpm.add(this.noButton);
  45.       this.noButton.setBounds(((Container)this).insets().left + 200, ((Container)this).insets().top + 84, 79, 22);
  46.       this.yesButton = new Button("Delete DSN");
  47.       this.yesButton.setActionCommand("button");
  48.       this.yesButton.setFont(new Font("Helvetica", 0, 11));
  49.       this.kpm.add(this.yesButton);
  50.       this.yesButton.setBounds(((Container)this).insets().left + 50, ((Container)this).insets().top + 84, 79, 22);
  51.       this.noButton.requestFocus();
  52.       SymWindow var3 = new SymWindow(this);
  53.       ((Window)this).addWindowListener(var3);
  54.       SymAction var4 = new SymAction(this);
  55.       this.noButton.addActionListener(var4);
  56.       this.yesButton.addActionListener(var4);
  57.    }
  58.  
  59.    public synchronized void show() {
  60.       Rectangle var1 = ((Component)this).getParent().bounds();
  61.       Rectangle var2 = ((Component)this).bounds();
  62.       ((Component)this).move(var1.x + (var1.width - var2.width) / 2, var1.y + (var1.height - var2.height) / 2);
  63.       super.show();
  64.    }
  65.  
  66.    public synchronized void wakeUp() {
  67.       this.notify();
  68.    }
  69.  
  70.    void DeleteBox_WindowClosing(WindowEvent var1) {
  71.       this.noButton.setLabel("Default Cancel");
  72.       ActionEvent var2 = new ActionEvent(this.noButton, 1001, "button");
  73.       this.Button_Action(var2);
  74.    }
  75.  
  76.    void Button_Action(ActionEvent var1) {
  77.       ((Component)this).hide();
  78.       ((Window)this).dispose();
  79.       ((DSNTOOL)((Component)this).getParent()).aSymAction.actionPerformed(var1);
  80.    }
  81. }
  82.