private void cmbFirstObjects_SelectedIndexChanged(object sender, EventArgs e) { setInformationLossBoolean(); object previouslySelectedSecondItem = this.cmbSecondObjects.SelectedItem; this.cmbSecondObjects.Items.Clear(); this.cmbSecondObjects.Items.AddRange(expressionProvider.getSecondStringList(cmbFirstObjects.SelectedIndex).ToArray()); if (this.cmbSecondObjects.Items.Count > 0) { if (previouslySelectedSecondItem != null && this.cmbSecondObjects.Items.Contains(previouslySelectedSecondItem)) { this.cmbSecondObjects.SelectedItem = previouslySelectedSecondItem; } else { this.cmbSecondObjects.SelectedIndex = 0; } } this.cmbSecondObjects.DropDownWidth = EAUtil.computeDropDownWidth(this.cmbSecondObjects); updateTreeView(); }
public void initializePossibleClassifiersComboBox(String ovStereotype, int classifierId, SQLRepository repository) { ovType = ovStereotype; this.Items.Clear(); this.classifierId = classifierId; this.sqlRepository = repository; this.Classifiers = new List <EClass>(); this.ClassifierIDs = new List <int>(); addPossibleEntriesToComboBoxSQL(); DropDownWidth = EAUtil.computeDropDownWidth(this); }
private void addLeftAttributes() { cmbAttributes.Items.Clear(); if (this.objectVariable.Classifier != null) { SQLElement classifier = this.objectVariable.Classifier.EaElement; List <SQLElement> classifierAndParents = EAUtil.getBaseClasses(classifier); foreach (SQLElement classif in classifierAndParents) { foreach (SQLAttribute attribute in classif.Attributes) { cmbAttributes.Items.Add(attribute.Name); this.leftAttributes.Add(attribute); } } if (cmbAttributes.Items.Count > 0) { cmbAttributes.SelectedIndex = 0; } cmbAttributes.DropDownWidth = EAUtil.computeDropDownWidth(cmbAttributes); } }
private void cmbExpressions_SelectedIndexChanged(object sender, EventArgs e) { setInformationLossBoolean(); object previousFirstObject = this.cmbFirstObjects.SelectedItem; object previousSecondObject = this.cmbSecondObjects.SelectedItem; this.cmbFirstObjects.Items.Clear(); //this.cmbSecondObjects.Items.Clear(); this.cmbFirstObjects.Items.AddRange(expressionProvider.getFirstStringList(cmbExpressions.Text).ToArray()); cmbFirstObjects.DropDownWidth = EAUtil.computeDropDownWidth(cmbFirstObjects); if (cmbFirstObjects.Items.Count > 0) { if (previousFirstObject != null && this.cmbFirstObjects.Items.Contains(previousFirstObject)) { this.cmbFirstObjects.SelectedItem = previousFirstObject; } else { this.cmbFirstObjects.SelectedIndex = 0; } } if (cmbExpressions.Text == "MethodCallExpression") { grpFirst.Enabled = true; grpSecond.Enabled = true; grpFirst.Text = "Target"; grpSecond.Text = "Method"; buttonToMethodCallExpression.Parent.Enabled = true; } else { buttonToMethodCallExpression.Parent.Enabled = false; } if (cmbExpressions.Text == "ObjectVariableExpression") { grpFirst.Enabled = true; grpSecond.Enabled = false; grpFirst.Text = "Object"; } else if (cmbExpressions.Text == "ParameterExpression") { grpFirst.Enabled = true; grpSecond.Enabled = false; grpFirst.Text = "Parameter"; } else if (cmbExpressions.Text == "LiteralExpression") { grpFirst.Enabled = false; grpSecond.Enabled = false; } else if (cmbExpressions.Text == "AttributeValueExpression") { grpFirst.Enabled = true; grpSecond.Enabled = true; grpFirst.Text = "Target"; grpSecond.Text = "Attribute"; } updateTreeView(); }