Class: ATT::FilePopup
Constant Summary
collapse
- CONFIRM_TEXT =
[ "OPEN", "打开", "Open","保存","Save","SAVE" ]
Constants inherited
from Popup
Popup::VERSION
Instance Attribute Summary
Attributes inherited from Popup
#window
Instance Method Summary
collapse
Methods inherited from Popup
#assert_exist?, #close, collect_windows, find, find_all, find_when, #initialize, record
Constructor Details
This class inherits a constructor from ATT::Popup
Instance Method Details
#click_confirm ⇒ Object
27
28
29
30
31
|
# File 'lib/popup/file_popup.rb', line 27
def click_confirm
confirm_button.click
end
|
33
34
35
36
37
38
39
40
41
42
43
44
45
|
# File 'lib/popup/file_popup.rb', line 33
def confirm_button
most_like = @window.button(:index=>1)
CONFIRM_TEXT.each do |text|
most_like.value.include?(text) && ( return most_like )
end
@window.buttons.find do |button|
CONFIRM_TEXT.each do |text|
button.value.include?(text) && ( break true ) || false
end
end
end
|
#set(file_path) ⇒ Object
Raise RootNotSetError when ATT::Config.root not set and path is not an absolute path
12
13
14
15
16
|
# File 'lib/popup/file_popup.rb', line 12
def set(file_path)
check_file_exist?(file_path)
set_text(file_path)
click_confirm
end
|
#set_text(file_path) ⇒ Object
18
19
20
21
|
# File 'lib/popup/file_popup.rb', line 18
def set_text(file_path)
text_field.set(window_full_path(file_path))
end
|
#text_field ⇒ Object
23
24
25
|
# File 'lib/popup/file_popup.rb', line 23
def text_field
@window.text_field(:instance=>1)
end
|