public HashtableKeyValueEditor(EditableResources res,String keyString,Object value){
  initComponents();
  this.res=res;
  ResourceEditorView.initImagesComboBox(imageValue,res,true,false);
  String[] arr=new String[res.getUIResourceNames().length];
  System.arraycopy(res.getUIResourceNames(),0,arr,0,arr.length);
  Arrays.sort(arr);
  navigationCombo.setModel(new DefaultComboBoxModel(arr));
  if (keyString != null) {
    key.setText(keyString);
    if (value instanceof String) {
      if (keyString.equals("$navigation")) {
        isNavigation.setSelected(true);
        stringValue.setEnabled(false);
        key.setEnabled(false);
        navigationCombo.setEnabled(true);
        navigationCombo.setSelectedItem(value);
      }
      if (value.equals("true") || value.equals("false")) {
        booleanValue.setSelected(true);
        booleanValue.setEnabled(true);
        isBoolean.setSelected(true);
        stringValue.setEnabled(false);
      }
 else {
        stringValue.setText((String)value);
      }
      return;
    }
    if (value instanceof com.codename1.ui.Image) {
      isImage.setSelected(true);
      imageValue.setSelectedItem(res.findId(value));
      stringValue.setEnabled(false);
      imageValue.setEnabled(true);
      return;
    }
  }
}

public HashtableKeyValueEditor ( EditableResources res , String keyString , Object value ) { initComponents ( ) ; this . res = res ; ResourceEditorView . initImagesComboBox ( imageValue , res , true , false ) ; String [ ] arr = new String [ res . getUIResourceNames ( ) . length ] ; System . arraycopy ( res . getUIResourceNames ( ) , 0 , arr , 0 , arr . length ) ; Arrays . sort ( arr ) ; navigationCombo . setModel ( new DefaultComboBoxModel ( arr ) ) ; if ( keyString != null ) { key . setText ( keyString ) ; if ( value instanceof String ) { if ( keyString . equals ( "$navigation" ) ) { isNavigation . setSelected ( true ) ; stringValue . setEnabled ( false ) ; key . setEnabled ( false ) ; navigationCombo . setEnabled ( true ) ; navigationCombo . setSelectedItem ( value ) ; } if ( value . equals ( "true" ) || value . equals ( "false" ) ) { booleanValue . setSelected ( true ) ; booleanValue . setEnabled ( true ) ; isBoolean . setSelected ( true ) ; stringValue . setEnabled ( false ) ; } else { stringValue . setText ( ( String ) value ) ; } return ; } if ( value instanceof com . codename1 . ui . Image ) { isImage . setSelected ( true ) ; imageValue . setSelectedItem ( res . findId ( value ) ) ; stringValue . setEnabled ( false ) ; imageValue . setEnabled ( true ) ; return ; } } }
creates new form hashtablekeyvalueeditor
