Exemplo n.º 1
0
 /**
  * This method inserts a default value for the standard java types, else it inserts the text name
  * of the expected class type. It acts to give a clue as to the input type.
  */
 public static String getDefaultValue(String type) {
   if (numericalTypes.contains(type) || extraNumericalTypes.contains(type)) {
     return "0";
   }
   if (booleanTypes.contains(type)) {
     return "true";
   }
   type = getReadableClassName(type);
   int i = type.lastIndexOf('.');
   if (i > 0) {
     return type.substring(i + 1, type.length());
   } else {
     return type;
   }
 }
Exemplo n.º 2
0
 @Override
 public void keyPressed(KeyEvent e) {
   // Accept "copy" key strokes
   KeyStroke ks = KeyStroke.getKeyStroke(e.getKeyCode(), e.getModifiers());
   JComponent comp = (JComponent) e.getSource();
   for (int i = 0; i < 3; i++) {
     InputMap im = comp.getInputMap(i);
     Object key = im.get(ks);
     if (defaultEditorKitCopyActionName.equals(key)
         || transferHandlerCopyActionName.equals(key)) {
       return;
     }
   }
   // Accept JTable navigation key strokes
   if (!tableNavigationKeys.contains(e.getKeyCode())) {
     e.consume();
   }
 }
Exemplo n.º 3
0
 /** This method tells whether the type is editable (means can be created with a String or not) */
 public static boolean isEditableType(String type) {
   return editableTypes.contains(type);
 }