Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorytanguy2012-01-25 17:45:25 +0000
committerytanguy2012-01-25 17:45:25 +0000
commitd9d8c7546ffa9979a8820ebe1b2d65c7c44c41de (patch)
treea8f5827edccf8ea6c02d6924c9e4d652a8578485 /plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen
parentd6564bb85aae7adaf9bc84d631f6df6eec643d2e (diff)
downloadorg.eclipse.papyrus-d9d8c7546ffa9979a8820ebe1b2d65c7c44c41de.tar.gz
org.eclipse.papyrus-d9d8c7546ffa9979a8820ebe1b2d65c7c44c41de.tar.xz
org.eclipse.papyrus-d9d8c7546ffa9979a8820ebe1b2d65c7c44c41de.zip
NEW - bug 369500: [SysML] Update to UML2.4 - Fix models and generators
https://bugs.eclipse.org/bugs/show_bug.cgi?id=369500
Diffstat (limited to 'plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen')
-rw-r--r--plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/ActionBarContributor.javajet704
-rw-r--r--plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/Advisor.javajet715
-rw-r--r--plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/Editor.javajet2397
-rw-r--r--plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/EntryPoint.javajet90
-rw-r--r--plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/ModelFile.gifbin346 -> 0 bytes
-rw-r--r--plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/ModelWizard.javajet976
-rw-r--r--plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/NewModel.gifbin2462 -> 0 bytes
-rw-r--r--plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/Plugin.javajet139
-rw-r--r--plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/appengine-web.xmljet24
-rw-r--r--plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/build.propertiesjet35
-rw-r--r--plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/home.htmljet86
-rw-r--r--plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/manifest.mfjet80
-rw-r--r--plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/module.gwt.xmljet35
-rw-r--r--plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/plugin.propertiesjet118
-rw-r--r--plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/plugin.xmljet253
-rw-r--r--plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/web.xmljet36
-rw-r--r--plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/model.tests/ModelTestSuite.javajet79
-rw-r--r--plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/model.tests/PackageExample.javajet205
-rw-r--r--plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/model.tests/PackageTestSuite.javajet79
-rw-r--r--plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/model.tests/TestCase.javajet318
-rw-r--r--plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/model.tests/build.propertiesjet33
-rw-r--r--plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/model.tests/manifest.mfjet43
-rw-r--r--plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/model.tests/plugin.propertiesjet22
-rw-r--r--plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/model.tests/plugin.xmljet50
24 files changed, 0 insertions, 6517 deletions
diff --git a/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/ActionBarContributor.javajet b/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/ActionBarContributor.javajet
deleted file mode 100644
index e6338f6935e..00000000000
--- a/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/ActionBarContributor.javajet
+++ /dev/null
@@ -1,704 +0,0 @@
-<%@ jet package="org.eclipse.emf.codegen.ecore.templates.editor" imports="org.eclipse.emf.codegen.ecore.genmodel.*" class="ActionBarContributor" version="$Id: ActionBarContributor.javajet,v 1.23 2008/03/10 19:10:25 emerks Exp $" %>
-<%
-/**
- * <copyright>
- *
- * Copyright (c) 2002-2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- *
- * </copyright>
- */
-%>
-<%GenPackage genPackage = (GenPackage)argument; GenModel genModel=genPackage.getGenModel();%>
-<%
-String _CollectionOfAnything = null;
-String _CollectionOfIAction = null;
-String _ArrayListOfIAction = null;
-String _CollectionOfExtendsIAction = null;
-String _IteratorOfIAction = null;
-String _MapOfStringToCollectionOfIAction = null;
-String _MapEntryOfStringToCollectionOfIAction = null;
-String _LinkedHashMapOfStringToCollectionOfIAction = null;
-if (genModel.isCreationCommands())
-{
- _CollectionOfAnything = genModel.getImportedName("Collection" + (genModel.useGenerics() ? "<?>" : ""));
- _CollectionOfIAction = genModel.getImportedName(genModel.useGenerics() ? "java.util.Collection<org.eclipse.jface.action.IAction>" : "java.util.Collection");
- _ArrayListOfIAction = genModel.getImportedName(genModel.useGenerics() ? "java.util.ArrayList<org.eclipse.jface.action.IAction>" : "java.util.ArrayList");
- _CollectionOfExtendsIAction = genModel.getImportedName(genModel.useGenerics() ? "java.util.Collection<? extends org.eclipse.jface.action.IAction>" : "java.util.Collection");
- if (genModel.isCreationSubmenus())
- {
- _IteratorOfIAction = genModel.getImportedName(genModel.useGenerics() ? "java.util.Iterator<org.eclipse.jface.action.IAction>" : "java.util.Iterator");
- _MapOfStringToCollectionOfIAction = genModel.getImportedName("java.util.Map") + (genModel.useGenerics() ? ("<String, " + _CollectionOfIAction + ">") : "");
- _MapEntryOfStringToCollectionOfIAction = genModel.getImportedName("java.util.Map") + ".Entry" + (genModel.useGenerics() ? ("<String, " + _CollectionOfIAction + ">") : "");
- _LinkedHashMapOfStringToCollectionOfIAction = genModel.getImportedName("java.util.LinkedHashMap") + (genModel.useGenerics() ? ("<String, " + _CollectionOfIAction + ">") : "");
- }
-}
-%>
-<%@ include file="../Header.javajetinc"%>
-package <%=genPackage.getPresentationPackageName()%>;
-
-<%genModel.markImportLocation(stringBuffer);%>
-
-/**
- * This is the action bar contributor for the <%=genPackage.getPrefix()%> model editor.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-public class <%=genPackage.getActionBarContributorClassName()%>
- extends <%=genModel.getImportedName("org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor")%>
- implements <%=genModel.getImportedName("org.eclipse.jface.viewers.ISelectionChangedListener")%>
-{
-<%if (genModel.hasCopyrightField()) {%>
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = <%=genModel.getCopyrightFieldLiteral()%>;<%=genModel.getNonNLS()%>
-
-<%}%>
-<%if (genModel.isRichClientPlatform() && genPackage.isGenerateModelWizard()) {%>
- /**
- * Action to create objects from the <%=genPackage.getPrefix()%> model.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static class NewAction extends <%=genModel.getImportedName("org.eclipse.emf.common.ui.action.WorkbenchWindowActionDelegate")%>
- {
- /**
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void run(<%=genModel.getImportedName("org.eclipse.jface.action.IAction")%> action)
- {
- <%=genPackage.getModelWizardClassName()%> wizard = new <%=genPackage.getModelWizardClassName()%>();
- wizard.init(getWindow().getWorkbench(), <%=genModel.getImportedName("org.eclipse.jface.viewers.StructuredSelection")%>.EMPTY);
- <%=genModel.getImportedName("org.eclipse.jface.wizard.WizardDialog")%> wizardDialog = new <%=genModel.getImportedName("org.eclipse.jface.wizard.WizardDialog")%>(getWindow().getShell(), wizard);
- wizardDialog.open();
- }
- }
-
-<%}%>
- /**
- * This keeps track of the active editor.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected <%=genModel.getImportedName("org.eclipse.ui.IEditorPart")%> activeEditorPart;
-
- /**
- * This keeps track of the current selection provider.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected <%=genModel.getImportedName("org.eclipse.jface.viewers.ISelectionProvider")%> selectionProvider;
-
- /**
- * This action opens the Properties view.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected <%=genModel.getImportedName("org.eclipse.jface.action.IAction")%> showPropertiesViewAction =
- new <%=genModel.getImportedName("org.eclipse.jface.action.Action")%>(<%=genPackage.getImportedEditorPluginClassName()%>.INSTANCE.getString("_UI_ShowPropertiesView_menu_item"))<%=genModel.getNonNLS()%>
- {
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- public void run()
- {
- try
- {
- getPage().showView("org.eclipse.ui.views.PropertySheet");<%=genModel.getNonNLS()%>
- }
- catch (<%=genModel.getImportedName("org.eclipse.ui.PartInitException")%> exception)
- {
- <%=genPackage.getImportedEditorPluginClassName()%>.INSTANCE.log(exception);
- }
- }
- };
-
- /**
- * This action refreshes the viewer of the current editor if the editor
- * implements {@link org.eclipse.emf.common.ui.viewer.IViewerProvider}.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected <%=genModel.getImportedName("org.eclipse.jface.action.IAction")%> refreshViewerAction =
- new <%=genModel.getImportedName("org.eclipse.jface.action.Action")%>(<%=genPackage.getImportedEditorPluginClassName()%>.INSTANCE.getString("_UI_RefreshViewer_menu_item"))<%=genModel.getNonNLS()%>
- {
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- public boolean isEnabled()
- {
- return activeEditorPart instanceof <%=genModel.getImportedName("org.eclipse.emf.common.ui.viewer.IViewerProvider")%>;
- }
-
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- public void run()
- {
- if (activeEditorPart instanceof <%=genModel.getImportedName("org.eclipse.emf.common.ui.viewer.IViewerProvider")%>)
- {
- <%=genModel.getImportedName("org.eclipse.jface.viewers.Viewer")%> viewer = ((<%=genModel.getImportedName("org.eclipse.emf.common.ui.viewer.IViewerProvider")%>)activeEditorPart).getViewer();
- if (viewer != null)
- {
- viewer.refresh();
- }
- }
- }
- };
-
-<%if (genModel.isCreationCommands()) {%>
- /**
- * This will contain one {@link org.eclipse.emf.edit.ui.action.CreateChildAction} corresponding to each descriptor
- * generated for the current selection by the item provider.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected <%=_CollectionOfIAction%> createChildActions;
-
- <%if (genModel.isCreationSubmenus()) {%>
- /**
- * This will contain a map of {@link org.eclipse.emf.edit.ui.action.CreateChildAction}s, keyed by sub-menu text.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected <%=_MapOfStringToCollectionOfIAction%> createChildSubmenuActions;
-
- <%}%>
- /**
- * This is the menu manager into which menu contribution items should be added for CreateChild actions.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected <%=genModel.getImportedName("org.eclipse.jface.action.IMenuManager")%> createChildMenuManager;
-
- /**
- * This will contain one {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} corresponding to each descriptor
- * generated for the current selection by the item provider.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected <%=_CollectionOfIAction%> createSiblingActions;
-
- <%if (genModel.isCreationSubmenus()) {%>
- /**
- * This will contain a map of {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction}s, keyed by submenu text.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected <%=_MapOfStringToCollectionOfIAction%> createSiblingSubmenuActions;
-
- <%}%>
- /**
- * This is the menu manager into which menu contribution items should be added for CreateSibling actions.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected <%=genModel.getImportedName("org.eclipse.jface.action.IMenuManager")%> createSiblingMenuManager;
-
-<%}%>
- /**
- * This creates an instance of the contributor.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public <%=genPackage.getActionBarContributorClassName()%>()
- {
- super(ADDITIONS_LAST_STYLE);
- loadResourceAction = new <%=genModel.getImportedName("org.eclipse.emf.edit.ui.action.LoadResourceAction")%>();
- validateAction = new <%=genModel.getImportedName("org.eclipse.emf.edit.ui.action.ValidateAction")%>();
- controlAction = new <%=genModel.getImportedName("org.eclipse.emf.edit.ui.action.ControlAction")%>();
- }
-
- /**
- * This adds Separators for editor additions to the tool bar.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- public void contributeToToolBar(<%=genModel.getImportedName("org.eclipse.jface.action.IToolBarManager")%> toolBarManager)
- {
- toolBarManager.add(new <%=genModel.getImportedName("org.eclipse.jface.action.Separator")%>("<%=genPackage.getPrefix().toLowerCase(genModel.getLocale())%>-settings"));<%=genModel.getNonNLS()%>
- toolBarManager.add(new <%=genModel.getImportedName("org.eclipse.jface.action.Separator")%>("<%=genPackage.getPrefix().toLowerCase(genModel.getLocale())%>-additions"));<%=genModel.getNonNLS()%>
- }
-
- /**
- * This adds to the menu bar a menu and some separators for editor additions,
- * as well as the sub-menus for object creation items.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- public void contributeToMenu(<%=genModel.getImportedName("org.eclipse.jface.action.IMenuManager")%> menuManager)
- {
- super.contributeToMenu(menuManager);
-
- <%=genModel.getImportedName("org.eclipse.jface.action.IMenuManager")%> submenuManager = new <%=genModel.getImportedName("org.eclipse.jface.action.MenuManager")%>(<%=genPackage.getImportedEditorPluginClassName()%>.INSTANCE.getString("_UI_<%=genPackage.getEditorClassName()%>_menu"), "<%=genPackage.getInterfacePackageName()%>MenuID");<%=genModel.getNonNLS()%><%=genModel.getNonNLS(2)%>
- menuManager.insertAfter("additions", submenuManager);<%=genModel.getNonNLS()%>
- submenuManager.add(new <%=genModel.getImportedName("org.eclipse.jface.action.Separator")%>("settings"));<%=genModel.getNonNLS()%>
- submenuManager.add(new <%=genModel.getImportedName("org.eclipse.jface.action.Separator")%>("actions"));<%=genModel.getNonNLS()%>
- submenuManager.add(new <%=genModel.getImportedName("org.eclipse.jface.action.Separator")%>("additions"));<%=genModel.getNonNLS()%>
- submenuManager.add(new <%=genModel.getImportedName("org.eclipse.jface.action.Separator")%>("additions-end"));<%=genModel.getNonNLS()%>
-
-<%if (genModel.isCreationCommands()) {%>
- // Prepare for CreateChild item addition or removal.
- //
- createChildMenuManager = new <%=genModel.getImportedName("org.eclipse.jface.action.MenuManager")%>(<%=genPackage.getImportedEditorPluginClassName()%>.INSTANCE.getString("_UI_CreateChild_menu_item"));<%=genModel.getNonNLS()%>
- submenuManager.insertBefore("additions", createChildMenuManager);<%=genModel.getNonNLS()%>
-
- // Prepare for CreateSibling item addition or removal.
- //
- createSiblingMenuManager = new <%=genModel.getImportedName("org.eclipse.jface.action.MenuManager")%>(<%=genPackage.getImportedEditorPluginClassName()%>.INSTANCE.getString("_UI_CreateSibling_menu_item"));<%=genModel.getNonNLS()%>
- submenuManager.insertBefore("additions", createSiblingMenuManager);<%=genModel.getNonNLS()%>
-
- // Force an update because Eclipse hides empty menus now.
- //
- submenuManager.addMenuListener
- (new <%=genModel.getImportedName("org.eclipse.jface.action.IMenuListener")%>()
- {
- public void menuAboutToShow(<%=genModel.getImportedName("org.eclipse.jface.action.IMenuManager")%> menuManager)
- {
- menuManager.updateAll(true);
- }
- });
-
-<%} else {%>
- // Add your contributions.
- // Ensure that you remove @generated or mark it @generated NOT
-
-<%}%>
- addGlobalActions(submenuManager);
- }
-
- /**
- * When the active editor changes, this remembers the change and registers with it as a selection provider.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- public void setActiveEditor(<%=genModel.getImportedName("org.eclipse.ui.IEditorPart")%> part)
- {
- super.setActiveEditor(part);
- activeEditorPart = part;
-
- // Switch to the new selection provider.
- //
- if (selectionProvider != null)
- {
- selectionProvider.removeSelectionChangedListener(this);
- }
- if (part == null)
- {
- selectionProvider = null;
- }
- else
- {
- selectionProvider = part.getSite().getSelectionProvider();
- selectionProvider.addSelectionChangedListener(this);
-
- // Fake a selection changed event to update the menus.
- //
- if (selectionProvider.getSelection() != null)
- {
- selectionChanged(new <%=genModel.getImportedName("org.eclipse.jface.viewers.SelectionChangedEvent")%>(selectionProvider, selectionProvider.getSelection()));
- }
- }
- }
-
- /**
- * This implements {@link org.eclipse.jface.viewers.ISelectionChangedListener},
- * handling {@link org.eclipse.jface.viewers.SelectionChangedEvent}s by querying for the children and siblings
- * that can be added to the selected object and updating the menus accordingly.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void selectionChanged(<%=genModel.getImportedName("org.eclipse.jface.viewers.SelectionChangedEvent")%> event)
- {
-<%if (genModel.isCreationCommands()) {%>
- // Remove any menu items for old selection.
- //
- if (createChildMenuManager != null)
- {
- <%if (genModel.isCreationSubmenus()) {%>
- depopulateManager(createChildMenuManager, createChildSubmenuActions);
- <%}%>
- depopulateManager(createChildMenuManager, createChildActions);
- }
- if (createSiblingMenuManager != null)
- {
- <%if (genModel.isCreationSubmenus()) {%>
- depopulateManager(createSiblingMenuManager, createSiblingSubmenuActions);
- <%}%>
- depopulateManager(createSiblingMenuManager, createSiblingActions);
- }
-
- // Query the new selection for appropriate new child/sibling descriptors
- //
- <%=_CollectionOfAnything%> newChildDescriptors = null;
- <%=_CollectionOfAnything%> newSiblingDescriptors = null;
-
- <%=genModel.getImportedName("org.eclipse.jface.viewers.ISelection")%> selection = event.getSelection();
- if (selection instanceof <%=genModel.getImportedName("org.eclipse.jface.viewers.IStructuredSelection")%> && ((IStructuredSelection)selection).size() == 1)
- {
- Object object = ((<%=genModel.getImportedName("org.eclipse.jface.viewers.IStructuredSelection")%>)selection).getFirstElement();
-
- <%=genModel.getImportedName("org.eclipse.emf.edit.domain.EditingDomain")%> domain = ((<%=genModel.getImportedName("org.eclipse.emf.edit.domain.IEditingDomainProvider")%>)activeEditorPart).getEditingDomain();
-
- newChildDescriptors = domain.getNewChildDescriptors(object, null);
- newSiblingDescriptors = domain.getNewChildDescriptors(null, object);
- }
-
- // Generate actions for selection; populate and redraw the menus.
- //
- createChildActions = generateCreateChildActions(newChildDescriptors, selection);
- <%if (genModel.isCreationSubmenus()) {%>
- createChildSubmenuActions = extractSubmenuActions(createChildActions);
- <%}%>
- createSiblingActions = generateCreateSiblingActions(newSiblingDescriptors, selection);
- <%if (genModel.isCreationSubmenus()) {%>
- createSiblingSubmenuActions = extractSubmenuActions(createSiblingActions);
- <%}%>
-
- if (createChildMenuManager != null)
- {
- <%if (genModel.isCreationSubmenus()) {%>
- populateManager(createChildMenuManager, createChildSubmenuActions, null);
- <%}%>
- populateManager(createChildMenuManager, createChildActions, null);
- createChildMenuManager.update(true);
- }
- if (createSiblingMenuManager != null)
- {
- <%if (genModel.isCreationSubmenus()) {%>
- populateManager(createSiblingMenuManager, createSiblingSubmenuActions, null);
- <%}%>
- populateManager(createSiblingMenuManager, createSiblingActions, null);
- createSiblingMenuManager.update(true);
- }
-<%} else {%>
- // Add your contributions.
- // Ensure that you remove @generated or mark it @generated NOT
-<%}%>
- }
-
-<%if (genModel.isCreationCommands()) {%>
- /**
- * This generates a {@link org.eclipse.emf.edit.ui.action.CreateChildAction} for each object in <code>descriptors</code>,
- * and returns the collection of these actions.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected <%=_CollectionOfIAction%> generateCreateChildActions(<%=_CollectionOfAnything%> descriptors, <%=genModel.getImportedName("org.eclipse.jface.viewers.ISelection")%> selection)
- {
- <%=_CollectionOfIAction%> actions = new <%=_ArrayListOfIAction%>();
- if (descriptors != null)
- {
-<%if (genModel.useGenerics()) {%>
- for (<%=genModel.getImportedName("java.lang.Object")%> descriptor : descriptors)
-<%} else {%>
- for (<%=genModel.getImportedName("java.util.Iterator")%> i = descriptors.iterator(); i.hasNext(); )
-<%}%>
- {
- actions.add(new <%=genModel.getImportedName("org.eclipse.emf.edit.ui.action.CreateChildAction")%>(activeEditorPart, selection, <%if (genModel.useGenerics()) {%>descriptor<%} else {%>i.next()<%}%>));
- }
- }
- return actions;
- }
-
- /**
- * This generates a {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} for each object in <code>descriptors</code>,
- * and returns the collection of these actions.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected <%=_CollectionOfIAction%> generateCreateSiblingActions(<%=_CollectionOfAnything%> descriptors, <%=genModel.getImportedName("org.eclipse.jface.viewers.ISelection")%> selection)
- {
- <%=_CollectionOfIAction%> actions = new <%=_ArrayListOfIAction%>();
- if (descriptors != null)
- {
-<%if (genModel.useGenerics()) {%>
- for (<%=genModel.getImportedName("java.lang.Object")%> descriptor : descriptors)
-<%} else {%>
- for (<%=genModel.getImportedName("java.util.Iterator")%> i = descriptors.iterator(); i.hasNext(); )
-<%}%>
- {
- actions.add(new <%=genModel.getImportedName("org.eclipse.emf.edit.ui.action.CreateSiblingAction")%>(activeEditorPart, selection, <%if (genModel.useGenerics()) {%>descriptor<%} else {%>i.next()<%}%>));
- }
- }
- return actions;
- }
-
- /**
- * This populates the specified <code>manager</code> with {@link org.eclipse.jface.action.ActionContributionItem}s
- * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection,
- * by inserting them before the specified contribution item <code>contributionID</code>.
- * If <code>contributionID</code> is <code>null</code>, they are simply added.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected void populateManager(<%=genModel.getImportedName("org.eclipse.jface.action.IContributionManager")%> manager, <%=_CollectionOfExtendsIAction%> actions, String contributionID)
- {
- if (actions != null)
- {
-<%if (genModel.useGenerics()) {%>
- for (<%=genModel.getImportedName("org.eclipse.jface.action.IAction")%> action : actions)
-<%} else {%>
- for (<%=genModel.getImportedName("java.util.Iterator")%> i = actions.iterator(); i.hasNext(); )
-<%}%>
- {
-<%if (!genModel.useGenerics()) {%>
- <%=genModel.getImportedName("org.eclipse.jface.action.IAction")%> action = (IAction)i.next();
-<%}%>
- if (contributionID != null)
- {
- manager.insertBefore(contributionID, action);
- }
- else
- {
- manager.add(action);
- }
- }
- }
- }
-
- /**
- * This removes from the specified <code>manager</code> all {@link org.eclipse.jface.action.ActionContributionItem}s
- * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected void depopulateManager(<%=genModel.getImportedName("org.eclipse.jface.action.IContributionManager")%> manager, <%=_CollectionOfExtendsIAction%> actions)
- {
- if (actions != null)
- {
- <%=genModel.getImportedName("org.eclipse.jface.action.IContributionItem")%>[] items = manager.getItems();
- for (int i = 0; i < items.length; i++)
- {
- // Look into SubContributionItems
- //
- <%=genModel.getImportedName("org.eclipse.jface.action.IContributionItem")%> contributionItem = items[i];
- while (contributionItem instanceof <%=genModel.getImportedName("org.eclipse.jface.action.SubContributionItem")%>)
- {
- contributionItem = ((<%=genModel.getImportedName("org.eclipse.jface.action.SubContributionItem")%>)contributionItem).getInnerItem();
- }
-
- // Delete the ActionContributionItems with matching action.
- //
- if (contributionItem instanceof <%=genModel.getImportedName("org.eclipse.jface.action.ActionContributionItem")%>)
- {
- <%=genModel.getImportedName("org.eclipse.jface.action.IAction")%> action = ((<%=genModel.getImportedName("org.eclipse.jface.action.ActionContributionItem")%>)contributionItem).getAction();
- if (actions.contains(action))
- {
- manager.remove(contributionItem);
- }
- }
- }
- }
- }
-
- <%if (genModel.isCreationSubmenus()) {%>
- /**
- * This extracts those actions in the <code>submenuActions</code> collection whose text is qualified and returns
- * a map of these actions, keyed by submenu text.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected <%=_MapOfStringToCollectionOfIAction%> extractSubmenuActions(<%=_CollectionOfIAction%> createActions)
- {
- <%=_MapOfStringToCollectionOfIAction%> createSubmenuActions = new <%=_LinkedHashMapOfStringToCollectionOfIAction%>();
- if (createActions != null)
- {
- for (<%=_IteratorOfIAction%> actions = createActions.iterator(); actions.hasNext(); )
- {
- <%=genModel.getImportedName("org.eclipse.jface.action.IAction")%> action = <%if (!genModel.useGenerics()) {%>(<%=genModel.getImportedName("org.eclipse.jface.action.IAction")%>)<%}%>actions.next();
- <%=genModel.getImportedName("java.util.StringTokenizer")%> st = new <%=genModel.getImportedName("java.util.StringTokenizer")%>(action.getText(), "|");<%=genModel.getNonNLS()%>
- if (st.countTokens() == 2)
- {
- String text = st.nextToken().trim();
- <%=_CollectionOfIAction%> submenuActions = <%if (!genModel.useGenerics()) {%>(<%=_CollectionOfIAction%>)<%}%>createSubmenuActions.get(text);
- if (submenuActions == null)
- {
- createSubmenuActions.put(text, submenuActions = new <%=_ArrayListOfIAction%>());
- }
- action.setText(st.nextToken().trim());
- submenuActions.add(action);
- actions.remove();
- }
- }
- }
- return createSubmenuActions;
- }
-
- /**
- * This populates the specified <code>manager</code> with {@link org.eclipse.jface.action.MenuManager}s containing
- * {@link org.eclipse.jface.action.ActionContributionItem}s based on the {@link org.eclipse.jface.action.IAction}s
- * contained in the <code>submenuActions</code> collection, by inserting them before the specified contribution
- * item <code>contributionID</code>.
- * If <code>contributionID</code> is <code>null</code>, they are simply added.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected void populateManager(<%=genModel.getImportedName("org.eclipse.jface.action.IContributionManager")%> manager, <%=_MapOfStringToCollectionOfIAction%> submenuActions, String contributionID)
- {
- if (submenuActions != null)
- {
- <%if (genModel.getComplianceLevel().getValue() >= GenJDKLevel.JDK50) {%>
- for (<%=_MapEntryOfStringToCollectionOfIAction%> entry : submenuActions.entrySet())
- {
- <%} else {%>
- for (<%=genModel.getImportedName("java.util.Iterator")%> entries = submenuActions.entrySet().iterator(); entries.hasNext();)
- {
- <%=_MapEntryOfStringToCollectionOfIAction%> entry = (<%=_MapEntryOfStringToCollectionOfIAction%>)entries.next();
- <%}%>
- <%=genModel.getImportedName("org.eclipse.jface.action.MenuManager")%> submenuManager = new <%=genModel.getImportedName("org.eclipse.jface.action.MenuManager")%>(<%if (!genModel.useGenerics()) {%>(String)<%}%>entry.getKey());
- if (contributionID != null)
- {
- manager.insertBefore(contributionID, submenuManager);
- }
- else
- {
- manager.add(submenuManager);
- }
- populateManager(submenuManager, <%if (!genModel.useGenerics()) {%>(<%=_CollectionOfIAction%>)<%}%>entry.getValue(), null);
- }
- }
- }
-
- /**
- * This removes from the specified <code>manager</code> all {@link org.eclipse.jface.action.MenuManager}s and their
- * {@link org.eclipse.jface.action.ActionContributionItem}s based on the {@link org.eclipse.jface.action.IAction}s
- * contained in the <code>submenuActions</code> map.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected void depopulateManager(<%=genModel.getImportedName("org.eclipse.jface.action.IContributionManager")%> manager, <%=_MapOfStringToCollectionOfIAction%> submenuActions)
- {
- if (submenuActions != null)
- {
- <%=genModel.getImportedName("org.eclipse.jface.action.IContributionItem")%>[] items = manager.getItems();
- for (int i = 0; i < items.length; i++)
- {
- <%=genModel.getImportedName("org.eclipse.jface.action.IContributionItem")%> contributionItem = items[i];
- if (contributionItem instanceof <%=genModel.getImportedName("org.eclipse.jface.action.MenuManager")%>)
- {
- <%=genModel.getImportedName("org.eclipse.jface.action.MenuManager")%> submenuManager = (<%=genModel.getImportedName("org.eclipse.jface.action.MenuManager")%>)contributionItem;
- if (submenuActions.containsKey(submenuManager.getMenuText()))
- {
- depopulateManager(submenuManager, <%if (!genModel.useGenerics()) {%>(<%=_CollectionOfIAction%>)<%}%>submenuActions.get(contributionItem));
- manager.remove(contributionItem);
- }
- }
- }
- }
- }
-
- <%}%>
-<%}%>
- /**
- * This populates the pop-up menu before it appears.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- public void menuAboutToShow(<%=genModel.getImportedName("org.eclipse.jface.action.IMenuManager")%> menuManager)
- {
- super.menuAboutToShow(menuManager);
-<%if (genModel.isCreationCommands()) {%>
- <%=genModel.getImportedName("org.eclipse.jface.action.MenuManager")%> submenuManager = null;
-
- submenuManager = new <%=genModel.getImportedName("org.eclipse.jface.action.MenuManager")%>(<%=genPackage.getImportedEditorPluginClassName()%>.INSTANCE.getString("_UI_CreateChild_menu_item"));<%=genModel.getNonNLS()%>
- <%if (genModel.isCreationSubmenus()) {%>
- populateManager(submenuManager, createChildSubmenuActions, null);
- <%}%>
- populateManager(submenuManager, createChildActions, null);
- menuManager.insertBefore("edit", submenuManager);<%=genModel.getNonNLS()%>
-
- submenuManager = new <%=genModel.getImportedName("org.eclipse.jface.action.MenuManager")%>(<%=genPackage.getImportedEditorPluginClassName()%>.INSTANCE.getString("_UI_CreateSibling_menu_item"));<%=genModel.getNonNLS()%>
- <%if (genModel.isCreationSubmenus()) {%>
- populateManager(submenuManager, createSiblingSubmenuActions, null);
- <%}%>
- populateManager(submenuManager, createSiblingActions, null);
- menuManager.insertBefore("edit", submenuManager);<%=genModel.getNonNLS()%>
-<%}%>
- }
-
- /**
- * This inserts global actions before the "additions-end" separator.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- protected void addGlobalActions(<%=genModel.getImportedName("org.eclipse.jface.action.IMenuManager")%> menuManager)
- {
- menuManager.insertAfter("additions-end", new <%=genModel.getImportedName("org.eclipse.jface.action.Separator")%>("ui-actions"));<%=genModel.getNonNLS()%><%=genModel.getNonNLS(2)%>
- menuManager.insertAfter("ui-actions", showPropertiesViewAction);<%=genModel.getNonNLS()%>
-
- refreshViewerAction.setEnabled(refreshViewerAction.isEnabled());
- menuManager.insertAfter("ui-actions", refreshViewerAction);<%=genModel.getNonNLS()%>
-
- super.addGlobalActions(menuManager);
- }
-
- /**
- * This ensures that a delete action will clean up all references to deleted objects.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- protected boolean removeAllReferencesOnDelete()
- {
- return true;
- }
-
-}
-<%genModel.emitSortedImports();%> \ No newline at end of file
diff --git a/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/Advisor.javajet b/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/Advisor.javajet
deleted file mode 100644
index 392b041992f..00000000000
--- a/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/Advisor.javajet
+++ /dev/null
@@ -1,715 +0,0 @@
-<%@ jet package="org.eclipse.emf.codegen.ecore.templates.editor" imports="org.eclipse.emf.codegen.ecore.genmodel.*" class="Advisor" version="$Id: Advisor.javajet,v 1.12 2010/03/11 02:31:37 khussey Exp $" %>
-<%
-/**
- * <copyright>
- *
- * Copyright (c) 2004-2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- *
- * </copyright>
- */
-%>
-<%GenModel genModel = (GenModel)argument;%>
-<%String _ListOfString = "List" + (genModel.useGenerics() ? "<String>" : "");%>
-<%String _UniqueEListOfString = "UniqueEList" + (genModel.useGenerics() ? "<String>" : "");%>
-<%String _StringBuilder = genModel.getImportedName(genModel.useGenerics() ? "java.lang.StringBuilder" : "java.lang.StringBuffer");%>
-<%@ include file="../Header.javajetinc"%>
-package <%=genModel.getEditorPluginPackageName()%>;
-
-<%if (!genModel.isRichAjaxPlatform()) {%>
-import java.io.File;
-import java.util.Arrays;
-<%}%>
-<%if (!genModel.useGenerics()) {%>
-import java.util.Iterator;
-<%}%>
-<%if (genModel.getAllGenPackagesWithConcreteClasses().size() > 1) {%>
-import java.util.List;
-<%}%>
-
-import org.eclipse.equinox.app.IApplication;
-import org.eclipse.equinox.app.IApplicationContext;
-
-import org.eclipse.jface.action.GroupMarker;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.window.Window;
-<%if (!genModel.isRichAjaxPlatform()) {%>
-import org.eclipse.swt.SWT;
-<%}%>
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Display;
-<%if (!genModel.isRichAjaxPlatform()) {%>
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Shell;
-<%}%>
-import org.eclipse.ui.IEditorDescriptor;
-import org.eclipse.ui.IFolderLayout;
-import org.eclipse.ui.IPageLayout;
-import org.eclipse.ui.IPerspectiveFactory;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.ActionFactory;
-<%if (!genModel.isRichAjaxPlatform()) {%>
-import org.eclipse.ui.actions.ContributionItemFactory;
-<%}%>
-import org.eclipse.ui.application.ActionBarAdvisor;
-import org.eclipse.ui.application.IActionBarConfigurer;
-import org.eclipse.ui.application.IWorkbenchConfigurer;
-import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
-import org.eclipse.ui.application.WorkbenchAdvisor;
-import org.eclipse.ui.application.WorkbenchWindowAdvisor;
-
-import org.eclipse.emf.common.ui.URIEditorInput;
-import org.eclipse.emf.common.ui.action.WorkbenchWindowActionDelegate;
-import org.eclipse.emf.common.util.URI;
-<%if (genModel.getAllGenPackagesWithConcreteClasses().size() > 1) {%>
-import org.eclipse.emf.common.util.UniqueEList;
-<%}%>
-import org.eclipse.emf.edit.ui.action.LoadResourceAction;
-import org.eclipse.emf.edit.ui.util.EditUIUtil;
-
-import <%=genModel.getQualifiedEditorPluginClassName()%>;
-<%genModel.markImportLocation(stringBuffer);%>
-
-
-/**
- * Customized {@link WorkbenchAdvisor} for the RCP application.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-public final class <%=genModel.getEditorAdvisorClassName()%> extends WorkbenchAdvisor
-{
-<%if (genModel.hasCopyrightField()) {%>
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String copyright = <%=genModel.getCopyrightFieldLiteral()%>;<%=genModel.getNonNLS()%>
-
-<%}%>
-<%if (!genModel.isRichAjaxPlatform()) {%>
- /**
- * The default file extension filters for use in dialogs.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- <%if (genModel.getAllGenPackagesWithConcreteClasses().size() == 1) {%>
- private static final String[] FILE_EXTENSION_FILTERS = <%if (!genModel.useGenerics()) {%>(String[])<%}%><%=genModel.getAllGenPackagesWithConcreteClasses().get(0).getImportedEditorClassName()%>.FILE_EXTENSION_FILTERS.toArray(new String[0]);
- <%} else {%>
- private static final String[] FILE_EXTENSION_FILTERS = getFileExtensionFilters();
-
- /**
- * Returns the default file extension filters. This method should only be used to initialize {@link #FILE_EXTENSION_FILTERS}.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static String[] getFileExtensionFilters()
- {
- <%=_ListOfString%> result = new <%=_UniqueEListOfString%>();
- <%for (GenPackage genPackage : genModel.getAllGenPackagesWithConcreteClasses()) {%>
- result.addAll(<%=genPackage.getImportedEditorClassName()%>.FILE_EXTENSION_FILTERS);
- <%}%>
- return <%if (!genModel.useGenerics()) {%>(String[])<%}%>result.toArray(new String[0]);
- }
- <%}%>
-<%}%>
-
- /**
- * This looks up a string in the plugin's plugin.properties file.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static String getString(String key)
- {
- return <%=genModel.getEditorPluginClassName()%>.INSTANCE.getString(key);
- }
-
- /**
- * This looks up a string in plugin.properties, making a substitution.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static String getString(String key, Object s1)
- {
- return <%=genModel.getQualifiedEditorPluginClassName()%>.INSTANCE.getString(key, new Object [] { s1 });
- }
-
- /**
- * RCP's application
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static class Application implements IApplication
- {
- /**
- * @see org.eclipse.equinox.app.IApplication#start(org.eclipse.equinox.app.IApplicationContext)
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Object start(IApplicationContext context) throws Exception
- {
- WorkbenchAdvisor workbenchAdvisor = new <%=genModel.getEditorAdvisorClassName()%>();
- Display display = PlatformUI.createDisplay();
- try
- {
- int returnCode = PlatformUI.createAndRunWorkbench(display, workbenchAdvisor);
- if (returnCode == PlatformUI.RETURN_RESTART)
- {
- return IApplication.EXIT_RESTART;
- }
- else
- {
- return IApplication.EXIT_OK;
- }
- }
- finally
- {
- display.dispose();
- }
- }
-
- /**
- * @see org.eclipse.equinox.app.IApplication#stop()
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void stop()
- {
- // Do nothing.
- }
- }
-
- /**
- * RCP's perspective
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static class Perspective implements IPerspectiveFactory
- {
- /**
- * Perspective ID
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String ID_PERSPECTIVE = "<%=genModel.getQualifiedEditorAdvisorClassName()%>Perspective";<%=genModel.getNonNLS()%>
-
- /**
- * @see org.eclipse.ui.IPerspectiveFactory#createInitialLayout(org.eclipse.ui.IPageLayout)
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void createInitialLayout(IPageLayout layout)
- {
- layout.setEditorAreaVisible(true);
- layout.addPerspectiveShortcut(ID_PERSPECTIVE);
-
- IFolderLayout right = layout.createFolder("right", IPageLayout.RIGHT, (float)0.66, layout.getEditorArea());<%=genModel.getNonNLS()%>
- right.addView(IPageLayout.ID_OUTLINE);
-
- IFolderLayout bottonRight = layout.createFolder("bottonRight", IPageLayout.BOTTOM, (float)0.60, "right");<%=genModel.getNonNLS()%><%=genModel.getNonNLS(2)%>
- bottonRight.addView(IPageLayout.ID_PROP_SHEET);
- }
- }
-
- /**
- * RCP's window advisor
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static class WindowAdvisor extends WorkbenchWindowAdvisor
- {
- /**
- * @see WorkbenchWindowAdvisor#WorkbenchWindowAdvisor(org.eclipse.ui.application.IWorkbenchWindowConfigurer)
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public WindowAdvisor(IWorkbenchWindowConfigurer configurer)
- {
- super(configurer);
- }
-
- /**
- * @see org.eclipse.ui.application.WorkbenchWindowAdvisor#preWindowOpen()
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- public void preWindowOpen()
- {
- IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
- configurer.setInitialSize(new Point(600, 450));
- configurer.setShowCoolBar(false);
- configurer.setShowStatusLine(true);
- configurer.setTitle(getString("_UI_Application_title"));<%=genModel.getNonNLS()%>
- }
-
- /**
- * @see org.eclipse.ui.application.WorkbenchWindowAdvisor#createActionBarAdvisor(org.eclipse.ui.application.IActionBarConfigurer)
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- public ActionBarAdvisor createActionBarAdvisor(IActionBarConfigurer configurer)
- {
- return new WindowActionBarAdvisor(configurer);
- }
- }
-
- /**
- * RCP's action bar advisor
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static class WindowActionBarAdvisor extends ActionBarAdvisor
- {
- /**
- * @see ActionBarAdvisor#ActionBarAdvisor(org.eclipse.ui.application.IActionBarConfigurer)
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public WindowActionBarAdvisor(IActionBarConfigurer configurer)
- {
- super(configurer);
- }
-
- /**
- * @see org.eclipse.ui.application.ActionBarAdvisor#fillMenuBar(org.eclipse.jface.action.IMenuManager)
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- protected void fillMenuBar(IMenuManager menuBar)
- {
- IWorkbenchWindow window = getActionBarConfigurer().getWindowConfigurer().getWindow();
- menuBar.add(createFileMenu(window));
- menuBar.add(createEditMenu(window));
- menuBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
- menuBar.add(createWindowMenu(window));
- menuBar.add(createHelpMenu(window));
- }
-
- /**
- * Creates the 'File' menu.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected IMenuManager createFileMenu(IWorkbenchWindow window)
- {
- IMenuManager menu = new MenuManager(getString("_UI_Menu_File_label"),<%=genModel.getNonNLS()%>
- IWorkbenchActionConstants.M_FILE);
- menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_START));
-
- IMenuManager newMenu = new MenuManager(getString("_UI_Menu_New_label"), "new");<%=genModel.getNonNLS()%><%=genModel.getNonNLS(2)%>
- newMenu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
-
- menu.add(newMenu);
- menu.add(new Separator());
- menu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
- menu.add(new Separator());
- addToMenuAndRegister(menu, ActionFactory.CLOSE.create(window));
- addToMenuAndRegister(menu, ActionFactory.CLOSE_ALL.create(window));
- menu.add(new Separator());
- addToMenuAndRegister(menu, ActionFactory.SAVE.create(window));
- addToMenuAndRegister(menu, ActionFactory.SAVE_AS.create(window));
- addToMenuAndRegister(menu, ActionFactory.SAVE_ALL.create(window));
- menu.add(new Separator());
- addToMenuAndRegister(menu, ActionFactory.QUIT.create(window));
- menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_END));
- return menu;
- }
-
- /**
- * Creates the 'Edit' menu.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected IMenuManager createEditMenu(IWorkbenchWindow window)
- {
- IMenuManager menu = new MenuManager(getString("_UI_Menu_Edit_label"),<%=genModel.getNonNLS()%>
- IWorkbenchActionConstants.M_EDIT);
- menu.add(new GroupMarker(IWorkbenchActionConstants.EDIT_START));
-
- addToMenuAndRegister(menu, ActionFactory.UNDO.create(window));
- addToMenuAndRegister(menu, ActionFactory.REDO.create(window));
- menu.add(new GroupMarker(IWorkbenchActionConstants.UNDO_EXT));
- menu.add(new Separator());
-
- addToMenuAndRegister(menu, ActionFactory.CUT.create(window));
- addToMenuAndRegister(menu, ActionFactory.COPY.create(window));
- addToMenuAndRegister(menu, ActionFactory.PASTE.create(window));
- menu.add(new GroupMarker(IWorkbenchActionConstants.CUT_EXT));
- menu.add(new Separator());
-
- addToMenuAndRegister(menu, ActionFactory.DELETE.create(window));
- addToMenuAndRegister(menu, ActionFactory.SELECT_ALL.create(window));
- menu.add(new Separator());
-
- menu.add(new GroupMarker(IWorkbenchActionConstants.ADD_EXT));
-
- menu.add(new GroupMarker(IWorkbenchActionConstants.EDIT_END));
- menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
- return menu;
- }
-
- /**
- * Creates the 'Window' menu.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected IMenuManager createWindowMenu(IWorkbenchWindow window)
- {
- IMenuManager menu = new MenuManager(getString("_UI_Menu_Window_label"),<%=genModel.getNonNLS()%>
- IWorkbenchActionConstants.M_WINDOW);
-
- addToMenuAndRegister(menu, ActionFactory.OPEN_NEW_WINDOW.create(window));
- menu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
-<%if (!genModel.isRichAjaxPlatform()) {%>
- menu.add(ContributionItemFactory.OPEN_WINDOWS.create(window));
-<%}%>
-
- return menu;
- }
-
- /**
- * Creates the 'Help' menu.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected IMenuManager createHelpMenu(IWorkbenchWindow window)
- {
- IMenuManager menu = new MenuManager(getString("_UI_Menu_Help_label"), IWorkbenchActionConstants.M_HELP);<%=genModel.getNonNLS()%>
- // Welcome or intro page would go here
- // Help contents would go here
- // Tips and tricks page would go here
- menu.add(new GroupMarker(IWorkbenchActionConstants.HELP_START));
- menu.add(new GroupMarker(IWorkbenchActionConstants.HELP_END));
- menu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
- return menu;
- }
-
- /**
- * Adds the specified action to the given menu and also registers the action with the
- * action bar configurer, in order to activate its key binding.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected void addToMenuAndRegister(IMenuManager menuManager, IAction action)
- {
- menuManager.add(action);
- getActionBarConfigurer().registerGlobalAction(action);
- }
- }
-
- /**
- * About action for the RCP application.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static class AboutAction extends WorkbenchWindowActionDelegate
- {
- /**
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void run(IAction action)
- {
- MessageDialog.openInformation(getWindow().getShell(), getString("_UI_About_title"),<%=genModel.getNonNLS()%>
- getString("_UI_About_text"));<%=genModel.getNonNLS()%>
- }
- }
-
-<%if (!genModel.isRichAjaxPlatform()) {%>
- /**
- * Open action for the objects from the <%=genModel.getModelName()%> model.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static class OpenAction extends WorkbenchWindowActionDelegate
- {
- /**
- * Opens the editors for the files selected using the file dialog.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void run(IAction action)
- {
- String[] filePaths = openFilePathDialog(getWindow().getShell(), SWT.OPEN, null);
- if (filePaths.length > 0)
- {
- openEditor(getWindow().getWorkbench(), URI.createFileURI(filePaths[0]));
- }
- }
- }
-<%}%>
-
- /**
- * Open URI action for the objects from the <%=genModel.getModelName()%> model.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static class OpenURIAction extends WorkbenchWindowActionDelegate
- {
- /**
- * Opens the editors for the files selected using the LoadResourceDialog.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void run(IAction action)
- {
- LoadResourceAction.LoadResourceDialog loadResourceDialog = new LoadResourceAction.LoadResourceDialog(getWindow().getShell());
- if (Window.OK == loadResourceDialog.open())
- {
-<%if (genModel.useGenerics()) {%>
- for (URI uri : loadResourceDialog.getURIs())
- {
- openEditor(getWindow().getWorkbench(), uri);
- }
-<%} else {%>
- for (Iterator i = loadResourceDialog.getURIs().iterator(); i.hasNext();)
- {
- openEditor(getWindow().getWorkbench(), (URI)i.next());
- }
-<%}%>
- }
- }
- }
-
-<%if (!genModel.isRichAjaxPlatform()) {%>
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static String[] openFilePathDialog(Shell shell, int style, String[] fileExtensionFilters)
- {
- return openFilePathDialog(shell, style, fileExtensionFilters, (style & SWT.OPEN) != 0, (style & SWT.OPEN) != 0, (style & SWT.SAVE) != 0);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static String[] openFilePathDialog(Shell shell, int style, String[] fileExtensionFilters, boolean includeGroupFilter, boolean includeAllFilter, boolean addExtension)
- {
- FileDialog fileDialog = new FileDialog(shell, style);
- if (fileExtensionFilters == null)
- {
- fileExtensionFilters = FILE_EXTENSION_FILTERS;
- }
-
- // If requested, augment the file extension filters by adding a group of all the other filters (*.ext1;*.ext2;...)
- // at the beginning and/or an all files wildcard (*.*) at the end.
- //
- includeGroupFilter &= fileExtensionFilters.length > 1;
- int offset = includeGroupFilter ? 1 : 0;
-
- if (includeGroupFilter || includeAllFilter)
- {
- int size = fileExtensionFilters.length + offset + (includeAllFilter ? 1 : 0);
- String[] allFilters = new String[size];
- <%=_StringBuilder%> group = includeGroupFilter ? new <%=_StringBuilder%>() : null;
-
- for (int i = 0; i < fileExtensionFilters.length; i++)
- {
- if (includeGroupFilter)
- {
- if (i != 0)
- {
- group.append(';');
- }
- group.append(fileExtensionFilters[i]);
- }
- allFilters[i + offset] = fileExtensionFilters[i];
- }
-
- if (includeGroupFilter)
- {
- allFilters[0] = group.toString();
- }
- if (includeAllFilter)
- {
- allFilters[allFilters.length - 1] = "*.*";<%=genModel.getNonNLS()%>
- }
-
- fileDialog.setFilterExtensions(allFilters);
- }
- else
- {
- fileDialog.setFilterExtensions(fileExtensionFilters);
- }
- fileDialog.open();
-
- String[] filenames = fileDialog.getFileNames();
- String[] result = new String[filenames.length];
- String path = fileDialog.getFilterPath() + File.separator;
- String extension = null;
-
- // If extension adding requested, get the dotted extension corresponding to the selected filter.
- //
- if (addExtension)
- {
- int i = fileDialog.getFilterIndex();
- if (i != -1 && (!includeAllFilter || i != fileExtensionFilters.length))
- {
- i = includeGroupFilter && i == 0 ? 0 : i - offset;
- String filter = fileExtensionFilters[i];
- int dot = filter.lastIndexOf('.');
- if (dot == 1 && filter.charAt(0) == '*')
- {
- extension = filter.substring(dot);
- }
- }
- }
-
- // Build the result by adding the selected path and, if needed, auto-appending the extension.
- //
- for (int i = 0; i < filenames.length; i++)
- {
- String filename = path + filenames[i];
- if (extension != null)
- {
- int dot = filename.lastIndexOf('.');
- if (dot == -1 || !Arrays.asList(fileExtensionFilters).contains("*" + filename.substring(dot)))<%=genModel.getNonNLS()%>
- {
- filename += extension;
- }
- }
- result[i] = filename;
- }
- return result;
- }
-<%}%>
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static boolean openEditor(IWorkbench workbench, URI uri)
- {
- IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
- IWorkbenchPage page = workbenchWindow.getActivePage();
-
- IEditorDescriptor editorDescriptor = EditUIUtil.getDefaultEditor(uri, null);
- if (editorDescriptor == null)
- {
- MessageDialog.openError(
- workbenchWindow.getShell(),
- getString("_UI_Error_title"),<%=genModel.getNonNLS()%>
- getString("_WARN_No_Editor", uri.lastSegment()));<%=genModel.getNonNLS()%>
- return false;
- }
- else
- {
- try
- {
- page.openEditor(new URIEditorInput(uri), editorDescriptor.getId());
- }
- catch (PartInitException exception)
- {
- MessageDialog.openError(
- workbenchWindow.getShell(),
- getString("_UI_OpenEditorError_label"),<%=genModel.getNonNLS()%>
- exception.getMessage());
- return false;
- }
- }
- return true;
- }
-
- /**
- * @see org.eclipse.ui.application.WorkbenchAdvisor#getInitialWindowPerspectiveId()
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- public String getInitialWindowPerspectiveId()
- {
- return Perspective.ID_PERSPECTIVE;
- }
-
- /**
- * @see org.eclipse.ui.application.WorkbenchAdvisor#initialize(org.eclipse.ui.application.IWorkbenchConfigurer)
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- public void initialize(IWorkbenchConfigurer configurer)
- {
- super.initialize(configurer);
- configurer.setSaveAndRestore(true);
- }
-
- /**
- * @see org.eclipse.ui.application.WorkbenchAdvisor#createWorkbenchWindowAdvisor(org.eclipse.ui.application.IWorkbenchWindowConfigurer)
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer)
- {
- return new WindowAdvisor(configurer);
- }
-}
-<%genModel.emitSortedImports();%>
diff --git a/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/Editor.javajet b/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/Editor.javajet
deleted file mode 100644
index 2b40f49b98c..00000000000
--- a/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/Editor.javajet
+++ /dev/null
@@ -1,2397 +0,0 @@
-<%@ jet package="org.eclipse.emf.codegen.ecore.templates.editor" imports="java.util.* org.eclipse.emf.codegen.ecore.genmodel.*" class="Editor" version="$Id: Editor.javajet,v 1.69 2010/03/11 02:31:37 khussey Exp $" %>
-<%
-/**
- * <copyright>
- *
- * Copyright (c) 2002-2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- *
- * </copyright>
- */
-%>
-<%GenPackage genPackage = (GenPackage)argument; GenModel genModel=genPackage.getGenModel(); /* Trick to import java.util.* without warnings */Iterator.class.getName(); %>
-<%String importedOperationClassName = genModel.getImportedName(genModel.isRichClientPlatform() ? "org.eclipse.jface.operation.IRunnableWithProgress" : "org.eclipse.ui.actions.WorkspaceModifyOperation");%>
-<%String operationMethodName = genModel.isRichClientPlatform() ? "run" : "execute";%>
-<%String _ArrayListOfObject = "ArrayList" + (genModel.useGenerics() ? "<Object>" : "");%>
-<%String _ArrayListOfSelectionChangedListener = "ArrayList" + (genModel.useGenerics() ? "<ISelectionChangedListener>" : "");%>
-<%String _CollectionOfSelectionChangedListener = "Collection" + (genModel.useGenerics() ? "<ISelectionChangedListener>" : "");%>
-<%String _ArrayListOfResource = "ArrayList" + (genModel.useGenerics() ? "<Resource>" : "");%>
-<%String _CollectionOfResource = "Collection" + (genModel.useGenerics() ? "<Resource>" : "");%>
-<%String _MapOfResourceToDiagnostic = "Map" + (genModel.useGenerics() ? "<Resource, Diagnostic>" : "");%>
-<%String _HashMapOfResourceToBoolean = "HashMap" + (genModel.useGenerics() ? "<Resource, Boolean>" : "");%>
-<%String _MapOfObjectToObject = "Map" + (genModel.useGenerics() ? "<Object, Object>" : "");%>
-<%String _HashMapOfObjectToObject = "HashMap" + (genModel.useGenerics() ? "<Object, Object>" : "");%>
-<%String _LinkedHashMapOfResourceToDiagnostic = "LinkedHashMap" + (genModel.useGenerics() ? "<Resource, Diagnostic>" : "");%>
-<%String _CollectionOfAnything = "Collection" + (genModel.useGenerics() ? "<?>" : "");%>
-<%String _ListOfAnything = "List" + (genModel.useGenerics() ? "<?>" : "");%>
-<%boolean useExtendedLabelProvider = genModel.isFontProviders() || genModel.isColorProviders();%>
-<%String _AdapterFactoryLabelProvider = "AdapterFactoryLabelProvider" + (genModel.isFontProviders() && genModel.isColorProviders() ? ".FontAndColorProvider" : genModel.isFontProviders() ? ".FontProvider" : genModel.isColorProviders() ? ".ColorProvider" : "");%>
-<%String _ArrayListOfString = "ArrayList" + (genModel.useGenerics() ? "<String>" : "");%>
-<%String _ListOfString = "List" + (genModel.useGenerics() ? "<String>" : "");%>
-<%@ include file="../Header.javajetinc"%>
-package <%=genPackage.getPresentationPackageName()%>;
-
-
-import java.io.IOException;
-import java.io.InputStream;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.EventObject;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-<%if (!genModel.isRichClientPlatform()) {%>
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.IResourceDeltaVisitor;
-import org.eclipse.core.resources.ResourcesPlugin;
-<%}%>
-
-<%if (!genModel.isRichClientPlatform()) {%>
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-<%}%>
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
-
-<%if (genPackage.isMultipleEditorPages()) {%>
-import org.eclipse.jface.viewers.ColumnWeightData;
-<%}%>
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-<%if (genPackage.isMultipleEditorPages()) {%>
-import org.eclipse.jface.viewers.ListViewer;
-<%}%>
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.StructuredViewer;
-<%if (genPackage.isMultipleEditorPages()) {%>
-import org.eclipse.jface.viewers.TableLayout;
-import org.eclipse.jface.viewers.TableViewer;
-<%}%>
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-
-import org.eclipse.swt.SWT;
-
-import org.eclipse.swt.custom.CTabFolder;
-
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.swt.dnd.Transfer;
-
-import org.eclipse.swt.events.ControlAdapter;
-import org.eclipse.swt.events.ControlEvent;
-
-import org.eclipse.swt.graphics.Point;
-<%if (genPackage.isMultipleEditorPages()) {%>
-
-import org.eclipse.swt.layout.FillLayout;
-<%}%>
-
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Menu;
-<%if (genPackage.isMultipleEditorPages()) {%>
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-<%}%>
-import org.eclipse.swt.widgets.Tree;
-<%if (genPackage.isMultipleEditorPages()) {%>
-import org.eclipse.swt.widgets.TreeColumn;
-<%}%>
-
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorSite;
-<%if (!genModel.isRichClientPlatform() && genModel.getComplianceLevel().getValue() < GenJDKLevel.JDK50) {%>
-import org.eclipse.ui.IFileEditorInput;
-<%}%>
-import org.eclipse.ui.IPartListener;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PartInitException;
-<%if (!genModel.isRichClientPlatform()) {%>
-
-import org.eclipse.ui.dialogs.SaveAsDialog;
-
-import org.eclipse.ui.ide.IGotoMarker;
-<%}%>
-
-<%if (!genModel.isRichClientPlatform()) {%>
-import org.eclipse.ui.part.FileEditorInput;
-<%}%>
-import org.eclipse.ui.part.MultiPageEditorPart;
-
-import org.eclipse.ui.views.contentoutline.ContentOutline;
-import org.eclipse.ui.views.contentoutline.ContentOutlinePage;
-import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
-
-import org.eclipse.ui.views.properties.IPropertySheetPage;
-import org.eclipse.ui.views.properties.PropertySheet;
-import org.eclipse.ui.views.properties.PropertySheetPage;
-
-import org.eclipse.emf.common.command.BasicCommandStack;
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.common.command.CommandStack;
-import org.eclipse.emf.common.command.CommandStackListener;
-
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.common.notify.Notification;
-
-<%if (!genModel.isRichClientPlatform()) {%>
-import org.eclipse.emf.common.ui.MarkerHelper;
-<%}%>
-<%if (genPackage.isMultipleEditorPages()) {%>
-import org.eclipse.emf.common.ui.ViewerPane;
-<%}%>
-
-import org.eclipse.emf.common.ui.editor.ProblemEditorPart;
-
-import org.eclipse.emf.common.ui.viewer.IViewerProvider;
-
-import org.eclipse.emf.common.util.BasicDiagnostic;
-import org.eclipse.emf.common.util.Diagnostic;
-import org.eclipse.emf.common.util.URI;
-
-<%if (!genModel.isRichClientPlatform()) {%>
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EValidator;
-<%}%>
-
-import org.eclipse.emf.ecore.resource.Resource;
-<%if (!genModel.isRichClientPlatform()) {%>
-import org.eclipse.emf.ecore.resource.ResourceSet;
-<%}%>
-
-import org.eclipse.emf.ecore.util.EContentAdapter;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-
-import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.emf.edit.domain.IEditingDomainProvider;
-
-import org.eclipse.emf.edit.provider.AdapterFactoryItemDelegator;
-import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
-import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory;
-
-import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory;
-
-import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor;
-
-import org.eclipse.emf.edit.ui.celleditor.AdapterFactoryTreeEditor;
-
-import org.eclipse.emf.edit.ui.dnd.EditingDomainViewerDropAdapter;
-import org.eclipse.emf.edit.ui.dnd.LocalTransfer;
-import org.eclipse.emf.edit.ui.dnd.ViewerDragAdapter;
-
-import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
-import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
-<%if (genModel.getRuntimeVersion().getValue() >= GenRuntimeVersion.EMF23_VALUE) {%>
-import org.eclipse.emf.edit.ui.provider.UnwrappingSelectionProvider;
-<%}%>
-<%if (!genModel.isRichClientPlatform()) {%>
-
-import org.eclipse.emf.edit.ui.util.EditUIMarkerHelper;
-<%}%>
-<%if (genModel.getComplianceLevel().getValue() >= GenJDKLevel.JDK50) {%>
-import org.eclipse.emf.edit.ui.util.EditUIUtil;
-<%}%>
-
-import org.eclipse.emf.edit.ui.view.ExtendedPropertySheetPage;
-
-import <%=genPackage.getQualifiedItemProviderAdapterFactoryClassName()%>;
-
-<%genModel.markImportLocation(stringBuffer);%>
-
-
-/**
- * This is an example of a <%=genPackage.getPrefix()%> model editor.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-public class <%=genPackage.getEditorClassName()%>
- extends MultiPageEditorPart
- implements IEditingDomainProvider, ISelectionProvider, IMenuListener, IViewerProvider<%if (!genModel.isRichClientPlatform()) {%>, IGotoMarker<%}%>
-{
-<%if (genModel.hasCopyrightField()) {%>
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final <%=genModel.getImportedName("java.lang.String")%> copyright = <%=genModel.getCopyrightFieldLiteral()%>;<%=genModel.getNonNLS()%>
-
-<%}%>
-<%if (genModel.isRichClientPlatform()) {%>
- /**
- * The filters for file extensions supported by the editor.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */<%if (genPackage.isGenerateModelWizard()) {%>
- public static final <%=_ListOfString%> FILE_EXTENSION_FILTERS = prefixExtensions(<%=genPackage.getImportedModelWizardClassName()%>.FILE_EXTENSIONS, "*.");<%=genModel.getNonNLS()%>
- <%} else {%>
- public static final <%=_ListOfString%> FILE_EXTENSION_FILTERS = prefixExtensions(<%=genModel.getImportedName("java.util.Arrays")%>.asList(<%=genPackage.getImportedEditorPluginClassName()%>.INSTANCE.getString("_UI_<%=genPackage.getEditorClassName()%>FilenameExtensions").split("\\s*,\\s*")), "*.");<%=genModel.getNonNLS()%><%=genModel.getNonNLS(2)%><%=genModel.getNonNLS(3)%>
- <%}%>
- /**
- * Returns a new unmodifiable list containing prefixed versions of the extensions in the given list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static <%=_ListOfString%> prefixExtensions(<%=_ListOfString%> extensions, String prefix)
- {
- <%=_ListOfString%> result = new <%=_ArrayListOfString%>();
- <%if (genModel.useGenerics()) {%>
- for (String extension : extensions)
- {
- result.add(prefix + extension);
- <%} else {%>
- for (Iterator iterator = extensions.iterator() ; iterator.hasNext(); )
- {
- result.add(prefix + (String)iterator.next());
- <%}%>
- }
- return Collections.unmodifiableList(result);
- }
-
-<%}%>
- /**
- * This keeps track of the editing domain that is used to track all changes to the model.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected AdapterFactoryEditingDomain editingDomain;
-
- /**
- * This is the one adapter factory used for providing views of the model.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected ComposedAdapterFactory adapterFactory;
-
- /**
- * This is the content outline page.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected IContentOutlinePage contentOutlinePage;
-
- /**
- * This is a kludge...
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected IStatusLineManager contentOutlineStatusLineManager;
-
- /**
- * This is the content outline page's viewer.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected TreeViewer contentOutlineViewer;
-
- /**
- * This is the property sheet page.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected PropertySheetPage propertySheetPage;
-
- /**
- * This is the viewer that shadows the selection in the content outline.
- * The parent relation must be correctly defined for this to work.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected TreeViewer selectionViewer;
-<%if (genPackage.isMultipleEditorPages()) {%>
-
- /**
- * This inverts the roll of parent and child in the content provider and show parents as a tree.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected TreeViewer parentViewer;
-
- /**
- * This shows how a tree view works.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected TreeViewer treeViewer;
-
- /**
- * This shows how a list view works.
- * A list viewer doesn't support icons.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected ListViewer listViewer;
-
- /**
- * This shows how a table view works.
- * A table can be used as a list with icons.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected TableViewer tableViewer;
-
- /**
- * This shows how a tree view with columns works.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected TreeViewer treeViewerWithColumns;
-
- /**
- * This keeps track of the active viewer pane, in the book.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected ViewerPane currentViewerPane;
-<%}%>
-
- /**
- * This keeps track of the active content viewer, which may be either one of the viewers in the pages or the content outline viewer.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected Viewer currentViewer;
-
- /**
- * This listens to which ever viewer is active.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected ISelectionChangedListener selectionChangedListener;
-
- /**
- * This keeps track of all the {@link org.eclipse.jface.viewers.ISelectionChangedListener}s that are listening to this editor.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected <%=_CollectionOfSelectionChangedListener%> selectionChangedListeners = new <%=_ArrayListOfSelectionChangedListener%>();
-
- /**
- * This keeps track of the selection of the editor as a whole.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected ISelection editorSelection = StructuredSelection.EMPTY;
-
-<%if (!genModel.isRichClientPlatform()) {%>
- /**
- * The MarkerHelper is responsible for creating workspace resource markers presented
- * in Eclipse's Problems View.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected MarkerHelper markerHelper = new EditUIMarkerHelper();
-
-<%}%>
- /**
- * This listens for when the outline becomes active
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected IPartListener partListener =
- new IPartListener()
- {
- public void partActivated(IWorkbenchPart p)
- {
- if (p instanceof ContentOutline)
- {
- if (((ContentOutline)p).getCurrentPage() == contentOutlinePage)
- {
- getActionBarContributor().setActiveEditor(<%=genPackage.getEditorClassName()%>.this);
-
- setCurrentViewer(contentOutlineViewer);
- }
- }
- else if (p instanceof PropertySheet)
- {
- if (((PropertySheet)p).getCurrentPage() == propertySheetPage)
- {
- getActionBarContributor().setActiveEditor(<%=genPackage.getEditorClassName()%>.this);
- handleActivate();
- }
- }
- else if (p == <%=genPackage.getEditorClassName()%>.this)
- {
- handleActivate();
- }
- }
- public void partBroughtToTop(IWorkbenchPart p)
- {
- // Ignore.
- }
- public void partClosed(IWorkbenchPart p)
- {
- // Ignore.
- }
- public void partDeactivated(IWorkbenchPart p)
- {
- // Ignore.
- }
- public void partOpened(IWorkbenchPart p)
- {
- // Ignore.
- }
- };
-
- /**
- * Resources that have been removed since last activation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected <%=_CollectionOfResource%> removedResources = new <%=_ArrayListOfResource%>();
-
- /**
- * Resources that have been changed since last activation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected <%=_CollectionOfResource%> changedResources = new <%=_ArrayListOfResource%>();
-
- /**
- * Resources that have been saved.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected <%=_CollectionOfResource%> savedResources = new <%=_ArrayListOfResource%>();
-
- /**
- * Map to store the diagnostic associated with a resource.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected <%=_MapOfResourceToDiagnostic%> resourceToDiagnosticMap = new <%=_LinkedHashMapOfResourceToDiagnostic%>();
-
- /**
- * Controls whether the problem indication should be updated.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected boolean updateProblemIndication = true;
-
- /**
- * Adapter used to update the problem indication when resources are demanded loaded.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected EContentAdapter problemIndicationAdapter =
- new EContentAdapter()
- {
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- public void notifyChanged(Notification notification)
- {
- if (notification.getNotifier() instanceof Resource)
- {
- switch (notification.getFeatureID(Resource.class))
- {
- case Resource.RESOURCE__IS_LOADED:
- case Resource.RESOURCE__ERRORS:
- case Resource.RESOURCE__WARNINGS:
- {
- Resource resource = (Resource)notification.getNotifier();
- Diagnostic diagnostic = analyzeResourceProblems(resource, null);
- if (diagnostic.getSeverity() != Diagnostic.OK)
- {
- resourceToDiagnosticMap.put(resource, diagnostic);
- }
- else
- {
- resourceToDiagnosticMap.remove(resource);
- }
-
- if (updateProblemIndication)
- {
- getSite().getShell().getDisplay().asyncExec
- (new Runnable()
- {
- public void run()
- {
- updateProblemIndication();
- }
- });
- }
- break;
- }
- }
- }
- else
- {
- super.notifyChanged(notification);
- }
- }
-
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- protected void setTarget(Resource target)
- {
- basicSetTarget(target);
- }
-
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- protected void unsetTarget(Resource target)
- {
- basicUnsetTarget(target);
- }
- };
-<%if (!genModel.isRichClientPlatform()) {%>
-
- /**
- * This listens for workspace changes.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected IResourceChangeListener resourceChangeListener =
- new IResourceChangeListener()
- {
- public void resourceChanged(IResourceChangeEvent event)
- {
- IResourceDelta delta = event.getDelta();
- try
- {
- class ResourceDeltaVisitor implements IResourceDeltaVisitor
- {
- protected ResourceSet resourceSet = editingDomain.getResourceSet();
- protected <%=_CollectionOfResource%> changedResources = new <%=_ArrayListOfResource%>();
- protected <%=_CollectionOfResource%> removedResources = new <%=_ArrayListOfResource%>();
-
- public boolean visit(IResourceDelta delta)
- {
- if (delta.getResource().getType() == IResource.FILE)
- {
- if (delta.getKind() == IResourceDelta.REMOVED ||
- delta.getKind() == IResourceDelta.CHANGED && delta.getFlags() != IResourceDelta.MARKERS)
- {
- Resource resource = resourceSet.getResource(URI.createPlatformResourceURI(delta.getFullPath().toString(), true), false);
- if (resource != null)
- {
- if (delta.getKind() == IResourceDelta.REMOVED)
- {
- removedResources.add(resource);
- }
- else if (!savedResources.remove(resource))
- {
- changedResources.add(resource);
- }
- }
- }
- }
-
- return true;
- }
-
- public <%=_CollectionOfResource%> getChangedResources()
- {
- return changedResources;
- }
-
- public <%=_CollectionOfResource%> getRemovedResources()
- {
- return removedResources;
- }
- }
-
- final ResourceDeltaVisitor visitor = new ResourceDeltaVisitor();
- delta.accept(visitor);
-
- if (!visitor.getRemovedResources().isEmpty())
- {
- getSite().getShell().getDisplay().asyncExec
- (new Runnable()
- {
- public void run()
- {
- removedResources.addAll(visitor.getRemovedResources());
- if (!isDirty())
- {
- getSite().getPage().closeEditor(<%=genPackage.getEditorClassName()%>.this, false);
- }
- }
- });
- }
-
- if (!visitor.getChangedResources().isEmpty())
- {
- getSite().getShell().getDisplay().asyncExec
- (new Runnable()
- {
- public void run()
- {
- changedResources.addAll(visitor.getChangedResources());
- if (getSite().getPage().getActiveEditor() == <%=genPackage.getEditorClassName()%>.this)
- {
- handleActivate();
- }
- }
- });
- }
- }
- catch (CoreException exception)
- {
- <%=genPackage.getImportedEditorPluginClassName()%>.INSTANCE.log(exception);
- }
- }
- };
-<%}%>
-
- /**
- * Handles activation of the editor or it's associated views.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected void handleActivate()
- {
- // Recompute the read only state.
- //
- if (editingDomain.getResourceToReadOnlyMap() != null)
- {
- editingDomain.getResourceToReadOnlyMap().clear();
-
- // Refresh any actions that may become enabled or disabled.
- //
- setSelection(getSelection());
- }
-
- if (!removedResources.isEmpty())
- {
- if (handleDirtyConflict())
- {
- getSite().getPage().closeEditor(<%=genPackage.getEditorClassName()%>.this, false);
- }
- else
- {
- removedResources.clear();
- changedResources.clear();
- savedResources.clear();
- }
- }
- else if (!changedResources.isEmpty())
- {
- changedResources.removeAll(savedResources);
- handleChangedResources();
- changedResources.clear();
- savedResources.clear();
- }
- }
-
- /**
- * Handles what to do with changed resources on activation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected void handleChangedResources()
- {
- if (!changedResources.isEmpty() && (!isDirty() || handleDirtyConflict()))
- {
- if (isDirty())
- {
- changedResources.addAll(editingDomain.getResourceSet().getResources());
- }
- editingDomain.getCommandStack().flush();
-
- updateProblemIndication = false;
-<%if (genModel.useGenerics()) {%>
- for (Resource resource : changedResources)
-<%} else {%>
- for (Iterator i = changedResources.iterator(); i.hasNext(); )
-<%}%>
- {
-<%if (!genModel.useGenerics()) {%>
- Resource resource = (Resource)i.next();
-<%}%>
- if (resource.isLoaded())
- {
- resource.unload();
- try
- {
- resource.load(Collections.EMPTY_MAP);
- }
- catch (IOException exception)
- {
- if (!resourceToDiagnosticMap.containsKey(resource))
- {
- resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
- }
- }
- }
- }
-
-<%if (genModel.getRuntimeVersion().getValue() >= GenRuntimeVersion.EMF24_VALUE) {%>
- if (AdapterFactoryEditingDomain.isStale(editorSelection))
- {
- setSelection(StructuredSelection.EMPTY);
- }
-<%}%>
-
- updateProblemIndication = true;
- updateProblemIndication();
- }
- }
-
- /**
- * Updates the problems indication with the information described in the specified diagnostic.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected void updateProblemIndication()
- {
- if (updateProblemIndication)
- {
- BasicDiagnostic diagnostic =
- new BasicDiagnostic
- (Diagnostic.OK,
- "<%=genPackage.getGenModel().getEditorPluginID()%>",<%=genModel.getNonNLS()%>
- 0,
- null,
- new Object [] { editingDomain.getResourceSet() });
-<%if (genModel.useGenerics()) {%>
- for (Diagnostic childDiagnostic : resourceToDiagnosticMap.values())
-<%} else {%>
- for (Iterator i = resourceToDiagnosticMap.values().iterator(); i.hasNext(); )
-<%}%>
- {
-<%if (!genModel.useGenerics()) {%>
- Diagnostic childDiagnostic = (Diagnostic)i.next();
-<%}%>
- if (childDiagnostic.getSeverity() != Diagnostic.OK)
- {
- diagnostic.add(childDiagnostic);
- }
- }
-
- int lastEditorPage = getPageCount() - 1;
- if (lastEditorPage >= 0 && getEditor(lastEditorPage) instanceof ProblemEditorPart)
- {
- ((ProblemEditorPart)getEditor(lastEditorPage)).setDiagnostic(diagnostic);
- if (diagnostic.getSeverity() != Diagnostic.OK)
- {
- setActivePage(lastEditorPage);
- }
- }
- else if (diagnostic.getSeverity() != Diagnostic.OK)
- {
- ProblemEditorPart problemEditorPart = new ProblemEditorPart();
- problemEditorPart.setDiagnostic(diagnostic);
-<%if (!genModel.isRichClientPlatform()) {%>
- problemEditorPart.setMarkerHelper(markerHelper);
-<%}%>
- try
- {
- addPage(++lastEditorPage, problemEditorPart, getEditorInput());
- setPageText(lastEditorPage, problemEditorPart.getPartName());
- setActivePage(lastEditorPage);
- showTabs();
- }
- catch (PartInitException exception)
- {
- <%=genPackage.getImportedEditorPluginClassName()%>.INSTANCE.log(exception);
- }
- }
-<%if (!genModel.isRichClientPlatform()) {%>
-
- if (markerHelper.hasMarkers(editingDomain.getResourceSet()))
- {
- markerHelper.deleteMarkers(editingDomain.getResourceSet());
- if (diagnostic.getSeverity() != Diagnostic.OK)
- {
- try
- {
- markerHelper.createMarkers(diagnostic);
- }
- catch (CoreException exception)
- {
- <%=genPackage.getImportedEditorPluginClassName()%>.INSTANCE.log(exception);
- }
- }
- }
-<%}%>
- }
- }
-
- /**
- * Shows a dialog that asks if conflicting changes should be discarded.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected boolean handleDirtyConflict()
- {
- return
- MessageDialog.openQuestion
- (getSite().getShell(),
- getString("_UI_FileConflict_label"),<%=genModel.getNonNLS()%>
- getString("_WARN_FileConflict"));<%=genModel.getNonNLS()%>
- }
-
- /**
- * This creates a model editor.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public <%=genPackage.getEditorClassName()%>()
- {
- super();
- initializeEditingDomain();
- }
-
- /**
- * This sets up the editing domain for the model editor.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected void initializeEditingDomain()
- {
- // Create an adapter factory that yields item providers.
- //
- adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
-
- adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
-<%@ include file="Editor/addItemProviderFactories.override.javajetinc" fail="alternative"%>
-<%@ start%>
-<%for (GenPackage aGenPackage : genModel.getAllGenPackagesWithClassifiers()) {%>
- <%if (!aGenPackage.getGenClasses().isEmpty() && aGenPackage.getGenModel().hasEditSupport()) {%>
- adapterFactory.addAdapterFactory(new <%=aGenPackage.getImportedItemProviderAdapterFactoryClassName()%>());
- <%}%>
-<%}%>
-<%for (GenPackage aGenPackage : genModel.getAllUsedGenPackagesWithClassifiers()) {%>
- <%if (!aGenPackage.getGenClasses().isEmpty() && aGenPackage.getGenModel().hasEditSupport()) {%>
- adapterFactory.addAdapterFactory(new <%=aGenPackage.getImportedItemProviderAdapterFactoryClassName()%>());
- <%}%>
-<%}%>
-<%@ include file="Editor/addItemProviderFactories.insert.javajetinc" fail="silent"%>
-<%@end%><%//Editor/addItemproviderFactories.override.javajetinc"%>
- adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
-
- // Create the command stack that will notify this editor as commands are executed.
- //
- BasicCommandStack commandStack = new BasicCommandStack();
-
- // Add a listener to set the most recent command's affected objects to be the selection of the viewer with focus.
- //
- commandStack.addCommandStackListener
- (new CommandStackListener()
- {
- public void commandStackChanged(final EventObject event)
- {
- getContainer().getDisplay().asyncExec
- (new Runnable()
- {
- public void run()
- {
- firePropertyChange(IEditorPart.PROP_DIRTY);
-
- // Try to select the affected objects.
- //
- Command mostRecentCommand = ((CommandStack)event.getSource()).getMostRecentCommand();
- if (mostRecentCommand != null)
- {
- setSelectionToViewer(mostRecentCommand.getAffectedObjects());
- }
- if (propertySheetPage != null && !propertySheetPage.getControl().isDisposed())
- {
- propertySheetPage.refresh();
- }
- }
- });
- }
- });
-
- // Create the editing domain with a special command stack.
- //
- editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack, new <%=_HashMapOfResourceToBoolean%>());
- }
-
- /**
- * This is here for the listener to be able to call it.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- protected void firePropertyChange(int action)
- {
- super.firePropertyChange(action);
- }
-
- /**
- * This sets the selection into whichever viewer is active.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setSelectionToViewer(<%=_CollectionOfAnything%> collection)
- {
- final <%=_CollectionOfAnything%> theSelection = collection;
- // Make sure it's okay.
- //
- if (theSelection != null && !theSelection.isEmpty())
- {
- Runnable runnable =
- new Runnable()
- {
- public void run()
- {
- // Try to select the items in the current content viewer of the editor.
- //
- if (currentViewer != null)
- {
- currentViewer.setSelection(new StructuredSelection(theSelection.toArray()), true);
- }
- }
- };
- getSite().getShell().getDisplay().asyncExec(runnable);
- }
- }
-
- /**
- * This returns the editing domain as required by the {@link IEditingDomainProvider} interface.
- * This is important for implementing the static methods of {@link AdapterFactoryEditingDomain}
- * and for supporting {@link org.eclipse.emf.edit.ui.action.CommandAction}.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EditingDomain getEditingDomain()
- {
- return editingDomain;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public class ReverseAdapterFactoryContentProvider extends AdapterFactoryContentProvider
- {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public ReverseAdapterFactoryContentProvider(AdapterFactory adapterFactory)
- {
- super(adapterFactory);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- public Object [] getElements(Object object)
- {
- Object parent = super.getParent(object);
- return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- public Object [] getChildren(Object object)
- {
- Object parent = super.getParent(object);
- return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- public boolean hasChildren(Object object)
- {
- Object parent = super.getParent(object);
- return parent != null;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- public Object getParent(Object object)
- {
- return null;
- }
- }
-<%if (genPackage.isMultipleEditorPages()) {%>
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setCurrentViewerPane(ViewerPane viewerPane)
- {
- if (currentViewerPane != viewerPane)
- {
- if (currentViewerPane != null)
- {
- currentViewerPane.showFocus(false);
- }
- currentViewerPane = viewerPane;
- }
- setCurrentViewer(currentViewerPane.getViewer());
- }
-<%}%>
-
- /**
- * This makes sure that one content viewer, either for the current page or the outline view, if it has focus,
- * is the current one.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setCurrentViewer(Viewer viewer)
- {
- // If it is changing...
- //
- if (currentViewer != viewer)
- {
- if (selectionChangedListener == null)
- {
- // Create the listener on demand.
- //
- selectionChangedListener =
- new ISelectionChangedListener()
- {
- // This just notifies those things that are affected by the section.
- //
- public void selectionChanged(SelectionChangedEvent selectionChangedEvent)
- {
- setSelection(selectionChangedEvent.getSelection());
- }
- };
- }
-
- // Stop listening to the old one.
- //
- if (currentViewer != null)
- {
- currentViewer.removeSelectionChangedListener(selectionChangedListener);
- }
-
- // Start listening to the new one.
- //
- if (viewer != null)
- {
- viewer.addSelectionChangedListener(selectionChangedListener);
- }
-
- // Remember it.
- //
- currentViewer = viewer;
-
- // Set the editors selection based on the current viewer's selection.
- //
- setSelection(currentViewer == null ? StructuredSelection.EMPTY : currentViewer.getSelection());
- }
- }
-
- /**
- * This returns the viewer as required by the {@link IViewerProvider} interface.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Viewer getViewer()
- {
- return currentViewer;
- }
-
- /**
- * This creates a context menu for the viewer and adds a listener as well registering the menu for extension.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected void createContextMenuFor(StructuredViewer viewer)
- {
- MenuManager contextMenu = new MenuManager("#PopUp");<%=genModel.getNonNLS()%>
- contextMenu.add(new Separator("additions"));<%=genModel.getNonNLS()%>
- contextMenu.setRemoveAllWhenShown(true);
- contextMenu.addMenuListener(this);
- Menu menu= contextMenu.createContextMenu(viewer.getControl());
- viewer.getControl().setMenu(menu);
-<%if (genModel.getRuntimeVersion().getValue() >= GenRuntimeVersion.EMF23_VALUE) {%>
- getSite().registerContextMenu(contextMenu, new UnwrappingSelectionProvider(viewer));
-<%} else {%>
- getSite().registerContextMenu(contextMenu, viewer);
-<%}%>
-
- int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
- Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance() };
- viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer));
- viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer));
- }
-
- /**
- * This is the method called to load a resource into the editing domain's resource set based on the editor's input.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void createModel()
- {
-<%if (genModel.getRuntimeVersion().getValue() >= GenRuntimeVersion.EMF23_VALUE) {%>
- URI resourceURI = EditUIUtil.getURI(getEditorInput());
-<%} else if (genModel.isRichClientPlatform()) {%>
- URI resourceURI = URI.createURI(getEditorInput().getName());
-<%} else {%>
- // Assumes that the input is a file object.
- //
- IFileEditorInput modelFile = (IFileEditorInput)getEditorInput();
- URI resourceURI = URI.createPlatformResourceURI(modelFile.getFile().getFullPath().toString(), true);
-<%}%>
- Exception exception = null;
- Resource resource = null;
- try
- {
- // Load the resource through the editing domain.
- //
- resource = editingDomain.getResourceSet().getResource(resourceURI, true);
- }
- catch (Exception e)
- {
- exception = e;
- resource = editingDomain.getResourceSet().getResource(resourceURI, false);
- }
-
- Diagnostic diagnostic = analyzeResourceProblems(resource, exception);
- if (diagnostic.getSeverity() != Diagnostic.OK)
- {
- resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
- }
- editingDomain.getResourceSet().eAdapters().add(problemIndicationAdapter);
- }
-
- /**
- * Returns a diagnostic describing the errors and warnings listed in the resource
- * and the specified exception (if any).
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Diagnostic analyzeResourceProblems(Resource resource, Exception exception)
- {
- if (!resource.getErrors().isEmpty() || !resource.getWarnings().isEmpty())
- {
- BasicDiagnostic basicDiagnostic =
- new BasicDiagnostic
- (Diagnostic.ERROR,
- "<%=genPackage.getGenModel().getEditorPluginID()%>",<%=genModel.getNonNLS()%>
- 0,
- getString("_UI_CreateModelError_message", resource.getURI()),<%=genModel.getNonNLS()%>
- new Object [] { exception == null ? (Object)resource : exception });
- basicDiagnostic.merge(EcoreUtil.computeDiagnostic(resource, true));
- return basicDiagnostic;
- }
- else if (exception != null)
- {
- return
- new BasicDiagnostic
- (Diagnostic.ERROR,
- "<%=genPackage.getGenModel().getEditorPluginID()%>",<%=genModel.getNonNLS()%>
- 0,
- getString("_UI_CreateModelError_message", resource.getURI()),<%=genModel.getNonNLS()%>
- new Object[] { exception });
- }
- else
- {
- return Diagnostic.OK_INSTANCE;
- }
- }
-
- /**
- * This is the method used by the framework to install your own controls.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- public void createPages()
- {
- // Creates the model from the editor input
- //
- createModel();
-
- // Only creates the other pages if there is something that can be edited
- //
- if (!getEditingDomain().getResourceSet().getResources().isEmpty())
- {
- // Create a page for the selection tree view.
- //
-<%if (genPackage.isMultipleEditorPages()) {%>
- {
- ViewerPane viewerPane =
- new ViewerPane(getSite().getPage(), <%=genPackage.getEditorClassName()%>.this)
- {
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- public Viewer createViewer(Composite composite)
- {
- Tree tree = new Tree(composite, SWT.MULTI);
- TreeViewer newTreeViewer = new TreeViewer(tree);
- return newTreeViewer;
- }
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- public void requestActivation()
- {
- super.requestActivation();
- setCurrentViewerPane(this);
- }
- };
- viewerPane.createControl(getContainer());
-
- selectionViewer = (TreeViewer)viewerPane.getViewer();
- selectionViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
-
- selectionViewer.setLabelProvider(new <%=_AdapterFactoryLabelProvider%>(adapterFactory<%if (useExtendedLabelProvider) {%>, selectionViewer<%}%>));
- selectionViewer.setInput(editingDomain.getResourceSet());
- selectionViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
- viewerPane.setTitle(editingDomain.getResourceSet());
-
- new AdapterFactoryTreeEditor(selectionViewer.getTree(), adapterFactory);
-
- createContextMenuFor(selectionViewer);
- int pageIndex = addPage(viewerPane.getControl());
- setPageText(pageIndex, getString("_UI_SelectionPage_label"));<%=genModel.getNonNLS()%>
- }
-
- // Create a page for the parent tree view.
- //
- {
- ViewerPane viewerPane =
- new ViewerPane(getSite().getPage(), <%=genPackage.getEditorClassName()%>.this)
- {
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- public Viewer createViewer(Composite composite)
- {
- Tree tree = new Tree(composite, SWT.MULTI);
- TreeViewer newTreeViewer = new TreeViewer(tree);
- return newTreeViewer;
- }
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- public void requestActivation()
- {
- super.requestActivation();
- setCurrentViewerPane(this);
- }
- };
- viewerPane.createControl(getContainer());
-
- parentViewer = (TreeViewer)viewerPane.getViewer();
- parentViewer.setAutoExpandLevel(30);
- parentViewer.setContentProvider(new ReverseAdapterFactoryContentProvider(adapterFactory));
- parentViewer.setLabelProvider(new <%=_AdapterFactoryLabelProvider%>(adapterFactory<%if (useExtendedLabelProvider) {%>, parentViewer<%}%>));
-
- createContextMenuFor(parentViewer);
- int pageIndex = addPage(viewerPane.getControl());
- setPageText(pageIndex, getString("_UI_ParentPage_label"));<%=genModel.getNonNLS()%>
- }
-
- // This is the page for the list viewer
- //
- {
- ViewerPane viewerPane =
- new ViewerPane(getSite().getPage(), <%=genPackage.getEditorClassName()%>.this)
- {
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- public Viewer createViewer(Composite composite)
- {
- return new ListViewer(composite);
- }
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- public void requestActivation()
- {
- super.requestActivation();
- setCurrentViewerPane(this);
- }
- };
- viewerPane.createControl(getContainer());
- listViewer = (ListViewer)viewerPane.getViewer();
- listViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
- listViewer.setLabelProvider(new <%=_AdapterFactoryLabelProvider%>(adapterFactory<%if (useExtendedLabelProvider) {%>, listViewer<%}%>));
-
- createContextMenuFor(listViewer);
- int pageIndex = addPage(viewerPane.getControl());
- setPageText(pageIndex, getString("_UI_ListPage_label"));<%=genModel.getNonNLS()%>
- }
-
- // This is the page for the tree viewer
- //
- {
- ViewerPane viewerPane =
- new ViewerPane(getSite().getPage(), <%=genPackage.getEditorClassName()%>.this)
- {
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- public Viewer createViewer(Composite composite)
- {
- return new TreeViewer(composite);
- }
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- public void requestActivation()
- {
- super.requestActivation();
- setCurrentViewerPane(this);
- }
- };
- viewerPane.createControl(getContainer());
- treeViewer = (TreeViewer)viewerPane.getViewer();
- treeViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
- treeViewer.setLabelProvider(new <%=_AdapterFactoryLabelProvider%>(adapterFactory<%if (useExtendedLabelProvider) {%>, treeViewer<%}%>));
-
- new AdapterFactoryTreeEditor(treeViewer.getTree(), adapterFactory);
-
- createContextMenuFor(treeViewer);
- int pageIndex = addPage(viewerPane.getControl());
- setPageText(pageIndex, getString("_UI_TreePage_label"));<%=genModel.getNonNLS()%>
- }
-
- // This is the page for the table viewer.
- //
- {
- ViewerPane viewerPane =
- new ViewerPane(getSite().getPage(), <%=genPackage.getEditorClassName()%>.this)
- {
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- public Viewer createViewer(Composite composite)
- {
- return new TableViewer(composite);
- }
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- public void requestActivation()
- {
- super.requestActivation();
- setCurrentViewerPane(this);
- }
- };
- viewerPane.createControl(getContainer());
- tableViewer = (TableViewer)viewerPane.getViewer();
-
- Table table = tableViewer.getTable();
- TableLayout layout = new TableLayout();
- table.setLayout(layout);
- table.setHeaderVisible(true);
- table.setLinesVisible(true);
-
- TableColumn objectColumn = new TableColumn(table, SWT.NONE);
- layout.addColumnData(new ColumnWeightData(3, 100, true));
- objectColumn.setText(getString("_UI_ObjectColumn_label"));<%=genModel.getNonNLS()%>
- objectColumn.setResizable(true);
-
- TableColumn selfColumn = new TableColumn(table, SWT.NONE);
- layout.addColumnData(new ColumnWeightData(2, 100, true));
- selfColumn.setText(getString("_UI_SelfColumn_label"));<%=genModel.getNonNLS()%>
- selfColumn.setResizable(true);
-
- tableViewer.setColumnProperties(new String [] {"a", "b"});<%=genModel.getNonNLS()%><%=genModel.getNonNLS(2)%>
- tableViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
- tableViewer.setLabelProvider(new <%=_AdapterFactoryLabelProvider%>(adapterFactory<%if (useExtendedLabelProvider) {%>, tableViewer<%}%>));
-
- createContextMenuFor(tableViewer);
- int pageIndex = addPage(viewerPane.getControl());
- setPageText(pageIndex, getString("_UI_TablePage_label"));<%=genModel.getNonNLS()%>
- }
-
- // This is the page for the table tree viewer.
- //
- {
- ViewerPane viewerPane =
- new ViewerPane(getSite().getPage(), <%=genPackage.getEditorClassName()%>.this)
- {
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- public Viewer createViewer(Composite composite)
- {
- return new TreeViewer(composite);
- }
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- public void requestActivation()
- {
- super.requestActivation();
- setCurrentViewerPane(this);
- }
- };
- viewerPane.createControl(getContainer());
-
- treeViewerWithColumns = (TreeViewer)viewerPane.getViewer();
-
- Tree tree = treeViewerWithColumns.getTree();
- tree.setLayoutData(new FillLayout());
- tree.setHeaderVisible(true);
- tree.setLinesVisible(true);
-
- TreeColumn objectColumn = new TreeColumn(tree, SWT.NONE);
- objectColumn.setText(getString("_UI_ObjectColumn_label"));<%=genModel.getNonNLS()%>
- objectColumn.setResizable(true);
- objectColumn.setWidth(250);
-
- TreeColumn selfColumn = new TreeColumn(tree, SWT.NONE);
- selfColumn.setText(getString("_UI_SelfColumn_label"));<%=genModel.getNonNLS()%>
- selfColumn.setResizable(true);
- selfColumn.setWidth(200);
-
- treeViewerWithColumns.setColumnProperties(new String [] {"a", "b"});<%=genModel.getNonNLS()%><%=genModel.getNonNLS(2)%>
- treeViewerWithColumns.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
- treeViewerWithColumns.setLabelProvider(new <%=_AdapterFactoryLabelProvider%>(adapterFactory<%if (useExtendedLabelProvider) {%>, treeViewerWithColumns<%}%>));
-
- createContextMenuFor(treeViewerWithColumns);
- int pageIndex = addPage(viewerPane.getControl());
- setPageText(pageIndex, getString("_UI_TreeWithColumnsPage_label"));<%=genModel.getNonNLS()%>
- }
-<%} else {%>
- Tree tree = new Tree(getContainer(), SWT.MULTI);
- selectionViewer = new TreeViewer(tree);
- setCurrentViewer(selectionViewer);
-
- selectionViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
- selectionViewer.setLabelProvider(new <%=_AdapterFactoryLabelProvider%>(adapterFactory<%if (useExtendedLabelProvider) {%>, selectionViewer<%}%>));
- selectionViewer.setInput(editingDomain.getResourceSet());
- selectionViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
-
- new AdapterFactoryTreeEditor(selectionViewer.getTree(), adapterFactory);
-
- createContextMenuFor(selectionViewer);
- int pageIndex = addPage(tree);
- setPageText(pageIndex, getString("_UI_SelectionPage_label"));<%=genModel.getNonNLS()%>
-<%}%>
-
- getSite().getShell().getDisplay().asyncExec
- (new Runnable()
- {
- public void run()
- {
- setActivePage(0);
- }
- });
- }
-
- // Ensures that this editor will only display the page's tab
- // area if there are more than one page
- //
- getContainer().addControlListener
- (new ControlAdapter()
- {
- boolean guard = false;
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- public void controlResized(ControlEvent event)
- {
- if (!guard)
- {
- guard = true;
- hideTabs();
- guard = false;
- }
- }
- });
-
- getSite().getShell().getDisplay().asyncExec
- (new Runnable()
- {
- public void run()
- {
- updateProblemIndication();
- }
- });
- }
-
- /**
- * If there is just one page in the multi-page editor part,
- * this hides the single tab at the bottom.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected void hideTabs()
- {
- if (getPageCount() <= 1)
- {
- setPageText(0, "");<%=genModel.getNonNLS()%>
- if (getContainer() instanceof CTabFolder)
- {
- ((CTabFolder)getContainer()).setTabHeight(1);
- Point point = getContainer().getSize();
- getContainer().setSize(point.x, point.y + 6);
- }
- }
- }
-
- /**
- * If there is more than one page in the multi-page editor part,
- * this shows the tabs at the bottom.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected void showTabs()
- {
- if (getPageCount() > 1)
- {
- setPageText(0, getString("_UI_SelectionPage_label"));<%=genModel.getNonNLS()%>
- if (getContainer() instanceof CTabFolder)
- {
- ((CTabFolder)getContainer()).setTabHeight(SWT.DEFAULT);
- Point point = getContainer().getSize();
- getContainer().setSize(point.x, point.y - 6);
- }
- }
- }
-
- /**
- * This is used to track the active viewer.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- protected void pageChange(int pageIndex)
- {
- super.pageChange(pageIndex);
-
- if (contentOutlinePage != null)
- {
- handleContentOutlineSelection(contentOutlinePage.getSelection());
- }
- }
-
- /**
- * This is how the framework determines which interfaces we implement.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-<%if (genModel.useGenerics()) {%>
- @SuppressWarnings("<%if (genModel.getRuntimeVersion().getValue() >= GenRuntimeVersion.EMF26_VALUE) {%>rawtypes<%} else {%>unchecked<%}%>")
-<%}%>
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- public Object getAdapter(Class key)
- {
- if (key.equals(IContentOutlinePage.class))
- {
- return showOutlineView() ? getContentOutlinePage() : null;
- }
- else if (key.equals(IPropertySheetPage.class))
- {
- return getPropertySheetPage();
- }
-<%if (!genModel.isRichClientPlatform()) {%>
- else if (key.equals(IGotoMarker.class))
- {
- return this;
- }
-<%}%>
- else
- {
- return super.getAdapter(key);
- }
- }
-
- /**
- * This accesses a cached version of the content outliner.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public IContentOutlinePage getContentOutlinePage()
- {
- if (contentOutlinePage == null)
- {
- // The content outline is just a tree.
- //
- class MyContentOutlinePage extends ContentOutlinePage
- {
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- public void createControl(Composite parent)
- {
- super.createControl(parent);
- contentOutlineViewer = getTreeViewer();
- contentOutlineViewer.addSelectionChangedListener(this);
-
- // Set up the tree viewer.
- //
- contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
- contentOutlineViewer.setLabelProvider(new <%=_AdapterFactoryLabelProvider%>(adapterFactory<%if (useExtendedLabelProvider) {%>, contentOutlineViewer<%}%>));
- contentOutlineViewer.setInput(editingDomain.getResourceSet());
-
- // Make sure our popups work.
- //
- createContextMenuFor(contentOutlineViewer);
-
- if (!editingDomain.getResourceSet().getResources().isEmpty())
- {
- // Select the root object in the view.
- //
- contentOutlineViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
- }
- }
-
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager)
- {
- super.makeContributions(menuManager, toolBarManager, statusLineManager);
- contentOutlineStatusLineManager = statusLineManager;
- }
-
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- public void setActionBars(IActionBars actionBars)
- {
- super.setActionBars(actionBars);
- getActionBarContributor().shareGlobalActions(this, actionBars);
- }
- }
-
- contentOutlinePage = new MyContentOutlinePage();
-
- // Listen to selection so that we can handle it is a special way.
- //
- contentOutlinePage.addSelectionChangedListener
- (new ISelectionChangedListener()
- {
- // This ensures that we handle selections correctly.
- //
- public void selectionChanged(SelectionChangedEvent event)
- {
- handleContentOutlineSelection(event.getSelection());
- }
- });
- }
-
- return contentOutlinePage;
- }
-
- /**
- * This accesses a cached version of the property sheet.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public IPropertySheetPage getPropertySheetPage()
- {
- if (propertySheetPage == null)
- {
- propertySheetPage =
- new ExtendedPropertySheetPage(editingDomain)
- {
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- public void setSelectionToViewer(<%=_ListOfAnything%> selection)
- {
- <%=genPackage.getEditorClassName()%>.this.setSelectionToViewer(selection);
- <%=genPackage.getEditorClassName()%>.this.setFocus();
- }
-
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- public void setActionBars(IActionBars actionBars)
- {
- super.setActionBars(actionBars);
- getActionBarContributor().shareGlobalActions(this, actionBars);
- }
- };
- propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory));
- }
-
- return propertySheetPage;
- }
-
- /**
- * This deals with how we want selection in the outliner to affect the other views.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void handleContentOutlineSelection(ISelection selection)
- {
-<%if (genPackage.isMultipleEditorPages()) {%>
- if (currentViewerPane != null && !selection.isEmpty() && selection instanceof IStructuredSelection)
-<%} else {%>
- if (selectionViewer != null && !selection.isEmpty() && selection instanceof IStructuredSelection)
-<%}%>
- {
- Iterator<%if (genModel.useGenerics()) {%><?><%}%> selectedElements = ((IStructuredSelection)selection).iterator();
- if (selectedElements.hasNext())
- {
- // Get the first selected element.
- //
- Object selectedElement = selectedElements.next();
-
-<%if (genPackage.isMultipleEditorPages()) {%>
- // If it's the selection viewer, then we want it to select the same selection as this selection.
- //
- if (currentViewerPane.getViewer() == selectionViewer)
- {
- <%=_ArrayListOfObject%> selectionList = new <%=_ArrayListOfObject%>();
- selectionList.add(selectedElement);
- while (selectedElements.hasNext())
- {
- selectionList.add(selectedElements.next());
- }
-
- // Set the selection to the widget.
- //
- selectionViewer.setSelection(new StructuredSelection(selectionList));
- }
- else
- {
- // Set the input to the widget.
- //
- if (currentViewerPane.getViewer().getInput() != selectedElement)
- {
- currentViewerPane.getViewer().setInput(selectedElement);
- currentViewerPane.setTitle(selectedElement);
- }
- }
-<%} else {%>
- <%=_ArrayListOfObject%> selectionList = new <%=_ArrayListOfObject%>();
- selectionList.add(selectedElement);
- while (selectedElements.hasNext())
- {
- selectionList.add(selectedElements.next());
- }
-
- // Set the selection to the widget.
- //
- selectionViewer.setSelection(new StructuredSelection(selectionList));
-<%}%>
- }
- }
- }
-
- /**
- * This is for implementing {@link IEditorPart} and simply tests the command stack.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- public boolean isDirty()
- {
- return ((BasicCommandStack)editingDomain.getCommandStack()).isSaveNeeded();
- }
-
- /**
- * This is for implementing {@link IEditorPart} and simply saves the model file.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- public void doSave(IProgressMonitor progressMonitor)
- {
- // Save only resources that have actually changed.
- //
- final <%=_MapOfObjectToObject%> saveOptions = new <%=_HashMapOfObjectToObject%>();
-<%if (genModel.getRuntimeVersion().getValue() >= GenRuntimeVersion.EMF23_VALUE) {%>
- saveOptions.put(Resource.OPTION_SAVE_ONLY_IF_CHANGED, Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER);
-<%}%>
-
- // Do the work within an operation because this is a long running activity that modifies the workbench.
- //
- <%=importedOperationClassName%> operation =
- new <%=importedOperationClassName%>()
- {
- // This is the method that gets invoked when the operation runs.
- //
-<%if (!genModel.isRichClientPlatform() && genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- public void <%=operationMethodName%>(IProgressMonitor monitor)
- {
- // Save the resources to the file system.
- //
- boolean first = true;
-<%if (genModel.useGenerics()) {%>
- for (Resource resource : editingDomain.getResourceSet().getResources())
-<%} else {%>
- for (Iterator i = editingDomain.getResourceSet().getResources().iterator(); i.hasNext(); )
-<%}%>
- {
-<%if (!genModel.useGenerics()) {%>
- Resource resource = (Resource)i.next();
-<%}%>
- if ((first || !resource.getContents().isEmpty() || isPersisted(resource)) && !editingDomain.isReadOnly(resource))
- {
- try
- {
-<%if (genModel.getRuntimeVersion().getValue() >= GenRuntimeVersion.EMF24_VALUE) {%>
- long timeStamp = resource.getTimeStamp();
- resource.save(saveOptions);
- if (resource.getTimeStamp() != timeStamp)
- {
- savedResources.add(resource);
- }
-<%} else {%>
- resource.save(saveOptions);
- savedResources.add(resource);
-<%}%>
- }
- catch (Exception exception)
- {
- resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
- }
- first = false;
- }
- }
- }
- };
-
- updateProblemIndication = false;
- try
- {
- // This runs the options, and shows progress.
- //
- new ProgressMonitorDialog(getSite().getShell()).run(true, false, operation);
-
- // Refresh the necessary state.
- //
- ((BasicCommandStack)editingDomain.getCommandStack()).saveIsDone();
- firePropertyChange(IEditorPart.PROP_DIRTY);
- }
- catch (Exception exception)
- {
- // Something went wrong that shouldn't.
- //
- <%=genPackage.getImportedEditorPluginClassName()%>.INSTANCE.log(exception);
- }
- updateProblemIndication = true;
- updateProblemIndication();
- }
-
- /**
- * This returns whether something has been persisted to the URI of the specified resource.
- * The implementation uses the URI converter from the editor's resource set to try to open an input stream.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected boolean isPersisted(Resource resource)
- {
- boolean result = false;
- try
- {
- InputStream stream = editingDomain.getResourceSet().getURIConverter().createInputStream(resource.getURI());
- if (stream != null)
- {
- result = true;
- stream.close();
- }
- }
- catch (IOException e)
- {
- // Ignore
- }
- return result;
- }
-
- /**
- * This always returns true because it is not currently supported.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- public boolean isSaveAsAllowed()
- {
- return true;
- }
-
- /**
- * This also changes the editor's input.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- public void doSaveAs()
- {
-<%if (genModel.isRichClientPlatform()) {%>
- <%if (genModel.isRichAjaxPlatform()) {%>
- new <%=genModel.getImportedName("org.eclipse.emf.common.ui.dialogs.ResourceDialog")%>(getSite().getShell(), null, SWT.NONE)
- {
- <%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
- <%}%>
- protected boolean isSave()
- {
- return true;
- }
-
- <%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
- <%}%>
- protected boolean processResources()
- {
- <%="List" + (genModel.useGenerics() ? "<URI>" : "")%> uris = getURIs();
- if (uris.size() > 0)
- {
- URI uri = <%=genModel.useGenerics() ? "": "(URI)"%>uris.get(0);
- doSaveAs(uri, new <%=genModel.getImportedName("org.eclipse.emf.common.ui.URIEditorInput")%>(uri));
- return true;
- }
- else
- {
- return false;
- }
- }
- }.open();
- <%} else {%>
- String[] filters = <%if (!genModel.useGenerics()) {%>(String[])<%}%>FILE_EXTENSION_FILTERS.toArray(new String[FILE_EXTENSION_FILTERS.size()]);
- String[] files = <%=genModel.getImportedName(genModel.getQualifiedEditorAdvisorClassName())%>.openFilePathDialog(getSite().getShell(), <%=genModel.getImportedName("org.eclipse.swt.SWT")%>.SAVE, filters);
- if (files.length > 0)
- {
- URI uri = URI.createFileURI(files[0]);
- doSaveAs(uri, new <%=genModel.getImportedName("org.eclipse.emf.common.ui.URIEditorInput")%>(uri));
- }
- <%}%>
-<%} else {%>
- SaveAsDialog saveAsDialog = new SaveAsDialog(getSite().getShell());
- saveAsDialog.open();
- IPath path = saveAsDialog.getResult();
- if (path != null)
- {
- IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
- if (file != null)
- {
- doSaveAs(URI.createPlatformResourceURI(file.getFullPath().toString(), true), new FileEditorInput(file));
- }
- }
-<%}%>
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected void doSaveAs(URI uri, IEditorInput editorInput)
- {
- (<%if (!genModel.useGenerics()) {%>(Resource)<%}%>editingDomain.getResourceSet().getResources().get(0)).setURI(uri);
- setInputWithNotify(editorInput);
- setPartName(editorInput.getName());
- IProgressMonitor progressMonitor =
- getActionBars().getStatusLineManager() != null ?
- getActionBars().getStatusLineManager().getProgressMonitor() :
- new <%=genModel.getImportedName("org.eclipse.core.runtime.NullProgressMonitor")%>();
- doSave(progressMonitor);
- }
-<%if (!genModel.isRichClientPlatform()) {%>
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void gotoMarker(IMarker marker)
- {
- try
- {
- if (marker.getType().equals(EValidator.MARKER))
- {
- String uriAttribute = marker.getAttribute(EValidator.URI_ATTRIBUTE, null);
- if (uriAttribute != null)
- {
- URI uri = URI.createURI(uriAttribute);
- EObject eObject = editingDomain.getResourceSet().getEObject(uri, true);
- if (eObject != null)
- {
- setSelectionToViewer(Collections.singleton(editingDomain.getWrapper(eObject)));
- }
- }
- }
- }
- catch (CoreException exception)
- {
- <%=genPackage.getImportedEditorPluginClassName()%>.INSTANCE.log(exception);
- }
- }
-<%}%>
-
- /**
- * This is called during startup.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- public void init(IEditorSite site, IEditorInput editorInput)
- {
- setSite(site);
- setInputWithNotify(editorInput);
- setPartName(editorInput.getName());
- site.setSelectionProvider(this);
- site.getPage().addPartListener(partListener);
-<%if (!genModel.isRichClientPlatform()) {%>
- ResourcesPlugin.getWorkspace().addResourceChangeListener(resourceChangeListener, IResourceChangeEvent.POST_CHANGE);
-<%}%>
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- public void setFocus()
- {
-<%if (genPackage.isMultipleEditorPages()) {%>
- if (currentViewerPane != null)
- {
- currentViewerPane.setFocus();
- }
- else
- {
- getControl(getActivePage()).setFocus();
- }
-<%} else {%>
- getControl(getActivePage()).setFocus();
-<%}%>
- }
-
- /**
- * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void addSelectionChangedListener(ISelectionChangedListener listener)
- {
- selectionChangedListeners.add(listener);
- }
-
- /**
- * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void removeSelectionChangedListener(ISelectionChangedListener listener)
- {
- selectionChangedListeners.remove(listener);
- }
-
- /**
- * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to return this editor's overall selection.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public ISelection getSelection()
- {
- return editorSelection;
- }
-
- /**
- * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to set this editor's overall selection.
- * Calling this result will notify the listeners.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setSelection(ISelection selection)
- {
- editorSelection = selection;
-
-<%if (genModel.useGenerics()) {%>
- for (ISelectionChangedListener listener : selectionChangedListeners)
-<%} else {%>
- for (Iterator listeners = selectionChangedListeners.iterator(); listeners.hasNext(); )
-<%}%>
- {
-<%if (!genModel.useGenerics()) {%>
- ISelectionChangedListener listener = (ISelectionChangedListener)listeners.next();
-<%}%>
- listener.selectionChanged(new SelectionChangedEvent(this, selection));
- }
- setStatusLineManager(selection);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setStatusLineManager(ISelection selection)
- {
- IStatusLineManager statusLineManager = currentViewer != null && currentViewer == contentOutlineViewer ?
- contentOutlineStatusLineManager : getActionBars().getStatusLineManager();
-
- if (statusLineManager != null)
- {
- if (selection instanceof IStructuredSelection)
- {
- <%=_CollectionOfAnything%> collection = ((IStructuredSelection)selection).toList();
- switch (collection.size())
- {
- case 0:
- {
- statusLineManager.setMessage(getString("_UI_NoObjectSelected"));<%=genModel.getNonNLS()%>
- break;
- }
- case 1:
- {
- String text = new AdapterFactoryItemDelegator(adapterFactory).getText(collection.iterator().next());
- statusLineManager.setMessage(getString("_UI_SingleObjectSelected", text));<%=genModel.getNonNLS()%>
- break;
- }
- default:
- {
- statusLineManager.setMessage(getString("_UI_MultiObjectSelected", Integer.toString(collection.size())));<%=genModel.getNonNLS()%>
- break;
- }
- }
- }
- else
- {
- statusLineManager.setMessage("");<%=genModel.getNonNLS()%>
- }
- }
- }
-
- /**
- * This looks up a string in the plugin's plugin.properties file.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static String getString(String key)
- {
- return <%=genPackage.getImportedEditorPluginClassName()%>.INSTANCE.getString(key);
- }
-
- /**
- * This looks up a string in plugin.properties, making a substitution.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static String getString(String key, Object s1)
- {
- return <%=genPackage.getImportedEditorPluginClassName()%>.INSTANCE.getString(key, new Object [] { s1 });
- }
-
- /**
- * This implements {@link org.eclipse.jface.action.IMenuListener} to help fill the context menus with contributions from the Edit menu.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void menuAboutToShow(IMenuManager menuManager)
- {
- ((IMenuListener)getEditorSite().getActionBarContributor()).menuAboutToShow(menuManager);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EditingDomainActionBarContributor getActionBarContributor()
- {
- return (EditingDomainActionBarContributor)getEditorSite().getActionBarContributor();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public IActionBars getActionBars()
- {
- return getActionBarContributor().getActionBars();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public AdapterFactory getAdapterFactory()
- {
- return adapterFactory;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- public void dispose()
- {
- updateProblemIndication = false;
-
-<%if (!genModel.isRichClientPlatform()) {%>
- ResourcesPlugin.getWorkspace().removeResourceChangeListener(resourceChangeListener);
-
-<%}%>
- getSite().getPage().removePartListener(partListener);
-
- adapterFactory.dispose();
-
- if (getActionBarContributor().getActiveEditor() == this)
- {
- getActionBarContributor().setActiveEditor(null);
- }
-
- if (propertySheetPage != null)
- {
- propertySheetPage.dispose();
- }
-
- if (contentOutlinePage != null)
- {
- contentOutlinePage.dispose();
- }
-
- super.dispose();
- }
-
- /**
- * Returns whether the outline view should be presented to the user.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected boolean showOutlineView()
- {
- return <%=genPackage.isMultipleEditorPages()%>;
- }
-}
-<%genModel.emitSortedImports();%>
diff --git a/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/EntryPoint.javajet b/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/EntryPoint.javajet
deleted file mode 100644
index d110e4aee8d..00000000000
--- a/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/EntryPoint.javajet
+++ /dev/null
@@ -1,90 +0,0 @@
-<%@ jet package="org.eclipse.emf.codegen.ecore.templates.editor" imports="java.util.* org.eclipse.emf.codegen.ecore.genmodel.*" class="EntryPoint" version="$Id: EntryPoint.javajet,v 1.2 2010/08/25 13:36:45 emerks Exp $" %>
-<%
-/**
- * <copyright>
- *
- * Copyright (c) 20010 Ed Merks and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Ed Merks - Initial API and implementation
- *
- * </copyright>
- */
-%>
-<%GenModel genModel = (GenModel)argument; /* Trick to import java.util.* without warnings */Iterator.class.getName();%>
-<%@ include file="../Header.javajetinc"%>
-package <%=genModel.getEditorPluginPackageName()%>;
-
-import org.eclipse.emf.edit.ui.EditorEntryPoint;
-<%genModel.markImportLocation(stringBuffer);%>
-
-/**
- * This is the entry point.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-public class <%=genModel.getEditorEntryPointClassName()%> extends EditorEntryPoint
-{
-<%if (genModel.hasCopyrightField()) {%>
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final <%=genModel.getImportedName("java.lang.String")%> copyright = <%=genModel.getCopyrightFieldLiteral()%>;<%=genModel.getNonNLS()%>
-
-<%}%>
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void onModuleLoad()
- {
- super.onModuleLoad();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected void registerPackages(<%=genModel.getImportedName("org.eclipse.emf.ecore.EPackage")%>.Registry packageRegistry)
- {
-<%for (GenPackage genPackage : genModel.getAllGenAndUsedGenPackagesWithClassifiers()) {%>
- packageRegistry.put(<%=genPackage.getImportedPackageInterfaceName()%>.eNS_URI, <%=genPackage.getImportedPackageInterfaceName()%>.eINSTANCE);
-<%}%>
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected void configureItemProviderAdapterFactories(<%=genModel.getImportedName("org.eclipse.emf.edit.provider.ComposedAdapterFactory")%> adapterFactory)
- {
-<%for (GenPackage genPackage : genModel.getAllGenAndUsedGenPackagesWithClassifiers()) {%>
- adapterFactory.addAdapterFactory(new <%=genPackage.getImportedItemProviderAdapterFactoryClassName()%>());
-<%}%>
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected String getApplicationTitle()
- {
- return "<%=genModel.getModelName()%> Application";<%=genModel.getNonNLS()%>
- }
-}
-<%genModel.emitSortedImports();%>
diff --git a/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/ModelFile.gif b/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/ModelFile.gif
deleted file mode 100644
index 27c7cbbe484..00000000000
--- a/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/ModelFile.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/ModelWizard.javajet b/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/ModelWizard.javajet
deleted file mode 100644
index af22c579711..00000000000
--- a/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/ModelWizard.javajet
+++ /dev/null
@@ -1,976 +0,0 @@
-<%@ jet package="org.eclipse.emf.codegen.ecore.templates.editor" imports="org.eclipse.emf.codegen.ecore.genmodel.*" class="ModelWizard" version="$Id: ModelWizard.javajet,v 1.29 2010/03/11 02:31:37 khussey Exp $" %>
-<%
-/**
- * <copyright>
- *
- * Copyright (c) 2002-2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- *
- * </copyright>
- */
-%>
-<%GenPackage genPackage = (GenPackage)argument; GenModel genModel=genPackage.getGenModel();%>
-<%@ include file="../Header.javajetinc"%>
-<%String _ListOfString = "List" + (genModel.useGenerics() ? "<" + genModel.getImportedName("java.lang.String") + ">" : "");%>
-<%String _ArrayListOfString = "ArrayList" + (genModel.useGenerics() ? "<" + genModel.getImportedName("java.lang.String") + ">" : "");%>
-<%String _CollectionOfString = "Collection" + (genModel.useGenerics() ? "<" + genModel.getImportedName("java.lang.String") + ">" : "");%>
-<%String _MapOfObjectToObject = "Map" + (genModel.useGenerics() ? "<" + genModel.getImportedName("java.lang.Object") + ", " + genModel.getImportedName("java.lang.Object") + ">" : "");%>
-<%String _HashMapOfObjectToObject = "HashMap" + (genModel.useGenerics() ? "<" + genModel.getImportedName("java.lang.Object") + ", " + genModel.getImportedName("java.lang.Object") + ">" : "");%>
-package <%=genPackage.getPresentationPackageName()%>;
-
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-<%if (!genModel.useGenerics()) {%>
-import java.util.Iterator;
-<%}%>
-import java.util.List;
-import java.util.Map;
-import java.util.MissingResourceException;
-import java.util.StringTokenizer;
-
-<%if (!genModel.isRichClientPlatform() && genModel.getComplianceLevel().getValue() >= GenJDKLevel.JDK50) {%>
-import org.eclipse.emf.common.CommonPlugin;
-
-<%}%>
-import org.eclipse.emf.common.util.URI;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EClassifier;
-
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
-
-import org.eclipse.emf.ecore.EObject;
-
-import org.eclipse.emf.ecore.xmi.XMLResource;
-
-import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry;
-
-<%if (!genModel.isRichClientPlatform()) {%>
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-
-<%}%>
-import org.eclipse.core.runtime.IProgressMonitor;
-
-import org.eclipse.jface.dialogs.MessageDialog;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.jface.wizard.WizardPage;
-
-import org.eclipse.swt.SWT;
-
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.ModifyEvent;
-
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
-
-<%if (!genModel.isRichClientPlatform()) {%>
-import org.eclipse.ui.actions.WorkspaceModifyOperation;
-
-import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
-
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.ui.part.ISetSelectionTarget;
-
-<%}%>
-<%if (!genModel.isSuppressEMFMetaData()) {%>
-import <%=genPackage.getQualifiedFactoryInterfaceName()%>;
-<%}%>
-import <%=genPackage.getQualifiedPackageInterfaceName()%>;
-import <%=genPackage.getQualifiedEditPluginClassName()%>;
-
-
-<%genModel.markImportLocation(stringBuffer);%>
-
-
-/**
- * This is a simple wizard for creating a new model file.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-public class <%=genPackage.getModelWizardClassName()%> extends Wizard implements INewWizard
-{
-<%if (genModel.hasCopyrightField()) {%>
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final <%=genModel.getImportedName("java.lang.String")%> copyright = <%=genModel.getCopyrightFieldLiteral()%>;<%=genModel.getNonNLS()%>
-
-<%}%>
- /**
- * The supported extensions for created files.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final <%=_ListOfString%> FILE_EXTENSIONS =
- Collections.unmodifiableList(Arrays.asList(<%=genPackage.getImportedEditorPluginClassName()%>.INSTANCE.getString("_UI_<%=genPackage.getEditorClassName()%>FilenameExtensions").split("\\s*,\\s*")));<%=genModel.getNonNLS()%><%=genModel.getNonNLS(2)%>
-
- /**
- * A formatted list of supported file extensions, suitable for display.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String FORMATTED_FILE_EXTENSIONS =
- <%=genPackage.getImportedEditorPluginClassName()%>.INSTANCE.getString("_UI_<%=genPackage.getEditorClassName()%>FilenameExtensions").replaceAll("\\s*,\\s*", ", ");<%=genModel.getNonNLS()%><%=genModel.getNonNLS(2)%><%=genModel.getNonNLS(3)%>
-
- /**
- * This caches an instance of the model package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected <%=genModel.isSuppressEMFMetaData() ? genModel.getImportedName("org.eclipse.emf.ecore.EPackage") : genPackage.getPackageInterfaceName()%> <%=genPackage.getUncapPackageName()%> = <%=genPackage.getPackageInterfaceName()%>.eINSTANCE;
-
- /**
- * This caches an instance of the model factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected <%=genModel.isSuppressEMFMetaData() ? genModel.getImportedName("org.eclipse.emf.ecore.EFactory") : genPackage.getFactoryInterfaceName()%> <%=genPackage.getUncapFactoryName()%> = <%=genPackage.getUncapPackageName()%>.get<%=genModel.isSuppressEMFMetaData() ? "EFactoryInstance" : genPackage.getFactoryName()%>();
-
-<%if (!genModel.isRichClientPlatform()) {%>
- /**
- * This is the file creation page.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected <%=genPackage.getModelWizardClassName()%>NewFileCreationPage newFileCreationPage;
-
-<%}%>
- /**
- * This is the initial object creation page.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected <%=genPackage.getModelWizardClassName()%>InitialObjectCreationPage initialObjectCreationPage;
-
- /**
- * Remember the selection during initialization for populating the default container.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected IStructuredSelection selection;
-
- /**
- * Remember the workbench during initialization.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected IWorkbench workbench;
-
- /**
-<%if (!genPackage.hasDocumentRoot()) {%>
- * Caches the names of the types that can be created as the root object.
-<%} else {%>
- * Caches the names of the features representing global elements.
-<%}%>
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected <%=_ListOfString%> initialObjectNames;
-
- /**
- * This just records the information.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void init(IWorkbench workbench, IStructuredSelection selection)
- {
- this.workbench = workbench;
- this.selection = selection;
- setWindowTitle(<%=genPackage.getImportedEditorPluginClassName()%>.INSTANCE.getString("_UI_Wizard_label"));<%=genModel.getNonNLS()%>
- setDefaultPageImageDescriptor(ExtendedImageRegistry.INSTANCE.getImageDescriptor(<%=genPackage.getImportedEditorPluginClassName()%>.INSTANCE.getImage("full/wizban/New<%=genPackage.getPrefix()%>")));<%=genModel.getNonNLS()%>
- }
-
- /**
-<%if (!genPackage.hasDocumentRoot()) {%>
- * Returns the names of the types that can be created as the root object.
-<%} else {%>
- * Returns the names of the features representing global elements.
-<%}%>
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected <%=_CollectionOfString%> getInitialObjectNames()
- {
- if (initialObjectNames == null)
- {
- initialObjectNames = new <%=_ArrayListOfString%>();
-<%if (!genPackage.hasDocumentRoot()) {%>
- <%if (genModel.useGenerics()) {%>
- for (EClassifier eClassifier : <%=genPackage.getUncapPackageName()%>.getEClassifiers())
- <%} else {%>
- for (Iterator classifiers = <%=genPackage.getUncapPackageName()%>.getEClassifiers().iterator(); classifiers.hasNext(); )
- <%}%>
- {
- <%if (!genModel.useGenerics()) {%>
- EClassifier eClassifier = (EClassifier)classifiers.next();
- <%}%>
- if (eClassifier instanceof EClass)
- {
- EClass eClass = (EClass)eClassifier;
- if (!eClass.isAbstract())
- {
- initialObjectNames.add(eClass.getName());
- }
- }
- }
-<%} else {%>
- <%if (genModel.useGenerics()) {%>
- for (<%=genModel.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")%> eStructuralFeature : <%=genModel.getImportedName("org.eclipse.emf.ecore.util.ExtendedMetaData")%>.INSTANCE.getAllElements(<%=genModel.getImportedName("org.eclipse.emf.ecore.util.ExtendedMetaData")%>.INSTANCE.getDocumentRoot(<%=genPackage.getUncapPackageName()%>)))
- <%} else {%>
- for (Iterator elements = <%=genModel.getImportedName("org.eclipse.emf.ecore.util.ExtendedMetaData")%>.INSTANCE.getAllElements(<%=genModel.getImportedName("org.eclipse.emf.ecore.util.ExtendedMetaData")%>.INSTANCE.getDocumentRoot(<%=genPackage.getUncapPackageName()%>)).iterator(); elements.hasNext(); )
- <%}%>
- {
- <%if (!genModel.useGenerics()) {%>
- <%=genModel.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")%> eStructuralFeature = (<%=genModel.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")%>)elements.next();
- <%}%>
- if (eStructuralFeature.isChangeable())
- {
- EClassifier eClassifier = eStructuralFeature.getEType();
- if (eClassifier instanceof EClass)
- {
- EClass eClass = (EClass)eClassifier;
- if (!eClass.isAbstract())
- {
- initialObjectNames.add(eStructuralFeature.getName());
- }
- }
- }
- }
-<%}%>
- Collections.sort(initialObjectNames, <%if (!genModel.isRichClientPlatform() && genModel.getComplianceLevel().getValue() >= GenJDKLevel.JDK50) {%>CommonPlugin.INSTANCE.getComparator()<%} else {%>java.text.Collator.getInstance()<%}%>);
- }
- return initialObjectNames;
- }
-
- /**
- * Create a new model.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected EObject createInitialModel()
- {
-<%if (!genPackage.hasDocumentRoot()) {%>
- EClass eClass = (EClass)<%=genPackage.getUncapPackageName()%>.getEClassifier(initialObjectCreationPage.getInitialObjectName());
- EObject rootObject = <%=genPackage.getUncapFactoryName()%>.create(eClass);
-<%} else {%>
- EClass eClass = <%=genModel.getImportedName("org.eclipse.emf.ecore.util.ExtendedMetaData")%>.INSTANCE.getDocumentRoot(<%=genPackage.getUncapPackageName()%>);
- EStructuralFeature eStructuralFeature = eClass.getEStructuralFeature(initialObjectCreationPage.getInitialObjectName());
- EObject rootObject = <%=genPackage.getUncapFactoryName()%>.create(eClass);
- rootObject.eSet(eStructuralFeature, <%=genModel.getImportedName("org.eclipse.emf.ecore.util.EcoreUtil")%>.create((EClass)eStructuralFeature.getEType()));
-<%}%>
- return rootObject;
- }
-
- /**
- * Do the work after everything is specified.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- public boolean performFinish()
- {
- try
- {
-<%if (genModel.isRichClientPlatform()) {%>
- // Get the URI of the model file.
- //
- final URI fileURI = getModelURI();
- if (new <%=genModel.getImportedName("java.io.File")%>(fileURI.toFileString()).exists())
- {
- if (!MessageDialog.openQuestion
- (getShell(),
- <%=genPackage.getImportedEditorPluginClassName()%>.INSTANCE.getString("_UI_Question_title"),<%=genModel.getNonNLS()%>
- <%=genPackage.getImportedEditorPluginClassName()%>.INSTANCE.getString("_WARN_FileConflict", new String []{ fileURI.toFileString() })))<%=genModel.getNonNLS()%>
- {
- initialObjectCreationPage.selectFileField();
- return false;
- }
- }
-
- // Do the work within an operation.
- //
- <%=genModel.getImportedName("org.eclipse.jface.operation.IRunnableWithProgress")%> operation = new <%=genModel.getImportedName("org.eclipse.jface.operation.IRunnableWithProgress")%>()
- {
- public void run(IProgressMonitor progressMonitor)
-<%} else {%>
- // Remember the file.
- //
- final IFile modelFile = getModelFile();
-
- // Do the work within an operation.
- //
- WorkspaceModifyOperation operation =
- new WorkspaceModifyOperation()
- {
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- protected void execute(IProgressMonitor progressMonitor)
-<%}%>
- {
- try
- {
- // Create a resource set
- //
- ResourceSet resourceSet = new ResourceSetImpl();
-
-<%if (!genModel.isRichClientPlatform()) {%>
- // Get the URI of the model file.
- //
- URI fileURI = URI.createPlatformResourceURI(modelFile.getFullPath().toString(), true);
-
-<%}%>
- // Create a resource for this file.
- //
- Resource resource = resourceSet.createResource(fileURI<%if (genPackage.isContentType()) {%>, <%=genPackage.getImportedPackageInterfaceName()%>.eCONTENT_TYPE<%}%>);
-
- // Add the initial model object to the contents.
- //
- EObject rootObject = createInitialModel();
- if (rootObject != null)
- {
- resource.getContents().add(rootObject);
- }
-
- // Save the contents of the resource to the file system.
- //
- <%=_MapOfObjectToObject%> options = new <%=_HashMapOfObjectToObject%>();
- options.put(XMLResource.OPTION_ENCODING, initialObjectCreationPage.getEncoding());
- resource.save(options);
- }
- catch (Exception exception)
- {
- <%=genPackage.getImportedEditorPluginClassName()%>.INSTANCE.log(exception);
- }
- finally
- {
- progressMonitor.done();
- }
- }
- };
-
- getContainer().run(false, false, operation);
-
-<%if (genModel.isRichClientPlatform()) {%>
- return <%=genModel.getImportedName(genModel.getQualifiedEditorAdvisorClassName())%>.openEditor(workbench, fileURI);
-<%} else {%>
- // Select the new file resource in the current view.
- //
- <%=genModel.getImportedName("org.eclipse.ui.IWorkbenchWindow")%> workbenchWindow = workbench.getActiveWorkbenchWindow();
- <%=genModel.getImportedName("org.eclipse.ui.IWorkbenchPage")%> page = workbenchWindow.getActivePage();
- final <%=genModel.getImportedName("org.eclipse.ui.IWorkbenchPart")%> activePart = page.getActivePart();
- if (activePart instanceof ISetSelectionTarget)
- {
- final <%=genModel.getImportedName("org.eclipse.jface.viewers.ISelection")%> targetSelection = new <%=genModel.getImportedName("org.eclipse.jface.viewers.StructuredSelection")%>(modelFile);
- getShell().getDisplay().asyncExec
- (new Runnable()
- {
- public void run()
- {
- ((ISetSelectionTarget)activePart).selectReveal(targetSelection);
- }
- });
- }
-
- // Open an editor on the new file.
- //
- try
- {
- page.openEditor
- (new FileEditorInput(modelFile),
- workbench.getEditorRegistry().getDefaultEditor<%if (!genPackage.isContentType()) {%>(modelFile.getFullPath().toString()).getId());<%} else {%>
- (modelFile.getFullPath().toString(),
- <%=genModel.getImportedName("org.eclipse.core.runtime.Platform")%>.getContentTypeManager().getContentType(<%=genPackage.getImportedPackageInterfaceName()%>.eCONTENT_TYPE)).getId());
-<%}%>
- }
- catch (<%=genModel.getImportedName("org.eclipse.ui.PartInitException")%> exception)
- {
- MessageDialog.openError(workbenchWindow.getShell(), <%=genPackage.getImportedEditorPluginClassName()%>.INSTANCE.getString("_UI_OpenEditorError_label"), exception.getMessage());<%=genModel.getNonNLS()%>
- return false;
- }
-
- return true;
-<%}%>
- }
- catch (Exception exception)
- {
- <%=genPackage.getImportedEditorPluginClassName()%>.INSTANCE.log(exception);
- return false;
- }
- }
-
-<%if (!genModel.isRichClientPlatform()) {%>
- /**
- * This is the one page of the wizard.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public class <%=genPackage.getModelWizardClassName()%>NewFileCreationPage extends WizardNewFileCreationPage
- {
- /**
- * Pass in the selection.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public <%=genPackage.getModelWizardClassName()%>NewFileCreationPage(String pageId, IStructuredSelection selection)
- {
- super(pageId, selection);
- }
-
- /**
- * The framework calls this to see if the file is correct.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- protected boolean validatePage()
- {
- if (super.validatePage())
- {
- String extension = new <%=genModel.getImportedName("org.eclipse.core.runtime.Path")%>(getFileName()).getFileExtension();
- if (extension == null || !FILE_EXTENSIONS.contains(extension))
- {
- String key = FILE_EXTENSIONS.size() > 1 ? "_WARN_FilenameExtensions" : "_WARN_FilenameExtension";<%=genModel.getNonNLS()%><%=genModel.getNonNLS(2)%>
- setErrorMessage(<%=genPackage.getImportedEditorPluginClassName()%>.INSTANCE.getString(key, new Object [] { FORMATTED_FILE_EXTENSIONS }));
- return false;
- }
- return true;
- }
- return false;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public IFile getModelFile()
- {
- return ResourcesPlugin.getWorkspace().getRoot().getFile(getContainerFullPath().append(getFileName()));
- }
- }
-
-<%}%>
- /**
- * This is the page where the type of object to create is selected.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public class <%=genPackage.getModelWizardClassName()%>InitialObjectCreationPage extends WizardPage
- {
-<%if (genModel.isRichClientPlatform()) {%>
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected <%=genModel.getImportedName("org.eclipse.swt.widgets.Text")%> fileField;
-
-<%}%>
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected Combo initialObjectField;
-
- /**
- * @generated
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- */
- protected <%=_ListOfString%> encodings;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected Combo encodingField;
-
- /**
- * Pass in the selection.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public <%=genPackage.getModelWizardClassName()%>InitialObjectCreationPage(String pageId)
- {
- super(pageId);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void createControl(Composite parent)
- {
- Composite composite = new Composite(parent, SWT.NONE);
- {
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- layout.verticalSpacing = 12;
- composite.setLayout(layout);
-
- GridData data = new GridData();
- data.verticalAlignment = GridData.FILL;
- data.grabExcessVerticalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- composite.setLayoutData(data);
- }
-
-<%if (genModel.isRichClientPlatform()) {%>
- Label resourceURILabel = new Label(composite, SWT.LEFT);
- {
- resourceURILabel.setText(<%=genPackage.getImportedEditorPluginClassName()%>.INSTANCE.getString("_UI_File_label"));<%=genModel.getNonNLS()%>
-
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- resourceURILabel.setLayoutData(data);
- }
-
- Composite fileComposite = new Composite(composite, SWT.NONE);
- {
- GridData data = new GridData();
- data.horizontalAlignment = GridData.END;
- fileComposite.setLayoutData(data);
-
- GridLayout layout = new GridLayout();
- data.horizontalAlignment = GridData.FILL;
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- layout.numColumns = 2;
- fileComposite.setLayout(layout);
- }
-
- fileField = new <%=genModel.getImportedName("org.eclipse.swt.widgets.Text")%>(fileComposite, SWT.BORDER);
- {
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- data.horizontalSpan = 1;
- fileField.setLayoutData(data);
- }
-
- fileField.addModifyListener(validator);
-
- <%if (!genModel.isRichAjaxPlatform()) {%>
- <%=genModel.getImportedName("org.eclipse.swt.widgets.Button")%> resourceURIBrowseFileSystemButton = new <%=genModel.getImportedName("org.eclipse.swt.widgets.Button")%>(fileComposite, SWT.PUSH);
- resourceURIBrowseFileSystemButton.setText(<%=genPackage.getImportedEditorPluginClassName()%>.INSTANCE.getString("_UI_Browse_label"));<%=genModel.getNonNLS()%>
-
- resourceURIBrowseFileSystemButton.addSelectionListener
- (new <%=genModel.getImportedName("org.eclipse.swt.events.SelectionAdapter")%>()
- {
- <%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
- <%}%>
- public void widgetSelected(<%=genModel.getImportedName("org.eclipse.swt.events.SelectionEvent")%> event)
- {
- String[] filters = <%if (!genModel.useGenerics()) {%>(String[])<%}%><%=genPackage.getImportedEditorClassName()%>.FILE_EXTENSION_FILTERS.toArray(new String[<%=genPackage.getImportedEditorClassName()%>.FILE_EXTENSION_FILTERS.size()]);
- String[] files = <%=genModel.getImportedName(genModel.getQualifiedEditorAdvisorClassName())%>.openFilePathDialog(getShell(), <%=genModel.getImportedName("org.eclipse.swt.SWT")%>.SAVE, filters);
- if (files.length > 0)
- {
- fileField.setText(files[0]);
- }
- }
- });
- <%}%>
-<%}%>
- Label containerLabel = new Label(composite, SWT.LEFT);
- {
- containerLabel.setText(<%=genPackage.getImportedEditorPluginClassName()%>.INSTANCE.getString("_UI_ModelObject"));<%=genModel.getNonNLS()%>
-
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- containerLabel.setLayoutData(data);
- }
-
- initialObjectField = new Combo(composite, SWT.BORDER);
- {
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- initialObjectField.setLayoutData(data);
- }
-
- <%if (genModel.useGenerics()) {%>
- for (String objectName : getInitialObjectNames())
- {
- initialObjectField.add(getLabel(objectName));
- }
- <%} else {%>
- for (Iterator i = getInitialObjectNames().iterator(); i.hasNext(); )
- {
- initialObjectField.add(getLabel((String)i.next()));
- }
- <%}%>
-
- if (initialObjectField.getItemCount() == 1)
- {
- initialObjectField.select(0);
- }
- initialObjectField.addModifyListener(validator);
-
- Label encodingLabel = new Label(composite, SWT.LEFT);
- {
- encodingLabel.setText(<%=genPackage.getImportedEditorPluginClassName()%>.INSTANCE.getString("_UI_XMLEncoding"));<%=genModel.getNonNLS()%>
-
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- encodingLabel.setLayoutData(data);
- }
- encodingField = new Combo(composite, SWT.BORDER);
- {
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- encodingField.setLayoutData(data);
- }
-
- <%if (genModel.useGenerics()) {%>
- for (String encoding : getEncodings())
- {
- encodingField.add(encoding);
- }
- <%} else {%>
- for (Iterator i = getEncodings().iterator(); i.hasNext(); )
- {
- encodingField.add((String)i.next());
- }
- <%}%>
-
- encodingField.select(0);
- encodingField.addModifyListener(validator);
-
- setPageComplete(validatePage());
- setControl(composite);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected ModifyListener validator =
- new ModifyListener()
- {
- public void modifyText(ModifyEvent e)
- {
- setPageComplete(validatePage());
- }
- };
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected boolean validatePage()
- {
-<%if (genModel.isRichClientPlatform()) {%>
- URI fileURI = getFileURI();
- if (fileURI == null || fileURI.isEmpty())
- {
- setErrorMessage(null);
- return false;
- }
-
- String extension = fileURI.fileExtension();
- if (extension == null || !FILE_EXTENSIONS.contains(extension))
- {
- String key = FILE_EXTENSIONS.size() > 1 ? "_WARN_FilenameExtensions" : "_WARN_FilenameExtension";<%=genModel.getNonNLS()%><%=genModel.getNonNLS(2)%>
- setErrorMessage(<%=genPackage.getImportedEditorPluginClassName()%>.INSTANCE.getString(key, new Object [] { FORMATTED_FILE_EXTENSIONS }));
- return false;
- }
-
- setErrorMessage(null);
-<%}%>
- return getInitialObjectName() != null && getEncodings().contains(encodingField.getText());
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- public void setVisible(boolean visible)
- {
- super.setVisible(visible);
- if (visible)
- {
-<%if (!genModel.isRichClientPlatform()) {%>
- if (initialObjectField.getItemCount() == 1)
- {
- initialObjectField.clearSelection();
- encodingField.setFocus();
- }
- else
- {
- encodingField.clearSelection();
- initialObjectField.setFocus();
- }
-<%} else {%>
- initialObjectField.clearSelection();
- encodingField.clearSelection();
- fileField.setFocus();
-<%}%>
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getInitialObjectName()
- {
- String label = initialObjectField.getText();
-
- <%if (genModel.useGenerics()) {%>
- for (String name : getInitialObjectNames())
- <%} else {%>
- for (Iterator i = getInitialObjectNames().iterator(); i.hasNext(); )
- <%}%>
- {
- <%if (!genModel.useGenerics()) {%>
- String name = (String)i.next();
- <%}%>
- if (getLabel(name).equals(label))
- {
- return name;
- }
- }
- return null;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getEncoding()
- {
- return encodingField.getText();
- }
-<%if (genModel.isRichClientPlatform()) {%>
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public URI getFileURI()
- {
- try
- {
- return URI.createFileURI(fileField.getText());
- }
- catch (Exception exception)
- {
- // Ignore
- }
- return null;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void selectFileField()
- {
- initialObjectField.clearSelection();
- encodingField.clearSelection();
- fileField.selectAll();
- fileField.setFocus();
- }
-<%}%>
-<%{ String type = genPackage.hasDocumentRoot() ? "feature" : "type"; String prefix = genPackage.hasDocumentRoot() ? "_UI_DocumentRoot_" : "_UI_";%>
-
- /**
- * Returns the label for the specified <%=type%> name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected String getLabel(String <%=type%>Name)
- {
- try
- {
- return <%=genPackage.getEditPluginClassName()%>.INSTANCE.getString("<%=prefix%>" + <%=type%>Name + "_<%=type%>");<%=genModel.getNonNLS()%><%=genModel.getNonNLS(2)%>
- }
- catch(MissingResourceException mre)
- {
- <%=genModel.getImportedName(genModel.getQualifiedEditorPluginClassName())%>.INSTANCE.log(mre);
- }
- return <%=type%>Name;
- }
-<%}%>
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected <%=_CollectionOfString%> getEncodings()
- {
- if (encodings == null)
- {
- encodings = new <%=_ArrayListOfString%>();
- for (StringTokenizer stringTokenizer = new StringTokenizer(<%=genPackage.getImportedEditorPluginClassName()%>.INSTANCE.getString("_UI_XMLEncodingChoices")); stringTokenizer.hasMoreTokens(); )<%=genModel.getNonNLS()%>
- {
- encodings.add(stringTokenizer.nextToken());
- }
- }
- return encodings;
- }
- }
-
- /**
- * The framework calls this to create the contents of the wizard.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- public void addPages()
- {
-<%if (!genModel.isRichClientPlatform()) {%>
- // Create a page, set the title, and the initial model file name.
- //
- newFileCreationPage = new <%=genPackage.getModelWizardClassName()%>NewFileCreationPage("Whatever", selection);<%=genModel.getNonNLS()%>
- newFileCreationPage.setTitle(<%=genPackage.getImportedEditorPluginClassName()%>.INSTANCE.getString("_UI_<%=genPackage.getModelWizardClassName()%>_label"));<%=genModel.getNonNLS()%>
- newFileCreationPage.setDescription(<%=genPackage.getImportedEditorPluginClassName()%>.INSTANCE.getString("_UI_<%=genPackage.getModelWizardClassName()%>_description"));<%=genModel.getNonNLS()%>
- newFileCreationPage.setFileName(<%=genPackage.getImportedEditorPluginClassName()%>.INSTANCE.getString("_UI_<%=genPackage.getEditorClassName()%>FilenameDefaultBase") + "." + <%if (!genModel.useGenerics()) {%>(String)<%}%>FILE_EXTENSIONS.get(0));<%=genModel.getNonNLS()%><%=genModel.getNonNLS(2)%>
- addPage(newFileCreationPage);
-
- // Try and get the resource selection to determine a current directory for the file dialog.
- //
- if (selection != null && !selection.isEmpty())
- {
- // Get the resource...
- //
- Object selectedElement = selection.iterator().next();
- if (selectedElement instanceof IResource)
- {
- // Get the resource parent, if its a file.
- //
- IResource selectedResource = (IResource)selectedElement;
- if (selectedResource.getType() == IResource.FILE)
- {
- selectedResource = selectedResource.getParent();
- }
-
- // This gives us a directory...
- //
- if (selectedResource instanceof IFolder || selectedResource instanceof IProject)
- {
- // Set this for the container.
- //
- newFileCreationPage.setContainerFullPath(selectedResource.getFullPath());
-
- // Make up a unique new name here.
- //
- String defaultModelBaseFilename = <%=genPackage.getImportedEditorPluginClassName()%>.INSTANCE.getString("_UI_<%=genPackage.getEditorClassName()%>FilenameDefaultBase");<%=genModel.getNonNLS()%>
- String defaultModelFilenameExtension = <%if (!genModel.useGenerics()) {%>(String)<%}%>FILE_EXTENSIONS.get(0);
- String modelFilename = defaultModelBaseFilename + "." + defaultModelFilenameExtension;<%=genModel.getNonNLS()%>
- for (int i = 1; ((IContainer)selectedResource).findMember(modelFilename) != null; ++i)
- {
- modelFilename = defaultModelBaseFilename + i + "." + defaultModelFilenameExtension;<%=genModel.getNonNLS()%>
- }
- newFileCreationPage.setFileName(modelFilename);
- }
- }
- }
-<%}%>
- initialObjectCreationPage = new <%=genPackage.getModelWizardClassName()%>InitialObjectCreationPage("Whatever2");<%=genModel.getNonNLS()%>
- initialObjectCreationPage.setTitle(<%=genPackage.getImportedEditorPluginClassName()%>.INSTANCE.getString("_UI_<%=genPackage.getModelWizardClassName()%>_label"));<%=genModel.getNonNLS()%>
- initialObjectCreationPage.setDescription(<%=genPackage.getImportedEditorPluginClassName()%>.INSTANCE.getString("_UI_Wizard_initial_object_description"));<%=genModel.getNonNLS()%>
- addPage(initialObjectCreationPage);
- }
-
-<%if (genModel.isRichClientPlatform()) {%>
- /**
- * Get the URI from the page.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public URI getModelURI()
- {
- return initialObjectCreationPage.getFileURI();
- }
-
-<%} else {%>
- /**
- * Get the file from the page.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public IFile getModelFile()
- {
- return newFileCreationPage.getModelFile();
- }
-
-<%}%>
-}
-<%genModel.emitSortedImports();%>
diff --git a/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/NewModel.gif b/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/NewModel.gif
deleted file mode 100644
index cf905caf0e5..00000000000
--- a/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/NewModel.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/Plugin.javajet b/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/Plugin.javajet
deleted file mode 100644
index c5a3f0c0d92..00000000000
--- a/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/Plugin.javajet
+++ /dev/null
@@ -1,139 +0,0 @@
-<%@ jet package="org.eclipse.emf.codegen.ecore.templates.editor" imports="java.util.* org.eclipse.emf.codegen.ecore.genmodel.*" class="Plugin" version="$Id: Plugin.javajet,v 1.11 2010/08/24 16:59:38 emerks Exp $" %>
-<%
-/**
- * <copyright>
- *
- * Copyright (c) 2002-2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- *
- * </copyright>
- */
-%>
-<%GenModel genModel = (GenModel)argument; /* Trick to import java.util.* without warnings */Iterator.class.getName();%>
-<%@ include file="../Header.javajetinc"%>
-package <%=genModel.getEditorPluginPackageName()%>;
-
-<%genModel.addImport("org.eclipse.emf.common.EMFPlugin");%>
-<%genModel.addImport("org.eclipse.emf.common.util.ResourceLocator");%>
-<%genModel.markImportLocation(stringBuffer);%>
-
-/**
- * This is the central singleton for the <%=genModel.getModelName()%> editor plugin.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-public final class <%=genModel.getEditorPluginClassName()%> extends EMFPlugin
-{
-<%if (genModel.hasCopyrightField()) {%>
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final <%=genModel.getImportedName("java.lang.String")%> copyright = <%=genModel.getCopyrightFieldLiteral()%>;<%=genModel.getNonNLS()%>
-
-<%}%>
- /**
- * Keep track of the singleton.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final <%=genModel.getEditorPluginClassName()%> INSTANCE = new <%=genModel.getEditorPluginClassName()%>();
-
-<%if (genModel.getRuntimePlatform() != GenRuntimePlatform.GWT) {%>
- /**
- * Keep track of the singleton.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static Implementation plugin;
-
-<%}%>
- /**
- * Create the instance.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public <%=genModel.getEditorPluginClassName()%>()
- {
- super
- (new ResourceLocator []
- {
-<%for (String pluginClassName : genModel.getEditResourceDelegateImportedPluginClassNames()) {%>
- <%=pluginClassName%>.INSTANCE,
-<%}%>
- });
- }
-
- /**
- * Returns the singleton instance of the Eclipse plugin.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the singleton instance.
- * @generated
- */
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- public ResourceLocator getPluginResourceLocator()
- {
-<%if (genModel.getRuntimePlatform() == GenRuntimePlatform.GWT) {%>
- return null;
-<%} else {%>
- return plugin;
-<%}%>
- }
-
-<%if (genModel.getRuntimePlatform() != GenRuntimePlatform.GWT) {%>
- /**
- * Returns the singleton instance of the Eclipse plugin.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the singleton instance.
- * @generated
- */
- public static Implementation getPlugin()
- {
- return plugin;
- }
-
- /**
- * The actual implementation of the Eclipse <b>Plugin</b>.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static class Implementation extends <%=genModel.getImportedName("org.eclipse.emf.common.ui.EclipseUIPlugin")%>
- {
- /**
- * Creates an instance.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
-<%if (genModel.needsRuntimeCompatibility()) {%>
- * @param descriptor the description of the plugin.
-<%}%>
- * @generated
- */
- public Implementation(<%if (genModel.needsRuntimeCompatibility()) {%><%=genModel.getImportedName("org.eclipse.core.runtime.IPluginDescriptor")%> descriptor<%}%>)
- {
- super(<%if (genModel.needsRuntimeCompatibility()) {%>descriptor<%}%>);
-
- // Remember the static instance.
- //
- plugin = this;
- }
- }
-
-<%}%>
-}
-<%genModel.emitSortedImports();%>
diff --git a/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/appengine-web.xmljet b/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/appengine-web.xmljet
deleted file mode 100644
index d6202feaca5..00000000000
--- a/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/appengine-web.xmljet
+++ /dev/null
@@ -1,24 +0,0 @@
-<%@ jet package="org.eclipse.emf.codegen.ecore.templates.editor" imports="java.util.* org.eclipse.emf.codegen.ecore.genmodel.*" class="AppEngineWebXML" version="$Id: appengine-web.xmljet,v 1.1 2010/08/24 16:59:38 emerks Exp $" %>
-<%
-/**
- * <copyright>
- *
- * Copyright (c) 2010 Ed Merks and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Ed Merks - Initial API and implementation
- *
- * </copyright>
- */
-%>
-<%GenModel genModel = (GenModel)argument; /* Trick to import java.util.* without warnings */Iterator.class.getName();%>
-<?xml version="1.0" encoding="UTF-8"?>
-<%@ include file="../Header.xmljetinc"%>
-<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
- <application><%=genModel.getModelName().toLowerCase().replaceAll("\\s", "-")%>-editor</application>
- <version>1</version>
-</appengine-web-app> \ No newline at end of file
diff --git a/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/build.propertiesjet b/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/build.propertiesjet
deleted file mode 100644
index a16bdc132ef..00000000000
--- a/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/build.propertiesjet
+++ /dev/null
@@ -1,35 +0,0 @@
-<%@ jet package="org.eclipse.emf.codegen.ecore.templates.editor" imports="org.eclipse.emf.codegen.ecore.genmodel.* java.util.*" class="BuildProperties" version="$Id: build.propertiesjet,v 1.11 2010/08/24 16:59:38 emerks Exp $" %>
-<%
-/**
- * <copyright>
- *
- * Copyright (c) 2002-2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- *
- * </copyright>
- */
-%>
-<%GenModel genModel = (GenModel)argument;%>
-<%String pluginClassesLocation = genModel.isRuntimeJar() ? genModel.getEditorPluginID()+".jar" : ".";%>
-<%List<String> sourceFolders = genModel.getEditorSourceFolders();%>
-<%@ include file="../Header.propertiesjetinc"%>
-
-bin.includes = <%=pluginClassesLocation%>,\
- icons/,\
-<%if (genModel.isBundleManifest()) {%>
- META-INF/,\
-<%}%>
-<%if (genModel.getRuntimePlatform() != GenRuntimePlatform.GWT) {%>
- plugin.xml,\
-<%}%>
- plugin.properties
-jars.compile.order = <%=pluginClassesLocation%>
-<% boolean first=true; for (Iterator<String> i = sourceFolders.iterator(); i.hasNext();) { String sourceFolder = i.next(); if (i.hasNext()){sourceFolder +=",\\";} if (first) {%>
-source.<%=pluginClassesLocation%> = <%=sourceFolder%><%first=false;} else {%><%=sourceFolder%><%}}%>
-output.<%=pluginClassesLocation%> = <%if (genModel.getRuntimePlatform() != GenRuntimePlatform.GWT) {%>bin<%} else {%>war/WEB-INF/classes<%}%>
diff --git a/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/home.htmljet b/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/home.htmljet
deleted file mode 100644
index c19a377f535..00000000000
--- a/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/home.htmljet
+++ /dev/null
@@ -1,86 +0,0 @@
-<%@ jet package="org.eclipse.emf.codegen.ecore.templates.editor" imports="java.util.* org.eclipse.emf.codegen.ecore.genmodel.*" class="HomeHTML" version="$Id: home.htmljet,v 1.2 2010/08/25 13:36:45 emerks Exp $" %>
-<%
-/**
- * <copyright>
- *
- * Copyright (c) 2010 Ed Merks and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Ed Merks - Initial API and implementation
- *
- * </copyright>
- */
-%>
-<%GenModel genModel = (GenModel)argument; /* Trick to import java.util.* without warnings */Iterator.class.getName();%>
-<?xml version="1.0" encoding="UTF-8"?>
-<!doctype html>
-<html style="height : 100%">
- <head>
- <meta http-equiv="content-type" content="text/html; charset=UTF-8">
-
- <!-- -->
- <!-- Any title is fine -->
- <!-- -->
- <title><%=genModel.getModelName()%> Application</title>
-
- <style TYPE="text/css">
- <!--
- .ToolBar
- {
- background-color: #d0e4f6;
- }
- .ToolBarButton
- {
- float: left;
- margin-top: 5px;
- }
- .ToolBarButtonLeftMargin
- {
- float: left;
- margin-left: 10px;
- margin-top: 5px;
- }
- .Header
- {
- background-color: #628cd5;
- color: #FFFFFF;
- float: left;
- font-weight: bold;
- font-size: xx-large;
- }
- .HeaderLabel
- {
- float: left;
- margin-left: 10px;
- }
- .PropertiesTitle
- {
- background-color: #628cd5;
- color: #FFFFFF;
- font-weight: bold;
- font-size: large;
- }
- .PropertiesTitleLabel
- {
- float: left;
- margin-left: 5px;
- }
- -->
- </style>
-
- <!-- -->
- <!-- This script loads your compiled module. -->
- <!-- If you add any GWT meta tags, they must -->
- <!-- be added before this line. -->
- <script type="text/javascript" language="javascript" src="<%=genModel.getQualifiedEditorModuleName()%>/<%=genModel.getQualifiedEditorModuleName()%>.nocache.js"></script>
- </head>
-
- <body style="height : 100%">
- <div id="main" style="height : 100%">
- </div>
- </body>
-</html>
diff --git a/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/manifest.mfjet b/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/manifest.mfjet
deleted file mode 100644
index dd5f16330e8..00000000000
--- a/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/manifest.mfjet
+++ /dev/null
@@ -1,80 +0,0 @@
-<%@ jet package="org.eclipse.emf.codegen.ecore.templates.editor" imports="java.util.* org.eclipse.emf.codegen.ecore.genmodel.*" class="ManifestMF" version="$Id: manifest.mfjet,v 1.10 2011/01/20 01:36:08 emerks Exp $" %>
-<%
-/**
- * <copyright>
- *
- * Copyright (c) 2005-2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- *
- * </copyright>
- */
-%>
-<%GenModel genModel = (GenModel)argument;%>
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: <%=genModel.getEditorPluginID()%>;singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Bundle-ClassPath: <%if (genModel.isRuntimeJar()) {%><%=genModel.getEditorPluginID()%>.jar<%}else{%>.<%}%>
-<%if (genModel.getRuntimePlatform() != GenRuntimePlatform.GWT) {%>
-Bundle-Activator: <%=genModel.getQualifiedEditorPluginClassName()%>$Implementation
-<%}%>
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-<%if (genModel.getComplianceLevel() == GenJDKLevel.JDK50_LITERAL) {%>
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-<%} else if (genModel.getComplianceLevel() == GenJDKLevel.JDK60_LITERAL) {%>
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-<%}%>
-<%Iterator<String> packagesIterator = genModel.getEditorQualifiedPackageNames().iterator(); if (packagesIterator.hasNext()) { String pack = packagesIterator.next();%>
-Export-Package: <%=pack%><%while(packagesIterator.hasNext()) { pack = packagesIterator.next();%>,
- <%=pack%><%}%>
-<%}%>
-<%Iterator<String> requiredPluginIterator = genModel.getEditorRequiredPlugins().iterator(); if (requiredPluginIterator.hasNext()) { String pluginID = requiredPluginIterator.next();%>
-Require-Bundle: <%=pluginID%><%if (!pluginID.startsWith("org.eclipse.core.runtime")){%>;visibility:=reexport<%} while(requiredPluginIterator.hasNext()) { pluginID = requiredPluginIterator.next();%>,
- <%=pluginID%><%if (!pluginID.startsWith("org.eclipse.core.runtime")){%>;visibility:=reexport<%}}%>
-<%}%>
-<%if (genModel.isRichAjaxPlatform()) {%>
-Import-Package: org.eclipse.emf.common.ui,
- org.eclipse.emf.common.ui.action,
- org.eclipse.emf.common.ui.dialogs,
- org.eclipse.emf.common.ui.editor,
- org.eclipse.emf.common.ui.viewer,
- org.eclipse.emf.edit.ui,
- org.eclipse.emf.edit.ui.action,
- org.eclipse.emf.edit.ui.celleditor,
- org.eclipse.emf.edit.ui.dnd,
- org.eclipse.emf.edit.ui.provider,
- org.eclipse.emf.edit.ui.util,
- org.eclipse.emf.edit.ui.view,
- org.eclipse.jface.action,
- org.eclipse.jface.dialogs,
- org.eclipse.jface.operation,
- org.eclipse.jface.viewers,
- org.eclipse.jface.window,
- org.eclipse.jface.wizard,
- org.eclipse.swt,
- org.eclipse.swt.custom,
- org.eclipse.swt.dnd,
- org.eclipse.swt.events,
- org.eclipse.swt.graphics,
- org.eclipse.swt.layout,
- org.eclipse.swt.widgets,
- org.eclipse.ui;ui.workbench="split",
- org.eclipse.ui.actions;ui.workbench="split",
- org.eclipse.ui.application,
- org.eclipse.ui.part;ui.workbench="split",
- org.eclipse.ui.views,
- org.eclipse.ui.views.contentoutline,
- org.eclipse.ui.views.properties;ui.views="split"
-<%}%>
-<%if (genModel.getRuntimeVersion() == GenRuntimeVersion.EMF22 || genModel.getRuntimeVersion() == GenRuntimeVersion.EMF23) {%>
-Eclipse-LazyStart: true
-<%}%>
-Bundle-ActivationPolicy: lazy
diff --git a/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/module.gwt.xmljet b/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/module.gwt.xmljet
deleted file mode 100644
index 97fa4294b85..00000000000
--- a/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/module.gwt.xmljet
+++ /dev/null
@@ -1,35 +0,0 @@
-<%@ jet package="org.eclipse.emf.codegen.ecore.templates.editor" imports="java.util.* org.eclipse.emf.codegen.ecore.genmodel.*" class="ModuleGWTXML" version="$Id: module.gwt.xmljet,v 1.1 2010/08/24 16:59:38 emerks Exp $" %>
-<%
-/**
- * <copyright>
- *
- * Copyright (c) 2010 Ed Merks and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Ed Merks - Initial API and implementation
- *
- * </copyright>
- */
-%>
-<%GenModel genModel = (GenModel)argument; /* Trick to import java.util.* without warnings */Iterator.class.getName();%>
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.0.1//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.0.1/distro-source/core/src/gwt-module.dtd">
-
-<%@ include file="../Header.xmljetinc"%>
-
-<module>
- <inherits name='com.google.gwt.user.theme.standard.Standard'/>
-<%for (String inherits : genModel.getEditorModuleInherits()) {%>
- <inherits name="<%=inherits%>" />
-<%}%>
-
- <entry-point class='<%=genModel.getQualifiedEditorEntryPointClassName()%>'/>
-
-<%for (String source : genModel.getEditorModuleSources()) {%>
- <source path="<%=source%>"/>
-<%}%>
-</module> \ No newline at end of file
diff --git a/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/plugin.propertiesjet b/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/plugin.propertiesjet
deleted file mode 100644
index 879322e0b73..00000000000
--- a/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/plugin.propertiesjet
+++ /dev/null
@@ -1,118 +0,0 @@
-<%@ jet package="org.eclipse.emf.codegen.ecore.templates.editor" imports="java.util.* org.eclipse.emf.codegen.ecore.genmodel.*" class="PluginProperties" version="$Id: plugin.propertiesjet,v 1.22 2010/08/24 16:59:38 emerks Exp $" %>
-<%
-/**
- * <copyright>
- *
- * Copyright (c) 2002-2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- *
- * </copyright>
- */
-%>
-<%GenModel genModel = (GenModel)argument; /* Trick to import java.util.* without warnings */Iterator.class.getName();%>
-<%@ include file="../Header.propertiesjetinc"%>
-
-pluginName = <%=genModel.getModelName()%> Editor
-providerName = www.example.org
-<%if (genModel.getRuntimePlatform() != GenRuntimePlatform.GWT) {%>
-
-<%boolean hasMultiPageEditor = false;%>
-<%for (GenPackage genPackage : genModel.getAllGenPackagesWithClassifiers()) {if (genPackage.isMultipleEditorPages()) { hasMultiPageEditor = true; }%>
-_UI_<%=genPackage.getEditorClassName()%>_menu = &<%=genPackage.getPrefix()%> Editor
-<%}%>
-
-<%if (genModel.isCreationCommands()) {%>
-_UI_CreateChild_menu_item = &New Child
-_UI_CreateSibling_menu_item = N&ew Sibling
-
-<%}%>
-_UI_ShowPropertiesView_menu_item = Show &Properties View
-_UI_RefreshViewer_menu_item = &Refresh
-
-_UI_SelectionPage_label = Selection
-<%if (hasMultiPageEditor) {%>
-_UI_ParentPage_label = Parent
-_UI_ListPage_label = List
-_UI_TreePage_label = Tree
-_UI_TablePage_label = Table
-_UI_TreeWithColumnsPage_label = Tree with Columns
-_UI_ObjectColumn_label = Object
-_UI_SelfColumn_label = Self
-<%}%>
-
-_UI_NoObjectSelected = Selected Nothing
-_UI_SingleObjectSelected = Selected Object: {0}
-_UI_MultiObjectSelected = Selected {0} Objects
-
-_UI_OpenEditorError_label = Open Editor
-
-_UI_Wizard_category = Example EMF Model Creation Wizards
-
-_UI_CreateModelError_message = Problems encountered in file "{0}"
-
-<%for (GenPackage genPackage : genModel.getAllGenPackagesWithClassifiers()) {%>
- <%if (genPackage.isGenerateModelWizard()) {%>
-_UI_<%=genPackage.getModelWizardClassName()%>_label = <%=genPackage.getPrefix()%> Model
-_UI_<%=genPackage.getModelWizardClassName()%>_description = Create a new <%=genPackage.getPrefix()%> model
-
- <%}%>
-_UI_<%=genPackage.getEditorClassName()%>_label = <%=genPackage.getPrefix()%> Model Editor
-
-_UI_<%=genPackage.getEditorClassName()%>FilenameDefaultBase = My
-_UI_<%=genPackage.getEditorClassName()%>FilenameExtensions = <%=genPackage.isMultipleFileExtensions() ? genPackage.getFileExtensions() : genPackage.getFileExtension()%>
-
-<%}%>
-_UI_Wizard_label = New
-
-_WARN_FilenameExtension = The file name must end in ''.{0}''
-_WARN_FilenameExtensions = The file name must have one of the following extensions: {0}
-
-_UI_ModelObject = &Model Object
-_UI_XMLEncoding = &XML Encoding
-_UI_XMLEncodingChoices = <%=genModel.getXMLEncodingChoices()%>
-<%if (genModel.isRichClientPlatform()) {%>
-_UI_Wizard_initial_object_description = Specify a file name and select a model object to create
-<%} else {%>
-_UI_Wizard_initial_object_description = Select a model object to create
-<%}%>
-
-_UI_FileConflict_label = File Conflict
-_WARN_FileConflict = There are unsaved changes that conflict with changes made outside the editor. Do you wish to discard this editor's changes?
-
-<%if (genModel.isRichClientPlatform()) {%>
-_UI_<%=genModel.getEditorAdvisorClassName()%>_ActionSet_label = <%=genModel.getModelName()%> Action Set
-_UI_Perspective_label = <%=genModel.getModelName()%>
-
-_UI_Browse_label = &Browse...
-_UI_File_label = &File
-_UI_Question_title = Question
-_WARN_FileConflict = The file "{0}" already exists. Do you want to replace the existing file?
-_UI_Error_title = Error
-_WARN_No_Editor = There is no editor registered for the file "{0}".
-
-_UI_Application_title = <%=genModel.getModelName()%> Application
-_UI_Menu_File_label = &File
-_UI_Menu_New_label = &New
-_UI_Menu_Open_label = &Open...
-_UI_Menu_Open_description = Opens a model object file
-_UI_Menu_OpenURI_label = &Open URI...
-_UI_Menu_OpenURI_description = Opens a model object loading it from a URI
-_UI_Menu_Edit_label = &Edit
-_UI_Menu_Window_label = &Window
-_UI_Menu_Help_label = &Help
-_UI_Menu_About_label = <%=genModel.getModelName()%> &About...
-_UI_About_title = <%=genModel.getModelName()%> Application
-_UI_About_text = <%=genModel.getModelName()%> Application about box goes here.
-
-<%for (GenPackage genPackage : genModel.getAllGenPackagesWithClassifiers()) {if (genPackage.isGenerateModelWizard()) {%>
-_UI_<%=genPackage.getModelWizardClassName()%>_ActionSet_label = <%=genPackage.getPrefix()%> Model Action Set
-<%}}%>
-
-<%}%>
-<%}%>
diff --git a/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/plugin.xmljet b/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/plugin.xmljet
deleted file mode 100644
index 4f9e68ef9aa..00000000000
--- a/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/plugin.xmljet
+++ /dev/null
@@ -1,253 +0,0 @@
-<%@ jet package="org.eclipse.emf.codegen.ecore.templates.editor" imports="java.util.* org.eclipse.emf.codegen.ecore.genmodel.*" class="PluginXML" version="$Id: plugin.xmljet,v 1.28 2010/03/11 02:31:37 khussey Exp $" %>
-<%
-/**
- * <copyright>
- *
- * Copyright (c) 2002-2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- *
- * </copyright>
- */
-%>
-<%GenModel genModel = (GenModel)argument;%>
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-
-<%@ include file="../Header.xmljetinc"%>
-
-<%if (genModel.isBundleManifest()) {%>
-<plugin>
-<%} else {%>
-<plugin
- name="%pluginName"
- id="<%=genModel.getEditorPluginID()%>"
- version="1.0.0"
- provider-name="%providerName"
- class="<%=genModel.getQualifiedEditorPluginClassName()%>$Implementation">
-
- <requires>
- <%for (String pluginID : genModel.getEditorRequiredPlugins()) { %>
- <import plugin="<%=pluginID%>"<%if (!pluginID.startsWith("org.eclipse.core.runtime")) {%> export="true"<%}%>/>
- <%}%>
- </requires>
-
- <runtime>
- <%if (genModel.isRuntimeJar()) {%>
- <library name="<%=genModel.getEditorPluginID()%>.jar">
- <%} else {%>
- <library name=".">
- <%}%>
- <export name="*"/>
- </library>
- </runtime>
-<%}%>
-<%if (genModel.sameEditEditorProject()) {%>
- <%for (GenPackage genPackage : genModel.getAllGenPackagesWithClassifiers()) {%>
- <%if (!genPackage.getGenClasses().isEmpty()) {%>
-
- <extension point="org.eclipse.emf.edit.itemProviderAdapterFactories">
- <factory
- uri="<%=genPackage.getNSURI()%>"
- class="<%=genPackage.getQualifiedItemProviderAdapterFactoryClassName()%>"
- supportedTypes=
- <%for (ListIterator<?> j = genPackage.getProviderSupportedTypes().listIterator(); j.hasNext(); ) {%>
- <%=j.hasPrevious() ? " " : "\""%><%=j.next()%><%if (!j.hasNext()) {%>"/><%}%>
- <%}%>
- </extension>
- <%if (genPackage.isChildCreationExtenders()) { Map<GenPackage, Map<GenClass, List<GenClass.ChildCreationData>>> extendedChildCreationData = genPackage.getExtendedChildCreationData();%>
- <%if (!extendedChildCreationData.isEmpty()) {%>
-
- <extension point="org.eclipse.emf.edit.childCreationExtenders">
- <%for (Map.Entry<GenPackage, Map<GenClass, List<GenClass.ChildCreationData>>> entry : extendedChildCreationData.entrySet()) {%>
- <extender
- uri="<%=entry.getKey().getNSURI()%>"
- class="<%=genPackage.getQualifiedItemProviderAdapterFactoryClassName()%>$<%=genPackage.getChildCreationExtenderName(entry.getKey())%>"/>
- <%}%>
- </extension>
- <%}%>
- <%}%>
- <%}%>
- <%}%>
-<%}%>
-<%if (genModel.sameModelEditorProject()) {%>
- <%for (GenPackage genPackage : genModel.getAllGenPackagesWithClassifiers()) {%>
-
- <extension point="org.eclipse.emf.ecore.generated_package">
- <package
- uri="<%=genPackage.getNSURI()%>"
- <%if (genModel.hasLocalGenModel()) {%>
- class="<%=genPackage.getQualifiedPackageInterfaceName()%>"
- genModel="<%=genModel.getRelativeGenModelLocation()%>"/>
- <%} else {%>
- class="<%=genPackage.getQualifiedPackageInterfaceName()%>"/>
- <%}%>
- </extension>
- <%if (genPackage.isContentType()) {%>
-
- <extension point="org.eclipse.emf.ecore.content_parser">
- <parser
- contentTypeIdentifier="<%=genPackage.getContentTypeIdentifier()%>"
- class="<%=genPackage.getQualifiedEffectiveResourceFactoryClassName()%>"/>
- </extension>
-
- <extension point="org.eclipse.core.contenttype.contentTypes">
- <content-type
- base-type="<%=genPackage.isXMIResource() ? "org.eclipse.emf.ecore.xmi" : "org.eclipse.core.runtime.xml"%>"
- file-extensions="<%=genPackage.getFileExtensions()%>"
- id="<%=genPackage.getContentTypeIdentifier()%>"
- name="%_UI_<%=genPackage.getPrefix()%>_content_type"
- priority="normal">
- <describer class="org.eclipse.emf.ecore.xmi.impl.RootXMLContentHandlerImpl$Describer">
- <%if (genPackage.hasTargetNamespace()) {%>
- <parameter name="namespace" value="<%=genPackage.getNSURI()%>"/>
- <%}%>
- <%if (genPackage.isXMIResource()) {%>
- <parameter name="kind" value="xmi"/>
- <%}%>
- </describer>
- </content-type>
- </extension>
- <%} else if (genPackage.getResource() != GenResourceKind.NONE_LITERAL) {%>
-
- <extension point="org.eclipse.emf.ecore.extension_parser">
- <parser
- type="<%=genPackage.getFileExtension()%>"
- class="<%=genPackage.getQualifiedResourceFactoryClassName()%>"/>
- </extension>
- <%}%>
- <%}%>
-<%}%>
-<%if (genModel.isRichClientPlatform()) {%>
-
- <extension
- point="org.eclipse.core.runtime.applications"
- id="<%=genModel.getEditorAdvisorClassName()%>Application">
- <application>
- <run class="<%=genModel.getQualifiedEditorAdvisorClassName()%>$Application"/>
- </application>
- </extension>
-
- <extension point="org.eclipse.ui.perspectives">
- <perspective
- name="%_UI_Perspective_label"
- class="<%=genModel.getQualifiedEditorAdvisorClassName()%>$Perspective"
- id="<%=genModel.getQualifiedEditorAdvisorClassName()%>Perspective">
- </perspective>
- </extension>
-
- <extension point="org.eclipse.ui.commands">
- <command
- name="%_UI_Menu_OpenURI_label"
- description="%_UI_Menu_OpenURI_description"
- categoryId="org.eclipse.ui.category.file"
- id="<%=genModel.getQualifiedEditorAdvisorClassName()%>OpenURICommand"/>
- <%if (!genModel.isRichAjaxPlatform()) {%>
- <command
- name="%_UI_Menu_Open_label"
- description="%_UI_Menu_Open_description"
- categoryId="org.eclipse.ui.category.file"
- id="<%=genModel.getQualifiedEditorAdvisorClassName()%>OpenCommand"/>
- <%}%>
- </extension>
-
-<%if (!genModel.isRichAjaxPlatform()) {%>
- <extension point="org.eclipse.ui.bindings">
- <key
- commandId="<%=genModel.getQualifiedEditorAdvisorClassName()%>OpenURICommand"
- sequence="M1+U"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"/>
- <key
- commandId="<%=genModel.getQualifiedEditorAdvisorClassName()%>OpenCommand"
- sequence="M1+O"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"/>
- </extension>
-<%}%>
-
- <extension point="org.eclipse.ui.actionSets">
- <actionSet
- label="%_UI_<%=genModel.getEditorAdvisorClassName()%>_ActionSet_label"
- visible="true"
- id="<%=genModel.getEditorAdvisorClassName()%>ActionSet">
- <action
- label="%_UI_Menu_About_label"
- class="<%=genModel.getQualifiedEditorAdvisorClassName()%>$AboutAction"
- menubarPath="help/additions"
- id="<%=genModel.getQualifiedEditorAdvisorClassName()%>AboutAction"/>
- <action
- label="%_UI_Menu_OpenURI_label"
- definitionId="<%=genModel.getQualifiedEditorAdvisorClassName()%>OpenURICommand"
- class="<%=genModel.getQualifiedEditorAdvisorClassName()%>$OpenURIAction"
- menubarPath="file/additions"
- id="<%=genModel.getQualifiedEditorAdvisorClassName()%>OpenURIAction"/>
- <%if (!genModel.isRichAjaxPlatform()) {%>
- <action
- label="%_UI_Menu_Open_label"
- definitionId="<%=genModel.getQualifiedEditorAdvisorClassName()%>OpenCommand"
- class="<%=genModel.getQualifiedEditorAdvisorClassName()%>$OpenAction"
- menubarPath="file/additions"
- id="<%=genModel.getQualifiedEditorAdvisorClassName()%>OpenAction"/>
- <%}%>
- </actionSet>
- </extension>
-<%}%>
-<%for (GenPackage genPackage : genModel.getAllGenPackagesWithClassifiers()) {%>
- <%if (genPackage.hasConcreteClasses()){%>
- <%if (genPackage.isGenerateModelWizard()) {%>
- <%if (genModel.isRichClientPlatform()) {%>
-
- <extension point="org.eclipse.ui.actionSets">
- <actionSet
- label="%_UI_<%=genPackage.getModelWizardClassName()%>_ActionSet_label"
- visible="true"
- id="<%=genPackage.getQualifiedActionBarContributorClassName()%>ActionSet">
- <action
- label="%_UI_<%=genPackage.getModelWizardClassName()%>_label"
- class="<%=genPackage.getQualifiedActionBarContributorClassName()%>$NewAction"
- menubarPath="file/new/additions"
- id="<%=genPackage.getQualifiedActionBarContributorClassName()%>NewAction"/>
- </actionSet>
- </extension>
- <%} else {%>
-
- <extension point="org.eclipse.ui.newWizards">
- <category
- id="org.eclipse.emf.ecore.Wizard.category.ID"
- name="%_UI_Wizard_category"/>
- <wizard
- id="<%=genPackage.getQualifiedModelWizardClassName()%>ID"
- name="%_UI_<%=genPackage.getModelWizardClassName()%>_label"
- class="<%=genPackage.getQualifiedModelWizardClassName()%>"
- category="org.eclipse.emf.ecore.Wizard.category.ID"
- icon="icons/full/obj16/<%=genPackage.getPrefix()%>ModelFile.gif">
- <description>%_UI_<%=genPackage.getModelWizardClassName()%>_description</description>
- <selection class="org.eclipse.core.resources.IResource"/>
- </wizard>
- </extension>
- <%}%>
- <%}%>
-
- <extension point="org.eclipse.ui.editors">
- <editor
- id="<%=genPackage.getQualifiedEditorClassName()%>ID"
- name="%_UI_<%=genPackage.getEditorClassName()%>_label"
- icon="icons/full/obj16/<%=genPackage.getPrefix()%>ModelFile.gif"
- <%if (!genPackage.isContentType()) {%>
- extensions="<%=genPackage.getFileExtension()%>"
- <%}%>
- class="<%=genPackage.getQualifiedEditorClassName()%>"
- contributorClass="<%=genPackage.getQualifiedActionBarContributorClassName()%>">
- <%if (genPackage.isContentType()) {%>
- <contentTypeBinding contentTypeId="<%=genPackage.getQualifiedContentTypeIdentifier()%>"/>
- <%}%>
- </editor>
- </extension>
- <%}%>
-<%}%>
-
-</plugin>
diff --git a/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/web.xmljet b/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/web.xmljet
deleted file mode 100644
index dd66c1d50d1..00000000000
--- a/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/editor/web.xmljet
+++ /dev/null
@@ -1,36 +0,0 @@
-<%@ jet package="org.eclipse.emf.codegen.ecore.templates.editor" imports="java.util.* org.eclipse.emf.codegen.ecore.genmodel.*" class="WebXML" version="$Id: web.xmljet,v 1.1 2010/08/24 16:59:38 emerks Exp $" %>
-<%
-/**
- * <copyright>
- *
- * Copyright (c) 2010 Ed Merks and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Ed Merks - Initial API and implementation
- *
- * </copyright>
- */
-%>
-<%GenModel genModel = (GenModel)argument; /* Trick to import java.util.* without warnings */Iterator.class.getName();%>
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
-<%@ include file="../Header.xmljetinc"%>
-<web-app>
- <servlet>
- <servlet-name>uriServlet</servlet-name>
- <servlet-class>org.eclipse.emf.server.ecore.resource.URIServiceImpl</servlet-class>
- </servlet>
-
- <servlet-mapping>
- <servlet-name>uriServlet</servlet-name>
- <url-pattern>/<%=genModel.getQualifiedEditorModuleName()%>/uriService</url-pattern>
- </servlet-mapping>
-
- <welcome-file-list>
- <welcome-file><%=genModel.getEditorHomePageName()%>.html</welcome-file>
- </welcome-file-list>
-</web-app>
diff --git a/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/model.tests/ModelTestSuite.javajet b/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/model.tests/ModelTestSuite.javajet
deleted file mode 100644
index 27c53424059..00000000000
--- a/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/model.tests/ModelTestSuite.javajet
+++ /dev/null
@@ -1,79 +0,0 @@
-<%@ jet package="org.eclipse.emf.codegen.ecore.templates.model.tests" imports="java.util.* org.eclipse.emf.codegen.ecore.genmodel.*" class="ModelTestSuite" %>
-<%
-/**
- * <copyright>
- *
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- *
- * </copyright>
- */
-%>
-<%GenModel genModel = (GenModel)argument; /* Trick to import java.util.* without warnings */Iterator.class.getName();%>
-<%@ include file="../Header.javajetinc"%>
-package <%=genModel.getTestSuitePackageName()%>;
-
-<%genModel.markImportLocation(stringBuffer);%>
-
-/**
- * <!-- begin-user-doc -->
- * A test suite for the '<em><b><%=genModel.getModelName()%></b></em>' model.
- * <!-- end-user-doc -->
- * @generated
- */
-public class <%=genModel.getTestSuiteClassName()%> extends <%=genModel.getImportedName("junit.framework.TestSuite")%>
-{
-<%if (genModel.hasCopyrightField()) {%>
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final <%=genModel.getImportedName("java.lang.String")%> copyright = <%=genModel.getCopyrightFieldLiteral()%>;<%=genModel.getNonNLS()%>
-<%}%>
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static void main(String[] args)
- {
- <%=genModel.getImportedName("junit.textui.TestRunner")%>.run(suite());
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static <%=genModel.getImportedName("junit.framework.Test")%> suite()
- {
- <%=genModel.getImportedName("junit.framework.TestSuite")%> suite = new <%=genModel.getTestSuiteClassName()%>("<%=genModel.getModelName()%> Tests");<%=genModel.getNonNLS()%>
-<%for (GenPackage genPackage : genModel.getAllGenPackagesWithClassifiers()) {%>
- <%if (genPackage.hasTests()) {%>
- suite.addTest(<%=genModel.getImportedName(genPackage.getImportedTestSuiteClassName())%>.suite());
- <%}%>
-<%}%>
- return suite;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public <%=genModel.getTestSuiteClassName()%>(String name)
- {
- super(name);
- }
-
-} //<%=genModel.getTestSuiteClassName()%>
-<%genModel.emitSortedImports();%>
diff --git a/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/model.tests/PackageExample.javajet b/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/model.tests/PackageExample.javajet
deleted file mode 100644
index 0b18b11c248..00000000000
--- a/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/model.tests/PackageExample.javajet
+++ /dev/null
@@ -1,205 +0,0 @@
-<%@ jet package="org.eclipse.emf.codegen.ecore.templates.model.tests" imports="org.eclipse.emf.codegen.ecore.genmodel.*" class="PackageExample" %>
-<%
-/**
- * <copyright>
- *
- * Copyright (c) 2005-2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- *
- * </copyright>
- */
-%>
-<%GenPackage genPackage = (GenPackage)argument; GenModel genModel = genPackage.getGenModel();%>
-<%
-String _System = genModel.getImportedName("java.lang.System");
-String _String = genModel.getImportedName("java.lang.String");
-String _RuntimeException = genModel.getImportedName("java.lang.RuntimeException");
-String _File = genModel.getImportedName("java.io.File");
-String _Iterator = null;
-if (!genModel.useGenerics()) {
- _Iterator = genModel.getImportedName("java.util.Iterator");
-}
-String _Diagnostic = genModel.getImportedName("org.eclipse.emf.common.util.Diagnostic");
-String _URI = genModel.getImportedName("org.eclipse.emf.common.util.URI");
-String _EObject = genModel.getImportedName("org.eclipse.emf.ecore.EObject");
-String _Diagnostician = genModel.getImportedName("org.eclipse.emf.ecore.util.Diagnostician");
-String _Resource = genModel.getImportedName("org.eclipse.emf.ecore.resource.Resource");
-String _ResourceSet = genModel.getImportedName("org.eclipse.emf.ecore.resource.ResourceSet");
-String _ResourceSetImpl = genModel.getImportedName("org.eclipse.emf.ecore.resource.impl.ResourceSetImpl");
-%>
-<%@ include file="../Header.javajetinc"%>
-package <%=genPackage.getTestsPackageName()%>;
-
-<%genModel.markImportLocation(stringBuffer);%>
-
-/**
- * <!-- begin-user-doc -->
- * A sample utility for the '<em><b><%=genPackage.getPackageName()%></b></em>' package.
- * <!-- end-user-doc -->
- * @generated
- */
-public class <%=genPackage.getExampleClassName()%>
-{
-<%if (genModel.hasCopyrightField()) {%>
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final <%=_String%> copyright = <%=genModel.getCopyrightFieldLiteral()%>;<%=genModel.getNonNLS()%>
-
-<%}%>
- /**
- * <!-- begin-user-doc -->
- * Load all the argument file paths or URIs as instances of the model.
- * <!-- end-user-doc -->
- * @param args the file paths or URIs.
- * @generated
- */
- public static void main(String[] args)
- {
- // Create a resource set to hold the resources.
- //
- <%=_ResourceSet%> resourceSet = new <%=_ResourceSetImpl%>();
-
-<%if (genPackage.isContentType()) {%>
- // Register the appropriate resource factory to handle the content type.
- //
- resourceSet.getResourceFactoryRegistry().getContentTypeToFactoryMap().put
- (<%=genPackage.getImportedPackageInterfaceName()%>.eCONTENT_TYPE,
- new <%=genModel.getImportedName(genPackage.getQualifiedEffectiveResourceFactoryClassName())%>());
-
- // Register the appropriate content handler for all file extensions and any element from the package's namespace.
- //
- resourceSet.getURIConverter().getContentHandlers().add
- (new <%=genModel.getImportedName("org.eclipse.emf.ecore.xmi.impl.RootXMLContentHandlerImpl")%>(<%=genPackage.getImportedPackageInterfaceName()%>.eCONTENT_TYPE, null, null, <%if (genPackage.hasTargetNamespace()) {%><%=genPackage.getImportedPackageInterfaceName()%>.eNS_URI<%} else {%>(<%=_String%>)null<%}%>, null));
-<%} else {%>
- // Register the appropriate resource factory to handle all file extensions.
- //
- resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put
- (Resource.Factory.Registry.DEFAULT_EXTENSION,
- new <%=genModel.getImportedName(genPackage.getQualifiedEffectiveResourceFactoryClassName())%>());
-<%}%>
-
- // Register the package to ensure it is available during loading.
- //
- resourceSet.getPackageRegistry().put
- (<%=genPackage.getImportedPackageInterfaceName()%>.eNS_URI,
- <%=genPackage.getImportedPackageInterfaceName()%>.eINSTANCE);
-
- // If there are no arguments, emit an appropriate usage message.
- //
- if (args.length == 0)
- {
-<%if (genPackage.getRootClass() != null) { GenClass rootClass = genPackage.getRootClass();%>
- System.out.println("Enter a list of file paths or URIs that have content like this:");<%=genModel.getNonNLS()%>
- try
- {
- <%if (genPackage.isContentType()) {%>
- <%=_Resource%> resource = resourceSet.createResource(<%=_URI%>.createURI("http:///My.<%=genPackage.getFileExtension()%>"), <%=genPackage.getImportedPackageInterfaceName()%>.eCONTENT_TYPE);<%=genModel.getNonNLS()%>
- <%} else {%>
- <%=_Resource%> resource = resourceSet.createResource(<%=_URI%>.createURI("http:///My.<%=genPackage.getFileExtension()%>"));<%=genModel.getNonNLS()%>
- <%}%>
- <%if (genPackage.getRootFeature() != null) { GenFeature rootFeature = genPackage.getRootFeature(); GenClass documentRoot = rootFeature.getGenClass();%>
- <%=documentRoot.getImportedInterfaceName()%> documentRoot = <%=genPackage.getQualifiedEFactoryInternalInstanceAccessor()%>.create<%=documentRoot.getName()%>();
- <%=rootClass.getImportedInterfaceName()%> root = <%=rootClass.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()%>.create<%=rootClass.getName()%>();
- <%if (documentRoot.isDynamic()) {%>
- documentRoot.eSet(<%=rootFeature.getQualifiedFeatureAccessor()%>, root);
- <%} else {%>
- documentRoot.set<%=rootFeature.getCapName()%>(root);
- <%}%>
- resource.getContents().add(<%if (!documentRoot.isEObjectExtension()){%>(<%=_EObject%>)<%}%>documentRoot);
- <%} else {%>
- <%=rootClass.getImportedInterfaceName()%><%=rootClass.getInterfaceWildTypeArguments()%> root = <%=rootClass.getGenPackage().getQualifiedEFactoryInternalInstanceAccessor()%>.create<%=rootClass.getName()%>();
- resource.getContents().add(<%if (!rootClass.isEObjectExtension()){%>(<%=_EObject%>)<%}%>root);
- <%}%>
- resource.save(<%=_System%>.out, null);
- }
- catch (<%=genModel.getImportedName("java.io.IOException")%> exception)
- {
- exception.printStackTrace();
- }
-<%} else {%>
- System.out.println("Enter a list of file paths or URIs");
-<%}%>
- }
- else
- {
- // Iterate over all the arguments.
- //
- for (int i = 0; i < args.length; ++i)
- {
- // Construct the URI for the instance file.
- // The argument is treated as a file path only if it denotes an existing file.
- // Otherwise, it's directly treated as a URL.
- //
- <%=_File%> file = new <%=_File%>(args[i]);
- <%=_URI%> uri = file.isFile() ? <%=_URI%>.createFileURI(file.getAbsolutePath()): URI.createURI(args[i]);
-
- try
- {
- // Demand load resource for this file.
- //
- <%=_Resource%> resource = resourceSet.getResource(uri, true);
- System.out.println("Loaded " + uri);<%=genModel.getNonNLS()%>
-
- // Validate the contents of the loaded resource.
- //
-<%if (genModel.useGenerics()) {%>
- for (<%=_EObject%> eObject : resource.getContents())
-<%} else {%>
- for (<%=_Iterator%> j = resource.getContents().iterator(); j.hasNext(); )
-<%}%>
- {
-<%if (!genModel.useGenerics()) {%>
- <%=_EObject%> eObject = (<%=_EObject%>)j.next();
-<%}%>
- <%=_Diagnostic%> diagnostic = <%=_Diagnostician%>.INSTANCE.validate(eObject);
- if (diagnostic.getSeverity() != Diagnostic.OK)
- {
- printDiagnostic(diagnostic, "");<%=genModel.getNonNLS()%>
- }
- }
- }
- catch (<%=_RuntimeException%> exception)
- {
- System.out.println("Problem loading " + uri);<%=genModel.getNonNLS()%>
- exception.printStackTrace();
- }
- }
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * Prints diagnostics with indentation.
- * <!-- end-user-doc -->
- * @param diagnostic the diagnostic to print.
- * @param indent the indentation for printing.
- * @generated
- */
- protected static void printDiagnostic(Diagnostic diagnostic, String indent)
- {
- System.out.print(indent);
- System.out.println(diagnostic.getMessage());
-<%if (genModel.useGenerics()) {%>
- for (Diagnostic child : diagnostic.getChildren())
- {
- printDiagnostic(child, indent + " ");<%=genModel.getNonNLS()%>
- }
-<%} else {%>
- for (Iterator i = diagnostic.getChildren().iterator(); i.hasNext(); )
- {
- printDiagnostic((Diagnostic)i.next(), indent + " ");<%=genModel.getNonNLS()%>
- }
-<%}%>
- }
-
-} //<%=genPackage.getExampleClassName()%>
-<%genModel.emitSortedImports();%>
diff --git a/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/model.tests/PackageTestSuite.javajet b/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/model.tests/PackageTestSuite.javajet
deleted file mode 100644
index a88d8c22f3e..00000000000
--- a/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/model.tests/PackageTestSuite.javajet
+++ /dev/null
@@ -1,79 +0,0 @@
-<%@ jet package="org.eclipse.emf.codegen.ecore.templates.model.tests" imports="java.util.* org.eclipse.emf.codegen.ecore.genmodel.*" class="PackageTestSuite" %>
-<%
-/**
- * <copyright>
- *
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- *
- * </copyright>
- */
-%>
-<%GenPackage genPackage = (GenPackage)argument; GenModel genModel = genPackage.getGenModel(); /* Trick to import java.util.* without warnings */Iterator.class.getName();%>
-<%@ include file="../Header.javajetinc"%>
-package <%=genPackage.getTestsPackageName()%>;
-
-<%genModel.markImportLocation(stringBuffer);%>
-
-/**
- * <!-- begin-user-doc -->
- * A test suite for the '<em><b><%=genPackage.getPackageName()%></b></em>' package.
- * <!-- end-user-doc -->
- * @generated
- */
-public class <%=genPackage.getTestSuiteClassName()%> extends <%=genModel.getImportedName("junit.framework.TestSuite")%>
-{
-<%if (genModel.hasCopyrightField()) {%>
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final <%=genModel.getImportedName("java.lang.String")%> copyright = <%=genModel.getCopyrightFieldLiteral()%>;<%=genModel.getNonNLS()%>
-<%}%>
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static void main(String[] args)
- {
- <%=genModel.getImportedName("junit.textui.TestRunner")%>.run(suite());
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static <%=genModel.getImportedName("junit.framework.Test")%> suite()
- {
- <%=genModel.getImportedName("junit.framework.TestSuite")%> suite = new <%=genPackage.getTestSuiteClassName()%>("<%=genPackage.getPackageName()%> Tests");<%=genModel.getNonNLS()%>
-<%for (GenClass genClass : genPackage.getGenClasses()) {%>
- <%if (!genClass.isExternalInterface() && !genClass.isAbstract() && genClass.hasTests()) {%>
- suite.addTestSuite(<%=genClass.getImportedTestCaseClassName()%>.class);
- <%}%>
-<%}%>
- return suite;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public <%=genPackage.getTestSuiteClassName()%>(String name)
- {
- super(name);
- }
-
-} //<%=genPackage.getTestSuiteClassName()%>
-<%genModel.emitSortedImports();%>
diff --git a/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/model.tests/TestCase.javajet b/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/model.tests/TestCase.javajet
deleted file mode 100644
index ff8958d5ff4..00000000000
--- a/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/model.tests/TestCase.javajet
+++ /dev/null
@@ -1,318 +0,0 @@
-<%@ jet package="org.eclipse.emf.codegen.ecore.templates.model.tests" imports="java.util.* org.eclipse.emf.codegen.ecore.genmodel.*" class="TestCase" %>
-<%
-/**
- * <copyright>
- *
- * Copyright (c) 2005, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- *
- * </copyright>
- */
-%>
-<%GenClass genClass = (GenClass)argument; GenPackage genPackage = genClass.getGenPackage(); GenModel genModel=genPackage.getGenModel(); /* Trick to import java.util.* without warnings */Iterator.class.getName();%>
-<%@ include file="../Header.javajetinc"%>
-package <%=genPackage.getTestsPackageName()%>;
-
-<%genModel.markImportLocation(stringBuffer);%>
-
-/**
- * <!-- begin-user-doc -->
- * A test case for the model object '<em><b><%=genClass.getFormattedName()%></b></em>'.
- * <!-- end-user-doc -->
-<%if (!genClass.getImplementedGenFeatures().isEmpty()) { boolean first = true;%>
- <%for (GenFeature genFeature : genClass.getImplementedGenFeatures()) {%>
- <%if (genFeature.isTested() && !genFeature.isSuppressedGetVisibility()) {%>
- <%if (first) { first = false;%>
- * <p>
- * The following features are tested:
- * <ul>
- <%}%>
- * <li>{@link <%=genFeature.getGenClass().getQualifiedInterfaceName()%>#<%=genFeature.getGetAccessor()%>() <em><%=genFeature.getFormattedName()%></em>}</li>
- <%}%>
- <%}%>
- <% if (!first) {%>
- * </ul>
- * </p>
- <%}%>
-<%}%>
-<%if (!genClass.getImplementedGenOperations().isEmpty()) { boolean first = true;%>
- <%for (GenOperation genOperation : genClass.getImplementedGenOperations()) {%>
- <%if (first) { first = false;%>
- * <p>
- * The following operations are tested:
- * <ul>
- <%}%>
- * <li>{@link <%=genOperation.getGenClass().getQualifiedInterfaceName()%>#<%=genOperation.getName()%>(<%=genOperation.getParameterTypes(", ")%>) <em><%=genOperation.getFormattedName()%></em>}</li>
- <%}%>
- <% if (!first) {%>
- * </ul>
- * </p>
- <%}%>
-<%}%>
- * @generated
- */
-public<%if (genClass.isAbstract()) {%> abstract<%}%> class <%=genClass.getTestCaseClassName()%> extends <%=genClass.isModelRoot() ? genModel.getImportedName("junit.framework.TestCase") : genClass.getClassExtendsGenClass().getImportedTestCaseClassName()%>
-{
-<%if (genModel.hasCopyrightField()) {%>
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final <%=genModel.getImportedName("java.lang.String")%> copyright = <%=genModel.getCopyrightFieldLiteral()%>;<%=genModel.getNonNLS()%>
-<%}%>
-<%if (genModel.getDriverNumber() != null) {%>
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final <%=genModel.getImportedName("java.lang.String")%> mofDriverNumber = "<%=genModel.getDriverNumber()%>";<%=genModel.getNonNLS()%>
-<%}%>
-<%if (genClass.isModelRoot()) {%>
-
- /**
- * The fixture for this <%=genClass.getFormattedName()%> test case.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected <%=genClass.getImportedInterfaceName()%><%=genClass.getInterfaceWildTypeArguments()%> fixture = null;
-<%}%>
-<%if (!genClass.isAbstract()) {%>
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static void main(String[] args)
- {
- <%=genModel.getImportedName("junit.textui.TestRunner")%>.run(<%=genClass.getTestCaseClassName()%>.class);
- }
-<%}%>
-
- /**
- * Constructs a new <%=genClass.getFormattedName()%> test case with the given name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public <%=genClass.getTestCaseClassName()%>(String name)
- {
- super(name);
- }
-<%if (genClass.isModelRoot()) {%>
-
- /**
- * Sets the fixture for this <%=genClass.getFormattedName()%> test case.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected void setFixture(<%=genClass.getImportedInterfaceName()%><%=genClass.getInterfaceWildTypeArguments()%> fixture)
- {
- this.fixture = fixture;
- }
-<%}%>
-
- /**
- * Returns the fixture for this <%=genClass.getFormattedName()%> test case.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-<%if (!genClass.isModelRoot() && genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- <%if (genModel.useGenerics()) {%>protected<%} else {%>private<%}%> <%=genClass.getImportedInterfaceName()%><%=genClass.getInterfaceWildTypeArguments()%> getFixture()
- {
-<%if (genClass.isModelRoot()) {%>
- return fixture;
-<%} else {%>
- return (<%=genClass.getImportedInterfaceName()%><%=genClass.getInterfaceWildTypeArguments()%>)fixture;
-<%}%>
- }
-<%if (!genClass.isAbstract()) {%>
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see junit.framework.TestCase#setUp()
- * @generated
- */
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
-<%if (genModel.useGenerics() && genClass.isMapEntry()) {%>
- @SuppressWarnings("unchecked")
-<%}%>
- protected void setUp() throws Exception
- {
- <%if (genClass.isMapEntry()) {%>
- setFixture((<%=genClass.getImportedInterfaceName()%><%=genClass.getInterfaceWildTypeArguments()%>)<%=genPackage.getQualifiedEFactoryInternalInstanceAccessor()%>.create(<%=genClass.getQualifiedClassifierAccessor()%>));
- <%} else {%>
- setFixture(<%=genPackage.getQualifiedEFactoryInternalInstanceAccessor()%>.create<%=genClass.getName()%>());
- <%}%>
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see junit.framework.TestCase#tearDown()
- * @generated
- */
-<%if (genModel.useClassOverrideAnnotation()) {%>
- @Override
-<%}%>
- protected void tearDown() throws Exception
- {
- setFixture(null);
- }
-<%}%>
-<%for (GenFeature genFeature : genClass.getImplementedGenFeatures()) {%>
-<%@ include file="TestCase/implementedGenFeature.override.javajetinc" fail="alternative" %>
-<%@ start %>
- <%if (genFeature.isTested()) {%>
- <%if (genFeature.isGet() && !genFeature.isSuppressedGetVisibility()) {%>
-<%@ include file="TestCase/getGenFeature.override.javajetinc" fail="alternative" %>
-<%@ start %>
-
- /**
- * Tests the '{@link <%=genFeature.getGenClass().getQualifiedInterfaceName()%>#<%=genFeature.getGetAccessor()%>() <em><%=genFeature.getFormattedName()%></em>}' feature getter.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see <%=genFeature.getGenClass().getQualifiedInterfaceName()%>#<%=genFeature.getGetAccessor()%>()
- * @generated
- */
- <%if (genModel.getComplianceLevel().getValue() >= GenJDKLevel.JDK50) { //TestCase/getGenFeature.annotations.insert.javajetinc%>
-<%@ include file="TestCase/getGenFeature.annotations.insert.javajetinc" fail="silent" %>
- <%}%>
- public void test<%=genModel.capName(genFeature.getGetAccessor())%>()
- {
-<%@ include file="TestCase/getGenFeature.TODO.override.javajetinc" fail="alternative" %>
-<%@ start %>
- // TODO: implement this feature getter test method
- // Ensure that you remove @generated or mark it @generated NOT
- fail();
-<%@ end %><%//TestCase/getGenFeature.todo.override.javajetinc%>
- }
-<%@ end %><%//TestCase/getGenFeature.override.javajetinc%>
- <%}%>
- <%if (genFeature.isSet() && !genFeature.isSuppressedSetVisibility()) {%>
-<%@ include file="TestCase/setGenFeature.override.javajetinc" fail="alternative" %>
-<%@ start %>
-
- /**
- * Tests the '{@link <%=genFeature.getGenClass().getQualifiedInterfaceName()%>#set<%=genFeature.getAccessorName()%>(<%=genFeature.getRawBoundType()%>) <em><%=genFeature.getFormattedName()%></em>}' feature setter.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see <%=genFeature.getGenClass().getQualifiedInterfaceName()%>#set<%=genFeature.getAccessorName()%>(<%=genFeature.getRawBoundType()%>)
- * @generated
- */
- <%if (genModel.getComplianceLevel().getValue() >= GenJDKLevel.JDK50) { //TestCase/setGenFeature.annotations.insert.javajetinc%>
-<%@ include file="TestCase/setGenFeature.annotations.insert.javajetinc" fail="silent" %>
- <%}%>
- public void testSet<%=genFeature.getAccessorName()%>()
- {
-<%@ include file="TestCase/setGenFeature.TODO.override.javajetinc" fail="alternative" %>
-<%@ start %>
- // TODO: implement this feature setter test method
- // Ensure that you remove @generated or mark it @generated NOT
- fail();
-<%@ end %><%//TestCase/setGenFeature.todo.override.javajetinc%>
- }
-<%@ end %><%//TestCase/setGenFeature.override.javajetinc%>
- <%}%>
- <%if (genFeature.isUnset() && !genFeature.isSuppressedUnsetVisibility()) {%>
-<%@ include file="TestCase/unsetGenFeature.override.javajetinc" fail="alternative" %>
-<%@ start %>
-
- /**
- * Tests the '{@link <%=genFeature.getGenClass().getQualifiedInterfaceName()%>#unset<%=genFeature.getAccessorName()%>() <em>unset<%=genFeature.getAccessorName()%>()</em>}' method.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see <%=genFeature.getGenClass().getQualifiedInterfaceName()%>#unset<%=genFeature.getAccessorName()%>()
- * @generated
- */
- <%if (genModel.getComplianceLevel().getValue() >= GenJDKLevel.JDK50) { //TestCase/unsetGenFeature.annotations.insert.javajetinc%>
-<%@ include file="TestCase/unsetGenFeature.annotations.insert.javajetinc" fail="silent" %>
- <%}%>
- public void testUnset<%=genFeature.getAccessorName()%>()
- {
-<%@ include file="TestCase/unsetGenFeature.TODO.override.javajetinc" fail="alternative" %>
-<%@ start %>
- // TODO: implement this test method
- // Ensure that you remove @generated or mark it @generated NOT
- fail();
-<%@ end %><%//TestCase/unsetGenFeature.todo.override.javajetinc%>
- }
-<%@ end %><%//TestCase/unsetGenFeature.override.javajetinc%>
- <%}%>
- <%if (genFeature.isIsSet() && !genFeature.isSuppressedIsSetVisibility()) {%>
-<%@ include file="TestCase/isSetGenFeature.override.javajetinc" fail="alternative" %>
-<%@ start %>
-
- /**
- * Tests the '{@link <%=genFeature.getGenClass().getQualifiedInterfaceName()%>#isSet<%=genFeature.getAccessorName()%>() <em>isSet<%=genFeature.getAccessorName()%>()</em>}' method.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see <%=genFeature.getGenClass().getQualifiedInterfaceName()%>#isSet<%=genFeature.getAccessorName()%>()
- * @generated
- */
- <%if (genModel.getComplianceLevel().getValue() >= GenJDKLevel.JDK50) { //TestCase/isSetGenFeature.annotations.insert.javajetinc%>
-<%@ include file="TestCase/isSetGenFeature.annotations.insert.javajetinc" fail="silent" %>
- <%}%>
- public void testIsSet<%=genFeature.getAccessorName()%>()
- {
-<%@ include file="TestCase/isSetGenFeature.TODO.override.javajetinc" fail="alternative" %>
-<%@ start %>
- // TODO: implement this test method
- // Ensure that you remove @generated or mark it @generated NOT
- fail();
-<%@ end %><%//TestCase/isSetGenFeature.todo.override.javajetinc%>
- }
-<%@ end %><%//TestCase/isSetGenFeature.override.javajetinc%>
- <%}%>
- <%}%>
-<%@ include file="TestCase/implementedGenFeature.insert.javajetinc" fail="silent" %>
-<%@ end %><%//TestCase/implementedGenFeature.override.javajetinc%>
-<%}%>
-<%for (GenOperation genOperation : genClass.getImplementedGenOperations()) {%>
-<%@ include file="TestCase/implementedGenOperation.override.javajetinc" fail="alternative" %>
-<%@ start %>
-
- /**
- * Tests the '{@link <%=genOperation.getGenClass().getQualifiedInterfaceName()%>#<%=genOperation.getName()%>(<%=genOperation.getParameterTypes(", ")%>) <em><%=genOperation.getFormattedName()%></em>}' operation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see <%=genOperation.getGenClass().getQualifiedInterfaceName()%>#<%=genOperation.getName()%>(<%=genOperation.getParameterTypes(", ")%>)
- * @generated
- */
- <%if (genModel.getComplianceLevel().getValue() >= GenJDKLevel.JDK50) { //TestCase/genOperation.annotations.insert.javajetinc%>
-<%@ include file="TestCase/genOperation.annotations.insert.javajetinc" fail="silent" %>
- <%}%>
- public void test<%=genClass.getUniqueName(genOperation)%>()
- {
-<%@ include file="TestCase/implementedGenOperation.TODO.override.javajetinc" fail="alternative" %>
-<%@ start %>
- // TODO: implement this operation test method
- // Ensure that you remove @generated or mark it @generated NOT
- fail();
-<%@ end %><%//TestCase/implementedGenOperation.todo.override.javajetinc%>
- }
-<%@ include file="TestCase/implementedGenOperation.insert.javajetinc" fail="silent" %>
-<%@ end %><%//TestCase/implementedGenOperation.override.javajetinc%>
-<%}%>
-
-<%@ include file="TestCase/insert.javajetinc" fail="silent" %>
-} //<%=genClass.getTestCaseClassName()%>
-<%genModel.emitSortedImports();%>
diff --git a/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/model.tests/build.propertiesjet b/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/model.tests/build.propertiesjet
deleted file mode 100644
index 00097f70d84..00000000000
--- a/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/model.tests/build.propertiesjet
+++ /dev/null
@@ -1,33 +0,0 @@
-<%@ jet package="org.eclipse.emf.codegen.ecore.templates.model.tests" imports="org.eclipse.emf.codegen.ecore.genmodel.* java.util.*" class="BuildProperties" version="$Id: build.propertiesjet,v 1.10 2008/04/18 04:34:29 davidms Exp $" %>
-<%
-/**
- * <copyright>
- *
- * Copyright (c) 2005-2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- *
- * </copyright>
- */
-%>
-<%GenModel genModel = (GenModel)argument;%>
-<%String pluginClassesLocation = genModel.isRuntimeJar() ? genModel.getTestsPluginID()+".jar" : ".";%>
-<%List<String> sourceFolders = genModel.getTestsSourceFolders();%>
-<%@ include file="../Header.propertiesjetinc"%>
-
-bin.includes = <%=pluginClassesLocation%>,\
-<%if (genModel.isBundleManifest()) {%>
- META-INF/,\
-<%} else {%>
- plugin.xml,\
-<%}%>
- plugin.properties
-jars.compile.order = <%=pluginClassesLocation%>
-<% boolean first=true; for (Iterator<String> i = sourceFolders.iterator(); i.hasNext();) { String sourceFolder = i.next(); if (i.hasNext()){sourceFolder +=",\\";} if (first) {%>
-source.<%=pluginClassesLocation%> = <%=sourceFolder%><%first=false;} else {%><%=sourceFolder%><%}}%>
-output.<%=pluginClassesLocation%> = bin/
diff --git a/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/model.tests/manifest.mfjet b/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/model.tests/manifest.mfjet
deleted file mode 100644
index f1cd0b6fabe..00000000000
--- a/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/model.tests/manifest.mfjet
+++ /dev/null
@@ -1,43 +0,0 @@
-<%@ jet package="org.eclipse.emf.codegen.ecore.templates.model.tests" imports="java.util.* org.eclipse.emf.codegen.ecore.genmodel.*" class="ManifestMF" version="$Id: manifest.mfjet,v 1.8 2011/01/20 01:36:08 emerks Exp $" %>
-<%
-/**
- * <copyright>
- *
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- *
- * </copyright>
- */
-%>
-<%GenModel genModel = (GenModel)argument;%>
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: <%=genModel.getTestsPluginID()%>;singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Bundle-ClassPath: <%if (genModel.isRuntimeJar()) {%><%=genModel.getTestsPluginID()%>.jar<%}else{%>.<%}%>
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-<%if (genModel.getComplianceLevel() == GenJDKLevel.JDK50_LITERAL) {%>
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-<%} else if (genModel.getComplianceLevel() == GenJDKLevel.JDK60_LITERAL) {%>
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-<%}%>
-<%Iterator<String> packagesIterator = genModel.getTestsQualifiedPackageNames().iterator(); if (packagesIterator.hasNext()) { String pack = packagesIterator.next();%>
-Export-Package: <%=pack%><%while(packagesIterator.hasNext()) { pack = packagesIterator.next();%>,
- <%=pack%><%}%>
-<%}%>
-<%Iterator<String> requiredPluginIterator = genModel.getTestsRequiredPlugins().iterator(); if (requiredPluginIterator.hasNext()) { String pluginID = requiredPluginIterator.next();%>
-Require-Bundle: <%=pluginID%><%if (!pluginID.startsWith("org.eclipse.core.runtime")){%>;visibility:=reexport<%} while(requiredPluginIterator.hasNext()) { pluginID = requiredPluginIterator.next();%>,
- <%=pluginID%><%if (!pluginID.startsWith("org.eclipse.core.runtime")){%>;visibility:=reexport<%}}%>
-<%}%>
-<%if (genModel.getRuntimeVersion() == GenRuntimeVersion.EMF22 || genModel.getRuntimeVersion() == GenRuntimeVersion.EMF23) {%>
-Eclipse-LazyStart: true
-<%}%>
-Bundle-ActivationPolicy: lazy
diff --git a/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/model.tests/plugin.propertiesjet b/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/model.tests/plugin.propertiesjet
deleted file mode 100644
index 9a72c61e766..00000000000
--- a/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/model.tests/plugin.propertiesjet
+++ /dev/null
@@ -1,22 +0,0 @@
-<%@ jet package="org.eclipse.emf.codegen.ecore.templates.model.tests" imports="org.eclipse.emf.codegen.ecore.genmodel.*" class="PluginProperties" %>
-<%
-/**
- * <copyright>
- *
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- *
- * </copyright>
- */
-%>
-<%GenModel genModel = (GenModel)argument;%>
-<%@ include file="../Header.propertiesjetinc"%>
-
-pluginName = <%=genModel.getModelName()%> Tests
-providerName = www.example.org
diff --git a/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/model.tests/plugin.xmljet b/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/model.tests/plugin.xmljet
deleted file mode 100644
index 9a1f654b651..00000000000
--- a/plugins/developer/org.eclipse.papyrus.sysml.sysmloveruml.codegen/templates/model.tests/plugin.xmljet
+++ /dev/null
@@ -1,50 +0,0 @@
-<%@ jet package="org.eclipse.emf.codegen.ecore.templates.model.tests" imports="java.util.* org.eclipse.emf.codegen.ecore.genmodel.*" class="PluginXML" %>
-<%
-/**
- * <copyright>
- *
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- *
- * </copyright>
- */
-%>
-<%GenModel genModel = (GenModel)argument; /* Trick to import java.util.* without warnings */Iterator.class.getName();%>
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-
-<%@ include file="../Header.xmljetinc"%>
-
-<%if (genModel.isBundleManifest()) {%>
-<plugin>
-<%} else {%>
-<plugin
- name="%pluginName"
- id="<%=genModel.getTestsPluginID()%>"
- version="1.0.0"
- provider-name="%providerName">
-
- <requires>
- <%for (String pluginID : genModel.getTestsRequiredPlugins()) {%>
- <import plugin="<%=pluginID%>"<%if (!pluginID.startsWith("org.eclipse.core.runtime")) {%> export="true"<%}%>/>
- <%}%>
- </requires>
-
- <runtime>
- <%if (genModel.isRuntimeJar()) {%>
- <library name="<%=genModel.getTestsPluginID()%>.jar">
- <%} else {%>
- <library name=".">
- <%}%>
- <export name="*"/>
- </library>
- </runtime>
-
-<%}%>
-</plugin>

Back to the top