org.eclipse.emf.ecp.spi.ui.util
Class ECPHandlerHelper

java.lang.Object
  extended by org.eclipse.emf.ecp.spi.ui.util.ECPHandlerHelper

public final class ECPHandlerHelper
extends Object

This is a utility class providing commonly necessary methods.

Since:
1.4
Author:
Eugen Neufeld

Method Summary
static org.eclipse.emf.ecore.EObject addModelElement(ECPProject ecpProject, org.eclipse.swt.widgets.Shell shell, boolean open)
          Add a new EObject to the root of an ECPProject.
static org.eclipse.emf.ecore.EObject addModelElement(org.eclipse.emf.ecore.resource.Resource resource, org.eclipse.swt.widgets.Shell activeShell, boolean open)
           
static void changeCloseState(ECPProject[] closeables, String currentType)
          This method closes/opens an array of ECPProject.
static void checkout(List<ECPCheckoutSource> checkoutObjects, org.eclipse.swt.widgets.Shell shell)
          This method allows to checkout a list of ECPCheckoutSource into the workspace.
static ECPProject createProject(org.eclipse.swt.widgets.Shell shell)
          This method creates a new project.
static ECPRepository createRepository(org.eclipse.swt.widgets.Shell shell)
          This method created a new Repository.
static void deleteHandlerHelper(List<ECPContainer> deletables, org.eclipse.swt.widgets.Shell shell)
          Deletes the provided ECPContainer elements.
static void deleteModelElement(ECPProject project, Collection<Object> objects)
          This helper method is used to delete model elements from a project.
static void filterProjectPackages(ECPProject ecpProject, org.eclipse.swt.widgets.Shell shell)
          This method allows the user to filter the visible packages and classes.
static void openModelElement(Object me, ECPProject ecpProject)
          This opens the model element.
static void openProjectProperties(ECPProject project, boolean editable, org.eclipse.swt.widgets.Shell shell)
          Opens a Dialog showing the properties of the provided ECPProject.
static void openRepositoryProperties(ECPRepository repository, boolean editable, org.eclipse.swt.widgets.Shell shell)
          Opens a Dialog showing the properties of the provided ECPRepository.
static void saveProject(ECPProject project)
          Triggers the save on an ECPProject.
static boolean showDirtyProjectsDialog(org.eclipse.swt.widgets.Shell shell)
          Opens a dialog to save dirty projects.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

checkout

public static void checkout(List<ECPCheckoutSource> checkoutObjects,
                            org.eclipse.swt.widgets.Shell shell)
This method allows to checkout a list of ECPCheckoutSource into the workspace.

Parameters:
checkoutObjects - the List of ECPCheckoutSource to checkout
shell - the Shell to use for diplaying UI

deleteModelElement

public static void deleteModelElement(ECPProject project,
                                      Collection<Object> objects)
This helper method is used to delete model elements from a project.

Parameters:
project - the project to delete from
objects - the model elements to delete

createProject

public static ECPProject createProject(org.eclipse.swt.widgets.Shell shell)
This method creates a new project.

Parameters:
shell - the shell for displaying the wizard
Returns:
the created ECPProject

addModelElement

public static org.eclipse.emf.ecore.EObject addModelElement(ECPProject ecpProject,
                                                            org.eclipse.swt.widgets.Shell shell,
                                                            boolean open)
Add a new EObject to the root of an ECPProject.

Parameters:
ecpProject - the ECPProject to add the EObject to
shell - the Shell used to display the UI
open - whether to open the corresponding editor or not
Returns:
the created EObject

addModelElement

public static org.eclipse.emf.ecore.EObject addModelElement(org.eclipse.emf.ecore.resource.Resource resource,
                                                            org.eclipse.swt.widgets.Shell activeShell,
                                                            boolean open)
Parameters:
resource - the resource
activeShell - current active shell
open - if model element should be directly opened in an editor after it is added to project.
Returns:
the created model element.

filterProjectPackages

public static void filterProjectPackages(ECPProject ecpProject,
                                         org.eclipse.swt.widgets.Shell shell)
This method allows the user to filter the visible packages and classes.

Parameters:
ecpProject - the project to filter
shell - the Shell to use for UI

createRepository

public static ECPRepository createRepository(org.eclipse.swt.widgets.Shell shell)
This method created a new Repository.

Parameters:
shell - the shell for the Wizard
Returns:
the created ECPRepository

changeCloseState

public static void changeCloseState(ECPProject[] closeables,
                                    String currentType)
This method closes/opens an array of ECPProject.

Parameters:
closeables - the ECPProjects to change the state for
currentType - the action to do

deleteHandlerHelper

public static void deleteHandlerHelper(List<ECPContainer> deletables,
                                       org.eclipse.swt.widgets.Shell shell)
Deletes the provided ECPContainer elements.

Parameters:
deletables - the List of ECPContainers to delete
shell - the shell to use for UI

saveProject

public static void saveProject(ECPProject project)
Triggers the save on an ECPProject.

Parameters:
project - the project to save the changes on

openModelElement

public static void openModelElement(Object me,
                                    ECPProject ecpProject)
This opens the model element.

Parameters:
me - ModelElement to open the view that requested the open model element
ecpProject - the ECPProject of the model element

openProjectProperties

public static void openProjectProperties(ECPProject project,
                                         boolean editable,
                                         org.eclipse.swt.widgets.Shell shell)
Opens a Dialog showing the properties of the provided ECPProject.

Parameters:
project - the project whose properties should be shown
editable - whether the properties should be editable
shell - the Shell to use for the dialog

openRepositoryProperties

public static void openRepositoryProperties(ECPRepository repository,
                                            boolean editable,
                                            org.eclipse.swt.widgets.Shell shell)
Opens a Dialog showing the properties of the provided ECPRepository.

Parameters:
repository - the repository whose properties should be shown
editable - whether the properties should be editable
shell - the Shell to use for the dialog

showDirtyProjectsDialog

public static boolean showDirtyProjectsDialog(org.eclipse.swt.widgets.Shell shell)
Opens a dialog to save dirty projects.

Parameters:
shell - to open the dialog in
Returns:
if the save was triggered


Copyright © 2015. All Rights Reserved.