Sha256: 110996a4c291292b21e3535df30a3eac0ae323d9da5c97294ea7c55077458f50

Contents?: true

Size: 1.03 KB

Versions: 10

Compression:

Stored size: 1.03 KB

Contents

require 'clevic/delegate'

module Clevic

  class Delegate
    def initialize( field )
      @field = field
      @message_receivers = Set.new
    end

    # FIXME this must actually show a message, and 
    # the Qt code must use it too
    def show_message( msg, &block )
      if block_given?
        @message_receivers << block
      else
        @message_receivers.each do |receiver|
          receiver.call( msg )
        end
      end
    end

    # workaround for broken JTable editing starts
    def needs_pre_selection?
      false
    end

    # Return something useful if this should use the default GUI framework
    # mechanism for table editing. Default is false, so native framework
    # won't be used. For Java/Swing, this would return the a class object
    # indicating the type of data, eg java.lang.Boolean, or java.lang.String
    # or something from JTable.setDefaultEditor
    def native
      false
    end

    def inspect
      "<#{self.class.name} native=#{native} needs_pre_selection=#{needs_pre_selection?}>"
    end
  end

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
clevic-0.14.6 lib/clevic/swing/delegate.rb
clevic-0.14.5 lib/clevic/swing/delegate.rb
clevic-0.14.4 lib/clevic/swing/delegate.rb
clevic-0.14.3 lib/clevic/swing/delegate.rb
clevic-0.14.2 lib/clevic/swing/delegate.rb
clevic-0.14.1 lib/clevic/swing/delegate.rb
clevic-0.14.0 lib/clevic/swing/delegate.rb
clevic-0.13.0.b12 lib/clevic/swing/delegate.rb
clevic-0.13.0.b11 lib/clevic/swing/delegate.rb
clevic-0.13.0.b10 lib/clevic/swing/delegate.rb