protected void onGroupFieldChange() { CombinedTransformationTreeEditorItem page = (CombinedTransformationTreeEditorItem)getCombineTransformationTreeEditor().getActivePage(); string name = page.getCombineTransformationTreeForm().CombinedTransformationTreePropertiesPanel.groupField.textBox.Text; ((CombinedTransformationTreeSideBar)SideBar).CombineTransformationTreeGroup.combinedTransformationTreeTreeview.updateTarget(name, page.Title, true); OnChange(); }
protected override void Rename(string name) { CombinedTransformationTreeEditorItem page = (CombinedTransformationTreeEditorItem)getCombineTransformationTreeEditor().getActivePage(); page.getCombineTransformationTreeForm().CombinedTransformationTreePropertiesPanel.nameTextBox.Text = name; page.EditedObject.name = name; base.Rename(name); }
/// <summary> /// Initialisation des Handlers sur une nouvelle page. /// En plus des handlers de base, on initialise les handlers sur : /// - DesignerPropertiesPanel /// - /// - SpreadSheet /// - /// </summary> protected override void initializePageHandlers(EditorItem <Kernel.Domain.CombinedTransformationTree> page) { base.initializePageHandlers(page); CombinedTransformationTreeEditorItem editorPage = (CombinedTransformationTreeEditorItem)page; editorPage.getCombineTransformationTreeForm().CombinedTransformationTreePropertiesPanel.groupField.GroupService = GetCombineTransformationTreeService().GroupService; editorPage.getCombineTransformationTreeForm().CombinedTransformationTreePropertiesPanel.groupField.subjectType = SubjectTypeFound(); editorPage.getCombineTransformationTreeForm().CombinedTransformationTreePropertiesPanel.nameTextBox.KeyUp += onNameTextChange; editorPage.getCombineTransformationTreeForm().CombinedTransformationTreePropertiesPanel.nameTextBox.LostFocus += onNameTextLostFocus; editorPage.getCombineTransformationTreeForm().CombinedTransformationTreePropertiesPanel.groupField.Changed += onGroupFieldChange; editorPage.getCombineTransformationTreeForm().CombinedTransformationTreePanel.Changed += OnCombineTransformationTreePanelChanged; editorPage.getCombineTransformationTreeForm().CombinedTransformationTreePanel.ItemDeleted += OnCombineTransformationTreePanelDeleted; if (editorPage.getCombineTransformationTreeForm().AdministrationBar != null) { editorPage.getCombineTransformationTreeForm().AdministrationBar.Changed += OnChangeEventHandler; } }
/// <summary> /// Cette methode est exécuté lorsqu'on édit le nom de la table active. /// Si l'utilisateur tappe sur la touche ENTER, le nouveau nom est validé. /// </summary> /// <param name="sender"></param> /// <param name="args"></param> protected void onNameTextChange(object sender, KeyEventArgs args) { CombinedTransformationTreeEditorItem page = (CombinedTransformationTreeEditorItem)getCombineTransformationTreeEditor().getActivePage(); if (args.Key == Key.Escape) { page.getCombineTransformationTreeForm().CombinedTransformationTreePropertiesPanel.nameTextBox.Text = page.Title; } else if (args.Key == Key.Enter) { ValidateEditedNewName(); } }
/// <summary> /// Cette méthode est exécutée lorsqu'on sélectionne une target sur la sidebar. /// Cette opération a pour but de rajouté la target sélectionnée au filtre de la table en édition, /// ou au scope des cellProperties correspondants à la sélection Excel. /// </summary> /// <param name="sender">La target sélectionné</param> protected void onSelectTransformationTreeFromSidebar(object sender) { if (sender != null && sender is Kernel.Domain.TransformationTree) { Kernel.Domain.TransformationTree tree = (Kernel.Domain.TransformationTree)sender; CombinedTransformationTreeEditorItem page = (CombinedTransformationTreeEditorItem)getCombineTransformationTreeEditor().getActivePage(); if (page == null) { return; } page.getCombineTransformationTreeForm().CombinedTransformationTreePanel.setTransformationTree(tree); } }
/// <summary> /// /// </summary> /// <returns></returns> protected virtual OperationState ValidateEditedNewName(string newName = "") { CombinedTransformationTreeEditorItem page = (CombinedTransformationTreeEditorItem)getCombineTransformationTreeEditor().getActivePage(); Kernel.Domain.CombinedTransformationTree combinedTransformationTree = page.EditedObject; if (string.IsNullOrEmpty(newName)) { newName = page.getCombineTransformationTreeForm().CombinedTransformationTreePropertiesPanel.nameTextBox.Text.Trim(); } if (string.IsNullOrEmpty(newName)) { DisplayError("Empty Name", "The Combine Transformation tree name can't be mepty!"); page.getCombineTransformationTreeForm().CombinedTransformationTreePropertiesPanel.nameTextBox.SelectAll(); page.getCombineTransformationTreeForm().CombinedTransformationTreePropertiesPanel.nameTextBox.Focus(); return(OperationState.STOP); } bool found = false; if (GetCombineTransformationTreeService().getByName(newName) != null) { found = true; } foreach (CombinedTransformationTreeEditorItem unInputTable in getCombineTransformationTreeEditor().getPages()) { if ((found && newName != getCombineTransformationTreeEditor().getActivePage().Title) || (unInputTable != getCombineTransformationTreeEditor().getActivePage() && newName == unInputTable.Title)) { DisplayError("Duplicate Name", "There is another Combine Transformation tree named: " + newName); page.getCombineTransformationTreeForm().CombinedTransformationTreePropertiesPanel.nameTextBox.Text = page.Title; page.getCombineTransformationTreeForm().CombinedTransformationTreePropertiesPanel.nameTextBox.SelectAll(); page.getCombineTransformationTreeForm().CombinedTransformationTreePropertiesPanel.nameTextBox.Focus(); return(OperationState.STOP); } } if (!IsRenameOnDoubleClick) { if (combinedTransformationTree.name.ToUpper().Equals(newName.ToUpper())) { return(OperationState.CONTINUE); } } ((CombinedTransformationTreeSideBar)SideBar).CombineTransformationTreeGroup.combinedTransformationTreeTreeview.updateTarget(newName, combinedTransformationTree.name, false); combinedTransformationTree.name = newName; page.Title = newName; OnChange(); return(OperationState.CONTINUE); }
/// <summary> /// /// </summary> /// <param name="oid"></param> /// <returns></returns> public override OperationState Open(Kernel.Domain.CombinedTransformationTree combinedTransformationTree) { if (combinedTransformationTree == null) { MessageDisplayer.DisplayWarning("Combined Transformation Tree", "This Combined Transformation tree is invalid"); this.ApplicationManager.HistoryHandler.closePage(this); return(OperationState.STOP); } int oidG = (int)combinedTransformationTree.group.oid; BGroup gr = (BGroup)GetCombineTransformationTreeService().GroupService.getByOid(oidG); combinedTransformationTree.group = gr; CombinedTransformationTreeEditorItem page = (CombinedTransformationTreeEditorItem)getEditor().addOrSelectPage(combinedTransformationTree); initializePageHandlers(page); getEditor().ListChangeHandler.AddNew(combinedTransformationTree); page.getCombineTransformationTreeForm().GroupService = GetCombineTransformationTreeService().GroupService; return(OperationState.CONTINUE); }