Class: Glimmer::SWT::SWTProxy

Inherits:
Object
  • Object
show all
Includes:
StyleConstantizable
Defined in:
lib/glimmer/swt/swt_proxy.rb

Overview

Proxy for org.eclipse.swt.SWT

Follows the Proxy Design Pattern

Constant Summary collapse

JAVA_IMPORT =
'org.eclipse.swt.SWT'
EXTRA_STYLES =
{
  NO_RESIZE: self[:shell_trim, :resize!, :max!],
  WINDOW_TRIM: self[:shell_trim],
}

Constants included from StyleConstantizable

Glimmer::SWT::StyleConstantizable::REGEX_SYMBOL_NEGATIVITY

Class Method Summary collapse

Methods included from StyleConstantizable

[], constant, constantify_args, deconstruct, error_message_invalid_style, extract_symbol_string_negativity, has_constant?, include?, negative?, reverse_lookup

Class Method Details

.color_optionsObject



65
66
67
# File 'lib/glimmer/swt/swt_proxy.rb', line 65

def color_options
  color_styles.map {|c| c.to_s.sub('COLOR_', '').downcase}.map(&:to_sym)
end

.color_stylesObject



57
58
59
# File 'lib/glimmer/swt/swt_proxy.rb', line 57

def color_styles
  SWT.constants.select {|c| c.to_s.start_with?('COLOR_')}
end

.constant_java_importObject



37
38
39
# File 'lib/glimmer/swt/swt_proxy.rb', line 37

def constant_java_import
  JAVA_IMPORT
end

.constant_source_classObject



41
42
43
# File 'lib/glimmer/swt/swt_proxy.rb', line 41

def constant_source_class
  SWT
end

.constant_value_noneObject



45
46
47
# File 'lib/glimmer/swt/swt_proxy.rb', line 45

def constant_value_none
  SWT::NONE
end

.cursor_optionsObject



61
62
63
# File 'lib/glimmer/swt/swt_proxy.rb', line 61

def cursor_options
  cursor_styles.map {|c| c.to_s.sub('CURSOR_', '').downcase}.map(&:to_sym)
end

.cursor_stylesObject



53
54
55
# File 'lib/glimmer/swt/swt_proxy.rb', line 53

def cursor_styles
  SWT.constants.select {|c| c.to_s.start_with?('CURSOR_')}
end

.extra_stylesObject



49
50
51
# File 'lib/glimmer/swt/swt_proxy.rb', line 49

def extra_styles
  EXTRA_STYLES
end