public void setEditedBlock(JBlock b) {
        if(b==editing) return ;
        if(editing!=null)
            finnishEdit();
        editing=(structBlock)b;
        fields.clear();
        //fieldsPane.removeAll();
        for(String f[]:editing.getFields()){
            Field field=new Field(this);
            field.name.setText(f[0]);
            field.type.setSelectedItem(addField);
            for(ComboText c: types){
                if(c.getValue().equals(editing.type)){
                    field.type.setSelectedItem(c);
                    break;
                }
            }
            fields.add(field);
            //fieldsPane.add(field);
        }
        makeList();
        name.setText(editing.name);
        iface.setSelected(editing.genInterface);
    }