/// <summary> /// Cleans all text fields in this element /// </summary> /// <param name="obj"></param> /// <param name="visitSubNodes"></param> public override void visit(Generated.Shortcut obj, bool visitSubNodes) { if ( obj.getShortcutName() != null ) { obj.setShortcutName(obj.getShortcutName().Trim()); } base.visit(obj, visitSubNodes); }
/// <summary> /// Compares two Shortcut and annotates the differences on the first one /// </summary> /// <param name="obj"></param> /// <param name="other"></param> public static void compareShortcut(Generated.Shortcut obj, Generated.Shortcut other, VersionDiff diff) { if ( other == null ) { diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aAdd, "", "", obj.Name ) ); return; } compareNamable (obj, other, diff); if ( !CompareUtil.canonicalStringEquality(obj.getShortcutName(), other.getShortcutName()) ) { diff.appendChanges ( new Diff(obj, HistoricalData.Generated.acceptor.ChangeOperationEnum.aChange, "ShortcutName", other.getShortcutName(), obj.getShortcutName()) ); } }
/// <summary> /// Duplicates a source Shortcut into its target /// </summary> /// <param name="source"></param> /// <param name="target"></param> public static void DuplicateShortcut(Generated.Shortcut source, Generated.Shortcut target) { if ( source != null && target != null ) { DuplicateNamable (source, target); target.setShortcutName(source.getShortcutName()); } }
/// <summary> /// Searches a specific string in Shortcut and updates the list /// of model element with all the elements in which that string is found /// </summary> /// <param name="obj"></param> /// <param name="obj">The string to search for</param> /// <param name="occurences">The list of model elements which hold the searched string</param> public static void searchShortcut(Generated.Shortcut obj, string searchString, List<ModelElement> occurences) { searchNamable (obj, searchString, occurences); if ( obj.getShortcutName() != null && obj.getShortcutName().Contains (searchString) ) { occurences.Add ( obj ); } }