Browse Source

Initial version of E4 based SC Viewer application

tags/V1.0.0
Eyck Jentzsch 4 years ago
parent
commit
032ffea7c8
67 changed files with 4019 additions and 0 deletions
  1. 7
    0
      com.minres.scviewer.e4.application/.classpath
  2. 1
    0
      com.minres.scviewer.e4.application/.gitignore
  3. 33
    0
      com.minres.scviewer.e4.application/.project
  4. 7
    0
      com.minres.scviewer.e4.application/.settings/org.eclipse.jdt.core.prefs
  5. 3
    0
      com.minres.scviewer.e4.application/.settings/org.eclipse.pde.core.prefs
  6. 190
    0
      com.minres.scviewer.e4.application/Application.e4xmi
  7. 29
    0
      com.minres.scviewer.e4.application/META-INF/MANIFEST.MF
  8. 9
    0
      com.minres.scviewer.e4.application/build.properties
  9. 130
    0
      com.minres.scviewer.e4.application/com.minres.scviewer.e4.application.product
  10. 205
    0
      com.minres.scviewer.e4.application/css/default.css
  11. BIN
      com.minres.scviewer.e4.application/icons/SCViewer.icns
  12. BIN
      com.minres.scviewer.e4.application/icons/SCViewer.ico
  13. BIN
      com.minres.scviewer.e4.application/icons/SCViewer_128x32.png
  14. BIN
      com.minres.scviewer.e4.application/icons/SCViewer_16x32.png
  15. BIN
      com.minres.scviewer.e4.application/icons/SCViewer_256x32.png
  16. BIN
      com.minres.scviewer.e4.application/icons/SCViewer_32x32.png
  17. BIN
      com.minres.scviewer.e4.application/icons/SCViewer_48x32.png
  18. BIN
      com.minres.scviewer.e4.application/icons/SCViewer_512.png
  19. BIN
      com.minres.scviewer.e4.application/icons/SCViewer_64x32.png
  20. BIN
      com.minres.scviewer.e4.application/icons/bullet_plus.png
  21. BIN
      com.minres.scviewer.e4.application/icons/cross.png
  22. BIN
      com.minres.scviewer.e4.application/icons/database.png
  23. BIN
      com.minres.scviewer.e4.application/icons/down_blue.png
  24. BIN
      com.minres.scviewer.e4.application/icons/folder.png
  25. BIN
      com.minres.scviewer.e4.application/icons/folder_database.png
  26. BIN
      com.minres.scviewer.e4.application/icons/play_blue.png
  27. BIN
      com.minres.scviewer.e4.application/icons/play_green.png
  28. BIN
      com.minres.scviewer.e4.application/icons/reverse_blue.png
  29. BIN
      com.minres.scviewer.e4.application/icons/reverse_green.png
  30. BIN
      com.minres.scviewer.e4.application/icons/save_edit.png
  31. BIN
      com.minres.scviewer.e4.application/icons/scviewer.gif
  32. BIN
      com.minres.scviewer.e4.application/icons/scviewer.png
  33. BIN
      com.minres.scviewer.e4.application/icons/signal.png
  34. BIN
      com.minres.scviewer.e4.application/icons/stream.png
  35. BIN
      com.minres.scviewer.e4.application/icons/trash.png
  36. BIN
      com.minres.scviewer.e4.application/icons/up_blue.png
  37. BIN
      com.minres.scviewer.e4.application/icons/zoom.png
  38. BIN
      com.minres.scviewer.e4.application/icons/zoom_in.png
  39. BIN
      com.minres.scviewer.e4.application/icons/zoom_out.png
  40. 22
    0
      com.minres.scviewer.e4.application/plugin.xml
  41. 43
    0
      com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/E4LifeCycle.java
  42. 23
    0
      com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/AboutHandler.java
  43. 29
    0
      com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/DeleteWaveformHandler.java
  44. 38
    0
      com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/MoveWaveformHandler.java
  45. 40
    0
      com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/NavigateEvent.java
  46. 37
    0
      com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/NavigateTrans.java
  47. 61
    0
      com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/OpenHandler.java
  48. 28
    0
      com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/QuitHandler.java
  49. 32
    0
      com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/SaveHandler.java
  50. 13
    0
      com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/SelectAllHandler.java
  51. 40
    0
      com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/ZoomHandler.java
  52. 607
    0
      com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/internal/HeapStatus.java
  53. 19
    0
      com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/internal/IHeapStatusConstants.java
  54. 209
    0
      com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/internal/StatusBarControl.java
  55. 42
    0
      com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/internal/TrimUtil.java
  56. 100
    0
      com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/internal/WaveStatusBarControl.java
  57. 108
    0
      com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/DesignBrowser.java
  58. 233
    0
      com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/TransactionDetails.java
  59. 170
    0
      com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/WaveformListPart.java
  60. 369
    0
      com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/WaveformViewerPart.java
  61. 68
    0
      com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/provider/TxDbContentProvider.java
  62. 88
    0
      com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/provider/TxDbLabelProvider.java
  63. 52
    0
      com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/provider/TxPropertiesContentProvider.java
  64. 72
    0
      com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/provider/TxPropertiesLabelProvider.java
  65. 415
    0
      com.minres.scviewer.e4.application/src/org/eclipse/wb/swt/ResourceManager.java
  66. 447
    0
      com.minres.scviewer.e4.application/src/org/eclipse/wb/swt/SWTResourceManager.java
  67. BIN
      signal.xcf

+ 7
- 0
com.minres.scviewer.e4.application/.classpath View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>

+ 1
- 0
com.minres.scviewer.e4.application/.gitignore View File

@@ -0,0 +1 @@
/bin/

+ 33
- 0
com.minres.scviewer.e4.application/.project View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.minres.scviewer.e4.application</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ds.core.builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

+ 7
- 0
com.minres.scviewer.e4.application/.settings/org.eclipse.jdt.core.prefs View File

@@ -0,0 +1,7 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.7

+ 3
- 0
com.minres.scviewer.e4.application/.settings/org.eclipse.pde.core.prefs View File

@@ -0,0 +1,3 @@
eclipse.preferences.version=1
pluginProject.extensions=false
resolve.requirebundle=false

+ 190
- 0
com.minres.scviewer.e4.application/Application.e4xmi View File

@@ -0,0 +1,190 @@
<?xml version="1.0" encoding="UTF-8"?>
<application:Application xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:advanced="http://www.eclipse.org/ui/2010/UIModel/application/ui/advanced" xmlns:application="http://www.eclipse.org/ui/2010/UIModel/application" xmlns:basic="http://www.eclipse.org/ui/2010/UIModel/application/ui/basic" xmlns:menu="http://www.eclipse.org/ui/2010/UIModel/application/ui/menu" xmi:id="_95PfsHNmEeWBq8z1Dv39LA" elementId="org.eclipse.e4.ide.application" bindingContexts="_95PfuXNmEeWBq8z1Dv39LA">
<children xsi:type="basic:TrimmedWindow" xmi:id="_95PfsXNmEeWBq8z1Dv39LA" label="SC Viewer" width="980" height="700">
<children xsi:type="advanced:PerspectiveStack" xmi:id="_95QGxnNmEeWBq8z1Dv39LA">
<children xsi:type="advanced:Perspective" xmi:id="_95QGx3NmEeWBq8z1Dv39LA">
<children xsi:type="basic:PartSashContainer" xmi:id="_95QGyHNmEeWBq8z1Dv39LA" horizontal="true">
<children xsi:type="basic:PartSashContainer" xmi:id="_61hA8HTPEeWwZ-9vrAR2UQ" elementId="" containerData="20">
<children xsi:type="basic:Part" xmi:id="_95QGynNmEeWBq8z1Dv39LA" containerData="10" contributionURI="bundleclass://com.minres.scviewer.e4.application/com.minres.scviewer.e4.application.parts.DesignBrowser" label="Design Browser"/>
<children xsi:type="basic:Part" xmi:id="_8KyKwHTPEeWwZ-9vrAR2UQ" containerData="9" contributionURI="bundleclass://com.minres.scviewer.e4.application/com.minres.scviewer.e4.application.parts.WaveformListPart" label="Signal List"/>
</children>
<children xsi:type="basic:PartSashContainer" xmi:id="_uT9BIHgtEeWwZ-9vrAR2UQ" elementId="" containerData="80">
<children xsi:type="basic:PartStack" xmi:id="_95QGyXNmEeWBq8z1Dv39LA" elementId="org.eclipse.editorss" containerData="80"/>
<children xsi:type="basic:Part" xmi:id="_vtfm8HgtEeWwZ-9vrAR2UQ" elementId="" containerData="20" contributionURI="bundleclass://com.minres.scviewer.e4.application/com.minres.scviewer.e4.application.parts.TransactionDetails"/>
</children>
</children>
</children>
</children>
<mainMenu xmi:id="_95PfyXNmEeWBq8z1Dv39LA" elementId="menu:org.eclipse.ui.main.menu">
<children xsi:type="menu:Menu" xmi:id="_95QGwHNmEeWBq8z1Dv39LA" elementId="com.minres.scviewer.e4.application.menu.file" label="File">
<children xsi:type="menu:HandledMenuItem" xmi:id="_VJG3YHgvEeWwZ-9vrAR2UQ" elementId="" label="Open" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/folder_database.png" command="_95PfwHNmEeWBq8z1Dv39LA"/>
<children xsi:type="menu:HandledMenuItem" xmi:id="_95QGwnNmEeWBq8z1Dv39LA" label="Save" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/save_edit.png" command="_95Pfw3NmEeWBq8z1Dv39LA"/>
<children xsi:type="menu:HandledMenuItem" xmi:id="_95QGw3NmEeWBq8z1Dv39LA" label="Quit" command="_95PfvHNmEeWBq8z1Dv39LA"/>
</children>
<children xsi:type="menu:Menu" xmi:id="_ZyHC0HgvEeWwZ-9vrAR2UQ" elementId="" label="Edit">
<children xsi:type="menu:HandledMenuItem" xmi:id="_cPlx4HgvEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.handledmenuitem.delete" label="Delete" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/cross.png" command="_WUZ2wHXHEeWwZ-9vrAR2UQ"/>
</children>
<children xsi:type="menu:Menu" xmi:id="_XmZY4HchEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.menu.navigate" label="Navigate">
<children xsi:type="menu:Menu" xmi:id="_VCn_cHgwEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.menu.waveform" label="Waveform ...">
<children xsi:type="menu:HandledMenuItem" xmi:id="_3I82cHguEeWwZ-9vrAR2UQ" elementId="" label="Move Waveform up" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/up_blue.png" command="_N_sOkHXHEeWwZ-9vrAR2UQ">
<parameters xmi:id="_5bKwsHguEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.parameter.16" name="com.minres.scviewer.e4.application.command.movewaveformupCommand.parameter.dir" value="up"/>
</children>
<children xsi:type="menu:HandledMenuItem" xmi:id="_7BRy4HguEeWwZ-9vrAR2UQ" elementId="" label="Move Waveform down" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/down_blue.png" command="_N_sOkHXHEeWwZ-9vrAR2UQ">
<parameters xmi:id="_7BRy4XguEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.parameter.16" name="com.minres.scviewer.e4.application.command.movewaveformupCommand.parameter.dir" value="down"/>
</children>
</children>
<children xsi:type="menu:Menu" xmi:id="_ZywtoHgwEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.menu.cursor" label="Cursor ...">
<children xsi:type="menu:HandledMenuItem" xmi:id="_pJVrgHgvEeWwZ-9vrAR2UQ" elementId="" label="Prev Event" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/reverse_blue.png" command="_79rx4HabEeWwZ-9vrAR2UQ">
<parameters xmi:id="_6P8nIHgvEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.parameter.17" name="com.minres.scviewer.e4.application.command.navigateEventCommand.parameter.dir" value="prev"/>
</children>
<children xsi:type="menu:HandledMenuItem" xmi:id="_ptDckHgvEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.handledmenuitem.nextevent" label="Next Event" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/play_blue.png" command="_79rx4HabEeWwZ-9vrAR2UQ">
<parameters xmi:id="_8bqQwHgvEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.parameter.18" name="com.minres.scviewer.e4.application.command.navigateEventCommand.parameter.dir" value="next"/>
</children>
</children>
<children xsi:type="menu:Menu" xmi:id="_ckjf0HgwEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.menu.transaction" label="Transaction ...">
<children xsi:type="menu:HandledMenuItem" xmi:id="_qKg0oHgvEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.handledmenuitem.prevtx" label="Prev Tx" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/reverse_green.png" command="_Gn3lEHXKEeWwZ-9vrAR2UQ">
<parameters xmi:id="_-szM8HgvEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.parameter.19" name="com.minres.scviewer.e4.application.command.navigateTransCommand.parameter.dir" value="prev"/>
</children>
<children xsi:type="menu:HandledMenuItem" xmi:id="_qsECgHgvEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.handledmenuitem.nexttx" label="Next Tx" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/play_green.png" command="_79rx4HabEeWwZ-9vrAR2UQ">
<parameters xmi:id="_BFe7kHgwEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.parameter.20" name="com.minres.scviewer.e4.application.command.navigateEventCommand.parameter.dir" value="next"/>
</children>
</children>
</children>
<children xsi:type="menu:Menu" xmi:id="_95QGxHNmEeWBq8z1Dv39LA" elementId="com.minres.scviewer.e4.application.menu.help" label="Help">
<children xsi:type="menu:HandledMenuItem" xmi:id="_95QGxXNmEeWBq8z1Dv39LA" label="About" command="_95PfxnNmEeWBq8z1Dv39LA"/>
</children>
</mainMenu>
<sharedElements xsi:type="basic:Part" xmi:id="_Oae6kHcvEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.part.0"/>
<trimBars xmi:id="_95QGy3NmEeWBq8z1Dv39LA" elementId="org.eclipse.ui.main.toolbar">
<children xsi:type="menu:ToolBar" xmi:id="_95QGzHNmEeWBq8z1Dv39LA" elementId="toolbar:org.eclipse.ui.main.toolbar">
<children xsi:type="menu:HandledToolItem" xmi:id="_95QGzXNmEeWBq8z1Dv39LA" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/folder_database.png" command="_95PfwHNmEeWBq8z1Dv39LA"/>
<children xsi:type="menu:HandledToolItem" xmi:id="_95QGznNmEeWBq8z1Dv39LA" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/save_edit.png" command="_95Pfw3NmEeWBq8z1Dv39LA"/>
</children>
<children xsi:type="menu:ToolBar" xmi:id="_VUv_AHckEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.toolbar.0">
<children xsi:type="menu:HandledToolItem" xmi:id="_EboiQHcjEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.handledtoolitem.removestream" label="Remove Stream" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/cross.png" command="_WUZ2wHXHEeWwZ-9vrAR2UQ"/>
<children xsi:type="menu:ToolBarSeparator" xmi:id="_rLVjAHgwEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.toolbarseparator.2"/>
<children xsi:type="menu:HandledToolItem" xmi:id="_FE0CIHcjEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.handledtoolitem.movestreamup" label="Move Stream up" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/up_blue.png" command="_N_sOkHXHEeWwZ-9vrAR2UQ">
<parameters xmi:id="_S_M5YHcjEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.parameter.8" name="com.minres.scviewer.e4.application.command.movewaveformupCommand.parameter.dir" value="up"/>
</children>
<children xsi:type="menu:HandledToolItem" xmi:id="_FrGmEHcjEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.handledtoolitem.movestreamdown" label="Move Stream down" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/down_blue.png" command="_N_sOkHXHEeWwZ-9vrAR2UQ">
<parameters xmi:id="_VA_yAHcjEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.parameter.9" name="com.minres.scviewer.e4.application.command.movewaveformupCommand.parameter.dir" value="down"/>
</children>
<children xsi:type="menu:ToolBarSeparator" xmi:id="_srcD0HgwEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.toolbarseparator.3"/>
<children xsi:type="menu:HandledToolItem" xmi:id="_GKi7IHcjEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.handledtoolitem.previousevent" label="Previous Event" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/reverse_blue.png" command="_79rx4HabEeWwZ-9vrAR2UQ">
<parameters xmi:id="_XS7YYHcjEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.parameter.10" name="com.minres.scviewer.e4.application.command.navigateEventCommand.parameter.dir" value="prev"/>
</children>
<children xsi:type="menu:HandledToolItem" xmi:id="_GjlGMHcjEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.handledtoolitem.nextevent" label="Next Event" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/play_blue.png" command="_79rx4HabEeWwZ-9vrAR2UQ">
<parameters xmi:id="_ZzTqcHcjEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.parameter.11" name="com.minres.scviewer.e4.application.command.navigateEventCommand.parameter.dir" value="next"/>
</children>
<children xsi:type="menu:ToolBarSeparator" xmi:id="_tcxaIHgwEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.toolbarseparator.4"/>
<children xsi:type="menu:HandledToolItem" xmi:id="_HdKZkHcjEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.handledtoolitem.previoustransaction" label="Previous Transaction" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/reverse_green.png" command="_Gn3lEHXKEeWwZ-9vrAR2UQ">
<parameters xmi:id="_cuGAkHcjEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.parameter.12" name="com.minres.scviewer.e4.application.command.navigateTransCommand.parameter.dir" value="prev"/>
</children>
<children xsi:type="menu:HandledToolItem" xmi:id="_H7bp8HcjEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.handledtoolitem.nexttransaction" label="Next Transaction" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/play_green.png" command="_Gn3lEHXKEeWwZ-9vrAR2UQ">
<parameters xmi:id="_fiO8IHcjEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.parameter.13" name="com.minres.scviewer.e4.application.command.navigateTransCommand.parameter.dir" value="next"/>
</children>
</children>
<children xsi:type="menu:ToolBar" xmi:id="_oQdMUHcqEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.toolbar.1">
<children xsi:type="menu:HandledToolItem" xmi:id="_5DrGQHf4EeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.handledtoolitem.zoomfit" label="Zoom out" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/zoom.png" command="_693GoHcqEeWwZ-9vrAR2UQ">
<parameters xmi:id="_5DrGQXf4EeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.parameter.14" name="com.minres.scviewer.e4.application.command.zoomcommand.parameter.level" value="fit"/>
</children>
<children xsi:type="menu:ToolBarSeparator" xmi:id="_p1AvUHcqEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.toolbarseparator.1"/>
<children xsi:type="menu:HandledToolItem" xmi:id="_XMQPAHcrEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.handledtoolitem.zoomin" label="Zoom in" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/zoom_in.png" command="_693GoHcqEeWwZ-9vrAR2UQ">
<parameters xmi:id="_fi5w4HcrEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.parameter.15" name="com.minres.scviewer.e4.application.command.zoomcommand.parameter.level" value="in"/>
</children>
<children xsi:type="menu:HandledToolItem" xmi:id="_XqTc8HcrEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.handledtoolitem.zoomout" label="Zoom out" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/zoom_out.png" command="_693GoHcqEeWwZ-9vrAR2UQ">
<parameters xmi:id="_d7OBYHcrEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.parameter.14" name="com.minres.scviewer.e4.application.command.zoomcommand.parameter.level" value="out"/>
</children>
</children>
</trimBars>
<trimBars xmi:id="_JHMt8HS8EeWBq8z1Dv39LA" elementId="org.eclipse.ui.trim.status" side="Bottom">
<persistedState key="height" value="50"/>
<children xsi:type="menu:ToolControl" xmi:id="_YsBi8HfLEeWwZ-9vrAR2UQ" elementId="org.eclipse.ui.StatusLine" contributionURI="bundleclass://com.minres.scviewer.e4.application/com.minres.scviewer.e4.application.internal.WaveStatusBarControl"/>
<children xsi:type="menu:ToolControl" xmi:id="_76uUAF9tEeO-yojH_y4TJA" elementId="Spacer Glue" contributionURI="bundleclass://org.eclipse.e4.ui.workbench.renderers.swt/org.eclipse.e4.ui.workbench.renderers.swt.LayoutModifierToolControl">
<tags>glue</tags>
<tags>move_after:PerspectiveSpacer</tags>
<tags>SHOW_RESTORE_MENU</tags>
</children>
<children xsi:type="menu:ToolControl" xmi:id="_VZzJMHdHEeWwZ-9vrAR2UQ" elementId="org.eclipse.ui.HeapStatus" contributionURI="bundleclass://com.minres.scviewer.e4.application/com.minres.scviewer.e4.application.internal.StatusBarControl"/>
<children xsi:type="menu:ToolControl" xmi:id="_y0ZS0HfzEeWwZ-9vrAR2UQ" elementId="org.eclipse.ui.ProgressBar" contributionURI="bundleclass://com.minres.scviewer.e4.application/com.minres.scviewer.e4.application.internal.StatusBarControl"/>
</trimBars>
</children>
<handlers xmi:id="_95PfvXNmEeWBq8z1Dv39LA" elementId="com.minres.scviewer.e4.application.handler.quitCommand" contributionURI="bundleclass://com.minres.scviewer.e4.application/com.minres.scviewer.e4.application.handlers.QuitHandler" command="_95PfvHNmEeWBq8z1Dv39LA"/>
<handlers xmi:id="_95PfwXNmEeWBq8z1Dv39LA" elementId="com.minres.scviewer.e4.application.handler.openCommand" contributionURI="bundleclass://com.minres.scviewer.e4.application/com.minres.scviewer.e4.application.handlers.OpenHandler" command="_95PfwHNmEeWBq8z1Dv39LA"/>
<handlers xmi:id="_95PfxHNmEeWBq8z1Dv39LA" elementId="com.minres.scviewer.e4.application.handler.saveCommand" contributionURI="bundleclass://com.minres.scviewer.e4.application/com.minres.scviewer.e4.application.handlers.SaveHandler" command="_95Pfw3NmEeWBq8z1Dv39LA"/>
<handlers xmi:id="_95Pfx3NmEeWBq8z1Dv39LA" elementId="com.minres.scviewer.e4.application.handler.aboutCommand" contributionURI="bundleclass://com.minres.scviewer.e4.application/com.minres.scviewer.e4.application.handlers.AboutHandler" command="_95PfxnNmEeWBq8z1Dv39LA"/>
<handlers xmi:id="_3ZZhsHXHEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.handler.selectallCommand" contributionURI="bundleclass://com.minres.scviewer.e4.application/com.minres.scviewer.e4.application.handlers.SelectAllHandler" command="_bV-TMHXHEeWwZ-9vrAR2UQ"/>
<bindingTables xmi:id="_95PfvnNmEeWBq8z1Dv39LA" bindingContext="_95PfuXNmEeWBq8z1Dv39LA">
<bindings xmi:id="_95Pfv3NmEeWBq8z1Dv39LA" keySequence="M1+Q" command="_95PfvHNmEeWBq8z1Dv39LA"/>
<bindings xmi:id="_95PfwnNmEeWBq8z1Dv39LA" keySequence="M1+O" command="_95PfwHNmEeWBq8z1Dv39LA"/>
<bindings xmi:id="_95PfxXNmEeWBq8z1Dv39LA" keySequence="M1+S" command="_95Pfw3NmEeWBq8z1Dv39LA"/>
<bindings xmi:id="_95PfyHNmEeWBq8z1Dv39LA" keySequence="M1+A" command="_bV-TMHXHEeWwZ-9vrAR2UQ"/>
</bindingTables>
<rootContext xmi:id="_95PfuXNmEeWBq8z1Dv39LA" elementId="org.eclipse.ui.contexts.dialogAndWindow" name="In Dialog and Windows">
<children xmi:id="_95PfunNmEeWBq8z1Dv39LA" elementId="org.eclipse.ui.contexts.window" name="In Windows"/>
<children xmi:id="_95Pfu3NmEeWBq8z1Dv39LA" elementId="org.eclipse.ui.contexts.dialog" name="In Dialogs"/>
</rootContext>
<descriptors xmi:id="_KicY0HRMEeWBq8z1Dv39LA" elementId="com.minres.scviewer.e4.application.partdescriptor.waveformviewer" label="SCViewer" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/scviewer.png" allowMultiple="true" category="General" closeable="true" contributionURI="bundleclass://com.minres.scviewer.e4.application/com.minres.scviewer.e4.application.parts.WaveformViewerPart">
<tags>categoryTag:General</tags>
<handlers xmi:id="_BSIuEHacEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.handler.navigateEventCommand" contributionURI="bundleclass://com.minres.scviewer.e4.application/com.minres.scviewer.e4.application.handlers.NavigateEvent" command="_79rx4HabEeWwZ-9vrAR2UQ"/>
<handlers xmi:id="_JpdGwHXKEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.handler.navigateTransCommand" contributionURI="bundleclass://com.minres.scviewer.e4.application/com.minres.scviewer.e4.application.handlers.NavigateTrans" command="_Gn3lEHXKEeWwZ-9vrAR2UQ"/>
<handlers xmi:id="_297tsHXHEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.handler.deletewaveformCommand" contributionURI="bundleclass://com.minres.scviewer.e4.application/com.minres.scviewer.e4.application.handlers.DeleteWaveformHandler" command="_WUZ2wHXHEeWwZ-9vrAR2UQ"/>
<handlers xmi:id="_2Ai4YHXHEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.handler.movewaveformupCommand" contributionURI="bundleclass://com.minres.scviewer.e4.application/com.minres.scviewer.e4.application.handlers.MoveWaveformHandler" command="_N_sOkHXHEeWwZ-9vrAR2UQ"/>
<handlers xmi:id="_Du1NAHcrEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.handler.zoomCommand" contributionURI="bundleclass://com.minres.scviewer.e4.application/com.minres.scviewer.e4.application.handlers.ZoomHandler" command="_693GoHcqEeWwZ-9vrAR2UQ"/>
<menus xsi:type="menu:PopupMenu" xmi:id="_TwzrsHWSEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.popupmenu.namecontext" label="Name Menu">
<children xsi:type="menu:HandledMenuItem" xmi:id="_Vco7YHWSEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.handledmenuitem.moveup" label="Move up" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/up_blue.png" command="_N_sOkHXHEeWwZ-9vrAR2UQ">
<parameters xmi:id="_qNG5kHZWEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.parameter.0" name="com.minres.scviewer.e4.application.command.movewaveformupCommand.parameter.dir" value="up"/>
</children>
<children xsi:type="menu:HandledMenuItem" xmi:id="_UlTbMHXIEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.handledmenuitem.movedown" label="Move down" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/down_blue.png" command="_N_sOkHXHEeWwZ-9vrAR2UQ">
<parameters xmi:id="_soO4MHZWEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.parameter.1" name="com.minres.scviewer.e4.application.command.movewaveformupCommand.parameter.dir" value="down"/>
</children>
<children xsi:type="menu:HandledMenuItem" xmi:id="_Vj4jUHXIEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.handledmenuitem.remove" label="Remove" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/cross.png" command="_WUZ2wHXHEeWwZ-9vrAR2UQ"/>
</menus>
<menus xsi:type="menu:PopupMenu" xmi:id="_CxJvAHXGEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.popupmenu.wavecontext" label="Wave Menu">
<children xsi:type="menu:HandledMenuItem" xmi:id="_7HrlwHXREeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.handledmenuitem.moveup" label="Move up" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/up_blue.png" command="_N_sOkHXHEeWwZ-9vrAR2UQ">
<parameters xmi:id="_snsmsHaYEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.parameter.2" name="com.minres.scviewer.e4.application.command.movewaveformupCommand.parameter.dir" value="up"/>
</children>
<children xsi:type="menu:HandledMenuItem" xmi:id="_8MkxQHXREeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.handledmenuitem.movedown" label="Move down" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/down_blue.png" command="_N_sOkHXHEeWwZ-9vrAR2UQ">
<parameters xmi:id="_uZBaYHaYEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.parameter.3" name="com.minres.scviewer.e4.application.command.movewaveformupCommand.parameter.dir" value="down"/>
</children>
<children xsi:type="menu:HandledMenuItem" xmi:id="_h4B6YHcZEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.handledmenuitem.nextevent" label="Next event" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/play_blue.png" command="_79rx4HabEeWwZ-9vrAR2UQ">
<parameters xmi:id="_rKkcwHcZEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.parameter.6" name="com.minres.scviewer.e4.application.command.navigateEventCommand.parameter.dir" value="next"/>
</children>
<children xsi:type="menu:HandledMenuItem" xmi:id="_kU1UAHcZEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.handledmenuitem.previousevent" label="Previous event" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/reverse_blue.png" command="_79rx4HabEeWwZ-9vrAR2UQ">
<parameters xmi:id="_tJOh0HcZEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.parameter.7" name="com.minres.scviewer.e4.application.command.navigateEventCommand.parameter.dir" value="prev"/>
</children>
<children xsi:type="menu:HandledMenuItem" xmi:id="_7Hz3sHXIEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.handledmenuitem.remove" label="Remove" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/cross.png" command="_WUZ2wHXHEeWwZ-9vrAR2UQ"/>
<children xsi:type="menu:HandledMenuItem" xmi:id="_33qXsHabEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.handledmenuitem.nextchange" label="Next Tx" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/play_green.png" command="_Gn3lEHXKEeWwZ-9vrAR2UQ">
<parameters xmi:id="_33qXsXabEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.parameter.4" name="com.minres.scviewer.e4.application.command.navigateTransCommand.parameter.dir" value="next"/>
</children>
<children xsi:type="menu:HandledMenuItem" xmi:id="_4ZeEQHabEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.handledmenuitem.previouschange" label="Previous Tx" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/reverse_green.png" command="_Gn3lEHXKEeWwZ-9vrAR2UQ">
<parameters xmi:id="_4ZeEQXabEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.parameter.5" name="com.minres.scviewer.e4.application.command.navigateTransCommand.parameter.dir" value="prev"/>
</children>
</menus>
</descriptors>
<commands xmi:id="_95PfvHNmEeWBq8z1Dv39LA" elementId="org.eclipse.ui.file.exit" commandName="quitCommand"/>
<commands xmi:id="_95PfwHNmEeWBq8z1Dv39LA" elementId="com.minres.scviewer.e4.application.open" commandName="openCommand"/>
<commands xmi:id="_95Pfw3NmEeWBq8z1Dv39LA" elementId="org.eclipse.ui.file.save" commandName="saveCommand"/>
<commands xmi:id="_95PfxnNmEeWBq8z1Dv39LA" elementId="org.eclipse.ui.help.aboutAction" commandName="aboutCommand"/>
<commands xmi:id="_N_sOkHXHEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.command.movewaveformupCommand" commandName="moveWaveformCommand">
<parameters xmi:id="_lMv-EHZWEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.command.movewaveformupCommand.parameter.dir" name="direction" optional="false"/>
</commands>
<commands xmi:id="_WUZ2wHXHEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.command.deletewaveformCommand" commandName="deleteWaveformCommand"/>
<commands xmi:id="_bV-TMHXHEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.command.selectallCommand" commandName="selectAllCommand"/>
<commands xmi:id="_Gn3lEHXKEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.command.navigateTransCommand" commandName="navigateTransCommand">
<parameters xmi:id="_howw0HXQEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.command.navigateTransCommand.parameter.dir" name="direction" optional="false"/>
</commands>
<commands xmi:id="_79rx4HabEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.command.navigateEventCommand" commandName="navigateEventCommand">
<parameters xmi:id="_79rx4XabEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.command.navigateEventCommand.parameter.dir" name="direction" optional="false"/>
</commands>
<commands xmi:id="_693GoHcqEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.command.zoomcommand" commandName="zoomCommand">
<parameters xmi:id="_8tbm0HcqEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.command.zoomcommand.parameter.level" name="level" optional="false"/>
</commands>
<addons xmi:id="_95PfsnNmEeWBq8z1Dv39LA" elementId="org.eclipse.e4.core.commands.service" contributionURI="bundleclass://org.eclipse.e4.core.commands/org.eclipse.e4.core.commands.CommandServiceAddon"/>
<addons xmi:id="_95Pfs3NmEeWBq8z1Dv39LA" elementId="org.eclipse.e4.ui.contexts.service" contributionURI="bundleclass://org.eclipse.e4.ui.services/org.eclipse.e4.ui.services.ContextServiceAddon"/>
<addons xmi:id="_95PftHNmEeWBq8z1Dv39LA" elementId="org.eclipse.e4.ui.bindings.service" contributionURI="bundleclass://org.eclipse.e4.ui.bindings/org.eclipse.e4.ui.bindings.BindingServiceAddon"/>
<addons xmi:id="_95PftXNmEeWBq8z1Dv39LA" elementId="org.eclipse.e4.ui.workbench.commands.model" contributionURI="bundleclass://org.eclipse.e4.ui.workbench/org.eclipse.e4.ui.internal.workbench.addons.CommandProcessingAddon"/>
<addons xmi:id="_95PftnNmEeWBq8z1Dv39LA" elementId="org.eclipse.e4.ui.workbench.handler.model" contributionURI="bundleclass://org.eclipse.e4.ui.workbench/org.eclipse.e4.ui.internal.workbench.addons.HandlerProcessingAddon"/>
<addons xmi:id="_95Pft3NmEeWBq8z1Dv39LA" elementId="org.eclipse.e4.ui.workbench.contexts.model" contributionURI="bundleclass://org.eclipse.e4.ui.workbench/org.eclipse.e4.ui.internal.workbench.addons.ContextProcessingAddon"/>
<addons xmi:id="_95PfuHNmEeWBq8z1Dv39LA" elementId="org.eclipse.e4.ui.workbench.bindings.model" contributionURI="bundleclass://org.eclipse.e4.ui.workbench.swt/org.eclipse.e4.ui.workbench.swt.util.BindingProcessingAddon"/>
</application:Application>

+ 29
- 0
com.minres.scviewer.e4.application/META-INF/MANIFEST.MF View File

@@ -0,0 +1,29 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Application
Bundle-SymbolicName: com.minres.scviewer.e4.application;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Vendor: MINRES Technologies GmbH
Require-Bundle: javax.inject;bundle-version="1.0.0",
org.eclipse.core.runtime;bundle-version="3.11.1",
org.eclipse.swt;bundle-version="3.104.1",
org.eclipse.e4.ui.model.workbench;bundle-version="1.1.100",
org.eclipse.jface;bundle-version="3.11.0",
org.eclipse.e4.ui.services;bundle-version="1.2.0",
org.eclipse.e4.ui.workbench;bundle-version="1.3.0",
org.eclipse.e4.core.di;bundle-version="1.5.0",
org.eclipse.e4.ui.di;bundle-version="1.1.0",
org.eclipse.e4.core.contexts;bundle-version="1.4.0",
com.minres.scviewer.database.swt;bundle-version="1.0.0",
com.minres.scviewer.database;bundle-version="1.0.0",
org.eclipse.equinox.ds;bundle-version="1.4.300",
org.eclipse.equinox.util;bundle-version="1.0.500",
org.eclipse.osgi.services;bundle-version="3.5.0",
org.eclipse.e4.core.services;bundle-version="2.0.0",
org.eclipse.osgi.services;bundle-version="3.5.0",
org.eclipse.core.jobs,
org.eclipse.osgi,
org.eclipse.wb.core.lib
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Import-Package: com.minres.scviewer.database,
javax.inject;version="1.0.0"

+ 9
- 0
com.minres.scviewer.e4.application/build.properties View File

@@ -0,0 +1,9 @@
output.. = bin/
bin.includes = META-INF/,\
.,\
plugin.xml,\
plugin.xml,\
Application.e4xmi,\
icons/,\
css/default.css
source.. = src/

+ 130
- 0
com.minres.scviewer.e4.application/com.minres.scviewer.e4.application.product View File

@@ -0,0 +1,130 @@
<?xml version="1.0" encoding="UTF-8"?>
<?pde version="3.5"?>

<product name="SCViewer" uid="com.minres.scviewer.e4.application" id="com.minres.scviewer.e4.application.product" application="org.eclipse.e4.ui.workbench.swt.E4Application" version="1.0.0.qualifier" useFeatures="false" includeLaunchers="true">


<configIni use="default">
</configIni>

<launcherArgs>
<programArgs>-clearPersistedState
</programArgs>
<vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts
</vmArgsMac>
</launcherArgs>

<windowImages i16="/com.minres.scviewer.e4.application/icons/SCViewer_16x32.png" i32="/com.minres.scviewer.e4.application/icons/SCViewer_32x32.png" i48="/com.minres.scviewer.e4.application/icons/SCViewer_48x32.png" i64="/com.minres.scviewer.e4.application/icons/SCViewer_64x32.png" i128="/com.minres.scviewer.e4.application/icons/SCViewer_128x32.png" i256="/com.minres.scviewer.e4.application/icons/SCViewer_256x32.png"/>


<launcher>
<macosx icon="/com.minres.scviewer.e4.application/icons/SCViewer.icns"/>
<solaris/>
<win useIco="true">
<ico path="/com.minres.scviewer.e4.application/icons/SCViewer.ico"/>
<bmp/>
</win>
</launcher>


<vm>
</vm>

<plugins>
<plugin id="com.ibm.icu"/>
<plugin id="com.minres.scviewer.e4.application"/>
<plugin id="javax.annotation"/>
<plugin id="javax.inject"/>
<plugin id="javax.xml"/>
<plugin id="org.apache.batik.css"/>
<plugin id="org.apache.batik.util"/>
<plugin id="org.apache.batik.util.gui"/>
<plugin id="org.apache.commons.jxpath"/>
<plugin id="org.apache.commons.logging"/>
<plugin id="org.eclipse.core.commands"/>
<plugin id="org.eclipse.core.contenttype"/>
<plugin id="org.eclipse.core.databinding"/>
<plugin id="org.eclipse.core.databinding.beans"/>
<plugin id="org.eclipse.core.databinding.observable"/>
<plugin id="org.eclipse.core.databinding.property"/>
<plugin id="org.eclipse.core.expressions"/>
<plugin id="org.eclipse.core.filesystem"/>
<plugin id="org.eclipse.core.filesystem.aix.ppc" fragment="true"/>
<plugin id="org.eclipse.core.filesystem.hpux.ia64_32" fragment="true"/>
<plugin id="org.eclipse.core.filesystem.linux.ppc" fragment="true"/>
<plugin id="org.eclipse.core.filesystem.linux.x86" fragment="true"/>
<plugin id="org.eclipse.core.filesystem.linux.x86_64" fragment="true"/>
<plugin id="org.eclipse.core.filesystem.macosx" fragment="true"/>
<plugin id="org.eclipse.core.filesystem.solaris.sparc" fragment="true"/>
<plugin id="org.eclipse.core.filesystem.win32.x86" fragment="true"/>
<plugin id="org.eclipse.core.filesystem.win32.x86_64" fragment="true"/>
<plugin id="org.eclipse.core.jobs"/>
<plugin id="org.eclipse.core.resources"/>
<plugin id="org.eclipse.core.resources.win32.x86" fragment="true"/>
<plugin id="org.eclipse.core.runtime"/>
<plugin id="org.eclipse.core.runtime.compatibility.registry" fragment="true"/>
<plugin id="org.eclipse.e4.core.commands"/>
<plugin id="org.eclipse.e4.core.contexts"/>
<plugin id="org.eclipse.e4.core.di"/>
<plugin id="org.eclipse.e4.core.di.annotations"/>
<plugin id="org.eclipse.e4.core.di.extensions"/>
<plugin id="org.eclipse.e4.core.services"/>
<plugin id="org.eclipse.e4.emf.xpath"/>
<plugin id="org.eclipse.e4.ui.bindings"/>
<plugin id="org.eclipse.e4.ui.css.core"/>
<plugin id="org.eclipse.e4.ui.css.swt"/>
<plugin id="org.eclipse.e4.ui.css.swt.theme"/>
<plugin id="org.eclipse.e4.ui.di"/>
<plugin id="org.eclipse.e4.ui.model.workbench"/>
<plugin id="org.eclipse.e4.ui.services"/>
<plugin id="org.eclipse.e4.ui.widgets"/>
<plugin id="org.eclipse.e4.ui.workbench"/>
<plugin id="org.eclipse.e4.ui.workbench.renderers.swt"/>
<plugin id="org.eclipse.e4.ui.workbench.renderers.swt.cocoa" fragment="true"/>
<plugin id="org.eclipse.e4.ui.workbench.swt"/>
<plugin id="org.eclipse.e4.ui.workbench3"/>
<plugin id="org.eclipse.emf.common"/>
<plugin id="org.eclipse.emf.databinding"/>
<plugin id="org.eclipse.emf.ecore"/>
<plugin id="org.eclipse.emf.ecore.change"/>
<plugin id="org.eclipse.emf.ecore.xmi"/>
<plugin id="org.eclipse.equinox.app"/>
<plugin id="org.eclipse.equinox.common"/>
<plugin id="org.eclipse.equinox.concurrent"/>
<plugin id="org.eclipse.equinox.ds"/>
<plugin id="org.eclipse.equinox.event"/>
<plugin id="org.eclipse.equinox.preferences"/>
<plugin id="org.eclipse.equinox.registry"/>
<plugin id="org.eclipse.equinox.util"/>
<plugin id="org.eclipse.jface"/>
<plugin id="org.eclipse.jface.databinding"/>
<plugin id="org.eclipse.osgi"/>
<plugin id="org.eclipse.osgi.compatibility.state" fragment="true"/>
<plugin id="org.eclipse.osgi.services"/>
<plugin id="org.eclipse.swt"/>
<plugin id="org.eclipse.swt.carbon.macosx" fragment="true"/>
<plugin id="org.eclipse.swt.cocoa.macosx" fragment="true"/>
<plugin id="org.eclipse.swt.cocoa.macosx.x86_64" fragment="true"/>
<plugin id="org.eclipse.swt.gtk.linux.ppc" fragment="true"/>
<plugin id="org.eclipse.swt.gtk.linux.ppc64" fragment="true"/>
<plugin id="org.eclipse.swt.gtk.linux.s390" fragment="true"/>
<plugin id="org.eclipse.swt.gtk.linux.s390x" fragment="true"/>
<plugin id="org.eclipse.swt.gtk.linux.x86" fragment="true"/>
<plugin id="org.eclipse.swt.gtk.linux.x86_64" fragment="true"/>
<plugin id="org.eclipse.swt.gtk.solaris.sparc" fragment="true"/>
<plugin id="org.eclipse.swt.gtk.solaris.x86" fragment="true"/>
<plugin id="org.eclipse.swt.motif.aix.ppc" fragment="true"/>
<plugin id="org.eclipse.swt.motif.hpux.ia64_32" fragment="true"/>
<plugin id="org.eclipse.swt.motif.linux.x86" fragment="true"/>
<plugin id="org.eclipse.swt.motif.solaris.sparc" fragment="true"/>
<plugin id="org.eclipse.swt.photon.qnx.x86" fragment="true"/>
<plugin id="org.eclipse.swt.win32.win32.x86" fragment="true"/>
<plugin id="org.eclipse.swt.win32.win32.x86_64" fragment="true"/>
<plugin id="org.w3c.css.sac"/>
<plugin id="org.w3c.dom.events"/>
<plugin id="org.w3c.dom.smil"/>
<plugin id="org.w3c.dom.svg"/>
</plugins>


</product>

+ 205
- 0
com.minres.scviewer.e4.application/css/default.css View File

@@ -0,0 +1,205 @@
/*******************************************************************************
* Copyright (c) 2010, 2014 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
* Lars Vogel <Lars.Vogel@gmail.com> - Bug 420836
*******************************************************************************/

/* New ColorDefinitions for the E4 default theme */
ThemesExtension { color-definition:
'#org-eclipse-ui-workbench-INACTIVE_UNSELECTED_TABS_COLOR_START',
'#org-eclipse-ui-workbench-INACTIVE_UNSELECTED_TABS_COLOR_END',
'#org-eclipse-ui-workbench-INACTIVE_TAB_OUTER_KEYLINE_COLOR',
'#org-eclipse-ui-workbench-INACTIVE_TAB_INNER_KEYLINE_COLOR',
'#org-eclipse-ui-workbench-INACTIVE_TAB_OUTLINE_COLOR',
'#org-eclipse-ui-workbench-ACTIVE_UNSELECTED_TABS_COLOR_START',
'#org-eclipse-ui-workbench-ACTIVE_UNSELECTED_TABS_COLOR_END',
'#org-eclipse-ui-workbench-ACTIVE_TAB_OUTER_KEYLINE_COLOR',
'#org-eclipse-ui-workbench-ACTIVE_TAB_INNER_KEYLINE_COLOR',
'#org-eclipse-ui-workbench-ACTIVE_TAB_OUTLINE_COLOR';
}

ColorDefinition#org-eclipse-ui-workbench-INACTIVE_UNSELECTED_TABS_COLOR_START {
color: #FFFFFF;
category: '#org-eclipse-ui-presentation-default';
label: url('platform:/plugin/org.eclipse.ui.themes?message=INACTIVE_UNSELECTED_TABS_COLOR_START')
}

ColorDefinition#org-eclipse-ui-workbench-INACTIVE_UNSELECTED_TABS_COLOR_END {
color: #FFFFFF;
category: '#org-eclipse-ui-presentation-default';
label: url('platform:/plugin/org.eclipse.ui.themes?message=INACTIVE_UNSELECTED_TABS_COLOR_END');
}

ColorDefinition#org-eclipse-ui-workbench-INACTIVE_TAB_OUTER_KEYLINE_COLOR {
color: #FFFFFF;
category: '#org-eclipse-ui-presentation-default';
label: url('platform:/plugin/org.eclipse.ui.themes?message=INACTIVE_TAB_OUTER_KEYLINE_COLOR');
}

ColorDefinition#org-eclipse-ui-workbench-INACTIVE_TAB_INNER_KEYLINE_COLOR {
color: #FFFFFF;
category: '#org-eclipse-ui-presentation-default';
label: url('platform:/plugin/org.eclipse.ui.themes?message=INACTIVE_TAB_INNER_KEYLINE_COLOR');
}

ColorDefinition#org-eclipse-ui-workbench-INACTIVE_TAB_OUTLINE_COLOR {
color: #B6BCCC;
category: '#org-eclipse-ui-presentation-default';
label: url('platform:/plugin/org.eclipse.ui.themes?message=INACTIVE_TAB_OUTLINE_COLOR');
}

ColorDefinition#org-eclipse-ui-workbench-ACTIVE_UNSELECTED_TABS_COLOR_START {
color: #FFFFFF;
category: '#org-eclipse-ui-presentation-default';
label: url('platform:/plugin/org.eclipse.ui.themes?message=ACTIVE_UNSELECTED_TABS_COLOR_START');
}

ColorDefinition#org-eclipse-ui-workbench-ACTIVE_UNSELECTED_TABS_COLOR_END {
color: #FFFFFF;
category: '#org-eclipse-ui-presentation-default';
label: url('platform:/plugin/org.eclipse.ui.themes?message=ACTIVE_UNSELECTED_TABS_COLOR_END');
}

ColorDefinition#org-eclipse-ui-workbench-ACTIVE_TAB_OUTER_KEYLINE_COLOR {
color: #CCCCCC;
category: '#org-eclipse-ui-presentation-default';
label: url('platform:/plugin/org.eclipse.ui.themes?message=ACTIVE_TAB_OUTER_KEYLINE_COLOR');
}

ColorDefinition#org-eclipse-ui-workbench-ACTIVE_TAB_INNER_KEYLINE_COLOR {
color: #FFFFFF;
category: '#org-eclipse-ui-presentation-default';
label: url('platform:/plugin/org.eclipse.ui.themes?message=ACTIVE_TAB_INNER_KEYLINE_COLOR');
}

ColorDefinition#org-eclipse-ui-workbench-ACTIVE_TAB_OUTLINE_COLOR {
color: #B6BCCC;
category: '#org-eclipse-ui-presentation-default';
label: url('platform:/plugin/org.eclipse.ui.themes?message=ACTIVE_TAB_OUTLINE_COLOR');
}

/* Already existing ColorDefinitions overridden for the E4 default theme */
ColorDefinition#org-eclipse-ui-workbench-INACTIVE_TAB_BG_START {
color: #dddfe5;
}

ColorDefinition#org-eclipse-ui-workbench-INACTIVE_TAB_BG_END {
color: #FFFFFF;
}

ColorDefinition#org-eclipse-ui-workbench-ACTIVE_TAB_BG_START{
color: #FFFFFF;
}

ColorDefinition#org-eclipse-ui-workbench-ACTIVE_TAB_BG_END {
color: #FFFFFF;
}

ColorDefinition#org-eclipse-ui-workbench-ACTIVE_NOFOCUS_TAB_BG_START {
color: #FFFFFF;
}

ColorDefinition#org-eclipse-ui-workbench-ACTIVE_NOFOCUS_TAB_BG_END {
color: #FFFFFF;
}

ColorDefinition#org-eclipse-ui-workbench-ACTIVE_NOFOCUS_TAB_TEXT_COLOR {
color: #000000;
}

.MTrimmedWindow.topLevel {
margin-top: 3px;
margin-bottom: 3px;
margin-left: 3px;
margin-right: 3px;
}

.MPart.busy {
font-style: italic;
}

.MPart.highlighted {
font-weight: bold;
}

.MPartStack, .MPart {
font-family: '#org-eclipse-ui-workbench-TAB_TEXT_FONT';
}

CTabItem:selected {
color: '#org-eclipse-ui-workbench-ACTIVE_TAB_TEXT_COLOR';
}

.MPartStack {
swt-tab-renderer: url('bundleclass://org.eclipse.e4.ui.workbench.renderers.swt/org.eclipse.e4.ui.workbench.renderers.swt.CTabRendering');
swt-selected-tab-fill: '#org-eclipse-ui-workbench-INACTIVE_TAB_BG_START' '#org-eclipse-ui-workbench-INACTIVE_TAB_BG_END' 100% 100%;
swt-unselected-tabs-color: '#org-eclipse-ui-workbench-INACTIVE_UNSELECTED_TABS_COLOR_START' '#org-eclipse-ui-workbench-INACTIVE_UNSELECTED_TABS_COLOR_END' 100% 100%;
swt-outer-keyline-color: '#org-eclipse-ui-workbench-INACTIVE_TAB_OUTER_KEYLINE_COLOR';
swt-inner-keyline-color: '#org-eclipse-ui-workbench-INACTIVE_TAB_INNER_KEYLINE_COLOR';
swt-tab-outline: '#org-eclipse-ui-workbench-INACTIVE_TAB_OUTLINE_COLOR';
padding: 0px 2px 2px;
swt-shadow-visible: false;
swt-mru-visible: false;
color: '#org-eclipse-ui-workbench-INACTIVE_TAB_TEXT_COLOR';
}

.MPartStack.active {
swt-selected-tab-fill: '#org-eclipse-ui-workbench-ACTIVE_TAB_BG_START' '#org-eclipse-ui-workbench-ACTIVE_TAB_BG_END' 100% 100%;
swt-unselected-tabs-color: '#org-eclipse-ui-workbench-ACTIVE_UNSELECTED_TABS_COLOR_START' '#org-eclipse-ui-workbench-ACTIVE_UNSELECTED_TABS_COLOR_END' 100% 100%;
swt-outer-keyline-color: '#org-eclipse-ui-workbench-ACTIVE_TAB_OUTER_KEYLINE_COLOR';
swt-inner-keyline-color: '#org-eclipse-ui-workbench-ACTIVE_TAB_INNER_KEYLINE_COLOR';
swt-tab-outline: '#org-eclipse-ui-workbench-ACTIVE_TAB_OUTLINE_COLOR';
swt-shadow-visible: false;
}

.MPartStack.active.noFocus {
swt-selected-tab-fill: '#org-eclipse-ui-workbench-ACTIVE_NOFOCUS_TAB_BG_START' '#org-eclipse-ui-workbench-ACTIVE_NOFOCUS_TAB_BG_END' 100% 100%;
}

.MPartStack.active.noFocus > CTabItem:selected {
color: '#org-eclipse-ui-workbench-ACTIVE_NOFOCUS_TAB_TEXT_COLOR';
}

#PerspectiveSwitcher {
eclipse-perspective-keyline-color: #AAB0BF #AAB0BF;
}

.MToolControl.TrimStack {
frame-image: url(./winXPTSFrame.png);
handle-image: url(./winXPHandle.png);
frame-cuts: 5px 1px 5px 16px;
}

.MToolBar.Draggable {
handle-image: url(./dragHandle.png);
}

.MToolControl.Draggable {
handle-image: url(./dragHandle.png);
}

.DragFeedback {
background-color: COLOR-WIDGET-NORMAL-SHADOW;
}

.ModifiedDragFeedback {
background-color: #A0A000;
}

.MPartStack > Composite {
background-color: '#org-eclipse-ui-workbench-INACTIVE_TAB_BG_END';
}

.MPartStack.active > Composite {
background-color: '#org-eclipse-ui-workbench-ACTIVE_TAB_BG_END';
}

.MPartStack.active.noFocus > Composite {
background-color: '#org-eclipse-ui-workbench-ACTIVE_NOFOCUS_TAB_BG_END';
}

BIN
com.minres.scviewer.e4.application/icons/SCViewer.icns View File


BIN
com.minres.scviewer.e4.application/icons/SCViewer.ico View File


BIN
com.minres.scviewer.e4.application/icons/SCViewer_128x32.png View File


BIN
com.minres.scviewer.e4.application/icons/SCViewer_16x32.png View File


BIN
com.minres.scviewer.e4.application/icons/SCViewer_256x32.png View File


BIN
com.minres.scviewer.e4.application/icons/SCViewer_32x32.png View File


BIN
com.minres.scviewer.e4.application/icons/SCViewer_48x32.png View File


BIN
com.minres.scviewer.e4.application/icons/SCViewer_512.png View File


BIN
com.minres.scviewer.e4.application/icons/SCViewer_64x32.png View File


BIN
com.minres.scviewer.e4.application/icons/bullet_plus.png View File


BIN
com.minres.scviewer.e4.application/icons/cross.png View File


BIN
com.minres.scviewer.e4.application/icons/database.png View File


BIN
com.minres.scviewer.e4.application/icons/down_blue.png View File


BIN
com.minres.scviewer.e4.application/icons/folder.png View File


BIN
com.minres.scviewer.e4.application/icons/folder_database.png View File


BIN
com.minres.scviewer.e4.application/icons/play_blue.png View File


BIN
com.minres.scviewer.e4.application/icons/play_green.png View File


BIN
com.minres.scviewer.e4.application/icons/reverse_blue.png View File


BIN
com.minres.scviewer.e4.application/icons/reverse_green.png View File


BIN
com.minres.scviewer.e4.application/icons/save_edit.png View File


BIN
com.minres.scviewer.e4.application/icons/scviewer.gif View File


BIN
com.minres.scviewer.e4.application/icons/scviewer.png View File


BIN
com.minres.scviewer.e4.application/icons/signal.png View File


BIN
com.minres.scviewer.e4.application/icons/stream.png View File


BIN
com.minres.scviewer.e4.application/icons/trash.png View File


BIN
com.minres.scviewer.e4.application/icons/up_blue.png View File


BIN
com.minres.scviewer.e4.application/icons/zoom.png View File


BIN
com.minres.scviewer.e4.application/icons/zoom_in.png View File


BIN
com.minres.scviewer.e4.application/icons/zoom_out.png View File


+ 22
- 0
com.minres.scviewer.e4.application/plugin.xml View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<plugin>

<extension
id="product"
point="org.eclipse.core.runtime.products">
<product
application="org.eclipse.e4.ui.workbench.swt.E4Application"
description="SystemC Transaction and Waveform Viewer"
name="SCViewer">
<property
name="lifeCycleURI"
value="bundleclass://com.minres.scviewer.e4.application/com.minres.scviewer.e4.application.E4LifeCycle">
</property>
<property
name="appName"
value="SCViewer">
</property>
</product>
</extension>

</plugin>

+ 43
- 0
com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/E4LifeCycle.java View File

@@ -0,0 +1,43 @@
/*******************************************************************************
* Copyright (c) 2014 TwelveTone LLC and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Steven Spungin <steven@spungin.tv> - initial API and implementation
*******************************************************************************/
package com.minres.scviewer.e4.application;

import org.eclipse.e4.core.contexts.IEclipseContext;
import org.eclipse.e4.ui.workbench.lifecycle.PostContextCreate;
import org.eclipse.e4.ui.workbench.lifecycle.PreSave;
import org.eclipse.e4.ui.workbench.lifecycle.ProcessAdditions;
import org.eclipse.e4.ui.workbench.lifecycle.ProcessRemovals;

/**
* This is a stub implementation containing e4 LifeCycle annotated methods.<br />
* There is a corresponding entry in <em>plugin.xml</em> (under the
* <em>org.eclipse.core.runtime.products' extension point</em>) that references
* this class.
**/
@SuppressWarnings("restriction")
public class E4LifeCycle {

@PostContextCreate
void postContextCreate(IEclipseContext workbenchContext) {
}

@PreSave
void preSave(IEclipseContext workbenchContext) {
}

@ProcessAdditions
void processAdditions(IEclipseContext workbenchContext) {
}

@ProcessRemovals
void processRemovals(IEclipseContext workbenchContext) {
}
}

+ 23
- 0
com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/AboutHandler.java View File

@@ -0,0 +1,23 @@
/*******************************************************************************
* Copyright (c) 2010 - 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
* Lars Vogel <lars.Vogel@gmail.com> - Bug 419770
*******************************************************************************/
package com.minres.scviewer.e4.application.handlers;

import org.eclipse.e4.core.di.annotations.Execute;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.widgets.Shell;

public class AboutHandler {
@Execute
public void execute(Shell shell) {
MessageDialog.openInformation(shell, "About", "Eclipse 4 Application example.");
}
}

+ 29
- 0
com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/DeleteWaveformHandler.java View File

@@ -0,0 +1,29 @@
package com.minres.scviewer.e4.application.handlers;

import org.eclipse.e4.core.di.annotations.CanExecute;
import org.eclipse.e4.core.di.annotations.Execute;
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
import org.eclipse.e4.ui.workbench.modeling.ESelectionService;

import com.minres.scviewer.database.IWaveform;
import com.minres.scviewer.e4.application.parts.WaveformViewerPart;

public class DeleteWaveformHandler {
@CanExecute
public Boolean canExecute(ESelectionService selectionService){
Object o = selectionService.getSelection();
return o instanceof IWaveform<?>;
}
@Execute
public void execute(ESelectionService selectionService, MPart activePart) {
Object o = activePart.getObject();
Object sel = selectionService.getSelection();
if(o instanceof WaveformViewerPart && sel instanceof IWaveform<?>){
((WaveformViewerPart)o).removeStreamFromList((IWaveform<?>) sel);
}
}
}

+ 38
- 0
com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/MoveWaveformHandler.java View File

@@ -0,0 +1,38 @@
package com.minres.scviewer.e4.application.handlers;

import javax.inject.Named;

import org.eclipse.e4.core.di.annotations.CanExecute;
import org.eclipse.e4.core.di.annotations.Execute;
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
import org.eclipse.e4.ui.workbench.modeling.EPartService;
import org.eclipse.e4.ui.workbench.modeling.ESelectionService;

import com.minres.scviewer.database.ITx;
import com.minres.scviewer.database.IWaveform;
import com.minres.scviewer.e4.application.parts.WaveformViewerPart;

public class MoveWaveformHandler {

static final String PARAMETER_ID="com.minres.scviewer.e4.application.command.movewaveformupCommand.parameter.dir";

@CanExecute
public Boolean canExecute(ESelectionService selectionService){
Object o = selectionService.getSelection();
return o instanceof IWaveform<?> || o instanceof ITx;
}
@Execute
public void execute(@Named(PARAMETER_ID) String param, EPartService partService) {
MPart part = partService.getActivePart();
Object obj = part.getObject();
if(obj instanceof WaveformViewerPart){
if("up".equalsIgnoreCase(param))
((WaveformViewerPart)obj).moveSelected(-1);
else if("down".equalsIgnoreCase(param))
((WaveformViewerPart)obj).moveSelected(1);
}
}
}

+ 40
- 0
com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/NavigateEvent.java View File

@@ -0,0 +1,40 @@

package com.minres.scviewer.e4.application.handlers;

import javax.inject.Named;

import org.eclipse.e4.core.di.annotations.CanExecute;
import org.eclipse.e4.core.di.annotations.Execute;
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
import org.eclipse.e4.ui.workbench.modeling.EPartService;
import org.eclipse.e4.ui.workbench.modeling.ESelectionService;

import com.minres.scviewer.database.ITx;
import com.minres.scviewer.database.IWaveform;
import com.minres.scviewer.database.swt.GotoDirection;
import com.minres.scviewer.e4.application.parts.WaveformViewerPart;

public class NavigateEvent {

final static String PARAMTER_ID="com.minres.scviewer.e4.application.command.navigateEventCommand.parameter.dir";
@CanExecute
public Boolean canExecute(ESelectionService selectionService){
Object o = selectionService.getSelection();
return o instanceof IWaveform<?> || o instanceof ITx;
}
@Execute
public void execute(@Named(PARAMTER_ID) String param, EPartService partService) {
// public void execute(EPartService partService) {
// String param="next";
MPart part = partService.getActivePart();
Object obj = part.getObject();
if(obj instanceof WaveformViewerPart){
if("next".equalsIgnoreCase(param))
((WaveformViewerPart)obj).moveCursor(GotoDirection.NEXT);
else if("prev".equalsIgnoreCase(param))
((WaveformViewerPart)obj).moveCursor(GotoDirection.PREV);
}
}
}

+ 37
- 0
com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/NavigateTrans.java View File

@@ -0,0 +1,37 @@

package com.minres.scviewer.e4.application.handlers;

import javax.inject.Named;

import org.eclipse.e4.core.di.annotations.CanExecute;
import org.eclipse.e4.core.di.annotations.Execute;
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
import org.eclipse.e4.ui.workbench.modeling.EPartService;
import org.eclipse.e4.ui.workbench.modeling.ESelectionService;

import com.minres.scviewer.database.ITx;
import com.minres.scviewer.database.swt.GotoDirection;
import com.minres.scviewer.e4.application.parts.WaveformViewerPart;

public class NavigateTrans {

final static String PARAMTER_ID="com.minres.scviewer.e4.application.command.navigateTransCommand.parameter.dir";
@CanExecute
public Boolean canExecute(ESelectionService selectionService){
Object o = selectionService.getSelection();
return o instanceof ITx;
}
@Execute
public void execute(@Named(PARAMTER_ID) String param, EPartService partService) {
MPart part = partService.getActivePart();
Object obj = part.getObject();
if(obj instanceof WaveformViewerPart){
if("next".equalsIgnoreCase(param))
((WaveformViewerPart)obj).moveSelection(GotoDirection.NEXT);
else if("prev".equalsIgnoreCase(param))
((WaveformViewerPart)obj).moveSelection(GotoDirection.PREV);
}
}
}

+ 61
- 0
com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/OpenHandler.java View File

@@ -0,0 +1,61 @@
/*******************************************************************************
* Copyright (c) 2010 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
* Lars Vogel <lars.Vogel@gmail.com> - Bug 419770
*******************************************************************************/
package com.minres.scviewer.e4.application.handlers;

import java.io.File;

import org.eclipse.e4.core.contexts.IEclipseContext;
import org.eclipse.e4.core.di.annotations.Execute;
import org.eclipse.e4.ui.model.application.MApplication;
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
import org.eclipse.e4.ui.model.application.ui.basic.MPartStack;
import org.eclipse.e4.ui.workbench.modeling.EModelService;
import org.eclipse.e4.ui.workbench.modeling.EPartService;
import org.eclipse.e4.ui.workbench.modeling.EPartService.PartState;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Shell;
public class OpenHandler {

@Execute
public void execute(Shell shell, MApplication app, EModelService modelService, EPartService partService){
FileDialog dialog = new FileDialog(shell, SWT.MULTI);
dialog.setFilterExtensions (new String []{"vcd", "txdb", "txlog"});
dialog.open();
String path = dialog.getFilterPath();
for(String fileName: dialog.getFileNames()){
File file = new File(path+File.separator+fileName);
if(file.exists()){
// MPart part = MBasicFactory.INSTANCE.createPart();
// part.setLabel(fileName);
// part.setContributionURI("bundleclass://com.minres.scviewer.e4.application/"+
// WaveformViewerPart.class.getName());
MPart part = partService .createPart("com.minres.scviewer.e4.application.partdescriptor.waveformviewer");
part.setLabel(fileName);

MPartStack partStack = (MPartStack)modelService.find("org.eclipse.editorss", app);
partStack.getChildren().add(part);
partService.showPart(part, PartState.ACTIVATE);
// Object o = part.getObject();
// if(o instanceof WaveformViewerPart)
// ((WaveformViewerPart)o).setPartInput(file);
IEclipseContext ctx=part.getContext();
ctx.modify("input", file);
ctx.declareModifiable("input");

}
}
}
}

+ 28
- 0
com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/QuitHandler.java View File

@@ -0,0 +1,28 @@
/*******************************************************************************
* Copyright (c) 2010 - 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
* Lars Vogel <lars.Vogel@gmail.com> - Bug 419770
*******************************************************************************/
package com.minres.scviewer.e4.application.handlers;

import org.eclipse.e4.core.di.annotations.Execute;
import org.eclipse.e4.ui.workbench.IWorkbench;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.widgets.Shell;


public class QuitHandler {
@Execute
public void execute(IWorkbench workbench, Shell shell){
if (MessageDialog.openConfirm(shell, "Confirmation",
"Do you want to exit?")) {
workbench.close();
}
}
}

+ 32
- 0
com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/SaveHandler.java View File

@@ -0,0 +1,32 @@
/*******************************************************************************
* Copyright (c) 2010 - 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
* Lars Vogel <lars.Vogel@gmail.com> - Bug 419770
*******************************************************************************/
package com.minres.scviewer.e4.application.handlers;

import org.eclipse.e4.core.di.annotations.CanExecute;
import org.eclipse.e4.core.di.annotations.Execute;
import org.eclipse.e4.ui.workbench.modeling.EPartService;

public class SaveHandler {

@CanExecute
public boolean canExecute(EPartService partService) {
if (partService != null) {
return !partService.getDirtyParts().isEmpty();
}
return false;
}

@Execute
public void execute(EPartService partService) {
partService.saveAll(false);
}
}

+ 13
- 0
com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/SelectAllHandler.java View File

@@ -0,0 +1,13 @@
package com.minres.scviewer.e4.application.handlers;

import org.eclipse.e4.core.di.annotations.Execute;

public class SelectAllHandler {

@Execute
public void execute() {
}
}

+ 40
- 0
com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/ZoomHandler.java View File

@@ -0,0 +1,40 @@
package com.minres.scviewer.e4.application.handlers;

import javax.inject.Named;

import org.eclipse.e4.core.di.annotations.CanExecute;
import org.eclipse.e4.core.di.annotations.Execute;
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.WaveformViewerPart;

public class ZoomHandler {

final static String PARAMTER_ID="com.minres.scviewer.e4.application.command.zoomcommand.parameter.level";

@CanExecute
public boolean canExecute(EPartService partService) {
return true;
}
@Execute
public void execute(@Named(PARAMTER_ID) String level, EPartService partService) {
MPart part = partService.getActivePart();
Object obj = part.getObject();
if(obj instanceof WaveformViewerPart){
WaveformViewerPart waveformViewerPart = (WaveformViewerPart) obj;
int zoomLevel = waveformViewerPart.getZoomLevel();
if("in".equalsIgnoreCase(level))
waveformViewerPart.setZoomLevel(zoomLevel-1);
else if("out".equalsIgnoreCase(level))
waveformViewerPart.setZoomLevel(zoomLevel+1);
else if("fit".equalsIgnoreCase(level))
waveformViewerPart.setZoomFit();
}

}
}

+ 607
- 0
com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/internal/HeapStatus.java View File

@@ -0,0 +1,607 @@
package com.minres.scviewer.e4.application.internal;
import java.lang.reflect.Method;

import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener;
import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Canvas;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.wb.swt.ResourceManager;

/**
* The Heap Status control, which shows the heap usage statistics in the window trim.
*
* @since 3.1
*/
public class HeapStatus extends Composite {

private boolean armed;
private Image gcImage;
private Image disabledGcImage;
private Color bgCol, usedMemCol, lowMemCol, freeMemCol, topLeftCol, bottomRightCol, sepCol, textCol, markCol, armCol;
private Canvas button;
private IEclipsePreferences prefStore;
private int updateInterval;
private boolean showMax;
private long totalMem;
private long prevTotalMem = -1L;
private long prevUsedMem = -1L;
private boolean hasChanged;
private long usedMem;
private long mark = -1;
// start with 12x12
private Rectangle imgBounds = new Rectangle(0,0,12,12);
private long maxMem = Long.MAX_VALUE;
private boolean maxMemKnown;
private float lowMemThreshold = 0.05f;
private boolean showLowMemThreshold = true;
private boolean updateTooltip = false;

protected volatile boolean isInGC = false;

private final Runnable timer = new Runnable() {
@Override
public void run() {
if (!isDisposed()) {
updateStats();
if (hasChanged) {
if (updateTooltip) {
updateToolTip();
}
redraw();
hasChanged = false;
}
getDisplay().timerExec(updateInterval, this);
}
}
};

private final IPreferenceChangeListener prefListener = new IPreferenceChangeListener() {
@Override
public void preferenceChange(PreferenceChangeEvent event) {
if (IHeapStatusConstants.PREF_UPDATE_INTERVAL.equals(event.getKey())) {
setUpdateIntervalInMS(prefStore.getInt(IHeapStatusConstants.PREF_UPDATE_INTERVAL, 100));
}
else if (IHeapStatusConstants.PREF_SHOW_MAX.equals(event.getKey())) {
showMax = prefStore.getBoolean(IHeapStatusConstants.PREF_SHOW_MAX, true);
}
}
};

/**
* Creates a new heap status control with the given parent, and using
* the given preference store to obtain settings such as the refresh
* interval.
*
* @param parent the parent composite
* @param preferences the preference store
*/
public HeapStatus(Composite parent, IEclipsePreferences preferences) {
super(parent, SWT.NONE);

maxMem = getMaxMem();
maxMemKnown = maxMem != Long.MAX_VALUE;

this.prefStore = preferences;
preferences.addPreferenceChangeListener(prefListener);

setUpdateIntervalInMS(preferences.getInt(IHeapStatusConstants.PREF_UPDATE_INTERVAL, 100));
showMax = preferences.getBoolean(IHeapStatusConstants.PREF_SHOW_MAX, true);

button = new Canvas(this, SWT.NONE);
button.setToolTipText("Run Garbage Collection");

ImageDescriptor imageDesc = ResourceManager.getPluginImageDescriptor("com.minres.scviewer.e4.application", "icons/trash.png"); //$NON-NLS-1$
Display display = getDisplay();
gcImage = imageDesc.createImage();
if (gcImage != null) {
imgBounds = gcImage.getBounds();
disabledGcImage = new Image(display, gcImage, SWT.IMAGE_DISABLE);
}
usedMemCol = display.getSystemColor(SWT.COLOR_INFO_BACKGROUND);
lowMemCol = new Color(display, 255, 70, 70); // medium red
freeMemCol = new Color(display, 255, 190, 125); // light orange
bgCol = display.getSystemColor(SWT.COLOR_WIDGET_BACKGROUND);
sepCol = topLeftCol = armCol = display.getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW);
bottomRightCol = display.getSystemColor(SWT.COLOR_WIDGET_HIGHLIGHT_SHADOW);
markCol = textCol = display.getSystemColor(SWT.COLOR_INFO_FOREGROUND);

createContextMenu();

Listener listener = new Listener() {

@Override
public void handleEvent(Event event) {
switch (event.type) {
case SWT.Dispose:
doDispose();
break;
case SWT.Resize:
Rectangle rect = getClientArea();
button.setBounds(rect.width - imgBounds.width - 1, 1, imgBounds.width, rect.height - 2);
break;
case SWT.Paint:
if (event.widget == HeapStatus.this) {
paintComposite(event.gc);
}
else if (event.widget == button) {
paintButton(event.gc);
}
break;
case SWT.MouseUp:
if (event.button == 1) {
if (!isInGC) {
arm(false);
gc();
}
}
break;
case SWT.MouseDown:
if (event.button == 1) {
if (event.widget == HeapStatus.this) {
setMark();
} else if (event.widget == button) {
if (!isInGC)
arm(true);
}
}
break;
case SWT.MouseEnter:
HeapStatus.this.updateTooltip = true;
updateToolTip();
break;
case SWT.MouseExit:
if (event.widget == HeapStatus.this) {
HeapStatus.this.updateTooltip = false;
} else if (event.widget == button) {
arm(false);
}
break;
}
}

};
addListener(SWT.Dispose, listener);
addListener(SWT.MouseDown, listener);
addListener(SWT.Paint, listener);
addListener(SWT.Resize, listener);
addListener(SWT.MouseEnter, listener);
addListener(SWT.MouseExit, listener);
button.addListener(SWT.MouseDown, listener);
button.addListener(SWT.MouseExit, listener);
button.addListener(SWT.MouseUp, listener);
button.addListener(SWT.Paint, listener);

// make sure stats are updated before first paint
updateStats();

getDisplay().asyncExec(new Runnable() {
@Override
public void run() {
if (!isDisposed()) {
getDisplay().timerExec(updateInterval, timer);
}
}
});
}

@Override
public void setBackground(Color color) {
bgCol = color;
button.redraw();
button.update();
}

@Override
public void setForeground(Color color) {
if (color == null) {
usedMemCol = getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND);
} else {
usedMemCol = color;
}

button.redraw();
button.update();
}

@Override
public Color getForeground() {
if (usedMemCol != null) {
return usedMemCol;
}
return getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND);
}

/**
* Returns the maximum memory limit, or Long.MAX_VALUE if the max is not known.
*/
private long getMaxMem() {
long max = Long.MAX_VALUE;
try {
// Must use reflect to allow compilation against JCL/Foundation
Method maxMemMethod = Runtime.class.getMethod("maxMemory", new Class[0]); //$NON-NLS-1$
Object o = maxMemMethod.invoke(Runtime.getRuntime(), new Object[0]);
if (o instanceof Long) {
max = ((Long) o).longValue();
}
}
catch (Exception e) {
// ignore if method missing or if there are other failures trying to determine the max
}
return max;
}

private void setUpdateIntervalInMS(int interval) {
updateInterval = Math.max(100, interval);
}

private void doDispose() {
prefStore.removePreferenceChangeListener(prefListener);
if (gcImage != null) {
gcImage.dispose();
}
if (disabledGcImage != null) {
disabledGcImage.dispose();
}

if (lowMemCol != null) {
lowMemCol.dispose();
}
if (freeMemCol != null) {
freeMemCol.dispose();
}
}

@Override
public Point computeSize(int wHint, int hHint, boolean changed) {
GC gc = new GC(this);
Point p = gc.textExtent("MMMMMMMMMMMM");
int height = imgBounds.height;
// choose the largest of
// - Text height + margins
// - Image height + margins
// - Default Trim heightin
height = Math.max(height, p.y) + 4;
height = Math.max(TrimUtil.TRIM_DEFAULT_HEIGHT, height);
gc.dispose();
return new Point(p.x + 15, height);
}

private void arm(boolean armed) {
if (this.armed == armed) {
return;
}
this.armed = armed;
button.redraw();
button.update();
}

private void gcRunning(boolean isInGC) {
if (this.isInGC == isInGC) {
return;
}
this.isInGC = isInGC;
button.redraw();
button.update();
}

/**
* Creates the context menu
*/
private void createContextMenu() {
MenuManager menuMgr = new MenuManager();
menuMgr.setRemoveAllWhenShown(true);
menuMgr.addMenuListener(new IMenuListener() {
@Override
public void menuAboutToShow(IMenuManager menuMgr) {
fillMenu(menuMgr);
}
});
Menu menu = menuMgr.createContextMenu(this);
setMenu(menu);
}

private void fillMenu(IMenuManager menuMgr) {
menuMgr.add(new SetMarkAction());
menuMgr.add(new ClearMarkAction());
menuMgr.add(new ShowMaxAction());
menuMgr.add(new CloseHeapStatusAction());
// if (isKyrsoftViewAvailable()) {
// menuMgr.add(new ShowKyrsoftViewAction());
// }
}

/**
* Sets the mark to the current usedMem level.
*/
private void setMark() {
updateStats(); // get up-to-date stats before taking the mark
mark = usedMem;
hasChanged = true;
redraw();
}

/**
* Clears the mark.
*/
private void clearMark() {
mark = -1;
hasChanged = true;
redraw();
}

private void gc() {
gcRunning(true);
Thread t = new Thread() {
@Override
public void run() {
busyGC();
getDisplay().asyncExec(new Runnable() {
@Override
public void run() {
if (!isDisposed()) {
gcRunning(false);
}
}
});
}
};
t.start();
}

private void busyGC() {
for (int i = 0; i < 2; ++i) {
System.gc();
System.runFinalization();
}
}

private void paintButton(GC gc) {
Rectangle rect = button.getClientArea();
if (isInGC) {
if (disabledGcImage != null) {
int buttonY = (rect.height - imgBounds.height) / 2 + rect.y;
gc.drawImage(disabledGcImage, rect.x, buttonY);
}
return;
}
if (armed) {
gc.setBackground(armCol);
gc.fillRectangle(rect.x, rect.y, rect.width, rect.height);
}
if (gcImage != null) {
int by = (rect.height - imgBounds.height) / 2 + rect.y; // button y
gc.drawImage(gcImage, rect.x, by);
}
}

private void paintComposite(GC gc) {
if (showMax && maxMemKnown) {
paintCompositeMaxKnown(gc);
} else {
paintCompositeMaxUnknown(gc);
}
}

private void paintCompositeMaxUnknown(GC gc) {
Rectangle rect = getClientArea();
int x = rect.x;
int y = rect.y;
int w = rect.width;
int h = rect.height;
int bw = imgBounds.width; // button width
int dx = x + w - bw - 2; // divider x
int sw = w - bw - 3; // status width
int uw = (int) (sw * usedMem / totalMem); // used mem width
int ux = x + 1 + uw; // used mem right edge
if (bgCol != null) {
gc.setBackground(bgCol);
}
gc.fillRectangle(rect);
gc.setForeground(sepCol);
gc.drawLine(dx, y, dx, y + h);
gc.drawLine(ux, y, ux, y + h);
gc.setForeground(topLeftCol);
gc.drawLine(x, y, x+w, y);
gc.drawLine(x, y, x, y+h);
gc.setForeground(bottomRightCol);
gc.drawLine(x+w-1, y, x+w-1, y+h);
gc.drawLine(x, y+h-1, x+w, y+h-1);

gc.setBackground(usedMemCol);
gc.fillRectangle(x + 1, y + 1, uw, h - 2);

String s = convertToMegString(usedMem)+" of "+ convertToMegString(totalMem);
Point p = gc.textExtent(s);
int sx = (rect.width - 15 - p.x) / 2 + rect.x + 1;
int sy = (rect.height - 2 - p.y) / 2 + rect.y + 1;
gc.setForeground(textCol);
gc.drawString(s, sx, sy, true);

// draw an I-shaped bar in the foreground colour for the mark (if present)
if (mark != -1) {
int ssx = (int) (sw * mark / totalMem) + x + 1;
paintMark(gc, ssx, y, h);
}
}

private void paintCompositeMaxKnown(GC gc) {
Rectangle rect = getClientArea();
int x = rect.x;
int y = rect.y;
int w = rect.width;
int h = rect.height;
int bw = imgBounds.width; // button width
int dx = x + w - bw - 2; // divider x
int sw = w - bw - 3; // status width
int uw = (int) (sw * usedMem / maxMem); // used mem width
int ux = x + 1 + uw; // used mem right edge
int tw = (int) (sw * totalMem / maxMem); // current total mem width
int tx = x + 1 + tw; // current total mem right edge

gc.setBackground(bgCol);
gc.fillRectangle(rect);
gc.setForeground(sepCol);
gc.drawLine(dx, y, dx, y + h);
gc.drawLine(ux, y, ux, y + h);
gc.drawLine(tx, y, tx, y + h);
gc.setForeground(topLeftCol);
gc.drawLine(x, y, x+w, y);
gc.drawLine(x, y, x, y+h);
gc.setForeground(bottomRightCol);
gc.drawLine(x+w-1, y, x+w-1, y+h);
gc.drawLine(x, y+h-1, x+w, y+h-1);

if (lowMemThreshold != 0 && ((double)(maxMem - usedMem) / (double)maxMem < lowMemThreshold)) {
gc.setBackground(lowMemCol);
} else {
gc.setBackground(usedMemCol);
}
gc.fillRectangle(x + 1, y + 1, uw, h - 2);

gc.setBackground(freeMemCol);
gc.fillRectangle(ux + 1, y + 1, tx - (ux + 1), h - 2);

// paint line for low memory threshold
if (showLowMemThreshold && lowMemThreshold != 0) {
gc.setForeground(lowMemCol);
int thresholdX = x + 1 + (int) (sw * (1.0 - lowMemThreshold));
gc.drawLine(thresholdX, y + 1, thresholdX, y + h - 2);
}

String s = convertToMegString(usedMem)+" of "+convertToMegString(totalMem);
Point p = gc.textExtent(s);
int sx = (rect.width - 15 - p.x) / 2 + rect.x + 1;
int sy = (rect.height - 2 - p.y) / 2 + rect.y + 1;
gc.setForeground(textCol);
gc.drawString(s, sx, sy, true);

// draw an I-shaped bar in the foreground colour for the mark (if present)
if (mark != -1) {
int ssx = (int) (sw * mark / maxMem) + x + 1;
paintMark(gc, ssx, y, h);
}
}

private void paintMark(GC gc, int x, int y, int h) {
gc.setForeground(markCol);
gc.drawLine(x, y+1, x, y+h-2);
gc.drawLine(x-1, y+1, x+1, y+1);
gc.drawLine(x-1, y+h-2, x+1, y+h-2);
}

private void updateStats() {
Runtime runtime = Runtime.getRuntime();
totalMem = runtime.totalMemory();
long freeMem = runtime.freeMemory();
usedMem = totalMem - freeMem;

if (convertToMeg(prevUsedMem) != convertToMeg(usedMem)) {
prevUsedMem = usedMem;
this.hasChanged = true;
}

if (prevTotalMem != totalMem) {
prevTotalMem = totalMem;
this.hasChanged = true;
}
}

private void updateToolTip() {
String usedStr = convertToMegString(usedMem);
String totalStr = convertToMegString(totalMem);
String maxStr = maxMemKnown ? convertToMegString(maxMem) : "<unknown>";
String markStr = mark == -1 ? "<none>" : convertToMegString(mark);
String toolTip = "Heap size: "+usedStr+" of total: "+totalStr+" max: "+maxStr+" mark: "+markStr;
if (!toolTip.equals(getToolTipText())) {
setToolTipText(toolTip);
}
}

/**
* Converts the given number of bytes to a printable number of megabytes (rounded up).
*/
private String convertToMegString(long numBytes) {
return new Long(convertToMeg(numBytes)).toString()+"M";
}

/**
* Converts the given number of bytes to the corresponding number of megabytes (rounded up).
*/
private long convertToMeg(long numBytes) {
return (numBytes + (512 * 1024)) / (1024 * 1024);
}


class SetMarkAction extends Action {
SetMarkAction() {
super("&Set Mark");
}

@Override
public void run() {
setMark();
}
}

class ClearMarkAction extends Action {
ClearMarkAction() {
super("&Clear Mark");
}

@Override
public void run() {
clearMark();
}
}

class ShowMaxAction extends Action {
ShowMaxAction() {
super("Show &Max Heap", IAction.AS_CHECK_BOX);
setEnabled(maxMemKnown);
setChecked(showMax);
}

@Override
public void run() {
prefStore.putBoolean(IHeapStatusConstants.PREF_SHOW_MAX, isChecked());
redraw();
}
}

class CloseHeapStatusAction extends Action{

CloseHeapStatusAction(){
super("&Close");
}

@Override
public void run(){
// WorkbenchWindow wbw = (WorkbenchWindow) PlatformUI.getWorkbench()
// .getActiveWorkbenchWindow();
// if (wbw != null) {
// wbw.showHeapStatus(false);
// }
System.out.println("NYI");
}
}

}


+ 19
- 0
com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/internal/IHeapStatusConstants.java View File

@@ -0,0 +1,19 @@
package com.minres.scviewer.e4.application.internal;
/**
* Preference constants for the heap status.
*
* @since 3.1
*/
public interface IHeapStatusConstants {

/**
* Preference key for the update interval (value in milliseconds).
*/
String PREF_UPDATE_INTERVAL = "HeapStatus.updateInterval"; //$NON-NLS-1$

/**
* Preference key for whether to show max heap, if available (value is boolean).
*/
String PREF_SHOW_MAX = "HeapStatus.showMax"; //$NON-NLS-1$

}

+ 209
- 0
com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/internal/StatusBarControl.java View File

@@ -0,0 +1,209 @@
package com.minres.scviewer.e4.application.internal;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.inject.Inject;

import org.eclipse.core.internal.preferences.BundleDefaultPreferences;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.jobs.IJobChangeEvent;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.core.runtime.jobs.JobChangeAdapter;
import org.eclipse.core.runtime.jobs.ProgressProvider;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.e4.core.di.annotations.Optional;
import org.eclipse.e4.ui.di.UIEventTopic;
import org.eclipse.e4.ui.di.UISynchronize;
import org.eclipse.e4.ui.model.application.ui.menu.MToolControl;
import org.eclipse.e4.ui.workbench.modeling.EModelService;
import org.eclipse.jface.action.StatusLineManager;
import org.eclipse.swt.widgets.Composite;

public class StatusBarControl {

public static final String STATUS_UPDATE="StatusUpdate";
public static final String ZOOM_LEVEL="ZoomLevelUpdate";
public static final String CURSOR_TIME="CursorPosUpdate";

@Inject EModelService modelService;
@Inject @Optional IEclipsePreferences preferences;
private final UISynchronize sync;

protected StatusLineManager manager;

private SyncedProgressMonitor monitor;

@Inject
public StatusBarControl(UISynchronize sync) {
this.sync=sync;
manager = new StatusLineManager();
manager.update(true);
}

@PostConstruct
void createWidget(Composite parent, MToolControl toolControl) {
if (toolControl.getElementId().equals("org.eclipse.ui.StatusLine")) { //$NON-NLS-1$
createStatusLine(parent, toolControl);
} else if (toolControl.getElementId().equals("org.eclipse.ui.HeapStatus")) { //$NON-NLS-1$
createHeapStatus(parent, toolControl);
} else if (toolControl.getElementId().equals("org.eclipse.ui.ProgressBar")) { //$NON-NLS-1$
createProgressBar(parent, toolControl);
}
}

@PreDestroy
void destroy() {
if (manager != null) {
manager.dispose();
manager = null;
}
}

/**
* @param parent
* @param toolControl
*/
private void createProgressBar(Composite parent, MToolControl toolControl) {
manager.createControl(parent);
monitor=new SyncedProgressMonitor(manager.getProgressMonitor());
Job.getJobManager().setProgressProvider(new ProgressProvider() {
@Override
public IProgressMonitor createMonitor(Job job) {
return monitor.addJob(job);
}
});
}

/**
* @param parent
* @param toolControl
*/
private void createHeapStatus(Composite parent, MToolControl toolControl) {
if(preferences==null){
preferences=new BundleDefaultPreferences();
preferences.putInt(IHeapStatusConstants.PREF_UPDATE_INTERVAL, 100);
preferences.putBoolean(IHeapStatusConstants.PREF_SHOW_MAX, true);
}
new HeapStatus(parent, preferences);
}

/**
* @param parent
* @param toolControl
*/
private void createStatusLine(Composite parent, MToolControl toolControl) {
// IEclipseContext context = modelService.getContainingContext(toolControl);
manager.createControl(parent);
}

@Inject @Optional
public void getStatusEvent(@UIEventTopic(STATUS_UPDATE) String text) {
if(manager!=null ){
manager.setMessage(text);
}
}

private final class SyncedProgressMonitor implements IProgressMonitor {

IProgressMonitor delegate;
private boolean cancelled;

SyncedProgressMonitor(IProgressMonitor delegate){
this.delegate=delegate;
}

public IProgressMonitor addJob(Job job){
if(job != null){
job.addJobChangeListener(new JobChangeAdapter() {
@Override
public void done(IJobChangeEvent event) {
// clean-up
event.getJob().removeJobChangeListener(this);
}
});
}
return this;
}

@Override
public void beginTask(final String name, final int totalWork) {
sync.syncExec(new Runnable() {
@Override
public void run() {
delegate.beginTask(name, totalWork);
}
});
}

@Override
public void worked(final int work) {
sync.syncExec(new Runnable() {
@Override
public void run() {
delegate.worked(work);
}
});
}

@Override
public void done() {
sync.syncExec(new Runnable() {
@Override
public void run() {
delegate.done();
}
});
}

@Override
public void internalWorked(final double work) {
sync.syncExec(new Runnable() {
@Override
public void run() {
delegate.internalWorked(work);
}
});
}

@Override
public boolean isCanceled() {
sync.syncExec(new Runnable() {
@Override
public void run() {
cancelled=delegate.isCanceled();
}
});
return cancelled;
}

@Override
public void setCanceled(final boolean value) {
sync.syncExec(new Runnable() {
@Override
public void run() {
delegate.setCanceled(value);
}
});
}

@Override
public void setTaskName(final String name) {
sync.syncExec(new Runnable() {
@Override
public void run() {
delegate.setTaskName(name);
}
});
}

@Override
public void subTask(final String name) {
sync.syncExec(new Runnable() {
@Override
public void run() {
delegate.subTask(name);
}
});
}
}
}

+ 42
- 0
com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/internal/TrimUtil.java View File

@@ -0,0 +1,42 @@
package com.minres.scviewer.e4.application.internal;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.ToolBar;
import org.eclipse.swt.widgets.ToolItem;

/**
* Simple class to provide some common internal Trim support.
*
* @since 3.2
*
*/
public class TrimUtil {

/**
* Default height for workbench trim.
*/
public static final int TRIM_DEFAULT_HEIGHT;
static {
Shell s = new Shell(Display.getCurrent(), SWT.NONE);
s.setLayout(new GridLayout());
ToolBar t = new ToolBar(s, SWT.NONE);
t.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
ToolItem ti = new ToolItem(t, SWT.PUSH);
ti.setImage(JFaceResources.getImageRegistry().get(Dialog.DLG_IMG_MESSAGE_INFO));
s.layout();
int toolItemHeight = t.computeSize(SWT.DEFAULT, SWT.DEFAULT).y;
GC gc = new GC(s);
Point fontSize = gc.textExtent("Wg"); //$NON-NLS-1$
gc.dispose();
TRIM_DEFAULT_HEIGHT = Math.max(toolItemHeight, fontSize.y);
s.dispose();

}
}

+ 100
- 0
com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/internal/WaveStatusBarControl.java View File

@@ -0,0 +1,100 @@
package com.minres.scviewer.e4.application.internal;

import java.util.List;

import javax.inject.Inject;
import javax.inject.Named;

import org.eclipse.e4.core.di.annotations.Optional;
import org.eclipse.e4.ui.di.UIEventTopic;
import org.eclipse.e4.ui.di.UISynchronize;
import org.eclipse.e4.ui.services.IServiceConstants;
import org.eclipse.e4.ui.workbench.modeling.EModelService;
import org.eclipse.jface.action.ContributionItem;
import org.eclipse.jface.action.StatusLineManager;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CLabel;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;

public class WaveStatusBarControl extends StatusBarControl {

public static final String STATUS_UPDATE="StatusUpdate";
public static final String ZOOM_LEVEL="ZoomLevelUpdate";
public static final String CURSOR_TIME="CursorPosUpdate";

@Inject
EModelService modelService;

class TextContributionItem extends ContributionItem {

final String labelString;
final int width;
CLabel label, text;
private String content;

public TextContributionItem(String labelString, int width) {
super();
this.labelString = labelString;
this.width=width;