Search code examples
eclipsemigrationeclipse-rcpe4

Remove handle from the ProgressBar (make it NoMove)


We are migrating an rcp application from e3 to e4. After our upgrade all the toolcontrols we had programmatically instantiated got movable, as CoolBarManager2 did not implement the locklayout function that used to be called upon to make all items not-movable.

To circumvent this problem, we have introduced our own *e4xmi and declaratively constructed almost all of our layout - except for the ProgressBar (in StandardTrim). This *e4xmi is not set as main.


To remove the movable aspect from that control we have unsuccessfully tried the following:

  • CSS-hack the handle-image to none [this does update the CSS Style in CSS Spy, but does not remove the handle itself]

  • Created our own ToolItem in the bottom Trim with id org.eclipse.ui.ProgressBar and the StandardTrim class with the NoMove tag. [This only works if the Trim is set to Top, and it does not work on the bottom]

  • Replicate the code from StandardTrim to create a progressbar in a new ToolItem [fails as IWorkbenchWindow is not injectable]
  • Installed the org.eclipse.e4.ui.progress_0.1.100.v20150731-0425 plugin.[sort-of works, the styling is all wrong and it doesn't seem to be fully supported]

How can we make the native eclipse progressbar not movable?


Solution

  • We have found a way to circumvent our issue using one of the solutions posted in the original question, but with a (very strange) modification.

    Our solution is to create our own ToolItem in the bottom Trim with id org.eclipse.ui.ProgressBar and the StandardTrim class with the NoMove tag. This produces an exception during startup except when "To Be Rendered" is unchecked.

    In the Supplementary tab the NoMove tag is added to make it not-movable.

    For some magic reason this works, and does not produce errors in Neon.2 Release (4.6.2).

    Screenshot of our *.e4xmi