-require_dependency "editor/dock/base"
-require_dependency "editor/dock/bay"
-require_dependency "editor/dock/board"
-require_dependency "editor/dock/bucket"
-require_dependency "editor/dock/bay/root"
-require_dependency "editor/dock/bay/element"
-require_dependency "editor/dock/bay/torder"
-require_dependency "editor/dock/bay/zorder"
-require_dependency "editor/dock/bay/new"
module Editor
-
- module DockModule
- include TabModule
- class Dock < Base
- include BayModule
- include BoardModule
- include RootBayModule
- include ElementBayModule
- include TorderBayModule
- include ZorderBayModule
- include NewBayModule
- attr_accessor :tabs
+ module EditorModule
+ class DockBase
+ attr_accessor :parent, :tabs
def initialize parent
- super
- tab = RootBay.new(self, 0, 'panel')
- add_tab tab, RootBayLabel.new(tab, 'panel'),
- RootBayBody.new(tab)
-
- tab = ElementBay.new(self, 1, 'elements')
- add_tab tab, ElementBayLabel.new(tab, 'elements'),
- ElementBayBody.new(tab)
-
- tab = TorderBay.new(self, 2, 'tsort')
- add_tab tab, TorderBayLabel.new(tab, 'torder'),
- TorderBayBody.new(tab)
-
- tab = ZorderBay.new(self, 3, 'zsort')
- add_tab tab, ZorderBayLabel.new(tab, 'zorder'),
- ZorderBayBody.new(tab)
-
- tab = NewBay.new(self, 4, 'new')
- add_tab tab, NewBayLabel.new(tab, 'new'),
- NewBayBody.new(tab)
-
+ @parent = parent
+ @tabs = []
end
- def editor
- @parent
+ def add_tab tab, label, body
+ @tabs << tab
+ tab.label = label
+ tab.body = body
+ tab
end
def root_item
end
def template_dir
- @parent.template_dir + 'dock/'
+ @parent.template_dir
end
- def labels_template_name
- self.template_dir + 'bay_labels'
+ def template_file_name
+ raise "no template_file_name"
end
- def bodys_template_name
- self.template_dir + 'bay_bodys'
- end
-
- def dom_id
- self.editor.dom_id + '-dock'
- end
-
- def dom_class
- self.editor.dom_class + '-dock'
- end
-
- def dom_labels_class
- self.dom_class + '-labels'
+ def template_name
+ self.template_dir + self.template_file_name
end
end
-
end
end