Skip to content

Commit 7c41b22

Browse files
committed
Lazily initialize the preferenceStore only when it is needed.
1 parent fc1c7f0 commit 7c41b22

File tree

1 file changed

+3
-5
lines changed
  • chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/swt

1 file changed

+3
-5
lines changed

chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/swt/TargetsListUI.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2017, 2025 Lablicate GmbH.
2+
* Copyright (c) 2017, 2026 Lablicate GmbH.
33
*
44
* This program and the accompanying materials are made
55
* available under the terms of the Eclipse Public License 2.0
@@ -54,8 +54,6 @@ public class TargetsListUI extends ExtendedTableViewer {
5454

5555
private IUpdateListener updateListener;
5656

57-
private IPreferenceStore preferenceStore = Activator.getDefault().getPreferenceStore();
58-
5957
public TargetsListUI(Composite parent, int style) {
6058

6159
this(parent, TITLES, style);
@@ -183,7 +181,7 @@ public void update(ViewerCell cell) {
183181
int retentionTimeTarget = libraryInformation.getRetentionTime();
184182

185183
if(retentionTime != null && retentionTimeTarget != 0) {
186-
184+
IPreferenceStore preferenceStore = Activator.getDefault().getPreferenceStore();
187185
boolean useAbsoluteDeviation = preferenceStore.getBoolean(PreferenceSupplier.P_USE_ABSOLUTE_DEVIATION_RETENTION_TIME);
188186
double deviation;
189187
double deviationWarn;
@@ -238,7 +236,7 @@ public void update(ViewerCell cell) {
238236
float retentionIndexTarget = libraryInformation.getRetentionIndex();
239237

240238
if(retentionIndex != null && retentionIndexTarget != 0) {
241-
239+
IPreferenceStore preferenceStore = Activator.getDefault().getPreferenceStore();
242240
boolean useAbsoluteDeviation = preferenceStore.getBoolean(PreferenceSupplier.P_USE_ABSOLUTE_DEVIATION_RETENTION_INDEX);
243241
double deviation;
244242
double deviationWarn;

0 commit comments

Comments
 (0)