Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: cdf2b3527149924ebe6848a461a5a47aaeba80b2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*****************************************************************************
 * Copyright (c) 2013 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:
 *  Patrick Tessier (CEA LIST) patrick.tessier@cea.fr - Initial API and implementation
 *
 *****************************************************************************/
package org.eclipse.papyrus.adl4eclipsetool.assistant;

import java.util.Set;

import org.eclipse.papyrus.adltool.ADL4EclipseUtils;
import org.eclipse.papyrus.adltool.command.CompleteArchitectureSnapshotCommand;
import org.eclipse.papyrus.adltool.designer.ReverseSettings;
import org.eclipse.papyrus.adltool.reversible.project.ReversibleProject;
import org.eclipse.uml2.uml.Package;

/**
 * This class is used to do the reverse engineering from workspace feature. It adds only in the platform dependencies.
 */
public class SimpleFeatureImport extends AbstractImportWizard {

	private static final boolean ADVANCED_MODE = false;

	public SimpleFeatureImport() {
		super(ADVANCED_MODE);

		reversibleList = ADL4EclipseUtils.getWorkspaceFeatures();
	}

	@Override
	public boolean performFinish() {
		Set<ReversibleProject> selectedBundles = bundleSelectionPage.getResult();

		// One bundle must be selected
		if (selectedBundles.size() > 0) {
			Package selection = bundleSelectionPage.getSelectedModel();

			if (selection != null) {
				ReverseSettings reverseSettings = bundleSelectionPage.getReverseSettings();

				// Launch the simple reverse engineering
				CompleteArchitectureSnapshotCommand comd = new CompleteArchitectureSnapshotCommand(transactionalEditingDomain, selection, selectedBundles, reverseSettings);
				transactionalEditingDomain.getCommandStack().execute(comd);

				return true;
			}
		}

		return false;
	}
}

Back to the top