Skip to content

Commit

Permalink
[26513] fall lastupdate-tooltip and falldetail saving only when modif…
Browse files Browse the repository at this point in the history
…ied (#691)
  • Loading branch information
marcel7ag authored Aug 8, 2024
1 parent 5495a92 commit 759e24e
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1812,6 +1812,7 @@ public class Messages extends NLS {
public static String FaelleView_FilterConsultations;
public static String FaelleView_ShowOnlyConsOfThisCase;
public static String FaelleView_ShowOnlyOpenCase;
public static String FaelleView_LastUpdated;
public static String FakturaJournalDetail_Beschreibung;
public static String FakturaJournalDetail_Name;
public static String FakturaJournalDetail_Rechnungsempfaenger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3651,6 +3651,8 @@ FaelleView_ShowOnlyConsOfThisCase = Nur Konsultationen dieses Falls anzeigen
FaelleView_ShowOnlyOpenCase = show only open cases
FaelleView_LastUpdated = Last updated:
FakturaJournalDetail_Beschreibung = Faktura detailliert
FakturaJournalDetail_Name = Faktura Journal detailliert
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3627,6 +3627,8 @@ FaelleView_ShowOnlyConsOfThisCase = Nur Konsultationen dieses Falls anzeigen

FaelleView_ShowOnlyOpenCase = Nur offene F\u00E4lle anzeigen

FaelleView_LastUpdated = Letzte \u00C4nderung:

FakturaJournalDetail_Beschreibung = Faktura detailliert

FakturaJournalDetail_Name = Faktura Journal detailliert
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3581,6 +3581,8 @@ FaelleView_ShowOnlyConsOfThisCase = Show only consultations of this case

FaelleView_ShowOnlyOpenCase = Show only open cases

FaelleView_LastUpdated = Last updated:

FakturaJournalDetail_Beschreibung = Billing details

FakturaJournalDetail_Name = Billing journal detailed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3577,6 +3577,8 @@ FaelleView_ShowOnlyConsOfThisCase = Afficher uniquement les consultations de ce
FaelleView_ShowOnlyOpenCase = Afficher uniquement les cas ouverts
FaelleView_LastUpdated = derni\u00E8re mise \u00E0 jour:
FakturaJournalDetail_Beschreibung = d\u00E9tail de facturation
FakturaJournalDetail_Name = Facturation d\u00E9tail Journal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3579,6 +3579,8 @@ FaelleView_ShowOnlyConsOfThisCase = Mostra solo le consultazioni di questo caso

FaelleView_ShowOnlyOpenCase = Mostra solo casi aperti

FaelleView_LastUpdated = ultima modifica:

FakturaJournalDetail_Beschreibung = dettagli di fatturazione

FakturaJournalDetail_Name = Fatturazione Journal dettagli
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ColumnViewerToolTipSupport;
import org.eclipse.jface.viewers.DoubleClickEvent;
import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jface.viewers.IFilter;
Expand Down Expand Up @@ -183,6 +184,7 @@ public void createPartControl(final Composite parent) {
setPartName(Messages.Core_Cases); // $NON-NLS-1$
parent.setLayout(new GridLayout());
tv = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
ColumnViewerToolTipSupport.enableFor(tv);
tv.getControl().setLayoutData(SWTHelper.getFillGridData(1, true, 1, true));
tv.setContentProvider(new FaelleContentProvider());
tv.setLabelProvider(new FaelleLabelProvider());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -590,19 +590,23 @@ private class Focusreact implements FocusListener {

private final String field;
private Control control;
private String originalValue;

public Focusreact(final Control control, final String field) {
this.field = field;
this.control = control;
}

@Override
public void focusGained(final FocusEvent e) { /* nichts */
public void focusGained(final FocusEvent e) {
this.originalValue = getValue(control);
}

@Override
public void focusLost(final FocusEvent e) {
save();
if (!getValue(control).equals(originalValue)) {
save();
}
}

public void save() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ public class Messages {
public static String FaelleView_FilterConsultations = ch.elexis.core.l10n.Messages.FaelleView_FilterConsultations;
public static String FaelleView_ShowOnlyConsOfThisCase = ch.elexis.core.l10n.Messages.FaelleView_ShowOnlyConsOfThisCase;
public static String FaelleView_ShowOnlyOpenCase = ch.elexis.core.l10n.Messages.FaelleView_ShowOnlyOpenCase;
public static String FaelleView_LastUpdated = ch.elexis.core.l10n.Messages.FaelleView_LastUpdated;
public static String Core_Cases = ch.elexis.core.l10n.Messages.Core_Cases;
public static String Core_Description = ch.elexis.core.l10n.Messages.Core_Description;
public static String FallDetailBlatt2_ApplyData = ch.elexis.core.l10n.Messages.FallDetailBlatt2_ApplyData;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,42 @@
package ch.elexis.core.ui.views.provider;

import org.eclipse.swt.graphics.Image;
import org.eclipse.jface.viewers.StyledCellLabelProvider;
import org.eclipse.jface.viewers.ViewerCell;

import ch.elexis.core.model.ICoverage;
import ch.elexis.core.services.holder.CoverageServiceHolder;
import ch.elexis.core.ui.icons.Images;
import ch.elexis.core.ui.util.viewers.DefaultLabelProvider;
import ch.elexis.core.ui.views.FaelleView;
import ch.elexis.core.ui.views.Messages;
import ch.rgw.tools.TimeTool;

/**
* @since 3.0.0 extracted from {@link FaelleView}
*/
public class FaelleLabelProvider extends DefaultLabelProvider {
public class FaelleLabelProvider extends StyledCellLabelProvider {

@Override
public Image getColumnImage(final Object element, final int columnIndex) {
public void update(ViewerCell cell) {
Object element = cell.getElement();
if (element instanceof ICoverage) {
ICoverage fall = (ICoverage) element;
cell.setText(fall.getLabel());
if (CoverageServiceHolder.get().isValid(fall)) {
return Images.IMG_OK.getImage();
cell.setImage(Images.IMG_OK.getImage());
} else {
return Images.IMG_FEHLER.getImage();
cell.setImage(Images.IMG_FEHLER.getImage());
}
}
return super.getColumnImage(element, columnIndex);
super.update(cell);
}

@Override
public String getToolTipText(Object element) {
if (element instanceof ICoverage) {
ICoverage fall = (ICoverage) element;
return Messages.FaelleView_LastUpdated + " "
+ new TimeTool(fall.getLastupdate()).toString(TimeTool.FULL_GER);
}
return null;
}
}

0 comments on commit 759e24e

Please sign in to comment.