private void onSelectCombinedTreeFromSidebar(object sender) { if (sender != null && sender is Kernel.Domain.CombinedTransformationTree) { Kernel.Domain.CombinedTransformationTree ctree = (Kernel.Domain.CombinedTransformationTree)sender; EditorItem <Kernel.Domain.CombinedTransformationTree> page = getCombineTransformationTreeEditor().getPage(ctree.name); if (page != null) { page.fillObject(); getCombineTransformationTreeEditor().selectePage(page); } else if (ctree.oid != null && ctree.oid.HasValue) { this.Open(ctree.oid.Value); } else { page = getCombineTransformationTreeEditor().addOrSelectPage(ctree); initializePageHandlers(page); page.Title = ctree.name; getCombineTransformationTreeEditor().ListChangeHandler.AddNew(ctree); } CombinedTransformationTreeEditorItem pageOpen = (CombinedTransformationTreeEditorItem)getCombineTransformationTreeEditor().getActivePage(); } }
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); }
protected void OnCombineTransformationTreePanelDeleted(object item) { CombinedTransformationTreeEditorItem page = (CombinedTransformationTreeEditorItem)getCombineTransformationTreeEditor().getActivePage(); if (page == null) { return; } page.EditedObject.DeleteTreeItem((CombinedTransformationTreeItem)item); }
/// <summary> /// Cette methode permet de créer une nouvelle table. /// </summary> /// <returns>CONTINUE si la création du nouveau Model se termine avec succès. STOP sinon</returns> public override OperationState Create() { Kernel.Domain.CombinedTransformationTree combinedTransformationTree = GetNewCombinedTransformationTree(); ((CombinedTransformationTreeSideBar)SideBar).CombineTransformationTreeGroup.combinedTransformationTreeTreeview.AddTarget(combinedTransformationTree); CombinedTransformationTreeEditorItem page = (CombinedTransformationTreeEditorItem)getCombineTransformationTreeEditor().addOrSelectPage(combinedTransformationTree); initializePageHandlers(page); page.Title = combinedTransformationTree.name; getCombineTransformationTreeEditor().ListChangeHandler.AddNew(combinedTransformationTree); return(OperationState.CONTINUE); }
public override OperationState Rename() { if (base.Rename() != OperationState.CONTINUE) { return(OperationState.STOP); } IsRenameOnDoubleClick = true; CombinedTransformationTreeEditorItem page = (CombinedTransformationTreeEditorItem)getCombineTransformationTreeEditor().getActivePage(); return(ValidateEditedNewName(page.EditedObject.name)); }
/// <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> /// 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; } }
private void OnClear(object sender, RoutedEventArgs e) { CombinedTransformationTreeEditorItem page = (CombinedTransformationTreeEditorItem)getCombineTransformationTreeEditor().getActivePage(); if (page == null) { return; } List <int> listTreeToClear = page.EditedObject.getTransformationTreesOids(); TableActionData tableActionData = new TableActionData(); tableActionData.oids.AddRange(listTreeToClear); GetCombineTransformationTreeService().TransformationTreeService.ClearTreeHandler += updateClearProgress; GetCombineTransformationTreeService().TransformationTreeService.ClearTree(tableActionData); Mask(true, RunMessageUtil.getMaskStartText(true)); }
public override OperationState Save(EditorItem <Kernel.Domain.CombinedTransformationTree> page) { try { currentPage = (CombinedTransformationTreeEditorItem)page; if (base.Save(page) == OperationState.STOP) { return(OperationState.STOP); } } catch (Exception) { DisplayError("Unable to save Target", "Unable to save Excel file."); return(OperationState.STOP); } 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); }
private void OnRun(object sender, RoutedEventArgs e) { CombinedTransformationTreeEditorItem page = (CombinedTransformationTreeEditorItem)getCombineTransformationTreeEditor().getActivePage(); if (page == null) { return; } if (!this.IsModify) { if (Save(getCombineTransformationTreeEditor().getActivePage()) == OperationState.STOP) { return; } } List <int> listTreeToRun = page.EditedObject.getTransformationTreesOids(); GetCombineTransformationTreeService().TransformationTreeService.RunHandler += updateRunProgress; GetCombineTransformationTreeService().TransformationTreeService.PowerpointHandler += loadPowerpoint; GetCombineTransformationTreeService().TransformationTreeService.Run(listTreeToRun, true); Mask(true, RunMessageUtil.getMaskStartText(), true); }
protected void onScopeItemDeleted(object item) { CombinedTransformationTreeEditorItem page = (CombinedTransformationTreeEditorItem)getCombineTransformationTreeEditor().getActivePage(); page.EditedObject.DeleteTreeItem((CombinedTransformationTreeItem)item); }