Commit cf3e8f45 authored by Thomas Huster's avatar Thomas Huster

[16539] fixed editing of conditions

parent ca48853d
Pipeline #11451 passed with stages
in 4 minutes and 29 seconds
...@@ -32,6 +32,7 @@ import org.eclipse.swt.graphics.Point; ...@@ -32,6 +32,7 @@ import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.ToolBar; import org.eclipse.swt.widgets.ToolBar;
import ca.odell.glazedlists.BasicEventList; import ca.odell.glazedlists.BasicEventList;
...@@ -149,7 +150,7 @@ public class DiagnoseListComposite extends Composite { ...@@ -149,7 +150,7 @@ public class DiagnoseListComposite extends Composite {
if (selection instanceof StructuredSelection && !selection.isEmpty()) { if (selection instanceof StructuredSelection && !selection.isEmpty()) {
ICondition condition = ICondition condition =
(ICondition) ((StructuredSelection) selection).getFirstElement(); (ICondition) ((StructuredSelection) selection).getFirstElement();
AcquireLockBlockingUi.aquireAndRun((IPersistentObject) condition, AcquireLockBlockingUi.aquireAndRun(condition,
new ILockHandler() { new ILockHandler() {
@Override @Override
public void lockFailed(){ public void lockFailed(){
...@@ -159,7 +160,8 @@ public class DiagnoseListComposite extends Composite { ...@@ -159,7 +160,8 @@ public class DiagnoseListComposite extends Composite {
@Override @Override
public void lockAcquired(){ public void lockAcquired(){
ConditionEditDialog dialog = ConditionEditDialog dialog =
new ConditionEditDialog(condition, getShell()); new ConditionEditDialog(condition,
Display.getDefault().getActiveShell());
if (dialog.open() == Dialog.OK) { if (dialog.open() == Dialog.OK) {
dialog.getCondition().ifPresent(c -> { dialog.getCondition().ifPresent(c -> {
source.getNatTable().refresh(); source.getNatTable().refresh();
......
...@@ -13,6 +13,7 @@ import org.eclipse.swt.widgets.Shell; ...@@ -13,6 +13,7 @@ import org.eclipse.swt.widgets.Shell;
import ch.elexis.core.findings.ICondition; import ch.elexis.core.findings.ICondition;
import ch.elexis.core.findings.ICondition.ConditionCategory; import ch.elexis.core.findings.ICondition.ConditionCategory;
import ch.elexis.core.findings.ui.composites.ConditionComposite; import ch.elexis.core.findings.ui.composites.ConditionComposite;
import ch.elexis.core.findings.ui.services.FindingsServiceComponent;
public class ConditionEditDialog extends TitleAreaDialog { public class ConditionEditDialog extends TitleAreaDialog {
...@@ -56,6 +57,7 @@ public class ConditionEditDialog extends TitleAreaDialog { ...@@ -56,6 +57,7 @@ public class ConditionEditDialog extends TitleAreaDialog {
protected void okPressed(){ protected void okPressed(){
conditionComposite.udpateModel(); conditionComposite.udpateModel();
condition = conditionComposite.getCondition(); condition = conditionComposite.getCondition();
FindingsServiceComponent.getService().saveFinding(condition.get());
super.okPressed(); super.okPressed();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment