Exemplo n.º 1
0
 protected void newZoneKeyPressed(KeyPressEvent event) {
   int[] selection = tiNewZone.getSelectionRange();
   if (selection[0] > selection[1]) {
     int tmp = selection[0];
     selection[0] = selection[1];
     selection[1] = tmp;
   }
   event.cancel();
   for (int i = 0; i < restrictedEdits.length; i++) {
     if (restrictedEdits[i] >= selection[0] && restrictedEdits[i] <= selection[1]) {
       tiNewZone.setSelectionRange(selection[0] + 1, selection[0] + 1);
       return;
     }
   }
   if (selection[0] >= CHARCOUNT) return;
   char c = (char) event.getCharacterValue().intValue();
   String value = event.getItem().getValue().toString();
   char[] cr = value.toCharArray();
   cr[selection[0]] = c;
   value = new String(cr);
   tiNewZone.setValue(value);
   tiNewZone.setSelectionRange(selection[0] + 1, selection[0] + 1);
 }
 public void onKeyPress(KeyPressEvent event) {
   if (event.getKeyName().equals("Enter") == false) {
     return;
   }
   fetchFilteredCarouselData();
 }