@Override protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) { super.formInnerEvent(ureq, source, event); if (source == cancelButton) { fireEvent(ureq, Event.CANCELLED_EVENT); } else if (source == importFile) { if (importFile.isUploadSuccess()) { File tmpJar = importFile.getUploadFile(); Set<String> importLangKeys = I18nManager.getInstance().sarchForAvailableLanguagesInJarFile(tmpJar, true); if (importLangKeys.size() == 0) { showError("configuration.management.package.import.failure.empty"); return; } // // enable language key selection String[] langKeys = ArrayHelper.toArray(importLangKeys); importKeys.setKeysAndValues(langKeys, langKeys); importKeys.selectAll(); importKeys.setVisible(true); // In language adaption mode the import is done as a package - can't deselect anything importKeys.setEnabled(false); } } }
private MultipleSelectionElement createSelection(String name) { MultipleSelectionElement selection = new MultipleSelectionElementImpl( name, MultipleSelectionElementImpl.createVerticalLayout("checkbox", 1)); selection.setKeysAndValues(new String[] {"on"}, new String[] {""}, null); tableCont.add(name, selection); return selection; }