Module: Rubeus::Extensions::Javax::Swing::BoxLayout::ClassMethods

Defined in:
lib/rubeus/extensions/javax/swing/box_layout.rb

Instance Method Summary collapse

Instance Method Details

#new_with_nestable(*args, &block) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/rubeus/extensions/javax/swing/box_layout.rb', line 12

def new_with_nestable(*args, &block)
  if args.length == 1
    container = Rubeus::Awt::Nestable::Context.container
    raise ArgumentError, "No container! you must specify a Container and an axis" unless container
    args.unshift(container.respond_to?(:content_pane) ? container.content_pane : container)
  end

  unless args.last.is_a?(Integer)
    value = args.pop
    args << const_get(value.to_s)
  end

  new_without_nestable(*args, &block)
end