Class: Redcar::Textmate::CreateNewSnippet

Inherits:
Command show all
Defined in:
plugins/textmate/lib/textmate/commands.rb

Constant Summary

Constants included from Observable

Observable::ASPECTS

Instance Attribute Summary

Attributes inherited from Command

#error

Instance Method Summary (collapse)

Methods inherited from Command

active_changed, #environment, inherited, #inspect, norecord, record?, #run

Methods included from Sensitive

#active?, #sensitivities, #sensitivity_names, #sensitize

Methods included from Observable

#add_listener, #notify_listeners, #remove_listener

Constructor Details

- (CreateNewSnippet) initialize(bundle, menu = nil)

A new instance of CreateNewSnippet



29
30
31
# File 'plugins/textmate/lib/textmate/commands.rb', line 29

def initialize bundle,menu=nil
  @bundle,@menu = bundle,menu
end

Instance Method Details

- (Object) execute



33
34
35
36
37
38
# File 'plugins/textmate/lib/textmate/commands.rb', line 33

def execute
  result = Redcar::Application::Dialog.input("Create Snippet","Choose a name for your new snippet:")
  if result[:button] == :ok and not result[:value].empty?
    BundleEditor.create_snippet result[:value], @bundle, @menu
  end
end