-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[26513] fall lastupdate-tooltip and falldetail saving only when modif…
…ied (#691)
- Loading branch information
Showing
10 changed files
with
40 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 20 additions & 7 deletions
27
bundles/ch.elexis.core.ui/src/ch/elexis/core/ui/views/provider/FaelleLabelProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |