Class: KeepYourHead::AdaptorFile

Inherits:
Adaptor
  • Object
show all
Defined in:
lib/Keepyourhead/gui/WindowEditAdapters.rb

Instance Method Summary collapse

Methods inherited from Adaptor

#createChild

Instance Method Details

#firstChild(object) ⇒ Object



94
95
96
# File 'lib/Keepyourhead/gui/WindowEditAdapters.rb', line 94

def firstChild(object)
	object.root.collections[0]
end

#insertAfter(parent, item, other) ⇒ Object



116
117
118
119
120
121
122
# File 'lib/Keepyourhead/gui/WindowEditAdapters.rb', line 116

def insertAfter(parent,item,other)
	if other then
		parent.root.collectionInsertAfter(item,other)
	else
		parent.root.collectionInsertFirst(item)
	end
end

#name(object) ⇒ Object



87
88
89
# File 'lib/Keepyourhead/gui/WindowEditAdapters.rb', line 87

def name(object)
	object.filename ? ::File.basename(object.filename) : "(unbenannt)"
end

#nextSibling(object) ⇒ Object



97
98
99
100
101
102
103
104
105
# File 'lib/Keepyourhead/gui/WindowEditAdapters.rb', line 97

def nextSibling(object)
	files = object.database.files
	idx = files.index object
	if idx == files.length - 1 then
		nil
	else
		files[idx+1]
	end
end

#parent(object) ⇒ Object



91
92
93
# File 'lib/Keepyourhead/gui/WindowEditAdapters.rb', line 91

def parent(object)
	object.database
end

#previousSibling(object) ⇒ Object



106
107
108
109
110
111
112
113
114
# File 'lib/Keepyourhead/gui/WindowEditAdapters.rb', line 106

def previousSibling(object)
	files = object.database.files
	idx = files.index object
	if idx == 0 then
		nil
	else
		files[idx-1]
	end
end

#realization(object) ⇒ Object



126
127
128
# File 'lib/Keepyourhead/gui/WindowEditAdapters.rb', line 126

def realization(object)
	object
end

#remove(item) ⇒ Object



123
124
125
# File 'lib/Keepyourhead/gui/WindowEditAdapters.rb', line 123

def remove(item)
	throw ExceptionNotImplimented.new
end