<commit_before>package org.gemoc.xdsmlframework.ide.ui.perspective;

import org.eclipse.debug.ui.IDebugUIConstants;
import org.eclipse.jdt.ui.JavaUI;
import org.eclipse.pde.internal.launching.IPDEConstants;
import org.eclipse.pde.internal.ui.IPDEUIConstants;
import org.eclipse.pde.internal.ui.views.target.TargetStateView;
import org.eclipse.sirius.ui.tools.api.views.modelexplorerview.IModelExplorerView;
import org.eclipse.sirius.ui.tools.internal.wizards.ModelingProjectWizard;
import org.eclipse.sirius.ui.tools.internal.wizards.NewSessionWizard;
import org.eclipse.ui.IFolderLayout;
import org.eclipse.ui.IPageLayout;
import org.eclipse.ui.IPerspectiveFactory;
import org.eclipse.ui.console.IConsoleConstants;


/**
 * Base perspective inspired from Plugin, Java and Sirius perspective
 * @author dvojtise
 *
 */
public class XDSMLPerspectiveFactory implements IPerspectiveFactory {

    
    /**
     * {@inheritDoc}
     */
    public void createInitialLayout(final IPageLayout layout) {
        defineActions(layout);
        defineLayout(layout);
    }

    /**
     * add items and actions set to the window
     * 
     * @param layout
     *            layout of the perspective
     */
    protected void defineActions(final IPageLayout layout) {
        // project wizards
        layout.addNewWizardShortcut("org.eclipse.pde.ui.NewProjectWizard");
        layout.addNewWizardShortcut("org.eclipse.ecoretools.emf.design.wizardID");
        layout.addNewWizardShortcut("org.eclipse.sirius.ui.specificationproject.wizard");
        layout.addNewWizardShortcut(ModelingProjectWizard.ID);
        layout.addNewWizardShortcut("fr.inria.diverse.k3.ui.wizards.WizardNewProjectK3Plugin");
        // project content wizards
		layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewPackageCreationWizard"); //$NON-NLS-1$
        layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.folder"); //$NON-NLS-1$ 
        layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.file"); //$NON-NLS-1$
        layout.addNewWizardShortcut(NewSessionWizard.ID);
        layout.addNewWizardShortcut("org.eclipse.sirius.presentation.DescriptionModelWizardID");
        
        
        // show view shortcuts
        layout.addShowViewShortcut(IPageLayout.ID_PROJECT_EXPLORER);
        layout.addShowViewShortcut(IModelExplorerView.ID);
        layout.addShowViewShortcut(IPageLayout.ID_PROP_SHEET);
        layout.addShowViewShortcut(IPageLayout.ID_OUTLINE);
        layout.addShowViewShortcut(IPageLayout.ID_PROBLEM_VIEW);
        layout.addShowViewShortcut(IPDEUIConstants.PLUGINS_VIEW_ID);
        layout.addShowViewShortcut("org.eclipse.pde.runtime.RegistryBrowser");
        layout.addShowViewShortcut(JavaUI.ID_TYPE_HIERARCHY);
        layout.addShowViewShortcut(JavaUI.ID_JAVADOC_VIEW);
        layout.addShowViewShortcut(JavaUI.ID_SOURCE_VIEW);
        layout.addShowViewShortcut("org.eclipse.emf.ecoretools.registration.viewregisteredpackages");
		layout.addShowViewShortcut(IConsoleConstants.ID_CONSOLE_VIEW);
		layout.addShowViewShortcut("org.eclipse.emf.ecoretools.internal.views.EClassHierarchyView");
		layout.addShowViewShortcut("org.eclipse.emf.ecoretools.internal.views.EReferencesView");
        
        // 'Window' > 'Open Perspective' contributions
        layout.addPerspectiveShortcut("org.eclipse.sirius.ui.tools.perspective.design");
        layout.addPerspectiveShortcut("org.eclipse.pde.ui.PDEPerspective");
     	layout.addPerspectiveShortcut(JavaUI.ID_PERSPECTIVE);
     	layout.addPerspectiveShortcut(JavaUI.ID_BROWSING_PERSPECTIVE);
     	layout.addPerspectiveShortcut(IDebugUIConstants.ID_DEBUG_PERSPECTIVE);
     	layout.addPerspectiveShortcut("org.eclipse.emf.ecoretools.perspective");
     	
     	// Action set
		layout.addActionSet(IDebugUIConstants.LAUNCH_ACTION_SET);
		layout.addActionSet(JavaUI.ID_ACTION_SET);
		layout.addActionSet(JavaUI.ID_ELEMENT_CREATION_ACTION_SET);
		layout.addActionSet(IPageLayout.ID_NAVIGATE_ACTION_SET);
    }

    /**
     * add views to the layout
     * 
     * @param layout
     *            layout of the perspective
     */
    protected void defineLayout(final IPageLayout layout) {
        final String editorArea = layout.getEditorArea();
        
        // Left
        IFolderLayout topLeft = layout.createFolder("topLeft", //$NON-NLS-1$
				IPageLayout.LEFT, 0.25f, editorArea);
		topLeft.addView(JavaUI.ID_PACKAGES);
		topLeft.addView(IModelExplorerView.ID);
		topLeft.addPlaceholder(IPageLayout.ID_PROJECT_EXPLORER);
		topLeft.addPlaceholder(JavaUI.ID_TYPE_HIERARCHY);
		topLeft.addPlaceholder(IPDEUIConstants.PLUGINS_VIEW_ID);
		
		// Bottom
		IFolderLayout bottom = layout.createFolder("bottom", //$NON-NLS-1$
				IPageLayout.BOTTOM, 0.75f, editorArea);
        bottom.addView(IPageLayout.ID_PROP_SHEET);
		bottom.addView(IPageLayout.ID_PROBLEM_VIEW);
		bottom.addView("org.eclipse.pde.runtime.LogView");
		bottom.addView(JavaUI.ID_JAVADOC_VIEW);
		bottom.addPlaceholder(JavaUI.ID_SOURCE_VIEW);
		bottom.addPlaceholder(TargetStateView.VIEW_ID);
		bottom.addPlaceholder(IConsoleConstants.ID_CONSOLE_VIEW);
        
		// Bottom Right
		IFolderLayout bottomright = layout.createFolder("bottomRight", IPageLayout.RIGHT, (float) 0.60, "bottom"); //$NON-NLS-1$ //$NON-NLS-2$
		bottomright.addPlaceholder("org.eclipse.emf.ecoretools.internal.views.EClassHierarchyView");
		bottomright.addPlaceholder("org.eclipse.emf.ecoretools.internal.views.EReferencesView");
        
		// Right
		IFolderLayout outlineFolder = layout.createFolder("right", IPageLayout.RIGHT, (float)0.75, editorArea); //$NON-NLS-1$
		outlineFolder.addView(IPageLayout.ID_OUTLINE);

    }<commit_msg>replaced Package Explorer by Project Explorer in the xDSML perspective<commit_after>package org.gemoc.xdsmlframework.ide.ui.perspective;

import org.eclipse.debug.ui.IDebugUIConstants;
import org.eclipse.jdt.ui.JavaUI;
import org.eclipse.pde.internal.launching.IPDEConstants;
import org.eclipse.pde.internal.ui.IPDEUIConstants;
import org.eclipse.pde.internal.ui.views.target.TargetStateView;
import org.eclipse.sirius.ui.tools.api.views.modelexplorerview.IModelExplorerView;
import org.eclipse.sirius.ui.tools.internal.wizards.ModelingProjectWizard;
import org.eclipse.sirius.ui.tools.internal.wizards.NewSessionWizard;
import org.eclipse.ui.IFolderLayout;
import org.eclipse.ui.IPageLayout;
import org.eclipse.ui.IPerspectiveFactory;
import org.eclipse.ui.console.IConsoleConstants;


/**
 * Base perspective inspired from Plugin, Java and Sirius perspective
 * @author dvojtise
 *
 */
public class XDSMLPerspectiveFactory implements IPerspectiveFactory {

    
    /**
     * {@inheritDoc}
     */
    public void createInitialLayout(final IPageLayout layout) {
        defineActions(layout);
        defineLayout(layout);
    }

    /**
     * add items and actions set to the window
     * 
     * @param layout
     *            layout of the perspective
     */
    protected void defineActions(final IPageLayout layout) {
        // project wizards
        layout.addNewWizardShortcut("org.eclipse.pde.ui.NewProjectWizard");
        layout.addNewWizardShortcut("org.eclipse.ecoretools.emf.design.wizardID");
        layout.addNewWizardShortcut("org.eclipse.sirius.ui.specificationproject.wizard");
        layout.addNewWizardShortcut(ModelingProjectWizard.ID);
        layout.addNewWizardShortcut("fr.inria.diverse.k3.ui.wizards.WizardNewProjectK3Plugin");
        // project content wizards
		layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewPackageCreationWizard"); //$NON-NLS-1$
        layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.folder"); //$NON-NLS-1$ 
        layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.file"); //$NON-NLS-1$
        layout.addNewWizardShortcut(NewSessionWizard.ID);
        layout.addNewWizardShortcut("org.eclipse.sirius.presentation.DescriptionModelWizardID");
        
        
        // show view shortcuts
        layout.addShowViewShortcut(IPageLayout.ID_PROJECT_EXPLORER);
        layout.addShowViewShortcut(JavaUI.ID_PACKAGES);
        layout.addShowViewShortcut(IModelExplorerView.ID);
        layout.addShowViewShortcut(IPageLayout.ID_PROP_SHEET);
        layout.addShowViewShortcut(IPageLayout.ID_OUTLINE);
        layout.addShowViewShortcut(IPageLayout.ID_PROBLEM_VIEW);
        layout.addShowViewShortcut(IPDEUIConstants.PLUGINS_VIEW_ID);
        layout.addShowViewShortcut("org.eclipse.pde.runtime.RegistryBrowser");
        layout.addShowViewShortcut(JavaUI.ID_TYPE_HIERARCHY);
        layout.addShowViewShortcut(JavaUI.ID_JAVADOC_VIEW);
        layout.addShowViewShortcut(JavaUI.ID_SOURCE_VIEW);
        layout.addShowViewShortcut("org.eclipse.emf.ecoretools.registration.viewregisteredpackages");
		layout.addShowViewShortcut(IConsoleConstants.ID_CONSOLE_VIEW);
		layout.addShowViewShortcut("org.eclipse.emf.ecoretools.internal.views.EClassHierarchyView");
		layout.addShowViewShortcut("org.eclipse.emf.ecoretools.internal.views.EReferencesView");
        
        // 'Window' > 'Open Perspective' contributions
        layout.addPerspectiveShortcut("org.eclipse.sirius.ui.tools.perspective.design");
        layout.addPerspectiveShortcut("org.eclipse.pde.ui.PDEPerspective");
     	layout.addPerspectiveShortcut(JavaUI.ID_PERSPECTIVE);
     	layout.addPerspectiveShortcut(JavaUI.ID_BROWSING_PERSPECTIVE);
     	layout.addPerspectiveShortcut(IDebugUIConstants.ID_DEBUG_PERSPECTIVE);
     	layout.addPerspectiveShortcut("org.eclipse.emf.ecoretools.perspective");
     	
     	// Action set
		layout.addActionSet(IDebugUIConstants.LAUNCH_ACTION_SET);
		layout.addActionSet(JavaUI.ID_ACTION_SET);
		layout.addActionSet(JavaUI.ID_ELEMENT_CREATION_ACTION_SET);
		layout.addActionSet(IPageLayout.ID_NAVIGATE_ACTION_SET);
    }

    /**
     * add views to the layout
     * 
     * @param layout
     *            layout of the perspective
     */
    protected void defineLayout(final IPageLayout layout) {
        final String editorArea = layout.getEditorArea();
        
        // Left
        IFolderLayout topLeft = layout.createFolder("topLeft", //$NON-NLS-1$
				IPageLayout.LEFT, 0.25f, editorArea);
		topLeft.addView(IPageLayout.ID_PROJECT_EXPLORER);
		topLeft.addView(IModelExplorerView.ID);
		topLeft.addPlaceholder(JavaUI.ID_PACKAGES);
		topLeft.addPlaceholder(JavaUI.ID_TYPE_HIERARCHY);
		topLeft.addPlaceholder(IPDEUIConstants.PLUGINS_VIEW_ID);
		
		// Bottom
		IFolderLayout bottom = layout.createFolder("bottom", //$NON-NLS-1$
				IPageLayout.BOTTOM, 0.75f, editorArea);
        bottom.addView(IPageLayout.ID_PROP_SHEET);
		bottom.addView(IPageLayout.ID_PROBLEM_VIEW);
		bottom.addView("org.eclipse.pde.runtime.LogView");
		bottom.addView(JavaUI.ID_JAVADOC_VIEW);
		bottom.addPlaceholder(JavaUI.ID_SOURCE_VIEW);
		bottom.addPlaceholder(TargetStateView.VIEW_ID);
		bottom.addPlaceholder(IConsoleConstants.ID_CONSOLE_VIEW);
        
		// Bottom Right
		IFolderLayout bottomright = layout.createFolder("bottomRight", IPageLayout.RIGHT, (float) 0.60, "bottom"); //$NON-NLS-1$ //$NON-NLS-2$
		bottomright.addPlaceholder("org.eclipse.emf.ecoretools.internal.views.EClassHierarchyView");
		bottomright.addPlaceholder("org.eclipse.emf.ecoretools.internal.views.EReferencesView");
        
		// Right
		IFolderLayout outlineFolder = layout.createFolder("right", IPageLayout.RIGHT, (float)0.75, editorArea); //$NON-NLS-1$
		outlineFolder.addView(IPageLayout.ID_OUTLINE);

    }
{'fraction_non_alphanumeric': 0.10941743320192729, 'fraction_numerical': 0.0038545773105562856, 'mean_word_length': 4.196176604460629, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3147551', 'n_tokens_mistral': 3851, 'n_tokens_neox': 3703, 'n_words': 390}