home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2001 October / PCpro_2001_10.ISO / xml / xmlpro / data1.cab / Program_Executable_FILES / xmlpro.jar / PopupSelected.class (.txt) < prev    next >
Encoding:
Java Class File  |  1999-09-15  |  1.6 KB  |  45 lines

  1. import java.awt.event.ActionEvent;
  2. import java.awt.event.ActionListener;
  3.  
  4. public class PopupSelected implements ActionListener {
  5.    ElemPanel parent;
  6.    XMLPro theApp;
  7.  
  8.    PopupSelected(ElemPanel var1, XMLPro var2) {
  9.       this.theApp = var2;
  10.       this.parent = var1;
  11.    }
  12.  
  13.    public void actionPerformed(ActionEvent var1) {
  14.       String var2 = var1.getActionCommand();
  15.       if (var2.equals(Strings.DeleteElement)) {
  16.          this.parent.deleteElem();
  17.          this.theApp.xmlDocument.modified = true;
  18.          this.theApp.xmlDocument.validated = false;
  19.       } else if (var2.equals(Strings.MoveElementUp)) {
  20.          this.parent.elemUp();
  21.          this.theApp.xmlDocument.validated = false;
  22.          this.theApp.xmlDocument.modified = true;
  23.          this.theApp.xmlDocument.validated = false;
  24.       } else if (var2.equals(Strings.MoveElementDown)) {
  25.          this.parent.elemDown();
  26.          this.theApp.xmlDocument.validated = false;
  27.          this.theApp.xmlDocument.modified = true;
  28.          this.theApp.xmlDocument.modified = true;
  29.          this.theApp.xmlDocument.validated = false;
  30.       } else if (var2.equals(Strings.ExpandBeneath)) {
  31.          this.parent.expandBeneath();
  32.       } else if (var2.equals(Strings.CollapseBeneath)) {
  33.          this.parent.collapseBeneath();
  34.       } else if (var2.equals(Strings.AddPCDATA)) {
  35.          this.parent.addElement("", 3);
  36.       } else if (var2.equals(Strings.AddCDATA)) {
  37.          this.parent.addElement("", 4);
  38.       } else if (var2.equals(Strings.AddComment)) {
  39.          this.parent.addElement("", 8);
  40.       }
  41.  
  42.       this.parent.theTree.repaint();
  43.    }
  44. }
  45.