home *** CD-ROM | disk | FTP | other *** search
- package com.extensibility.xa;
-
- import com.extensibility.app.UI;
- import com.extensibility.util.Debug;
- import com.extensibility.xml.BaseDeclaration;
- import com.extensibility.xml.DTDUtilities;
- import com.extensibility.xml.EntityDeclaration;
- import com.extensibility.xml.InternalPEDeclaration;
- import com.extensibility.xml.URI;
- import java.awt.Component;
- import java.awt.Point;
- import java.util.Enumeration;
- import javax.swing.JFrame;
- import javax.swing.JPanel;
- import javax.swing.text.JTextComponent;
-
- public class TextCellDialog extends CellDialog {
- static Point lastLoc = new Point(0, 0);
- JPanel btns;
- Enumeration reusables;
- BaseDeclaration owner;
-
- public TextCellDialog(JFrame var1, SchemaDoc var2, BaseDeclaration var3, boolean var4, String var5) {
- super(var1, var2);
- boolean var6 = false;
- this.reusables = var2.getTextPENames();
- Object var7;
- if (var3 != null) {
- var6 = true;
- var7 = var3.getName();
- this.owner = var3;
- } else if (var4) {
- var7 = null;
- } else {
- var7 = var2.getTextPENames();
- }
-
- if (lastLoc.x == 0 && lastLoc.y == 0) {
- lastLoc.x = 100;
- lastLoc.y = 100;
- }
-
- ((Component)this).setLocation(lastLoc);
- ((CellDialog)this).prepare(UI.getString(var6 ? "dialog.text.cell.title" : "dialog.text.reusable.title"), UI.getString(var6 ? "dialog.text.cell.heading" : "dialog.text.reusable.heading"), var7);
- if (var3 != null) {
- this.setCellOwner(var3.getName(), var5);
- }
-
- }
-
- public void dispose() {
- lastLoc = ((Component)this).getLocation();
- super.dispose();
- }
-
- protected void insertName(String var1) {
- super.editor.replaceSelection(var1);
- }
-
- protected JTextComponent createEditor() {
- return UI.createTextArea();
- }
-
- protected JPanel createButtonPanel() {
- return null;
- }
-
- protected String getListTab(int var1) {
- if (var1 <= 0 && this.reusables != null) {
- String var2 = String.valueOf("dialog.text.tab").concat(String.valueOf(var1));
- return UI.getString(var2);
- } else {
- return null;
- }
- }
-
- protected Enumeration getList(int var1) {
- if (var1 == 0) {
- return this.reusables;
- } else {
- Debug.assert(false, "getlist > 0");
- return null;
- }
- }
-
- protected void setCellOwner(String var1, String var2) {
- if (var2 == null) {
- String var3 = DTDUtilities.convertPEName(var1, false);
- InternalPEDeclaration var4 = (InternalPEDeclaration)super.doc.getNamedDeclaration(var3, Class.forName("com.extensibility.xml.InternalPEDeclaration"));
- URI var5 = ((BaseDeclaration)var4).getURI();
- ((CellDialog)this).setURI(var5.equals(((CellDialog)this).getSchemaDoc().getURI()) ? null : var5);
- ((CellDialog)this).setText(((EntityDeclaration)var4).getValue());
- } else {
- ((CellDialog)this).setText(var2);
- }
-
- super.setCellOwner(var1, var2);
- }
- }
-