Search code examples
javaeclipsercp

Eclipse RCP. Add an additional condition for view restorable


How to add an additional condition for restorable view? My plugin.xml:

<plugin>
   <extension point="org.eclipse.ui.views">
  <view
        allowMultiple="false"
        class="com.example.ui.example.views.newView"
        icon="icons/example.png"
        id="com.example.ui.example.views.newView"
        name="New View"
        restorable="true">
  </view>

I want to view restorable work only on Mondays.


Solution

  • Restorable is either true or false, there is no support for anything else.

    You might be able to use the org.eclipse.ui.startup extension point to run code during the Eclipse startup and use IWorkbenchPage showView / hideView to show or hide the view.