public void selectionChanged() {
        NSRelation or;
        int i, oc;

        SObjectTableModel tm;
        oc = 0;
        for (i = 0; i < this.M.getSize(); i++) {
            if (this.M.getObjectAt(i).isSelected()) {
                oc++;
                this.o = (NSObject) this.M.getObjectAt(i);
            }
        }
        if (oc == 1) {
            this.nameField.setText(this.o.getName());
            if (this.o.getSnippet().isRelation()) {
                or = (NSRelation) this.o;
                this.description.setText(Messages.tr("relates") + " (" + or.getFrom().getName() + ", " + or.getTo().getName() + ")");
            } else {
                this.description.setText(Messages.tr("entity_class") + ": " + this.o.getSnippet().getName() + " : " + this.o.getSnippet().getBase());
            }
            // Prepare array list
            this.arrayIndex.removeAllItems();
            this.arrayIndex.addItem(new NSArray(Messages.tr("no_index"), 0));
            for (i = 0; i < this.M.getArrayCount(); i++) {
                this.arrayIndex.addItem(this.M.getArray(i));
            }
            if (this.o.getArrayIndex() >= 0) {
                this.arrayIndex.setSelectedIndex(this.o.getArrayIndex() + 1);
            }
        }
        if (oc > 1) {
            this.nameField.setText("");
            this.description.setText(Messages.tr("multiple_selection"));
            this.arrayIndex.setSelectedIndex(-1);
            this.o = null;
        }
        if (oc == 0) {
            this.nameField.setText("");
            this.description.setText(Messages.tr("no_selection"));
            this.arrayIndex.setSelectedIndex(-1);
            this.o = null;
        }
        tm = new SObjectTableModel(this.o);
        this.attrTable.setModel(tm);
        if (oc == 1) {
            this.attrTable.getColumnModel().getColumn(1).setCellEditor(new SObjectCellEditor(this.o));
        }
    }