TestFileCellView.swift 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. //
  2. // TeseCaseCell.swift
  3. // KdanAuto
  4. //
  5. // Created by 朱东勇 on 2022/11/21.
  6. //
  7. import Foundation
  8. import AppKit
  9. class TestFileCellView : NSTableCellView {
  10. @IBOutlet var _titleLbl : NSTextField!
  11. @IBOutlet var _sepLine : NSView!
  12. var _title : String!
  13. var _isExpad: Bool!
  14. var _typeInfo : NSDictionary!
  15. class func shared() -> TestFileCellView? {
  16. var objects : NSArray!
  17. Bundle.main.loadNibNamed("TestFileCellView", owner: nil, topLevelObjects: &objects)
  18. for tView in objects {
  19. if let tv = tView as? TestFileCellView {
  20. return tv
  21. }
  22. }
  23. return nil
  24. }
  25. override func awakeFromNib() {
  26. _sepLine.wantsLayer = true;
  27. _sepLine.layer?.backgroundColor = NSColor.lightGray.cgColor
  28. }
  29. // Setter & Getter
  30. public func setTitle(_ title:String) {
  31. _title = title;
  32. _titleLbl.stringValue = _title ?? ""
  33. }
  34. public func title() -> String? {
  35. return _title
  36. }
  37. public func fileType() -> String? {
  38. return _title
  39. }
  40. public func setTypeInfo(_ typeInfo:NSDictionary) {
  41. _typeInfo = typeInfo
  42. self.setTitle(_typeInfo["Type"] as! String)
  43. }
  44. public func typeInfo() -> NSDictionary? {
  45. return _typeInfo
  46. }
  47. }