IWBundle iwb = iwma.getBundle(selectedBundle); IWResourceBundle iwrb = iwb.getResourceBundle(LocaleUtil.getLocale(iwc.getParameter(localesParameter))); String stringsKey = iwc.getParameter(stringsParameter); String areaText = iwc.getParameter(areaParameter); String newStringsKey = iwc.getParameter(this.newStringKeyParameter); if(stringsKey==null && newStringsKey!=null){ stringsKey=newStringsKey;
IWBundle iwb = iwma.getBundle(selectedBundle); IWResourceBundle iwrb = iwb.getResourceBundle(LocaleUtil.getLocale(iwc.getParameter(localesParameter))); String stringsKey = iwc.getParameter(stringsParameter); String areaText = iwc.getParameter(areaParameter); String newStringsKey = iwc.getParameter(this.newStringKeyParameter); if (stringsKey == null && newStringsKey != null) { stringsKey = newStringsKey; }  if (stringsKey != null) { String oldStringValue = iwrb.getLocalizedString(stringsKey); if (areaText == null) { PresentationObject area = getTextArea(areaParameter, oldStringValue); table.add(area, 2, 5); } else { if (areaText.equals("")) { PresentationObject area; if (oldStringValue != null) { area = getTextArea(areaParameter, oldStringValue); } else { area = getTextArea(areaParameter, ""); } table.add(area, 2, 5); } else if (this.isDeleteable(iwc)) { iwb.removeLocalizableString(stringsKey);  iwrb.storeState(); } else { PresentationObject area;  if (this.isSaveable(iwc)) { String newKey = iwc.getParameter(newStringKeyParameter);  if (newKey != null) { if (newKey.equals("")) { iwrb.setString(stringsKey, areaText); } else { iwrb.setString(newKey, areaText); } } area = getTextArea(areaParameter, areaText); }  else {   String areaValue = iwc.getParameter(this.areaParameter); if (areaValue == null) { area = getTextArea(areaParameter, ""); } else { if (oldStringValue == null) { area = getTextArea(areaParameter, ""); } else { area = getTextArea(areaParameter, oldStringValue); } } } table.add(area, 2, 5); } IBAddModuleWindow.removeAttributes(iwc);  } table.add(new SubmitButton("Save", subAction, "save"), 2, 6); table.add(new SubmitButton("Delete", subAction, "delete"), 2, 6); table.add(IWDeveloper.getText("New String key:"), 1, 4); table.add(IWDeveloper.getText("New String value:"), 1, 5); TextInput newInput = new TextInput(newStringKeyParameter); table.add(newInput, 2, 4); } else { table.add(getTextArea(areaParameter, ""), 2, 5); table.add(new SubmitButton("Save", subAction, "save"), 2, 6); table.add(IWDeveloper.getText("New String key:"), 1, 4); table.add(IWDeveloper.getText("New String value:"), 1, 5); TextInput newInput = new TextInput(newStringKeyParameter); table.add(newInput, 2, 4); }   table.add(IWDeveloper.getText("String:"), 1, 3); stringsDrop = this.getLocalizeableStringsMenu(iwma, selectedBundle, stringsParameter); stringsDrop.keepStatusOnAction(); stringsDrop.setToSubmit(); table.add(stringsDrop, 2, 3);   Frame.add(IWDeveloper.getText("Available Strings:"), 1, 3); Frame.add(Text.getBreak(), 1, 3); Frame.add(this.getLocalizeableStringsTable(iwma, selectedBundle, iwrb, stringsParameter, templateLink), 1, 3);  }
  public void main(IWContext iwc){      add(IWDeveloper.getTitleTable(this.getClass()));      getParentPage().setBackgroundColor("#FFFFFF");      IWMainApplication iwma = iwc.getApplication();      DropdownMenu bundlesDrop = getRegisteredDropdown(iwma,bundlesParameter);      bundlesDrop.keepStatusOnAction();      bundlesDrop.setToSubmit();      DropdownMenu localesDrop = getAvailableLocalesDropdown(iwma,localesParameter);      localesDrop.keepStatusOnAction();      localesDrop.setToSubmit();      DropdownMenu stringsDrop;      String selectedLocale = iwc.getParameter(localesParameter);      String selectedBundle = iwc.getParameter(bundlesParameter);      Link templateLink = new Link();      templateLink.maintainParameter(IWDeveloper.actionParameter,iwc);      templateLink.maintainParameter(localesParameter,iwc);      templateLink.maintainParameter(bundlesParameter,iwc);      Form form = new Form();      form.maintainParameter(IWDeveloper.actionParameter);      add(form);      Table Frame = new Table();      Table table = new Table(2,6);	table.setAlignment(2,6,"right");	table.setColumnVerticalAlignment(1,"top");	table.setWidth(1,"150");      Frame.add(table,1,1);      form.add(Frame);      table.add(IWDeveloper.getText("Bundle:"),1,1);      table.add(bundlesDrop,2,1);      table.add(IWDeveloper.getText("Locale:"),1,2);      table.add(localesDrop,2,2);      if(selectedBundle ==null){	//stringsDrop = new DropdownMenu(stringsParameter);	table.setAlignment(2,3,"right");	table.add(new SubmitButton("Get Available Keys",subAction,"choose"),2,3);      }      else{	IWBundle iwb = iwma.getBundle(selectedBundle);	IWResourceBundle iwrb = iwb.getResourceBundle(LocaleUtil.getLocale(iwc.getParameter(localesParameter)));	String stringsKey = iwc.getParameter(stringsParameter);	String areaText = iwc.getParameter(areaParameter);	String newStringsKey = iwc.getParameter(this.newStringKeyParameter);	if(stringsKey==null && newStringsKey!=null){	  stringsKey=newStringsKey;	}	if(stringsKey!=null){	  String oldStringValue = iwrb.getLocalizedString(stringsKey);	  if(areaText==null){	    PresentationObject area = getTextArea(areaParameter,oldStringValue);	    table.add(area,2,5);	  }	  else{	    if(areaText.equals("")){	      PresentationObject area;	      if(oldStringValue!=null){		area = getTextArea(areaParameter,oldStringValue);	      }	      else{		area = getTextArea(areaParameter,"");	      }	      table.add(area,2,5);	    }	   else if(this.isDeleteable(iwc)){	      iwb.removeLocalizableString(stringsKey);	      //boolean b = iwrb.removeString(stringsKey);	      iwrb.storeState();	    }	    else{	      PresentationObject area;	      /**	       * Saving possible	       */	      if(this.isSaveable(iwc)){		String newKey = iwc.getParameter(newStringKeyParameter);		if(newKey !=null){		  if(newKey.equals("")){		    iwrb.setString(stringsKey,areaText);		  }		  else{		    iwrb.setString(newKey,areaText);		  }		}		area = getTextArea(areaParameter,areaText);	      }	      /**	       * Not Saving	       */	      else{		//String areaValue = iwrb.getStringChecked(stringsKey);		String areaValue = iwc.getParameter(this.areaParameter);		if(areaValue==null){		  area = getTextArea(areaParameter,"");		}		else{		  if(oldStringValue==null){		    area = getTextArea(areaParameter,"");		  }		  else{		    area = getTextArea(areaParameter,oldStringValue);		  }		}	      }	       table.add(area,2,5);	    }	    IBAddModuleWindow.removeAttributes(iwc);	  }	  table.add(new SubmitButton("Save",subAction,"save"),2,6);	  table.add(new SubmitButton("Delete",subAction,"delete"),2,6);	  table.add(IWDeveloper.getText("New String key:"),1,4);	  table.add(IWDeveloper.getText("New String value:"),1,5);	  TextInput newInput = new TextInput(newStringKeyParameter);	  table.add(newInput,2,4);	}	else{	  table.add(getTextArea(areaParameter,""),2,5);	  table.add(new SubmitButton("Save",subAction,"save"),2,6);	  table.add(IWDeveloper.getText("New String key:"),1,4);	  table.add(IWDeveloper.getText("New String value:"),1,5);	  TextInput newInput = new TextInput(newStringKeyParameter);	  table.add(newInput,2,4);	}	//table.add(new SubmitButton("Select Locale",subAction,"select"),2,1);	table.add(IWDeveloper.getText("String:"),1,3);	stringsDrop = this.getLocalizeableStringsMenu(iwma,selectedBundle,stringsParameter);	stringsDrop.keepStatusOnAction();	stringsDrop.setToSubmit();	table.add(stringsDrop,2,3);	//table.add(new SubmitButton("Choose String",subAction,"choose"),3,1);	Frame.add(IWDeveloper.getText("Available Strings:"),1,3);	Frame.add(Text.getBreak(),1,3);	Frame.add(this.getLocalizeableStringsTable(iwma,selectedBundle,iwrb,stringsParameter,templateLink),1,3);      }  }