Skip to content

Commit a5147ee

Browse files
committed
resolve sonar errors
1 parent 7084763 commit a5147ee

File tree

2 files changed

+35
-4
lines changed

2 files changed

+35
-4
lines changed

core/src/main/java/de/muenchen/allg/itd51/wollmux/form/model/FormModel.java

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ public class FormModel
107107
* The dialog library.
108108
* @param presetValues
109109
* The values already set in the document.
110+
* @param txtDocController
111+
* Instance of TextDocumentController.
110112
*/
111113
@SuppressWarnings("squid:S3776")
112114
public FormModel(FormConfig conf, Map<Object, Object> functionContext, FunctionLibrary funcLib,
@@ -147,7 +149,12 @@ public FormModel(FormConfig conf, Map<Object, Object> functionContext, FunctionL
147149
this.initControls(presetValues);
148150
}
149151

150-
public void initControls(Map<String, String> presetValues)
152+
/**
153+
* Init Controls autofills, trafos and visibilites.
154+
*
155+
* @param presetValues
156+
*/
157+
private void initControls(Map<String, String> presetValues)
151158
{
152159
// Initialize controls with preset values or AUTOFILL function
153160
SimpleMap values = idToValue();
@@ -232,14 +239,17 @@ public Map<String, Control> getFormControls()
232239
return formControls;
233240
}
234241

242+
/**
243+
* Update visibilites in form ui.
244+
*/
235245
public void updateFormControlsVisibility()
236246
{
237247
for (Map.Entry<String, Control> entry : this.getFormControls().entrySet())
238248
{
239249
for (VisibilityGroup vs: entry.getValue().getGroups())
240250
{
241251
//notifiy form gui ui
242-
formSidebarController.visibilityChanged(vs.getGroupId(), vs.isVisible());
252+
formSidebarController.visibilityChanged(vs.getGroupId());
243253
}
244254
}
245255
}
@@ -285,7 +295,7 @@ public void setValue(final String id, final String value)
285295
//update vis. in doc
286296
txtDocController.setVisibilityChanged(g.getGroupId(), g.isVisible());
287297
//update vis in form-ui
288-
formSidebarController.visibilityChanged(g.getGroupId(), g.isVisible());
298+
formSidebarController.visibilityChanged(g.getGroupId());
289299
}
290300
}
291301
}

core/src/main/java/de/muenchen/allg/itd51/wollmux/form/sidebar/FormSidebarController.java

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,11 @@ public void buttonPressed(ActionEvent actionEvent)
467467

468468
/**
469469
* Sets control's text if value changed. Can be called by a dependency to another control.
470+
*
471+
* @param id
472+
* Control Id.
473+
* @param value
474+
* value to set.
470475
*/
471476
public void setFormUiValue(String id, String value)
472477
{
@@ -480,6 +485,11 @@ public void setFormUiValue(String id, String value)
480485

481486
/**
482487
* Get notifications if current textfield's value is valid. Colorize if not.
488+
*
489+
* @param id
490+
* Control Id.
491+
* @param okay
492+
* set okay.
483493
*/
484494
public void setControlBackground(String id, boolean okay)
485495
{
@@ -488,8 +498,11 @@ public void setControlBackground(String id, boolean okay)
488498

489499
/**
490500
* Hide / Show form controls by its new visibility changed status.
501+
*
502+
* @param groupId
503+
* The group Id which visibility should be changed.
491504
*/
492-
public void visibilityChanged(String groupId, boolean visible)
505+
public void visibilityChanged(String groupId)
493506
{
494507
Collection<Control> controls = formModel.getControlsByGroupId(groupId);
495508

@@ -507,6 +520,9 @@ public void visibilityChanged(String groupId, boolean visible)
507520
formSidebarPanel.paint();
508521
}
509522

523+
/**
524+
* Sets preset Values (Formularwerte) in form ui.
525+
*/
510526
public void setFormularwerte()
511527
{
512528
Map<String,String> formFieldValues = documentController.getFormFieldValues();
@@ -521,6 +537,11 @@ public void setFormularwerte()
521537
processUIElementEvents = false;
522538
}
523539

540+
/**
541+
* updates and sets all form control values in form ui.
542+
*
543+
* @param formControls
544+
*/
524545
public void updateFormUiValues(Map<String,Control> formControls)
525546
{
526547
for (String control : formControls.keySet())

0 commit comments

Comments
 (0)