// adds an empty column and selects it. user can now select a Data Item. // because of magic values in de new empty column, validation will not only // validate, but also immediately perform a sync private void addEmptyColumn() { TSF_EA.Attribute attribute = this.ui.Addin.Model.factory.createNewElement <TSF_EA.Attribute>( this.context, "<new>" ); attribute.AddStereotype("column"); attribute.save(); this.context.save(); this.refreshTree(); this.selectNewColumn(); }
private void linkColumnToDataItem() { // TODO: this allows for selecting/creating a new table anywhere // currently the TreeView will only be populated with tables // that are within the managed (gloaasry) package. // select a table (or create a new one) TSF_EA.Class table = (TSF_EA.Class) this.ui.Addin.Model.getUserSelectedElement( new List <string>() { "Class" } ); if (!table.HasStereotype("table")) { return; } // create new column on table TSF_EA.Attribute attribute = this.ui.Addin.Model.factory.createNewElement <TSF_EA.Attribute>( table, "<new>" ); attribute.AddStereotype("column"); var context = this.context; attribute.save(); // link the column to the DataItem attribute.addTaggedValue("EDD::dataitem", context.guid); attribute.save(); // sync this.sync(attribute); this.ui.Addin.SelectedItem = context; }