コード例 #1
0
 public void updateData() {
   try {
     UIWikiSyntaxPreferences uiWikiSyntaxPreferences = getChildById(PREFERENCES_SYNTAX);
     if (uiWikiSyntaxPreferences != null) {
       uiWikiSyntaxPreferences.updateData();
     }
   } catch (Exception e) {
     log.warn("Can not update data for syntax setting form", e);
   }
 }
コード例 #2
0
 public void execute(Event<UISyntaxSettingForm> event) throws Exception {
   UIWikiPortlet wikiPortlet = event.getSource().getAncestorOfType(UIWikiPortlet.class);
   UIWikiSyntaxPreferences uiSyntaxPreferences =
       wikiPortlet.findComponentById(PREFERENCES_SYNTAX);
   UIFormSelectBox defaultSyntaxSelect =
       uiSyntaxPreferences.getChildById(UIWikiSyntaxPreferences.FIELD_SYNTAX);
   UIFormCheckBoxInput<Boolean> allowCheckBox =
       uiSyntaxPreferences.getChildById(UIWikiSyntaxPreferences.FIELD_ALLOW);
   WikiPreferences preferences = Utils.getCurrentPreferences();
   WikiPreferencesSyntax preferencesSyntax = preferences.getWikiPreferencesSyntax();
   preferencesSyntax.setAllowMultipleSyntaxes(allowCheckBox.isChecked());
   preferencesSyntax.setDefaultSyntax(defaultSyntaxSelect.getValue());
   event
       .getRequestContext()
       .getUIApplication()
       .addMessage(
           new ApplicationMessage(
               "UISyntaxSettingForm.msg.Save-syntax-setting-success",
               null,
               ApplicationMessage.INFO));
 }