Skip to content

Commit

Permalink
Merge pull request #730 from Mailaender/dirty-action
Browse files Browse the repository at this point in the history
Fixed processing data does not mark the editor as dirty
  • Loading branch information
eselmeister authored Sep 7, 2021
2 parents 7396e0d + 0aec209 commit d9100fd
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
config="org.eclipse.chemclipse.chromatogram.xxd.filter.supplier.savitzkygolay.settings.MassSpectrumFilterSettings"
description="This is a Savitzky-Golay Mass Spectrum optimization filter."
filter="org.eclipse.chemclipse.chromatogram.xxd.filter.supplier.savitzkygolay.core.MassSpectrumFilter"
filterName="Savitzky-Golay MassSpectrum Filter"
filterName="Savitzky-Golay Filter"
id="org.eclipse.chemclipse.chromatogram.msd.filter.supplier.savitzkygolay.massspectrum">
</MassSpectrumFilterSupplier>
</extension>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -953,6 +953,7 @@ public void doOperation(IChromatogramProcessor chromatogramProcessor, boolean is
chromatogramSelection.getChromatogram().recalculateTheNoiseFactor();
//
fireUpdate(chromatogramSelection);
setDirty(true);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ private void preDestroy() {
@Persist
public boolean save() {

ProgressMonitorDialog dialog = new ProgressMonitorDialog(DisplayUtils.getShell());
Shell shell = DisplayUtils.getShell();
ProgressMonitorDialog dialog = new ProgressMonitorDialog(shell);
IRunnableWithProgress runnable = new IRunnableWithProgress() {

@Override
Expand All @@ -155,7 +156,7 @@ public void run(IProgressMonitor monitor) throws InvocationTargetException, Inte
try {
monitor.beginTask("Save Mass Spectra", IProgressMonitor.UNKNOWN);
try {
saveMassSpectra(monitor, DisplayUtils.getShell());
saveMassSpectra(monitor, shell);
} catch(NoMassSpectrumConverterAvailableException e) {
throw new InvocationTargetException(e);
}
Expand Down Expand Up @@ -351,6 +352,7 @@ private EventHandler registerEventHandler(IEventBroker eventBroker, String topic

EventHandler eventHandler = new EventHandler() {

@Override
public void handleEvent(Event event) {

try {
Expand Down Expand Up @@ -385,9 +387,13 @@ public void updateObjects(List<Object> objects, String topic) {

if(objects.size() == 1) {
Object object = objects.get(0);
if(object instanceof IScanMSD && object != massSpectrum) {
IScanMSD massSpectrum = (IScanMSD)object;
massSpectrumChart.update(massSpectrum);
if(object instanceof IScanMSD) {
if(object != massSpectrum) {
IScanMSD massSpectrum = (IScanMSD)object;
massSpectrumChart.update(massSpectrum);
} else {
dirtyable.setDirty(massSpectrum.isDirty());
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2018, 2020 Lablicate GmbH.
* Copyright (c) 2018, 2021 Lablicate GmbH.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
Expand All @@ -23,6 +23,7 @@
import org.eclipse.chemclipse.chromatogram.msd.identifier.massspectrum.IMassSpectrumIdentifierSupplier;
import org.eclipse.chemclipse.chromatogram.msd.identifier.massspectrum.IMassSpectrumIdentifierSupport;
import org.eclipse.chemclipse.chromatogram.msd.identifier.massspectrum.MassSpectrumIdentifier;
import org.eclipse.chemclipse.model.notifier.UpdateNotifier;
import org.eclipse.chemclipse.msd.model.core.IIon;
import org.eclipse.chemclipse.msd.model.core.IScanMSD;
import org.eclipse.chemclipse.ux.extension.msd.ui.internal.provider.UpdateMenuEntry;
Expand Down Expand Up @@ -80,6 +81,7 @@ public void update() {
ILineSeriesData lineSeriesData = new LineSeriesData(seriesData);
barSeriesDataList.add(lineSeriesData);
addSeriesData(barSeriesDataList, MAX_NUMBER_MZ);
UpdateNotifier.update(massSpectrum);
}
}

Expand Down Expand Up @@ -133,6 +135,7 @@ public void execute(Shell shell, ScrollableChart scrollableChart) {

if(massSpectrum != null) {
MassSpectrumFilter.applyFilter(massSpectrum, supplier.getId(), new NullProgressMonitor());
massSpectrum.setDirty(true);
update();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,10 @@ protected boolean updateData(List<Object> objects, String topic) {
IChromatogramSelection chromatogramSelection = (IChromatogramSelection)object;
if(extendedChromatogramUI.isActiveChromatogramSelection(chromatogramSelection)) {
extendedChromatogramUI.update();
IChromatogram chromatogram = chromatogramSelection.getChromatogram();
if(chromatogram != null) {
dirtyable.setDirty(chromatogram.isDirty());
}
return true;
}
} else if(object instanceof IScan) {
Expand Down

0 comments on commit d9100fd

Please sign in to comment.