class PerspectiveEditorPresenter extends BaseEditor<LayoutTemplate, DefaultMetadata> {

    @OnStartup
    public void onStartup(final ObservablePath path,
                          final PlaceRequest place) {

        super.baseView = perspectiveEditorView;

        // This is only used to define the "name" used by @WorkbenchPartTitle which is called by Uberfire after @OnStartup
        // but before the async call in "loadContent()" has returned. When the *real* plugin is loaded this is overwritten
        final String name = place.getParameter("name",
                                               "");
        plugin = new Plugin(name,
                            PluginType.PERSPECTIVE_LAYOUT,
                            path);

        // Show the available menu options according to the permissions set
        List<MenuItems> menuItems = new ArrayList<>();
        addMenuItem(menuItems,
                    SAVE,
                    pluginController.canUpdate(plugin));
        addMenuItem(menuItems,
                    COPY,
                    pluginController.canCreatePerspectives());
        addMenuItem(menuItems,
                    RENAME,
                    pluginController.canUpdate(plugin));
        addMenuItem(menuItems,
                    DELETE,
                    pluginController.canDelete(plugin));

        // Init the editor
        init(path,
             place,
             resourceType,
             true,
             false,
             menuItems);

        // Init the drag component palette
        initLayoutDragComponentGroups();

        // Init the layout editor
        this.layoutEditorPlugin.init(name,
                org.uberfire.ext.plugin.client.resources.i18n.CommonConstants.INSTANCE.EmptyTitleText(),
                org.uberfire.ext.plugin.client.resources.i18n.CommonConstants.INSTANCE.EmptySubTitleText(),
                LayoutTemplate.Style.PAGE);

        // Enable the preview feature in the perspective editor
        this.layoutEditorPlugin.setPreviewEnabled(true);
        this.layoutEditorPlugin.setElementSelectionEnabled(true);
        this.perspectiveEditorView.setupLayoutEditor(layoutEditorPlugin.asWidget());
    }

}