Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.0.0)

E17493-01

oracle.ide.keyboard
Class KeyStrokes

java.lang.Object
  extended by oracle.ide.keyboard.KeyStrokes
All Implemented Interfaces:
java.io.Serializable

public final class KeyStrokes
extends java.lang.Object
implements java.io.Serializable

Stores a multi-KeyStroke.

This class basically stores an ArrayList of KeyStrokes. The different constructors should make it easy to convert a KeyStroke or a KeyEvent to a KeyStrokes

See Also:
Serialized Form

Constructor Summary
KeyStrokes()
           
KeyStrokes(int modifiers, int keyCode)
           
KeyStrokes(int modifiers, int keyCode1, int keyCode2)
           
KeyStrokes(javax.swing.KeyStroke ks1)
           
KeyStrokes(javax.swing.KeyStroke ks1, javax.swing.KeyStroke ks2)
           
KeyStrokes(KeyStrokes kss)
           
KeyStrokes(KeyStrokes kss, int modifiers, int keyCode)
           
 
Method Summary
 void add(javax.swing.KeyStroke ks)
          Adds a KeyStroke to the list.
 void clear()
          Removes all the KeyStroke
 boolean equals(java.lang.Object obj)
           
 java.util.ArrayList getData()
           
 javax.swing.KeyStroke getKeyStroke(int nIndex)
          Returns the KeyStroke at the secified index.
 javax.swing.KeyStroke getLast()
           
 int getLength()
          Returns the number of KeyStroke.
 int hashCode()
          Improves performances when in a HashMap
 boolean isEmpty()
           
 boolean isValid()
           
 void removeLast()
          Removes the last KeyStroke of the sequence
 void setData(java.util.ArrayList ks)
           
 boolean startWith(KeyStrokes kss)
          Checks if this KeyStrokes start with the same KeyStroke as in kss
 java.lang.String toString()
          Returns a user readable version of the keystroke like "Ctrl+K, S"
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

KeyStrokes

public KeyStrokes()

KeyStrokes

public KeyStrokes(javax.swing.KeyStroke ks1)

KeyStrokes

public KeyStrokes(javax.swing.KeyStroke ks1,
                  javax.swing.KeyStroke ks2)

KeyStrokes

public KeyStrokes(int modifiers,
                  int keyCode)

KeyStrokes

public KeyStrokes(int modifiers,
                  int keyCode1,
                  int keyCode2)

KeyStrokes

public KeyStrokes(KeyStrokes kss)

KeyStrokes

public KeyStrokes(KeyStrokes kss,
                  int modifiers,
                  int keyCode)
Method Detail

add

public void add(javax.swing.KeyStroke ks)
Adds a KeyStroke to the list.


removeLast

public void removeLast()
Removes the last KeyStroke of the sequence


clear

public void clear()
Removes all the KeyStroke


getLast

public javax.swing.KeyStroke getLast()
Returns:
the last keystroke or null if it is empty

getLength

public int getLength()
Returns the number of KeyStroke.


getKeyStroke

public javax.swing.KeyStroke getKeyStroke(int nIndex)
Returns the KeyStroke at the secified index.

Parameters:
nIndex - must be a valid index ( 0 <= nIndex < getLength() )

isEmpty

public boolean isEmpty()
Returns:
getLength()==0

startWith

public boolean startWith(KeyStrokes kss)
Checks if this KeyStrokes start with the same KeyStroke as in kss

For example, if this contains "Ctrl+S", the method returns true for kss="Ctrl+S", and "Ctrl+S, A". Note: returns true is kss is empty


toString

public java.lang.String toString()
Returns a user readable version of the keystroke like "Ctrl+K, S"

Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Improves performances when in a HashMap

Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

getData

public java.util.ArrayList getData()

setData

public void setData(java.util.ArrayList ks)

isValid

public boolean isValid()

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.0.0)

E17493-01

Copyright © 1997, 2011, Oracle. All rights reserved.