home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / esc.jar / com / extensibility / xa / ConstraintsCellDialog.class (.txt) < prev    next >
Encoding:
Java Class File  |  2000-06-30  |  4.1 KB  |  107 lines

  1. package com.extensibility.xa;
  2.  
  3. import com.extensibility.app.UI;
  4. import com.extensibility.util.Debug;
  5. import com.extensibility.xml.BaseDeclaration;
  6. import com.extensibility.xml.DTDUtilities;
  7. import com.extensibility.xml.EntityDeclaration;
  8. import com.extensibility.xml.InternalPEDeclaration;
  9. import com.extensibility.xml.URI;
  10. import java.awt.Component;
  11. import java.awt.Point;
  12. import java.util.Enumeration;
  13. import javax.swing.JFrame;
  14. import javax.swing.JPanel;
  15. import javax.swing.text.JTextComponent;
  16.  
  17. public class ConstraintsCellDialog extends CellDialog {
  18.    static Point lastLoc = new Point(0, 0);
  19.    // $FF: renamed from: oq com.extensibility.xa.OptionsQlicker
  20.    OptionsQlicker field_0;
  21.    JPanel btns;
  22.    Enumeration reusables;
  23.    Enumeration notations;
  24.    BaseDeclaration owner;
  25.  
  26.    public ConstraintsCellDialog(JFrame var1, SchemaDoc var2, OptionsQlicker var3, BaseDeclaration var4, boolean var5, String var6) {
  27.       super(var1, var2);
  28.       boolean var7 = false;
  29.       this.reusables = var2.getConstraintPENames();
  30.       this.notations = new 1(var2, (ConstraintsCellDialog)null);
  31.       this.field_0 = var3 != null ? var3 : new OptionsQlicker(((CellDialog)this).getSchemaDoc(), new OptionsQDataSource(((CellDialog)this).getSchemaDoc()));
  32.       Object var8;
  33.       if (var4 != null) {
  34.          var7 = true;
  35.          var8 = var4.getName();
  36.          this.owner = var4;
  37.       } else if (var5) {
  38.          var8 = null;
  39.       } else {
  40.          var8 = var2.getConstraintPENames();
  41.       }
  42.  
  43.       if (lastLoc.x == 0 && lastLoc.y == 0) {
  44.          lastLoc.x = 100;
  45.          lastLoc.y = 100;
  46.       }
  47.  
  48.       ((Component)this).setLocation(lastLoc);
  49.       ((CellDialog)this).prepare(UI.getString(var7 ? "dialog.constraints.cell.title" : "dialog.constraints.reusable.title"), UI.getString(var7 ? "dialog.constraints.cell.heading" : "dialog.constraints.reusable.heading"), var8);
  50.       if (var4 != null) {
  51.          this.setCellOwner(var4.getName(), var6);
  52.       }
  53.  
  54.    }
  55.  
  56.    protected JPanel createButtonPanel() {
  57.       return this.field_0.adoptBtnPanel();
  58.    }
  59.  
  60.    protected JTextComponent createEditor() {
  61.       return this.field_0;
  62.    }
  63.  
  64.    public void dispose() {
  65.       lastLoc = ((Component)this).getLocation();
  66.       super.dispose();
  67.    }
  68.  
  69.    protected Enumeration getList(int var1) {
  70.       if (var1 == 0) {
  71.          return this.notations;
  72.       } else if (var1 == 1) {
  73.          return this.reusables;
  74.       } else {
  75.          Debug.assert(false, "getlist > 1");
  76.          return null;
  77.       }
  78.    }
  79.  
  80.    protected String getListTab(int var1) {
  81.       if (var1 > 1) {
  82.          return null;
  83.       } else {
  84.          String var2 = String.valueOf("dialog.constraints.tab").concat(String.valueOf(var1));
  85.          return UI.getString(var2);
  86.       }
  87.    }
  88.  
  89.    protected void insertName(String var1) {
  90.       this.field_0.insertName(var1);
  91.    }
  92.  
  93.    protected void setCellOwner(String var1, String var2) {
  94.       if (var2 == null) {
  95.          String var3 = DTDUtilities.convertPEName(var1, false);
  96.          InternalPEDeclaration var4 = (InternalPEDeclaration)super.doc.getNamedDeclaration(var3, Class.forName("com.extensibility.xml.InternalPEDeclaration"));
  97.          URI var5 = ((BaseDeclaration)var4).getURI();
  98.          ((CellDialog)this).setURI(var5.equals(((CellDialog)this).getSchemaDoc().getURI()) ? null : var5);
  99.          ((CellDialog)this).setText(((EntityDeclaration)var4).getValue());
  100.       } else {
  101.          ((CellDialog)this).setText(var2);
  102.       }
  103.  
  104.       super.setCellOwner(var1, var2);
  105.    }
  106. }
  107.