fixes database reopening problem due to locking
This commit is contained in:
@ -124,7 +124,7 @@ public class RelationTypeToolControl extends PartListener implements ISelectionC
|
||||
return;
|
||||
}
|
||||
}
|
||||
if(comboViewer!=null) comboViewer.getCombo().setEnabled(false);
|
||||
if(comboViewer!=null && !comboViewer.getCombo().isDisposed()) comboViewer.getCombo().setEnabled(false);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
@ -35,8 +35,12 @@ public class AddSeparatorHandler {
|
||||
Object sel = ((WaveformViewer)part.getObject()).getSelection();
|
||||
if( sel instanceof IStructuredSelection) {
|
||||
if(((IStructuredSelection)sel).isEmpty()) return false;
|
||||
Object o= ((IStructuredSelection)sel).getFirstElement();
|
||||
return o instanceof TrackEntry;
|
||||
IStructuredSelection isel = (IStructuredSelection) sel;
|
||||
if(isel.size()==1)
|
||||
return isel.getFirstElement() instanceof TrackEntry;
|
||||
else if(isel.size()==2) {
|
||||
return isel.toArray()[1] instanceof TrackEntry;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
@ -23,13 +23,13 @@ public class SelectAllHandler {
|
||||
@CanExecute
|
||||
public boolean canExecute(EPartService partService) {
|
||||
MPart part = partService.getActivePart();
|
||||
return part.getObject() instanceof WaveformViewer;
|
||||
return part!=null && part.getObject() instanceof WaveformViewer;
|
||||
}
|
||||
|
||||
@Execute
|
||||
public void execute(EPartService partService) {
|
||||
MPart part = partService.getActivePart();
|
||||
if(part.getObject() instanceof WaveformViewer)
|
||||
if(part!=null && part.getObject() instanceof WaveformViewer)
|
||||
((WaveformViewer) part.getObject()).selectAll();
|
||||
}
|
||||
|
||||
|
@ -29,6 +29,7 @@ import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.annotation.PreDestroy;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
|
||||
@ -512,6 +513,12 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||
showTxDetails(false);
|
||||
}
|
||||
|
||||
@PreDestroy
|
||||
public void closeDatabase() {
|
||||
if(database.isLoaded())
|
||||
database.close();
|
||||
}
|
||||
|
||||
@Inject
|
||||
@Optional
|
||||
public void reactOnPrefsChange(@Preference(nodePath = PreferenceConstants.PREFERENCES_SCOPE) IEclipsePreferences prefs) {
|
||||
|
Reference in New Issue
Block a user