Class: SensibleSwing::JFileChooser

Inherits:
Object
  • Object
show all
Defined in:
lib/swing_helpers.rb

Instance Method Summary collapse

Instance Method Details

#goObject

raises on failureā€¦



65
66
67
68
69
70
71
# File 'lib/swing_helpers.rb', line 65

def go
  success = show_open_dialog nil
  unless success == Java::javax::swing::JFileChooser::APPROVE_OPTION
    java.lang.System.exit 1 # kills background proc...but we shouldn't let them do stuff while a background proc is running, anyway
  end
  get_selected_file.get_absolute_path
end

#set_file(f) ⇒ Object Also known as: setFile



78
79
80
# File 'lib/swing_helpers.rb', line 78

def set_file f
  set_selected_file JFile.new(f)
end

#set_title(x) ⇒ Object

match FileDialog



74
75
76
# File 'lib/swing_helpers.rb', line 74

def set_title x
  set_dialog_title x
end