Sha256: 7617d7385485a9eff489bb59b599c95db91c712fbf915edf3aa136d821438c42
Contents?: true
Size: 1.24 KB
Versions: 44
Compression:
Stored size: 1.24 KB
Contents
module Redcar class ApplicationSWT module Dialogs class InputDialog < JFace::Dialogs::Dialog def initialize(parent_shell, title, message, options={}) super(parent_shell) @title, @message = title, message @options = {:password => false, :initial_text => ""}.merge(options) end def password? @options[:password] end def initial_text @options[:initial_text] end def createDialogArea(parent) composite = super(parent) passwordLabel = Swt::Widgets::Label.new(composite, Swt::SWT::RIGHT) passwordLabel.setText(@message) style = Swt::SWT::SINGLE style = style | Swt::SWT::PASSWORD if password? @inputField = Swt::Widgets::Text.new(composite, style) data = Swt::Layout::GridData.new(Swt::Layout::GridData::FILL_HORIZONTAL) @inputField.setLayoutData(data) @inputField.setText(initial_text) getShell.setText(@title) end def value @text end def close @text = @inputField.getText super end end end end end
Version data entries
44 entries across 44 versions & 2 rubygems