SIP Communicator: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.keybindings
Class KeybindingSetImpl

java.lang.Object
  extended by java.util.Observable
      extended by net.java.sip.communicator.service.keybindings.KeybindingSet
          extended by net.java.sip.communicator.impl.keybindings.KeybindingSetImpl

 class KeybindingSetImpl
extends KeybindingSet

Default implementation for the wrapper of keybinding sets.

Author:
Damian Johnson

Nested Class Summary
 
Nested classes/interfaces inherited from class net.java.sip.communicator.service.keybindings.KeybindingSet
KeybindingSet.Category
 
Constructor Summary
KeybindingSetImpl(Map<KeyStroke,String> initial, KeybindingSet.Category category, File saveDst)
           
 
Method Summary
 LinkedHashMap<KeyStroke,String> getBindings()
          Provides current keybinding mappings.
 KeybindingSet.Category getCategory()
          Provides the portion of the UI to which the bindings belong.
(package private)  File getCustomFile()
          Provides the file where custom bindings are to be saved.
(package private)  void invalidate()
          Invalidates reference to custom output, preventing further writes.
(package private)  boolean isWritable()
          Provides if the keybindings can be written when changed or not.
 void setBindings(Map<KeyStroke,String> newBindings)
          Resets the bindings and notifies the observer's listeners if they've changed.
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeybindingSetImpl

KeybindingSetImpl(Map<KeyStroke,String> initial,
                  KeybindingSet.Category category,
                  File saveDst)
Method Detail

getBindings

public LinkedHashMap<KeyStroke,String> getBindings()
Provides current keybinding mappings.

Specified by:
getBindings in class KeybindingSet
Returns:
mapping of keystrokes to the string representation of the actions they perform

setBindings

public void setBindings(Map<KeyStroke,String> newBindings)
Resets the bindings and notifies the observer's listeners if they've changed. If the bindings can be written then they will be.

Specified by:
setBindings in class KeybindingSet
Parameters:
newBindings - new keybindings to be held

getCategory

public KeybindingSet.Category getCategory()
Provides the portion of the UI to which the bindings belong.

Specified by:
getCategory in class KeybindingSet
Returns:
binding category

isWritable

boolean isWritable()
Provides if the keybindings can be written when changed or not.

Returns:
true if bindings can be written when changed, false otherwise

getCustomFile

File getCustomFile()
Provides the file where custom bindings are to be saved.

Returns:
custom bindings save destination

invalidate

void invalidate()
Invalidates reference to custom output, preventing further writes.


SIP Communicator: the OpenSource Java VoIP and Instant Messaging client.

SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.