Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/actions/CustomizationAction.java')
-rw-r--r--sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/actions/CustomizationAction.java104
1 files changed, 0 insertions, 104 deletions
diff --git a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/actions/CustomizationAction.java b/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/actions/CustomizationAction.java
deleted file mode 100644
index 8883cb205d3..00000000000
--- a/sandbox/PapyrusEMFCompareV1/org.eclipse.papyrus.infra.emf.compare.ui/src/org/eclipse/papyrus/infra/emf/compare/ui/actions/CustomizationAction.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- *
- * 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:
- * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.emf.compare.ui.actions;
-
-import java.util.Collection;
-import java.util.List;
-
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.facet.infra.browser.custom.MetamodelView;
-import org.eclipse.emf.facet.infra.browser.custom.ui.dialogs.LoadCustomizationsDialog;
-import org.eclipse.emf.facet.infra.browser.uicore.CustomizationManager;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.infra.emf.compare.ui.Activator;
-import org.eclipse.papyrus.infra.emf.compare.utils.Utils;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-
-/**
- *
- * @author VL222926
- *
- * This action allows to choose the customization to apply on the viewer
- */
-public class CustomizationAction extends Action {
-
- /**
- * tooltip for this action
- */
- private static final String TOOLTIPTEXT = "Manage the applied customization";
-
- //FIXME : avoid to duplicate this image?
- private static final String CUSTOMIZATION_IMAGE_PATH = "icons/addUiCustom.gif";
-
- // private IEditorPart currentEditor;
-
- /**
- * the registered metamodels for the customization manager
- */
- private final Collection<EPackage> registeredMetamodel;
-
- /**
- *
- * Constructor.
- *
- * @param registeredMetamodel
- * can be empty when the class is created
- */
- public CustomizationAction(final Collection<EPackage> registeredMetamodel) {
- super(IAction.TOOL_TIP_TEXT, IAction.AS_PUSH_BUTTON);
- setToolTipText(CustomizationAction.TOOLTIPTEXT);
- setImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin(Activator.PLUGIN_ID, CustomizationAction.CUSTOMIZATION_IMAGE_PATH));
- // this.currentEditor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- this.registeredMetamodel = registeredMetamodel;
- }
-
- /**
- *
- * {@inheritDoc}
- *
- */
- //TODO duplicate code from ModelExplorer
- //TODO vérifier que l'on n'a pas la même chose dans les tables également!
- @Override
- public void run() {
- final IEditorPart currentEditor = Utils.getCurrentEditor();
- final CustomizationManager customizationManager = Activator.getDefault().getCustomizationManager(currentEditor);
- final List<MetamodelView> initiallySelectedCustomizations = customizationManager.getRegisteredCustomizations();
- final LoadCustomizationsDialog loadCustomizationsDialog = new LoadCustomizationsDialog(Display.getCurrent().getActiveShell(), initiallySelectedCustomizations, this.registeredMetamodel);
- //TODO : override the dialog to hide the checkbox for the facet
- if(Window.OK == loadCustomizationsDialog.open()) {
- customizationManager.clearCustomizations();
- final List<MetamodelView> selectedCustomizations = loadCustomizationsDialog.getSelectedCustomizations();
- //before loading, clean all facet to prevent to let not interesting facets.
- customizationManager.clearFacets();
- if(loadCustomizationsDialog.isLoadRequiredFacetsSelected()) {
- // load facets corresponding to customizations
- //we ignore the facet in this dialog
- }
- for(final MetamodelView metamodelView : selectedCustomizations) {
- customizationManager.registerCustomization(metamodelView);
- }
- customizationManager.loadCustomizations();
- }
- //dialog.s
-
- //TODO
- // TODO Auto-generated method stub
- // super.run();
- }
-}

Back to the top