Class EmptyWorkspaceHelper


  • public class EmptyWorkspaceHelper
    extends Object
    This class can be re-used by views that show the workspace's projects (like e.g. the "1C Navigator" does). With the help of this class these views can show explanatory text in cases where no project is in the workspace. This class uses a stack layout to switch between the "original" composite of the view and an additional composite given the user the explanatory text. This text is displayed when no projects are in the workspace. Once projects are created this class switches back to the "original" composite of the view. The explanatory text explains the current situation that no projects are available and provides a list of options to create projects. This list contains links to:
    1. Project creation wizards specific to the current perspective
    2. The "New Project Wizard" to allow creation of project of any type
    3. Provided import wizards
    If no perspective specific project creation wizards are found then a simple text with a link to the "New Project Wizard" is shown. This class also takes care of refreshing these links when the user switches the perspective.
    • Constructor Detail

      • EmptyWorkspaceHelper

        public EmptyWorkspaceHelper​(List<String> importWizardIds)
        Empty workspace helper constructor.
        Parameters:
        importWizardIds - identifiers of import wizards for creating links in navigator, not null
    • Method Detail

      • getComposite

        public org.eclipse.swt.widgets.Composite getComposite​(org.eclipse.swt.widgets.Composite aParent)
        Call this method at the point in time when the view's controls are created.
        Parameters:
        parent - The composite where the explanatory text should be put into.
        Returns:
        A new composite (a child of "parent") that has to be used by consumers as parent for their UI elements
      • setNonEmptyControl

        public void setNonEmptyControl​(org.eclipse.swt.widgets.Composite control)
        This method should be used to hand over the "original" control that is "normally" visible in the view.
        Parameters:
        control - The "original" control of the view.