Program: 50899
Project: 50899
Buggy source:
public Component getTableCellEditorComponent(final JTable table,Object value,boolean isSelected,final int row,final int column){
  PropertyTableModel tableModel=(PropertyTableModel)table.getModel();
  Class<?> parentClassz=null;
  if (tableModel.getParentTarget() != null) {
    parentClassz=tableModel.getParentTarget().getClass();
  }
  Class<?> targetClassz=tableModel.target.getClass();
  String propertyName=tableModel.getRowName(row);
  String selectedFactTable=tableModel.getFactTable();
  String selectedFactTableSchema=tableModel.getFactTableSchema();
  listEditorValue=null;
  Object parent=this.getParentObject();
  MondrianGuiDef.RelationOrJoin currentRelation=getRelation(table,row,column);
  boolean nonTableRelation=currentRelation != null && !(currentRelation instanceof MondrianGuiDef.Table || currentRelation instanceof MondrianGuiDef.Join);
  if (targetClassz == MondrianGuiDef.UserDefinedFunction.class && propertyName.equals("String_Node_Str")) {
    List<String> udfs=getUdfs();
    ComboBoxModel cAlludfs=new DefaultComboBoxModel(new Vector<String>(udfs));
    listEditor.setEditable(true);
    listEditor.setToolTipText(null);
    listEditor.removeActionListener(al);
    listEditor.setModel(cAlludfs);
    listEditor.setSelectedItem((String)value);
    listEditorValue=(String)value;
    activeEditor=listEditor;
  }
 else   if (targetClassz == MondrianGuiDef.Measure.class && propertyName.equals("String_Node_Str")) {
    List<String> formatStrs=getFormatStrings();
    ComboBoxModel cAllformatStrs=new DefaultComboBoxModel(new Vector<String>(formatStrs));
    listEditor.setEditable(true);
    listEditor.setToolTipText(null);
    listEditor.removeActionListener(al);
    listEditor.setModel(cAllformatStrs);
    listEditor.setSelectedItem((String)value);
    listEditorValue=(String)value;
    activeEditor=listEditor;
  }
 else   if (targetClassz == MondrianGuiDef.Measure.class && propertyName.equals("String_Node_Str")) {
    listEditor.setEditable(false);
    listEditor.setToolTipText(null);
    listEditor.removeActionListener(al);
    listEditor.setModel(new DefaultComboBoxModel(MondrianGuiDef.Measure._aggregator_values));
    listEditor.setSelectedItem((String)value);
    activeEditor=listEditor;
  }
 else   if (targetClassz == MondrianGuiDef.Measure.class && propertyName.equals("String_Node_Str")) {
    listEditor.setEditable(false);
    listEditor.setToolTipText(null);
    listEditor.removeActionListener(al);
    listEditor.setModel(new DefaultComboBoxModel(MondrianGuiDef.Measure._datatype_values));
    listEditor.setSelectedItem((String)value);
    activeEditor=listEditor;
  }
 else   if (targetClassz == MondrianGuiDef.Parameter.class && propertyName.equals("String_Node_Str")) {
    listEditor.setEditable(false);
    listEditor.setToolTipText(null);
    listEditor.removeActionListener(al);
    listEditor.setModel(new DefaultComboBoxModel(MondrianGuiDef.Parameter._type_values));
    listEditor.setSelectedItem((String)value);
    activeEditor=listEditor;
  }
 else   if (targetClassz == MondrianGuiDef.SQL.class && propertyName.equals("String_Node_Str")) {
    listEditor.setEditable(false);
    listEditor.setToolTipText(null);
    listEditor.removeActionListener(al);
    listEditor.setModel(new DefaultComboBoxModel(MondrianGuiDef.SQL._dialect_values));
    listEditor.setSelectedItem((String)value);
    activeEditor=listEditor;
  }
 else   if (targetClassz == MondrianGuiDef.Level.class && propertyName.equals("String_Node_Str")) {
    listEditor.setEditable(false);
    listEditor.setToolTipText(null);
    listEditor.removeActionListener(al);
    listEditor.setModel(new DefaultComboBoxModel(MondrianGuiDef.Level._hideMemberIf_values));
    listEditor.setSelectedItem((String)value);
    activeEditor=listEditor;
  }
 else   if (targetClassz == MondrianGuiDef.Level.class && propertyName.equals("String_Node_Str")) {
    listEditor.setEditable(false);
    listEditor.setToolTipText(null);
    listEditor.removeActionListener(al);
    listEditor.setModel(new DefaultComboBoxModel(MondrianGuiDef.Level._levelType_values));
    listEditor.setSelectedItem((String)value);
    activeEditor=listEditor;
  }
 else   if (targetClassz == MondrianGuiDef.Level.class && propertyName.equals("String_Node_Str")) {
    listEditor.setEditable(false);
    listEditor.setToolTipText(null);
    listEditor.removeActionListener(al);
    listEditor.setModel(new DefaultComboBoxModel(MondrianGuiDef.Level._type_values));
    listEditor.setSelectedItem((String)value);
    activeEditor=listEditor;
  }
 else   if (targetClassz == MondrianGuiDef.Level.class && propertyName.equals("String_Node_Str")) {
    listEditor.setEditable(false);
    listEditor.setToolTipText(null);
    listEditor.removeActionListener(al);
    listEditor.setModel(new DefaultComboBoxModel(MondrianGuiDef.Level._internalType_values));
    listEditor.setSelectedItem((String)value);
    activeEditor=listEditor;
  }
 else   if (targetClassz == MondrianGuiDef.Dimension.class && propertyName.equals("String_Node_Str")) {
    listEditor.setEditable(false);
    listEditor.setToolTipText(null);
    listEditor.removeActionListener(al);
    listEditor.setModel(new DefaultComboBoxModel(MondrianGuiDef.Dimension._type_values));
    listEditor.setSelectedItem((String)value);
    activeEditor=listEditor;
  }
 else   if (targetClassz == MondrianGuiDef.DimensionUsage.class && propertyName.equals("String_Node_Str")) {
    List<String> source=getSource();
    ComboBoxModel cAllsource=new DefaultComboBoxModel(new Vector<String>(source));
    listEditor.setEditable(true);
    listEditor.setToolTipText(null);
    listEditor.removeActionListener(al);
    listEditor.setModel(cAllsource);
    listEditor.setSelectedItem((String)value);
    listEditorValue=(String)value;
    activeEditor=listEditor;
  }
 else   if ((tableModel.target instanceof MondrianGuiDef.Grant || tableModel.target instanceof MondrianGuiDef.MemberGrant) && propertyName.equals("String_Node_Str")) {
    listEditor.setEditable(false);
    listEditor.setToolTipText(null);
    listEditor.removeActionListener(al);
    ComboBoxModel cAccess=new DefaultComboBoxModel(new String[]{"String_Node_Str","String_Node_Str"});
    if (targetClassz == MondrianGuiDef.SchemaGrant.class) {
      cAccess=new DefaultComboBoxModel(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"});
    }
 else     if (targetClassz == MondrianGuiDef.CubeGrant.class || targetClassz == MondrianGuiDef.DimensionGrant.class || targetClassz == MondrianGuiDef.MemberGrant.class) {
      cAccess=new DefaultComboBoxModel(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"});
    }
 else     if (targetClassz == MondrianGuiDef.HierarchyGrant.class || targetClassz == MondrianGuiDef.DimensionGrant.class) {
      cAccess=new DefaultComboBoxModel(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"});
    }
    listEditor.setModel(cAccess);
    listEditor.setSelectedItem((String)value);
    activeEditor=listEditor;
  }
 else   if ((targetClassz == MondrianGuiDef.DimensionGrant.class && propertyName.equals("String_Node_Str")) || (targetClassz == MondrianGuiDef.HierarchyGrant.class && propertyName.equals("String_Node_Str"))) {
    List<String> source=getHierarchies();
    ComboBoxModel cAllsource=new DefaultComboBoxModel(new Vector<String>(source));
    listEditor.setEditable(false);
    listEditor.setToolTipText(null);
    listEditor.removeActionListener(al);
    listEditor.setModel(cAllsource);
    listEditor.setSelectedItem((String)value);
    listEditorValue=(String)value;
    activeEditor=listEditor;
  }
 else   if ((targetClassz == MondrianGuiDef.HierarchyGrant.class && (propertyName.equals("String_Node_Str") || propertyName.equals("String_Node_Str")))) {
    List<String> source=getLevels(((MondrianGuiDef.HierarchyGrant)tableModel.target).hierarchy);
    ComboBoxModel cAllsource=new DefaultComboBoxModel(new Vector<String>(source));
    listEditor.setEditable(false);
    listEditor.setToolTipText(null);
    listEditor.removeActionListener(al);
    listEditor.setModel(cAllsource);
    listEditor.setSelectedItem((String)value);
    listEditorValue=(String)value;
    activeEditor=listEditor;
  }
 else   if (((targetClassz == MondrianGuiDef.VirtualCubeDimension.class || targetClassz == MondrianGuiDef.VirtualCubeMeasure.class) && propertyName.equals("String_Node_Str")) || (targetClassz == MondrianGuiDef.CubeGrant.class && propertyName.equals("String_Node_Str"))) {
    List<String> source=getCubes();
    ComboBoxModel cAllsource=new DefaultComboBoxModel(new Vector<String>(source));
    listEditor.setEditable(false);
    listEditor.setToolTipText(null);
    listEditor.removeActionListener(al);
    listEditor.setModel(cAllsource);
    listEditor.setSelectedItem((String)value);
    listEditorValue=(String)value;
    activeEditor=listEditor;
  }
 else   if ((targetClassz == MondrianGuiDef.Dimension.class && propertyName.equals("String_Node_Str")) || (targetClassz == MondrianGuiDef.DimensionUsage.class && propertyName.equals("String_Node_Str")) || (targetClassz == MondrianGuiDef.Measure.class && propertyName.equals("String_Node_Str"))) {
    Vector<String> fks=new Vector<String>(jdbcMetaData.getFactTableFKs(selectedFactTableSchema,selectedFactTable));
    fks.add(0,getResourceConverter().getString("String_Node_Str","String_Node_Str"));
    Vector<String> allcols=new Vector<String>(jdbcMetaData.getAllColumns(selectedFactTableSchema,selectedFactTable));
    ComboBoxModel cFks=new DefaultComboBoxModel(fks);
    listEditor.setEditable(true);
    listEditor.setToolTipText(null);
    listEditor.removeActionListener(al);
    if ((fks.size() > 1) && propertyName.equals("String_Node_Str")) {
      allcols.add(0,getResourceConverter().getString("String_Node_Str","String_Node_Str"));
      ComboBoxModel cAllcols=new DefaultComboBoxModel(allcols);
      listEditor.setModel(cFks);
      selOptions=cFks;
      allOptions=cAllcols;
      listEditor.addActionListener(al);
    }
 else {
      ComboBoxModel cAllcols=new DefaultComboBoxModel(allcols);
      listEditor.setModel(cAllcols);
    }
    listEditor.setSelectedItem((String)value);
    listEditorValue=(String)value;
    activeEditor=listEditor;
  }
 else   if (targetClassz == MondrianGuiDef.Hierarchy.class && propertyName.equals("String_Node_Str")) {
    MondrianGuiDef.Hierarchy hProps=(MondrianGuiDef.Hierarchy)tableModel.getValue();
    String pkTable=hProps.primaryKeyTable;
    String schemaName=null;
    String pk="String_Node_Str";
    List<String> allcols;
    MondrianGuiDef.RelationOrJoin relation=hProps.relation;
    if (relation instanceof MondrianGuiDef.Table) {
      pkTable=((MondrianGuiDef.Table)relation).name;
      schemaName=((MondrianGuiDef.Table)relation).schema;
      pk=jdbcMetaData.getTablePK(schemaName,pkTable);
    }
 else     if (relation instanceof MondrianGuiDef.Join) {
      String[] schemaAndTable=SchemaExplorer.getTableNameForAlias(hProps.relation,pkTable);
      schemaName=schemaAndTable[0];
      pkTable=schemaAndTable[1];
    }
    if (relation instanceof MondrianGuiDef.Table || relation instanceof MondrianGuiDef.Join) {
      allcols=jdbcMetaData.getAllColumns(schemaName,pkTable);
      pk=jdbcMetaData.getTablePK(schemaName,pkTable);
    }
 else {
      allcols=Collections.emptyList();
    }
    ComboBoxModel cAllcols=new DefaultComboBoxModel(new Vector<String>(allcols));
    listEditor.setEditable(true);
    listEditor.setToolTipText(null);
    listEditor.removeActionListener(al);
    listEditor.setModel(cAllcols);
    if (value == null || ((String)value).equals("String_Node_Str")) {
      listEditor.setSelectedItem(pk);
    }
 else {
      listEditor.setSelectedItem((String)value);
      listEditorValue=(String)value;
    }
    activeEditor=listEditor;
  }
 else   if ((targetClassz == MondrianGuiDef.Level.class && propertyName.equals("String_Node_Str")) || (targetClassz == MondrianGuiDef.Level.class && propertyName.equals("String_Node_Str")) || (targetClassz == MondrianGuiDef.Level.class && propertyName.equals("String_Node_Str"))|| (targetClassz == MondrianGuiDef.Level.class && propertyName.equals("String_Node_Str"))|| (targetClassz == MondrianGuiDef.Level.class && propertyName.equals("String_Node_Str"))|| (targetClassz == MondrianGuiDef.Closure.class && propertyName.equals("String_Node_Str"))|| (targetClassz == MondrianGuiDef.Closure.class && propertyName.equals("String_Node_Str"))|| (targetClassz == MondrianGuiDef.Property.class && propertyName.equals("String_Node_Str"))) {
    MondrianGuiDef.Level lProps;
    if (targetClassz == MondrianGuiDef.Level.class) {
      lProps=(MondrianGuiDef.Level)tableModel.getValue();
    }
 else {
      lProps=(MondrianGuiDef.Level)this.getParentObject();
    }
    String schemaName=null;
    String lTable=lProps.table;
    List<String> allcols;
    if (targetClassz == MondrianGuiDef.Level.class && parent != null) {
      if (parent instanceof MondrianGuiDef.Hierarchy) {
        MondrianGuiDef.RelationOrJoin relation=((MondrianGuiDef.Hierarchy)parent).relation;
        if (relation instanceof MondrianGuiDef.Table) {
          lTable=((MondrianGuiDef.Table)relation).name;
          schemaName=((MondrianGuiDef.Table)relation).schema;
        }
 else         if (relation instanceof MondrianGuiDef.Join) {
          String[] schemaAndTable=SchemaExplorer.getTableNameForAlias(relation,lTable);
          schemaName=schemaAndTable[0];
          lTable=schemaAndTable[1];
        }
      }
    }
    if (lTable != null) {
      allcols=jdbcMetaData.getAllColumns(schemaName,lTable);
    }
 else {
      allcols=Collections.emptyList();
    }
    ComboBoxModel cAllcols=new DefaultComboBoxModel(new Vector<String>(allcols));
    listEditor.setEditable(true);
    listEditor.setToolTipText(null);
    listEditor.removeActionListener(al);
    listEditor.setModel(cAllcols);
    listEditor.setSelectedItem((String)value);
    listEditorValue=(String)value;
    activeEditor=listEditor;
  }
 else   if (targetClassz == MondrianGuiDef.Property.class && propertyName.equals("String_Node_Str")) {
    listEditor.setEditable(false);
    listEditor.setToolTipText(null);
    listEditor.removeActionListener(al);
    listEditor.setModel(new DefaultComboBoxModel(MondrianGuiDef.Property._type_values));
    listEditor.setSelectedItem((String)value);
    activeEditor=listEditor;
  }
 else   if ((targetClassz == MondrianGuiDef.AggFactCount.class && propertyName.equals("String_Node_Str")) || (targetClassz == MondrianGuiDef.AggIgnoreColumn.class && propertyName.equals("String_Node_Str")) || (targetClassz == MondrianGuiDef.AggLevel.class && propertyName.equals("String_Node_Str"))|| (targetClassz == MondrianGuiDef.AggMeasure.class && propertyName.equals("String_Node_Str"))|| (targetClassz == MondrianGuiDef.AggForeignKey.class && propertyName.equals("String_Node_Str"))|| (targetClassz == MondrianGuiDef.AggForeignKey.class && propertyName.equals("String_Node_Str"))) {
    List<String> allcols=jdbcMetaData.getAllColumns(null,null);
    ComboBoxModel cAllcols=new DefaultComboBoxModel(new Vector<String>(allcols));
    listEditor.setEditable(true);
    listEditor.setToolTipText(null);
    listEditor.removeActionListener(al);
    listEditor.setModel(cAllcols);
    listEditor.setSelectedItem((String)value);
    listEditorValue=(String)value;
    activeEditor=listEditor;
  }
 else   if (targetClassz == MondrianGuiDef.Table.class && propertyName.equals("String_Node_Str")) {
    List<String> allschemas=jdbcMetaData.getAllSchemas();
    ComboBoxModel cAllschemas=new DefaultComboBoxModel(new Vector<String>(allschemas));
    listEditor.setEditable(true);
    listEditor.setToolTipText(null);
    listEditor.removeActionListener(al);
    listEditor.setModel(cAllschemas);
    listEditor.setSelectedItem((String)value);
    listEditorValue=(String)value;
    activeEditor=listEditor;
  }
 else   if (currentRelation != null && nonTableRelation && ((targetClassz == MondrianGuiDef.Hierarchy.class && propertyName.equals("String_Node_Str")) || (targetClassz == MondrianGuiDef.Level.class && propertyName.equals("String_Node_Str")))) {
    listEditor.setEditable(false);
    listEditor.setToolTipText(null);
    listEditor.removeActionListener(al);
    activeEditor=listEditor;
  }
 else   if ((targetClassz == MondrianGuiDef.Table.class && propertyName.equals("String_Node_Str")) || (targetClassz == MondrianGuiDef.Hierarchy.class && propertyName.equals("String_Node_Str")) || (targetClassz == MondrianGuiDef.Level.class && propertyName.equals("String_Node_Str"))) {
    String schema="String_Node_Str";
    if (targetClassz == MondrianGuiDef.Table.class) {
      MondrianGuiDef.Table tProps=(MondrianGuiDef.Table)tableModel.getValue();
      schema=tProps.schema;
    }
    Vector<String> factTables=new Vector<String>(jdbcMetaData.getFactTables(schema));
    Vector<String> allTablesMinusFact=new Vector<String>(jdbcMetaData.getAllTables(schema,selectedFactTable));
    Vector<String> allTables=new Vector<String>(jdbcMetaData.getAllTables(schema));
    Vector<String> dimeTables=new Vector<String>(jdbcMetaData.getDimensionTables(schema,selectedFactTable));
    ComboBoxModel cFactTables=new DefaultComboBoxModel(factTables);
    ComboBoxModel cAllTables=new DefaultComboBoxModel((allTablesMinusFact.size() > 0) ? allTablesMinusFact : allTables);
    ComboBoxModel cDimeTables=new DefaultComboBoxModel(dimeTables);
    if (targetClassz == MondrianGuiDef.Level.class || targetClassz == MondrianGuiDef.Hierarchy.class) {
      MondrianGuiDef.RelationOrJoin relation=null;
      if (parent != null && parent instanceof MondrianGuiDef.Hierarchy) {
        relation=((MondrianGuiDef.Hierarchy)parent).relation;
      }
 else {
        relation=((MondrianGuiDef.Hierarchy)tableModel.target).relation;
      }
      if (relation instanceof MondrianGuiDef.Join) {
        TreeSet<String> joinTables=new TreeSet<String>();
        SchemaExplorer.getTableNamesForJoin(relation,joinTables);
        cAllTables=new DefaultComboBoxModel(new Vector<String>(joinTables));
      }
    }
    listEditor.setEditable(true);
    listEditor.setToolTipText(null);
    listEditor.removeActionListener(al);
    listEditor.setModel(cAllTables);
    allOptions=cAllTables;
    boolean toggleModel=false;
    if (parentClassz == MondrianGuiDef.Cube.class) {
      cAllTables=new DefaultComboBoxModel(allTables);
      allOptions=cAllTables;
      if (factTables.size() > 0) {
        ((DefaultComboBoxModel)cFactTables).insertElementAt(workbench.getResourceConverter().getString("String_Node_Str","String_Node_Str"),0);
        ((DefaultComboBoxModel)cAllTables).insertElementAt(workbench.getResourceConverter().getString("String_Node_Str","String_Node_Str"),0);
        listEditor.setModel(cFactTables);
        selOptions=cFactTables;
        toggleModel=true;
      }
    }
 else {
      if (dimeTables.size() > 0) {
        ((DefaultComboBoxModel)cDimeTables).insertElementAt(workbench.getResourceConverter().getString("String_Node_Str","String_Node_Str"),0);
        ((DefaultComboBoxModel)cAllTables).insertElementAt(workbench.getResourceConverter().getString("String_Node_Str","String_Node_Str"),0);
        listEditor.setModel(cDimeTables);
        selOptions=cDimeTables;
        toggleModel=true;
      }
    }
    if (toggleModel) {
      listEditor.addActionListener(al);
    }
    listEditor.setSelectedItem((String)value);
    listEditorValue=(String)value;
    activeEditor=listEditor;
    if ((targetClassz == MondrianGuiDef.Level.class && propertyName.equals(SchemaExplorer.DEF_LEVEL[1]) && parent != null) || (targetClassz == MondrianGuiDef.Hierarchy.class && propertyName.equals(SchemaExplorer.DEF_HIERARCHY[7]) && parent != null)) {
      MondrianGuiDef.RelationOrJoin relation=null;
      if (parent instanceof MondrianGuiDef.Hierarchy) {
        relation=((MondrianGuiDef.Hierarchy)parent).relation;
      }
 else       if (parent instanceof MondrianGuiDef.Dimension) {
        relation=((MondrianGuiDef.Hierarchy)tableModel.target).relation;
      }
      if (relation instanceof MondrianGuiDef.Table) {
        activeEditor=stringEditor;
        stringEditor.setText((String)value);
      }
    }
  }
 else   if (propertyName.equals("String_Node_Str")) {
    try {
      cdataTextArea.read(new StringReader((String)value),null);
    }
 catch (    Exception ex) {
    }
    activeEditor=jScrollPaneCDATA;
  }
 else   if (value instanceof String) {
    activeEditor=stringEditor;
    stringEditor.setText((String)value);
  }
 else   if (value instanceof Boolean) {
    activeEditor=booleanEditor;
    booleanEditor.setSelected((Boolean)value);
  }
 else   if (value instanceof Integer) {
    activeEditor=integerEditor;
    integerEditor.setText((String)value);
  }
 else   if (value == null) {
    value="String_Node_Str";
    activeEditor=stringEditor;
    stringEditor.setText((String)value);
  }
 else   if (value.getClass() == MondrianGuiDef.Join.class) {
    SchemaPropertyCellEditor spce=new SchemaPropertyCellEditor(workbench);
    tableEditor.setDefaultEditor(Object.class,spce);
    SchemaPropertyCellRenderer spcr=new SchemaPropertyCellRenderer(workbench);
    tableEditor.setDefaultRenderer(Object.class,spcr);
    PropertyTableModel ptm=new PropertyTableModel(workbench,value,SchemaExplorer.DEF_JOIN);
    tableEditor.setModel(ptm);
    activeEditor=tableEditor;
  }
 else   if (value.getClass() == MondrianGuiDef.NameExpression.class) {
    return null;
  }
 else   if (value.getClass() == MondrianGuiDef.RelationOrJoin.class) {
    SchemaPropertyCellEditor spce=new SchemaPropertyCellEditor(workbench);
    tableEditor.setDefaultEditor(Object.class,spce);
    SchemaPropertyCellRenderer spcr=new SchemaPropertyCellRenderer(workbench);
    tableEditor.setDefaultRenderer(Object.class,spcr);
    PropertyTableModel ptm=new PropertyTableModel(workbench,value,SchemaExplorer.DEF_RELATION);
    tableEditor.setModel(ptm);
    activeEditor=tableEditor;
    return null;
  }
 else   if (value.getClass() == MondrianGuiDef.OrdinalExpression.class) {
    SchemaPropertyCellEditor spce=new SchemaPropertyCellEditor(workbench);
    tableEditor.setDefaultEditor(Object.class,spce);
    SchemaPropertyCellRenderer spcr=new SchemaPropertyCellRenderer(workbench);
    tableEditor.setDefaultRenderer(Object.class,spcr);
    PropertyTableModel ptm=new PropertyTableModel(workbench,((MondrianGuiDef.OrdinalExpression)value).expressions[0],SchemaExplorer.DEF_SQL);
    ptm.setParentTarget(((PropertyTableModel)table.getModel()).target);
    tableEditor.setModel(ptm);
    activeEditor=tableEditor;
  }
 else   if (value.getClass() == MondrianGuiDef.CaptionExpression.class) {
    SchemaPropertyCellEditor spce=new SchemaPropertyCellEditor(workbench);
    tableEditor.setDefaultEditor(Object.class,spce);
    SchemaPropertyCellRenderer spcr=new SchemaPropertyCellRenderer(workbench);
    tableEditor.setDefaultRenderer(Object.class,spcr);
    PropertyTableModel ptm=new PropertyTableModel(workbench,((MondrianGuiDef.CaptionExpression)value).expressions[0],SchemaExplorer.DEF_SQL);
    ptm.setParentTarget(((PropertyTableModel)table.getModel()).target);
    tableEditor.setModel(ptm);
    activeEditor=tableEditor;
  }
 else   if (value.getClass() == MondrianGuiDef.Formula.class) {
    SchemaPropertyCellEditor spce=new SchemaPropertyCellEditor(workbench,jdbcMetaData);
    tableEditor.setDefaultEditor(Object.class,spce);
    SchemaPropertyCellRenderer spcr=new SchemaPropertyCellRenderer(workbench);
    tableEditor.setDefaultRenderer(Object.class,spcr);
    PropertyTableModel ptm=new PropertyTableModel(workbench,value,SchemaExplorer.DEF_FORMULA);
    tableEditor.setModel(ptm);
    tableEditor.getColumnModel().getColumn(0).setMaxWidth(100);
    tableEditor.getColumnModel().getColumn(0).setMinWidth(100);
    activeEditor=tableEditor;
  }
 else   if (value.getClass() == MondrianGuiDef.CalculatedMemberProperty.class) {
    SchemaPropertyCellEditor spce=new SchemaPropertyCellEditor(workbench,jdbcMetaData);
    tableEditor.setDefaultEditor(Object.class,spce);
    SchemaPropertyCellRenderer spcr=new SchemaPropertyCellRenderer(workbench);
    tableEditor.setDefaultRenderer(Object.class,spcr);
    PropertyTableModel ptm=new PropertyTableModel(workbench,value,SchemaExplorer.DEF_CALCULATED_MEMBER_PROPERTY);
    tableEditor.setModel(ptm);
    tableEditor.getColumnModel().getColumn(0).setMaxWidth(100);
    tableEditor.getColumnModel().getColumn(0).setMinWidth(100);
    activeEditor=tableEditor;
  }
 else   if (value.getClass() == MondrianGuiDef.Table.class) {
    SchemaPropertyCellEditor spce=new SchemaPropertyCellEditor(workbench,jdbcMetaData);
    for (int i=listeners.size() - 1; i >= 0; i--) {
      spce.addCellEditorListener(listeners.get(i));
    }
    tableEditor.setDefaultEditor(Object.class,spce);
    SchemaPropertyCellRenderer spcr=new SchemaPropertyCellRenderer(workbench);
    tableEditor.setDefaultRenderer(Object.class,spcr);
    PropertyTableModel ptm=new PropertyTableModel(workbench,value,SchemaExplorer.DEF_TABLE);
    ptm.setFactTable(selectedFactTable);
    if (targetClassz == MondrianGuiDef.Cube.class) {
      ptm.setParentTarget(((PropertyTableModel)table.getModel()).target);
    }
    tableEditor.setModel(ptm);
    tableEditor.getColumnModel().getColumn(0).setMaxWidth(100);
    tableEditor.getColumnModel().getColumn(0).setMinWidth(100);
    activeEditor=tableEditor;
  }
 else   if (value.getClass() == MondrianGuiDef.AggFactCount.class) {
    SchemaPropertyCellEditor spce=new SchemaPropertyCellEditor(workbench,jdbcMetaData);
    for (int i=listeners.size() - 1; i >= 0; i--) {
      spce.addCellEditorListener(listeners.get(i));
    }
    tableEditor.setDefaultEditor(Object.class,spce);
    SchemaPropertyCellRenderer spcr=new SchemaPropertyCellRenderer(workbench);
    tableEditor.setDefaultRenderer(Object.class,spcr);
    PropertyTableModel ptm=new PropertyTableModel(workbench,value,SchemaExplorer.DEF_AGG_FACT_COUNT);
    ptm.setFactTable(selectedFactTable);
    tableEditor.setModel(ptm);
    tableEditor.getColumnModel().getColumn(0).setMaxWidth(100);
    tableEditor.getColumnModel().getColumn(0).setMinWidth(100);
    activeEditor=tableEditor;
  }
 else   if (value.getClass() == MondrianGuiDef.Closure.class) {
    SchemaPropertyCellEditor spce=new SchemaPropertyCellEditor(workbench,jdbcMetaData);
    for (int i=listeners.size() - 1; i >= 0; i--) {
      spce.addCellEditorListener(listeners.get(i));
    }
    tableEditor.setDefaultEditor(Object.class,spce);
    SchemaPropertyCellRenderer spcr=new SchemaPropertyCellRenderer(workbench);
    tableEditor.setDefaultRenderer(Object.class,spcr);
    PropertyTableModel ptm=new PropertyTableModel(workbench,value,SchemaExplorer.DEF_CLOSURE);
    ptm.setFactTable(selectedFactTable);
    if (targetClassz == MondrianGuiDef.Level.class) {
      ptm.setParentTarget(((PropertyTableModel)table.getModel()).target);
    }
    tableEditor.setModel(ptm);
    tableEditor.getColumnModel().getColumn(0).setMaxWidth(100);
    tableEditor.getColumnModel().getColumn(0).setMinWidth(100);
    spcr.setTableRendererHeight(tableEditor,null);
    activeEditor=tableEditor;
  }
 else   if (value.getClass() == MondrianGuiDef.Property.class) {
    SchemaPropertyCellEditor spce=new SchemaPropertyCellEditor(workbench);
    tableEditor.setDefaultEditor(Object.class,spce);
    SchemaPropertyCellRenderer spcr=new SchemaPropertyCellRenderer(workbench);
    tableEditor.setDefaultRenderer(Object.class,spcr);
    PropertyTableModel ptm=new PropertyTableModel(workbench,value,SchemaExplorer.DEF_PROPERTY);
    tableEditor.setModel(ptm);
    activeEditor=tableEditor;
  }
 else {
    value="String_Node_Str";
    activeEditor=stringEditor;
    stringEditor.setText((String)value);
  }
  activeEditor.setVisible(true);
  setOriginalValue();
  table.changeSelection(row,column,false,false);
  activeEditor.setBackground(new java.awt.Color(224,249,255));
  activeEditor.requestFocusInWindow();
  return activeEditor;
}

Fixed version (ground truth):
public Component getTableCellEditorComponent(final JTable table,Object value,boolean isSelected,final int row,final int column){
  PropertyTableModel tableModel=(PropertyTableModel)table.getModel();
  Class<?> parentClassz=null;
  if (tableModel.getParentTarget() != null) {
    parentClassz=tableModel.getParentTarget().getClass();
  }
  Class<?> targetClassz=tableModel.target.getClass();
  String propertyName=tableModel.getRowName(row);
  String selectedFactTable=tableModel.getFactTable();
  String selectedFactTableSchema=tableModel.getFactTableSchema();
  listEditorValue=null;
  Object parent=this.getParentObject();
  MondrianGuiDef.RelationOrJoin currentRelation=getRelation(table,row,column);
  boolean nonTableRelation=currentRelation != null && !(currentRelation instanceof MondrianGuiDef.Table || currentRelation instanceof MondrianGuiDef.Join);
  if (targetClassz == MondrianGuiDef.UserDefinedFunction.class && propertyName.equals("String_Node_Str")) {
    List<String> udfs=getUdfs();
    ComboBoxModel cAlludfs=new DefaultComboBoxModel(new Vector<String>(udfs));
    listEditor.setEditable(true);
    listEditor.setToolTipText(null);
    listEditor.removeActionListener(al);
    listEditor.setModel(cAlludfs);
    listEditor.setSelectedItem((String)value);
    listEditorValue=(String)value;
    activeEditor=listEditor;
  }
 else   if (targetClassz == MondrianGuiDef.Measure.class && propertyName.equals("String_Node_Str")) {
    List<String> formatStrs=getFormatStrings();
    ComboBoxModel cAllformatStrs=new DefaultComboBoxModel(new Vector<String>(formatStrs));
    listEditor.setEditable(true);
    listEditor.setToolTipText(null);
    listEditor.removeActionListener(al);
    listEditor.setModel(cAllformatStrs);
    listEditor.setSelectedItem((String)value);
    listEditorValue=(String)value;
    activeEditor=listEditor;
  }
 else   if (targetClassz == MondrianGuiDef.Measure.class && propertyName.equals("String_Node_Str")) {
    listEditor.setEditable(false);
    listEditor.setToolTipText(null);
    listEditor.removeActionListener(al);
    listEditor.setModel(new DefaultComboBoxModel(MondrianGuiDef.Measure._aggregator_values));
    listEditor.setSelectedItem((String)value);
    activeEditor=listEditor;
  }
 else   if (targetClassz == MondrianGuiDef.Measure.class && propertyName.equals("String_Node_Str")) {
    listEditor.setEditable(false);
    listEditor.setToolTipText(null);
    listEditor.removeActionListener(al);
    listEditor.setModel(new DefaultComboBoxModel(MondrianGuiDef.Measure._datatype_values));
    listEditor.setSelectedItem((String)value);
    activeEditor=listEditor;
  }
 else   if (targetClassz == MondrianGuiDef.Parameter.class && propertyName.equals("String_Node_Str")) {
    listEditor.setEditable(false);
    listEditor.setToolTipText(null);
    listEditor.removeActionListener(al);
    listEditor.setModel(new DefaultComboBoxModel(MondrianGuiDef.Parameter._type_values));
    listEditor.setSelectedItem((String)value);
    activeEditor=listEditor;
  }
 else   if (targetClassz == MondrianGuiDef.SQL.class && propertyName.equals("String_Node_Str")) {
    listEditor.setEditable(false);
    listEditor.setToolTipText(null);
    listEditor.removeActionListener(al);
    listEditor.setModel(new DefaultComboBoxModel(MondrianGuiDef.SQL._dialect_values));
    listEditor.setSelectedItem((String)value);
    activeEditor=listEditor;
  }
 else   if (targetClassz == MondrianGuiDef.Level.class && propertyName.equals("String_Node_Str")) {
    listEditor.setEditable(false);
    listEditor.setToolTipText(null);
    listEditor.removeActionListener(al);
    listEditor.setModel(new DefaultComboBoxModel(MondrianGuiDef.Level._hideMemberIf_values));
    listEditor.setSelectedItem((String)value);
    activeEditor=listEditor;
  }
 else   if (targetClassz == MondrianGuiDef.Level.class && propertyName.equals("String_Node_Str")) {
    listEditor.setEditable(false);
    listEditor.setToolTipText(null);
    listEditor.removeActionListener(al);
    listEditor.setModel(new DefaultComboBoxModel(MondrianGuiDef.Level._levelType_values));
    listEditor.setSelectedItem((String)value);
    activeEditor=listEditor;
  }
 else   if (targetClassz == MondrianGuiDef.Level.class && propertyName.equals("String_Node_Str")) {
    listEditor.setEditable(false);
    listEditor.setToolTipText(null);
    listEditor.removeActionListener(al);
    listEditor.setModel(new DefaultComboBoxModel(MondrianGuiDef.Level._type_values));
    listEditor.setSelectedItem((String)value);
    activeEditor=listEditor;
  }
 else   if (targetClassz == MondrianGuiDef.Level.class && propertyName.equals("String_Node_Str")) {
    listEditor.setEditable(false);
    listEditor.setToolTipText(null);
    listEditor.removeActionListener(al);
    listEditor.setModel(new DefaultComboBoxModel(MondrianGuiDef.Level._internalType_values));
    listEditor.setSelectedItem((String)value);
    activeEditor=listEditor;
  }
 else   if (targetClassz == MondrianGuiDef.Dimension.class && propertyName.equals("String_Node_Str")) {
    listEditor.setEditable(false);
    listEditor.setToolTipText(null);
    listEditor.removeActionListener(al);
    listEditor.setModel(new DefaultComboBoxModel(MondrianGuiDef.Dimension._type_values));
    listEditor.setSelectedItem((String)value);
    activeEditor=listEditor;
  }
 else   if (targetClassz == MondrianGuiDef.DimensionUsage.class && propertyName.equals("String_Node_Str")) {
    List<String> source=getSource();
    ComboBoxModel cAllsource=new DefaultComboBoxModel(new Vector<String>(source));
    listEditor.setEditable(true);
    listEditor.setToolTipText(null);
    listEditor.removeActionListener(al);
    listEditor.setModel(cAllsource);
    listEditor.setSelectedItem((String)value);
    listEditorValue=(String)value;
    activeEditor=listEditor;
  }
 else   if ((tableModel.target instanceof MondrianGuiDef.Grant || tableModel.target instanceof MondrianGuiDef.MemberGrant) && propertyName.equals("String_Node_Str")) {
    listEditor.setEditable(false);
    listEditor.setToolTipText(null);
    listEditor.removeActionListener(al);
    ComboBoxModel cAccess=new DefaultComboBoxModel(new String[]{"String_Node_Str","String_Node_Str"});
    if (targetClassz == MondrianGuiDef.SchemaGrant.class) {
      cAccess=new DefaultComboBoxModel(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"});
    }
 else     if (targetClassz == MondrianGuiDef.CubeGrant.class || targetClassz == MondrianGuiDef.DimensionGrant.class || targetClassz == MondrianGuiDef.MemberGrant.class) {
      cAccess=new DefaultComboBoxModel(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"});
    }
 else     if (targetClassz == MondrianGuiDef.HierarchyGrant.class || targetClassz == MondrianGuiDef.DimensionGrant.class) {
      cAccess=new DefaultComboBoxModel(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"});
    }
    listEditor.setModel(cAccess);
    listEditor.setSelectedItem((String)value);
    activeEditor=listEditor;
  }
 else   if (targetClassz == MondrianGuiDef.DimensionGrant.class && propertyName.equals("String_Node_Str")) {
    List<String> source=getDimensions();
    ComboBoxModel cAllsource=new DefaultComboBoxModel(new Vector<String>(source));
    listEditor.setEditable(false);
    listEditor.setToolTipText(null);
    listEditor.removeActionListener(al);
    listEditor.setModel(cAllsource);
    listEditor.setSelectedItem((String)value);
    listEditorValue=(String)value;
    activeEditor=listEditor;
  }
 else   if (targetClassz == MondrianGuiDef.HierarchyGrant.class && propertyName.equals("String_Node_Str")) {
    List<String> source=getHierarchies();
    ComboBoxModel cAllsource=new DefaultComboBoxModel(new Vector<String>(source));
    listEditor.setEditable(false);
    listEditor.setToolTipText(null);
    listEditor.removeActionListener(al);
    listEditor.setModel(cAllsource);
    listEditor.setSelectedItem((String)value);
    listEditorValue=(String)value;
    activeEditor=listEditor;
  }
 else   if ((targetClassz == MondrianGuiDef.HierarchyGrant.class && (propertyName.equals("String_Node_Str") || propertyName.equals("String_Node_Str")))) {
    List<String> source=getLevels(((MondrianGuiDef.HierarchyGrant)tableModel.target).hierarchy);
    ComboBoxModel cAllsource=new DefaultComboBoxModel(new Vector<String>(source));
    listEditor.setEditable(false);
    listEditor.setToolTipText(null);
    listEditor.removeActionListener(al);
    listEditor.setModel(cAllsource);
    listEditor.setSelectedItem((String)value);
    listEditorValue=(String)value;
    activeEditor=listEditor;
  }
 else   if (((targetClassz == MondrianGuiDef.VirtualCubeDimension.class || targetClassz == MondrianGuiDef.VirtualCubeMeasure.class) && propertyName.equals("String_Node_Str")) || (targetClassz == MondrianGuiDef.CubeGrant.class && propertyName.equals("String_Node_Str"))) {
    List<String> source=getCubes();
    ComboBoxModel cAllsource=new DefaultComboBoxModel(new Vector<String>(source));
    listEditor.setEditable(false);
    listEditor.setToolTipText(null);
    listEditor.removeActionListener(al);
    listEditor.setModel(cAllsource);
    listEditor.setSelectedItem((String)value);
    listEditorValue=(String)value;
    activeEditor=listEditor;
  }
 else   if ((targetClassz == MondrianGuiDef.Dimension.class && propertyName.equals("String_Node_Str")) || (targetClassz == MondrianGuiDef.DimensionUsage.class && propertyName.equals("String_Node_Str")) || (targetClassz == MondrianGuiDef.Measure.class && propertyName.equals("String_Node_Str"))) {
    Vector<String> fks=new Vector<String>(jdbcMetaData.getFactTableFKs(selectedFactTableSchema,selectedFactTable));
    fks.add(0,getResourceConverter().getString("String_Node_Str","String_Node_Str"));
    Vector<String> allcols=new Vector<String>(jdbcMetaData.getAllColumns(selectedFactTableSchema,selectedFactTable));
    ComboBoxModel cFks=new DefaultComboBoxModel(fks);
    listEditor.setEditable(true);
    listEditor.setToolTipText(null);
    listEditor.removeActionListener(al);
    if ((fks.size() > 1) && propertyName.equals("String_Node_Str")) {
      allcols.add(0,getResourceConverter().getString("String_Node_Str","String_Node_Str"));
      ComboBoxModel cAllcols=new DefaultComboBoxModel(allcols);
      listEditor.setModel(cFks);
      selOptions=cFks;
      allOptions=cAllcols;
      listEditor.addActionListener(al);
    }
 else {
      ComboBoxModel cAllcols=new DefaultComboBoxModel(allcols);
      listEditor.setModel(cAllcols);
    }
    listEditor.setSelectedItem((String)value);
    listEditorValue=(String)value;
    activeEditor=listEditor;
  }
 else   if (targetClassz == MondrianGuiDef.Hierarchy.class && propertyName.equals("String_Node_Str")) {
    MondrianGuiDef.Hierarchy hProps=(MondrianGuiDef.Hierarchy)tableModel.getValue();
    String pkTable=hProps.primaryKeyTable;
    String schemaName=null;
    String pk="String_Node_Str";
    List<String> allcols;
    MondrianGuiDef.RelationOrJoin relation=hProps.relation;
    if (relation instanceof MondrianGuiDef.Table) {
      pkTable=((MondrianGuiDef.Table)relation).name;
      schemaName=((MondrianGuiDef.Table)relation).schema;
      pk=jdbcMetaData.getTablePK(schemaName,pkTable);
    }
 else     if (relation instanceof MondrianGuiDef.Join) {
      String[] schemaAndTable=SchemaExplorer.getTableNameForAlias(hProps.relation,pkTable);
      schemaName=schemaAndTable[0];
      pkTable=schemaAndTable[1];
    }
    if (relation instanceof MondrianGuiDef.Table || relation instanceof MondrianGuiDef.Join) {
      allcols=jdbcMetaData.getAllColumns(schemaName,pkTable);
      pk=jdbcMetaData.getTablePK(schemaName,pkTable);
    }
 else {
      allcols=Collections.emptyList();
    }
    ComboBoxModel cAllcols=new DefaultComboBoxModel(new Vector<String>(allcols));
    listEditor.setEditable(true);
    listEditor.setToolTipText(null);
    listEditor.removeActionListener(al);
    listEditor.setModel(cAllcols);
    if (value == null || ((String)value).equals("String_Node_Str")) {
      listEditor.setSelectedItem(pk);
    }
 else {
      listEditor.setSelectedItem((String)value);
      listEditorValue=(String)value;
    }
    activeEditor=listEditor;
  }
 else   if ((targetClassz == MondrianGuiDef.Level.class && propertyName.equals("String_Node_Str")) || (targetClassz == MondrianGuiDef.Level.class && propertyName.equals("String_Node_Str")) || (targetClassz == MondrianGuiDef.Level.class && propertyName.equals("String_Node_Str"))|| (targetClassz == MondrianGuiDef.Level.class && propertyName.equals("String_Node_Str"))|| (targetClassz == MondrianGuiDef.Level.class && propertyName.equals("String_Node_Str"))|| (targetClassz == MondrianGuiDef.Closure.class && propertyName.equals("String_Node_Str"))|| (targetClassz == MondrianGuiDef.Closure.class && propertyName.equals("String_Node_Str"))|| (targetClassz == MondrianGuiDef.Property.class && propertyName.equals("String_Node_Str"))) {
    MondrianGuiDef.Level lProps;
    if (targetClassz == MondrianGuiDef.Level.class) {
      lProps=(MondrianGuiDef.Level)tableModel.getValue();
    }
 else {
      lProps=(MondrianGuiDef.Level)this.getParentObject();
    }
    String schemaName=null;
    String lTable=lProps.table;
    List<String> allcols;
    if (targetClassz == MondrianGuiDef.Level.class && parent != null) {
      if (parent instanceof MondrianGuiDef.Hierarchy) {
        MondrianGuiDef.RelationOrJoin relation=((MondrianGuiDef.Hierarchy)parent).relation;
        if (relation instanceof MondrianGuiDef.Table) {
          lTable=((MondrianGuiDef.Table)relation).name;
          schemaName=((MondrianGuiDef.Table)relation).schema;
        }
 else         if (relation instanceof MondrianGuiDef.Join) {
          String[] schemaAndTable=SchemaExplorer.getTableNameForAlias(relation,lTable);
          schemaName=schemaAndTable[0];
          lTable=schemaAndTable[1];
        }
      }
    }
    if (lTable != null) {
      allcols=jdbcMetaData.getAllColumns(schemaName,lTable);
    }
 else {
      allcols=Collections.emptyList();
    }
    ComboBoxModel cAllcols=new DefaultComboBoxModel(new Vector<String>(allcols));
    listEditor.setEditable(true);
    listEditor.setToolTipText(null);
    listEditor.removeActionListener(al);
    listEditor.setModel(cAllcols);
    listEditor.setSelectedItem((String)value);
    listEditorValue=(String)value;
    activeEditor=listEditor;
  }
 else   if (targetClassz == MondrianGuiDef.Property.class && propertyName.equals("String_Node_Str")) {
    listEditor.setEditable(false);
    listEditor.setToolTipText(null);
    listEditor.removeActionListener(al);
    listEditor.setModel(new DefaultComboBoxModel(MondrianGuiDef.Property._type_values));
    listEditor.setSelectedItem((String)value);
    activeEditor=listEditor;
  }
 else   if ((targetClassz == MondrianGuiDef.AggFactCount.class && propertyName.equals("String_Node_Str")) || (targetClassz == MondrianGuiDef.AggIgnoreColumn.class && propertyName.equals("String_Node_Str")) || (targetClassz == MondrianGuiDef.AggLevel.class && propertyName.equals("String_Node_Str"))|| (targetClassz == MondrianGuiDef.AggMeasure.class && propertyName.equals("String_Node_Str"))|| (targetClassz == MondrianGuiDef.AggForeignKey.class && propertyName.equals("String_Node_Str"))|| (targetClassz == MondrianGuiDef.AggForeignKey.class && propertyName.equals("String_Node_Str"))) {
    List<String> allcols=jdbcMetaData.getAllColumns(null,null);
    ComboBoxModel cAllcols=new DefaultComboBoxModel(new Vector<String>(allcols));
    listEditor.setEditable(true);
    listEditor.setToolTipText(null);
    listEditor.removeActionListener(al);
    listEditor.setModel(cAllcols);
    listEditor.setSelectedItem((String)value);
    listEditorValue=(String)value;
    activeEditor=listEditor;
  }
 else   if (targetClassz == MondrianGuiDef.Table.class && propertyName.equals("String_Node_Str")) {
    List<String> allschemas=jdbcMetaData.getAllSchemas();
    ComboBoxModel cAllschemas=new DefaultComboBoxModel(new Vector<String>(allschemas));
    listEditor.setEditable(true);
    listEditor.setToolTipText(null);
    listEditor.removeActionListener(al);
    listEditor.setModel(cAllschemas);
    listEditor.setSelectedItem((String)value);
    listEditorValue=(String)value;
    activeEditor=listEditor;
  }
 else   if (currentRelation != null && nonTableRelation && ((targetClassz == MondrianGuiDef.Hierarchy.class && propertyName.equals("String_Node_Str")) || (targetClassz == MondrianGuiDef.Level.class && propertyName.equals("String_Node_Str")))) {
    listEditor.setEditable(false);
    listEditor.setToolTipText(null);
    listEditor.removeActionListener(al);
    activeEditor=listEditor;
  }
 else   if ((targetClassz == MondrianGuiDef.Table.class && propertyName.equals("String_Node_Str")) || (targetClassz == MondrianGuiDef.Hierarchy.class && propertyName.equals("String_Node_Str")) || (targetClassz == MondrianGuiDef.Level.class && propertyName.equals("String_Node_Str"))) {
    String schema="String_Node_Str";
    if (targetClassz == MondrianGuiDef.Table.class) {
      MondrianGuiDef.Table tProps=(MondrianGuiDef.Table)tableModel.getValue();
      schema=tProps.schema;
    }
    Vector<String> factTables=new Vector<String>(jdbcMetaData.getFactTables(schema));
    Vector<String> allTablesMinusFact=new Vector<String>(jdbcMetaData.getAllTables(schema,selectedFactTable));
    Vector<String> allTables=new Vector<String>(jdbcMetaData.getAllTables(schema));
    Vector<String> dimeTables=new Vector<String>(jdbcMetaData.getDimensionTables(schema,selectedFactTable));
    ComboBoxModel cFactTables=new DefaultComboBoxModel(factTables);
    ComboBoxModel cAllTables=new DefaultComboBoxModel((allTablesMinusFact.size() > 0) ? allTablesMinusFact : allTables);
    ComboBoxModel cDimeTables=new DefaultComboBoxModel(dimeTables);
    if (targetClassz == MondrianGuiDef.Level.class || targetClassz == MondrianGuiDef.Hierarchy.class) {
      MondrianGuiDef.RelationOrJoin relation=null;
      if (parent != null && parent instanceof MondrianGuiDef.Hierarchy) {
        relation=((MondrianGuiDef.Hierarchy)parent).relation;
      }
 else {
        relation=((MondrianGuiDef.Hierarchy)tableModel.target).relation;
      }
      if (relation instanceof MondrianGuiDef.Join) {
        TreeSet<String> joinTables=new TreeSet<String>();
        SchemaExplorer.getTableNamesForJoin(relation,joinTables);
        cAllTables=new DefaultComboBoxModel(new Vector<String>(joinTables));
      }
    }
    listEditor.setEditable(true);
    listEditor.setToolTipText(null);
    listEditor.removeActionListener(al);
    listEditor.setModel(cAllTables);
    allOptions=cAllTables;
    boolean toggleModel=false;
    if (parentClassz == MondrianGuiDef.Cube.class) {
      cAllTables=new DefaultComboBoxModel(allTables);
      allOptions=cAllTables;
      if (factTables.size() > 0) {
        ((DefaultComboBoxModel)cFactTables).insertElementAt(workbench.getResourceConverter().getString("String_Node_Str","String_Node_Str"),0);
        ((DefaultComboBoxModel)cAllTables).insertElementAt(workbench.getResourceConverter().getString("String_Node_Str","String_Node_Str"),0);
        listEditor.setModel(cFactTables);
        selOptions=cFactTables;
        toggleModel=true;
      }
    }
 else {
      if (dimeTables.size() > 0) {
        ((DefaultComboBoxModel)cDimeTables).insertElementAt(workbench.getResourceConverter().getString("String_Node_Str","String_Node_Str"),0);
        ((DefaultComboBoxModel)cAllTables).insertElementAt(workbench.getResourceConverter().getString("String_Node_Str","String_Node_Str"),0);
        listEditor.setModel(cDimeTables);
        selOptions=cDimeTables;
        toggleModel=true;
      }
    }
    if (toggleModel) {
      listEditor.addActionListener(al);
    }
    listEditor.setSelectedItem((String)value);
    listEditorValue=(String)value;
    activeEditor=listEditor;
    if ((targetClassz == MondrianGuiDef.Level.class && propertyName.equals(SchemaExplorer.DEF_LEVEL[1]) && parent != null) || (targetClassz == MondrianGuiDef.Hierarchy.class && propertyName.equals(SchemaExplorer.DEF_HIERARCHY[7]) && parent != null)) {
      MondrianGuiDef.RelationOrJoin relation=null;
      if (parent instanceof MondrianGuiDef.Hierarchy) {
        relation=((MondrianGuiDef.Hierarchy)parent).relation;
      }
 else       if (parent instanceof MondrianGuiDef.Dimension) {
        relation=((MondrianGuiDef.Hierarchy)tableModel.target).relation;
      }
      if (relation instanceof MondrianGuiDef.Table) {
        activeEditor=stringEditor;
        stringEditor.setText((String)value);
      }
    }
  }
 else   if (propertyName.equals("String_Node_Str")) {
    try {
      cdataTextArea.read(new StringReader((String)value),null);
    }
 catch (    Exception ex) {
    }
    activeEditor=jScrollPaneCDATA;
  }
 else   if (value instanceof String) {
    activeEditor=stringEditor;
    stringEditor.setText((String)value);
  }
 else   if (value instanceof Boolean) {
    activeEditor=booleanEditor;
    booleanEditor.setSelected((Boolean)value);
  }
 else   if (value instanceof Integer) {
    activeEditor=integerEditor;
    integerEditor.setText((String)value);
  }
 else   if (value == null) {
    value="String_Node_Str";
    activeEditor=stringEditor;
    stringEditor.setText((String)value);
  }
 else   if (value.getClass() == MondrianGuiDef.Join.class) {
    SchemaPropertyCellEditor spce=new SchemaPropertyCellEditor(workbench);
    tableEditor.setDefaultEditor(Object.class,spce);
    SchemaPropertyCellRenderer spcr=new SchemaPropertyCellRenderer(workbench);
    tableEditor.setDefaultRenderer(Object.class,spcr);
    PropertyTableModel ptm=new PropertyTableModel(workbench,value,SchemaExplorer.DEF_JOIN);
    tableEditor.setModel(ptm);
    activeEditor=tableEditor;
  }
 else   if (value.getClass() == MondrianGuiDef.NameExpression.class) {
    return null;
  }
 else   if (value.getClass() == MondrianGuiDef.RelationOrJoin.class) {
    SchemaPropertyCellEditor spce=new SchemaPropertyCellEditor(workbench);
    tableEditor.setDefaultEditor(Object.class,spce);
    SchemaPropertyCellRenderer spcr=new SchemaPropertyCellRenderer(workbench);
    tableEditor.setDefaultRenderer(Object.class,spcr);
    PropertyTableModel ptm=new PropertyTableModel(workbench,value,SchemaExplorer.DEF_RELATION);
    tableEditor.setModel(ptm);
    activeEditor=tableEditor;
    return null;
  }
 else   if (value.getClass() == MondrianGuiDef.OrdinalExpression.class) {
    SchemaPropertyCellEditor spce=new SchemaPropertyCellEditor(workbench);
    tableEditor.setDefaultEditor(Object.class,spce);
    SchemaPropertyCellRenderer spcr=new SchemaPropertyCellRenderer(workbench);
    tableEditor.setDefaultRenderer(Object.class,spcr);
    PropertyTableModel ptm=new PropertyTableModel(workbench,((MondrianGuiDef.OrdinalExpression)value).expressions[0],SchemaExplorer.DEF_SQL);
    ptm.setParentTarget(((PropertyTableModel)table.getModel()).target);
    tableEditor.setModel(ptm);
    activeEditor=tableEditor;
  }
 else   if (value.getClass() == MondrianGuiDef.CaptionExpression.class) {
    SchemaPropertyCellEditor spce=new SchemaPropertyCellEditor(workbench);
    tableEditor.setDefaultEditor(Object.class,spce);
    SchemaPropertyCellRenderer spcr=new SchemaPropertyCellRenderer(workbench);
    tableEditor.setDefaultRenderer(Object.class,spcr);
    PropertyTableModel ptm=new PropertyTableModel(workbench,((MondrianGuiDef.CaptionExpression)value).expressions[0],SchemaExplorer.DEF_SQL);
    ptm.setParentTarget(((PropertyTableModel)table.getModel()).target);
    tableEditor.setModel(ptm);
    activeEditor=tableEditor;
  }
 else   if (value.getClass() == MondrianGuiDef.Formula.class) {
    SchemaPropertyCellEditor spce=new SchemaPropertyCellEditor(workbench,jdbcMetaData);
    tableEditor.setDefaultEditor(Object.class,spce);
    SchemaPropertyCellRenderer spcr=new SchemaPropertyCellRenderer(workbench);
    tableEditor.setDefaultRenderer(Object.class,spcr);
    PropertyTableModel ptm=new PropertyTableModel(workbench,value,SchemaExplorer.DEF_FORMULA);
    tableEditor.setModel(ptm);
    tableEditor.getColumnModel().getColumn(0).setMaxWidth(100);
    tableEditor.getColumnModel().getColumn(0).setMinWidth(100);
    activeEditor=tableEditor;
  }
 else   if (value.getClass() == MondrianGuiDef.CalculatedMemberProperty.class) {
    SchemaPropertyCellEditor spce=new SchemaPropertyCellEditor(workbench,jdbcMetaData);
    tableEditor.setDefaultEditor(Object.class,spce);
    SchemaPropertyCellRenderer spcr=new SchemaPropertyCellRenderer(workbench);
    tableEditor.setDefaultRenderer(Object.class,spcr);
    PropertyTableModel ptm=new PropertyTableModel(workbench,value,SchemaExplorer.DEF_CALCULATED_MEMBER_PROPERTY);
    tableEditor.setModel(ptm);
    tableEditor.getColumnModel().getColumn(0).setMaxWidth(100);
    tableEditor.getColumnModel().getColumn(0).setMinWidth(100);
    activeEditor=tableEditor;
  }
 else   if (value.getClass() == MondrianGuiDef.Table.class) {
    SchemaPropertyCellEditor spce=new SchemaPropertyCellEditor(workbench,jdbcMetaData);
    for (int i=listeners.size() - 1; i >= 0; i--) {
      spce.addCellEditorListener(listeners.get(i));
    }
    tableEditor.setDefaultEditor(Object.class,spce);
    SchemaPropertyCellRenderer spcr=new SchemaPropertyCellRenderer(workbench);
    tableEditor.setDefaultRenderer(Object.class,spcr);
    PropertyTableModel ptm=new PropertyTableModel(workbench,value,SchemaExplorer.DEF_TABLE);
    ptm.setFactTable(selectedFactTable);
    if (targetClassz == MondrianGuiDef.Cube.class) {
      ptm.setParentTarget(((PropertyTableModel)table.getModel()).target);
    }
    tableEditor.setModel(ptm);
    tableEditor.getColumnModel().getColumn(0).setMaxWidth(100);
    tableEditor.getColumnModel().getColumn(0).setMinWidth(100);
    activeEditor=tableEditor;
  }
 else   if (value.getClass() == MondrianGuiDef.AggFactCount.class) {
    SchemaPropertyCellEditor spce=new SchemaPropertyCellEditor(workbench,jdbcMetaData);
    for (int i=listeners.size() - 1; i >= 0; i--) {
      spce.addCellEditorListener(listeners.get(i));
    }
    tableEditor.setDefaultEditor(Object.class,spce);
    SchemaPropertyCellRenderer spcr=new SchemaPropertyCellRenderer(workbench);
    tableEditor.setDefaultRenderer(Object.class,spcr);
    PropertyTableModel ptm=new PropertyTableModel(workbench,value,SchemaExplorer.DEF_AGG_FACT_COUNT);
    ptm.setFactTable(selectedFactTable);
    tableEditor.setModel(ptm);
    tableEditor.getColumnModel().getColumn(0).setMaxWidth(100);
    tableEditor.getColumnModel().getColumn(0).setMinWidth(100);
    activeEditor=tableEditor;
  }
 else   if (value.getClass() == MondrianGuiDef.Closure.class) {
    SchemaPropertyCellEditor spce=new SchemaPropertyCellEditor(workbench,jdbcMetaData);
    for (int i=listeners.size() - 1; i >= 0; i--) {
      spce.addCellEditorListener(listeners.get(i));
    }
    tableEditor.setDefaultEditor(Object.class,spce);
    SchemaPropertyCellRenderer spcr=new SchemaPropertyCellRenderer(workbench);
    tableEditor.setDefaultRenderer(Object.class,spcr);
    PropertyTableModel ptm=new PropertyTableModel(workbench,value,SchemaExplorer.DEF_CLOSURE);
    ptm.setFactTable(selectedFactTable);
    if (targetClassz == MondrianGuiDef.Level.class) {
      ptm.setParentTarget(((PropertyTableModel)table.getModel()).target);
    }
    tableEditor.setModel(ptm);
    tableEditor.getColumnModel().getColumn(0).setMaxWidth(100);
    tableEditor.getColumnModel().getColumn(0).setMinWidth(100);
    spcr.setTableRendererHeight(tableEditor,null);
    activeEditor=tableEditor;
  }
 else   if (value.getClass() == MondrianGuiDef.Property.class) {
    SchemaPropertyCellEditor spce=new SchemaPropertyCellEditor(workbench);
    tableEditor.setDefaultEditor(Object.class,spce);
    SchemaPropertyCellRenderer spcr=new SchemaPropertyCellRenderer(workbench);
    tableEditor.setDefaultRenderer(Object.class,spcr);
    PropertyTableModel ptm=new PropertyTableModel(workbench,value,SchemaExplorer.DEF_PROPERTY);
    tableEditor.setModel(ptm);
    activeEditor=tableEditor;
  }
 else {
    value="String_Node_Str";
    activeEditor=stringEditor;
    stringEditor.setText((String)value);
  }
  activeEditor.setVisible(true);
  setOriginalValue();
  table.changeSelection(row,column,false,false);
  activeEditor.setBackground(new java.awt.Color(224,249,255));
  activeEditor.requestFocusInWindow();
  return activeEditor;
}