fix handling of key short cuts
This commit is contained in:
@@ -19,25 +19,15 @@ import org.eclipse.e4.ui.model.application.ui.basic.MPart;
|
||||
import org.eclipse.e4.ui.workbench.modeling.EPartService;
|
||||
|
||||
import com.minres.scviewer.e4.application.parts.DesignBrowser;
|
||||
import com.minres.scviewer.e4.application.parts.WaveformViewer;
|
||||
|
||||
public class SelectAllHandler {
|
||||
|
||||
@Inject @Optional DesignBrowser designBrowser;
|
||||
|
||||
@Execute
|
||||
public void execute(EPartService partService) {
|
||||
if(designBrowser==null) designBrowser = getListPart(partService);
|
||||
if(designBrowser!=null){
|
||||
designBrowser.selectAllWaveforms();
|
||||
}
|
||||
MPart part = partService.getActivePart();
|
||||
if(part.getObject() instanceof WaveformViewer)
|
||||
((WaveformViewer) part.getObject()).selectAll();
|
||||
}
|
||||
|
||||
protected DesignBrowser getListPart(EPartService partService){
|
||||
MPart part = partService.getActivePart();
|
||||
if(part.getObject() instanceof DesignBrowser)
|
||||
return (DesignBrowser) part.getObject();
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
@@ -85,7 +85,7 @@ HelpDialog_2=Stop
|
||||
HelpDialog_3=Refresh
|
||||
HelpDialog_4=Go
|
||||
HelpDialog_5=Address
|
||||
HelpDialog_6=https://git.minres.com/VP-Tools/SCViewer/src/branch/master/README.md\#key-shortcuts
|
||||
HelpDialog_6=https://minres.github.io/SCViewer#key-shortcuts
|
||||
HelpDialog_7=Could not instantiate Browser:
|
||||
marker=Marker
|
||||
marker_text=Marker TExt
|
||||
|
@@ -226,6 +226,10 @@ public class DesignBrowser {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public Control getControl() {
|
||||
return top;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the table composite.
|
||||
|
@@ -337,6 +337,8 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||
case SWT.ARROW_DOWN:
|
||||
waveformPane.moveSelectedTrack(1);
|
||||
return;
|
||||
case 'a':
|
||||
selectAll();
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -1269,4 +1271,11 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||
} catch (BackingStoreException e) {}
|
||||
}
|
||||
}
|
||||
|
||||
public void selectAll() {
|
||||
List<TrackEntry> entries = waveformPane.getStreamList();
|
||||
ISelection sel = new StructuredSelection(entries);
|
||||
waveformPane.setSelection(sel);
|
||||
designBrowser.selectAllWaveforms();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user