Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'extraplugins/uml')
-rw-r--r--extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.ui/src/org/eclipse/papyrus/uml/compare/ui/Activator.java8
-rw-r--r--extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.ui/src/org/eclipse/papyrus/uml/compare/ui/provider/PapyrusCompareAdapterFactory.java16
-rw-r--r--extraplugins/uml/compare/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/postprocessor/PapyrusPostProcessor.java37
-rw-r--r--extraplugins/uml/compare/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/utils/GeneralizationChangesHelper.java110
-rw-r--r--extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/Activator.java16
-rw-r--r--extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/dialog/ExportProfilesIconsDialog.java27
-rw-r--r--extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/dialog/ExportProfilesParametersDialog.java64
-rw-r--r--extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/dialog/ProfilesToExportSelectionDialog.java43
-rw-r--r--extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/handlers/EditProfileApplicationAction.java110
-rw-r--r--extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/handlers/ExportAppliedProfileHandler.java15
-rw-r--r--extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/handlers/ExportProfilesCommand.java194
-rw-r--r--extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/messages/Messages.java2
-rw-r--r--extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/AreThereAppliedProfilesFromWS.java17
-rw-r--r--extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/BuildProperties.java52
-rw-r--r--extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/ChangeProfileApplicationTester.java5
-rw-r--r--extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/ExportProfilesUserParameters.java36
-rw-r--r--extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/ImportedLibrary.java36
-rw-r--r--extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/InstalledProfileURI.java20
-rw-r--r--extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/PluginExportUtil.java186
-rw-r--r--extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/ProfileUtil.java29
-rw-r--r--extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/ProfilesLabelProvider.java10
-rw-r--r--extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/WSFileUtil.java56
22 files changed, 555 insertions, 534 deletions
diff --git a/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.ui/src/org/eclipse/papyrus/uml/compare/ui/Activator.java b/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.ui/src/org/eclipse/papyrus/uml/compare/ui/Activator.java
index 5b9be30878b..39d1c322473 100644
--- a/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.ui/src/org/eclipse/papyrus/uml/compare/ui/Activator.java
+++ b/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.ui/src/org/eclipse/papyrus/uml/compare/ui/Activator.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -27,7 +27,7 @@ public class Activator extends AbstractUIPlugin {
// The shared instance
private static Activator plugin;
-
+
/**
* The constructor
*/
@@ -36,8 +36,10 @@ public class Activator extends AbstractUIPlugin {
/*
* (non-Javadoc)
+ *
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
+ @Override
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
@@ -45,8 +47,10 @@ public class Activator extends AbstractUIPlugin {
/*
* (non-Javadoc)
+ *
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
*/
+ @Override
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
diff --git a/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.ui/src/org/eclipse/papyrus/uml/compare/ui/provider/PapyrusCompareAdapterFactory.java b/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.ui/src/org/eclipse/papyrus/uml/compare/ui/provider/PapyrusCompareAdapterFactory.java
index a36acf4ec29..2ca39007802 100644
--- a/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.ui/src/org/eclipse/papyrus/uml/compare/ui/provider/PapyrusCompareAdapterFactory.java
+++ b/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare.ui/src/org/eclipse/papyrus/uml/compare/ui/provider/PapyrusCompareAdapterFactory.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -31,12 +31,12 @@ public class PapyrusCompareAdapterFactory extends AdapterFactoryImpl {
* The instance of the actual label provider
*/
private LabelProviderAdapter instance = new LabelProviderAdapter();
-
- /**
+
+ /**
* Overrides AdapatFactoryImple.adapt so that, if the target element is an Element,
* and if the requested adaptation type is IItemLabelProvider,
* the production of the adapter is delegated to delegate.
- *
+ *
* @see org.eclipse.emf.common.notify.impl.AdapterFactoryImpl#adapt(org.eclipse.emf.common.notify.Notifier, java.lang.Object)
*/
@Override
@@ -46,14 +46,14 @@ public class PapyrusCompareAdapterFactory extends AdapterFactoryImpl {
}
return super.adapt(target, type);
}
-
+
private class LabelProviderAdapter extends AdapterImpl implements IItemLabelProvider {
-
+
/**
* An instance of the Papyrus label provider service
*/
private LabelProviderService service = new LabelProviderServiceImpl();
-
+
/**
* Delegates production of the text label to the
* label provider associated with the Papyrus label provider service
@@ -71,6 +71,6 @@ public class PapyrusCompareAdapterFactory extends AdapterFactoryImpl {
Object result = service.getLabelProvider().getImage(object);
return result;
}
-
+
};
}
diff --git a/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/postprocessor/PapyrusPostProcessor.java b/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/postprocessor/PapyrusPostProcessor.java
index b44d28146b3..d2e20808c6e 100644
--- a/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/postprocessor/PapyrusPostProcessor.java
+++ b/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/postprocessor/PapyrusPostProcessor.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -32,7 +32,7 @@ import org.eclipse.uml2.uml.Generalization;
* PostProcessor specific to integration with Papyrus.
* Creates needed requirements between Diffs implying addition/deletion of Generalizations in a .uml model,
* and Diffs implying addition/deletion of graphical nodes for inherited features.
- *
+ *
*/
@SuppressWarnings("restriction")
public class PapyrusPostProcessor implements IPostProcessor {
@@ -94,14 +94,13 @@ public class PapyrusPostProcessor implements IPostProcessor {
* Generalization) are also merged
* - When a merge implies addition of a node for an inherited feature, Diffs corresponding to addition of a Generalization (required for the
* inheritance of this feature) are also merged
- *
+ *
* It means that merging the deletion of a node for an inherited feature does not imply merging the deletion of a Generalization (required for
* this inheritance), if any.
- *
+ *
* (non-Javadoc)
- *
- * @see org.eclipse.emf.compare.postprocessor.IPostProcessor#postComparison(org.eclipse.emf.compare.Comparison,
- * org.eclipse.emf.common.util.Monitor)
+ *
+ * @see org.eclipse.emf.compare.postprocessor.IPostProcessor#postComparison(org.eclipse.emf.compare.Comparison, org.eclipse.emf.common.util.Monitor)
*/
@Override
public void postComparison(Comparison comparison, Monitor monitor) {
@@ -115,21 +114,21 @@ public class PapyrusPostProcessor implements IPostProcessor {
* Adds additional requirements between Diffs classified by the given helper.
* Requirements are added when required between Diffs implying addition/deletion of Generalizations in a .uml model,
* and Diffs implying addition/deletion of graphical nodes for inherited features.
- *
+ *
* @param helper
- * A GeneralizationChangesHelper containing a pre-classification of Diffs
+ * A GeneralizationChangesHelper containing a pre-classification of Diffs
*/
protected void computeRequirements(GeneralizationChangesHelper helper) {
// Compute diff requirements related to additions of graphical nodes for inherited features
List<Class> classesWIthNodesForInheritedFeatures_ADDED = helper.getClassesWithInheritedPropertyNode(DifferenceKind.ADD);
- for(Class c : classesWIthNodesForInheritedFeatures_ADDED) {
+ for (Class c : classesWIthNodesForInheritedFeatures_ADDED) {
Set<Feature> features = helper.getInheritedFeaturesWithNodeChange(c);
- for(Feature f : features) {
- for(Generalization generalization : helper.getGeneralizationPath(c, f)) {
+ for (Feature f : features) {
+ for (Generalization generalization : helper.getGeneralizationPath(c, f)) {
ReferenceChange generalizationAdded = helper.getGeneralizationChange(generalization);
- if(generalizationAdded != null) {
+ if (generalizationAdded != null) {
NodeChange nodeAdded = helper.getFeatureNodeChange(f);
- if(nodeAdded != null) {
+ if (nodeAdded != null) {
nodeAdded.getRequires().add(generalizationAdded);
generalizationAdded.getRequiredBy().add(nodeAdded);
}
@@ -140,14 +139,14 @@ public class PapyrusPostProcessor implements IPostProcessor {
// Compute diff requirements related to deletions of nodes for inherited features
List<Class> classesWIthNodesForInheritedFeatures_DELETED = helper.getClassesWithInheritedPropertyNode(DifferenceKind.DELETE);
- for(Class c : classesWIthNodesForInheritedFeatures_DELETED) {
+ for (Class c : classesWIthNodesForInheritedFeatures_DELETED) {
Set<Feature> features = helper.getInheritedFeaturesWithNodeChange(c);
- for(Feature f : features) {
- for(Generalization generalization : helper.getGeneralizationPath(c, f)) {
+ for (Feature f : features) {
+ for (Generalization generalization : helper.getGeneralizationPath(c, f)) {
ReferenceChange generalizationDeleted = helper.getGeneralizationChange(generalization);
- if(generalizationDeleted != null) {
+ if (generalizationDeleted != null) {
NodeChange nodeDeleted = helper.getFeatureNodeChange(f);
- if(nodeDeleted != null) {
+ if (nodeDeleted != null) {
nodeDeleted.getRequiredBy().add(generalizationDeleted);
generalizationDeleted.getRequires().add(nodeDeleted);
}
diff --git a/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/utils/GeneralizationChangesHelper.java b/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/utils/GeneralizationChangesHelper.java
index 89b850855c3..abb9452dbf7 100644
--- a/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/utils/GeneralizationChangesHelper.java
+++ b/extraplugins/uml/compare/org.eclipse.papyrus.uml.compare/src/org/eclipse/papyrus/uml/compare/utils/GeneralizationChangesHelper.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* 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
@@ -37,7 +37,7 @@ import org.eclipse.uml2.uml.UMLPackage;
* Helper for extracting information used by the ComparePapyrusDiagramPostProcessor,
* in order to establish requirements between Diffs representing changes on Generalization in a .uml model,
* and Diffs representing changes on nodes for inherited features in .notation model.
- *
+ *
*/
@SuppressWarnings("restriction")
public class GeneralizationChangesHelper {
@@ -79,7 +79,7 @@ public class GeneralizationChangesHelper {
/**
* Constructor for this helper. Instantiation of this helper implies classification of Diffs associated with the given comparison.
- *
+ *
* @param comparison
*/
public GeneralizationChangesHelper(Comparison comparison) {
@@ -97,13 +97,13 @@ public class GeneralizationChangesHelper {
* classesWithNodeForInheritedFeature_ADDED, classesWithNodeForInheritedFeature_DELETED)
*/
protected void classifyDiffs() {
- for(Diff difference : this.comparison.getDifferences()) {
- if(difference instanceof ReferenceChange) {
+ for (Diff difference : this.comparison.getDifferences()) {
+ if (difference instanceof ReferenceChange) {
// TODO Changes may be required in connection with the following bug:
- // Bug 406405 - A macroscopic change has to be created for UML DirectedRelationship elements
- this.evaluateGeneralizationChange((ReferenceChange)difference);
- } else if(difference instanceof NodeChange) {
- this.evaluateNodeForInheritedFeatureChange((NodeChange)difference);
+ // Bug 406405 - A macroscopic change has to be created for UML DirectedRelationship elements
+ this.evaluateGeneralizationChange((ReferenceChange) difference);
+ } else if (difference instanceof NodeChange) {
+ this.evaluateNodeForInheritedFeatureChange((NodeChange) difference);
}
}
}
@@ -111,62 +111,62 @@ public class GeneralizationChangesHelper {
/**
* Evaluates if the given difference concerns a change on a Generalization,
* and classifies it accordingly.
- *
+ *
* @param difference
- * The difference being evaluated
+ * The difference being evaluated
*/
protected void evaluateGeneralizationChange(ReferenceChange difference) {
// difference is a generalization if the associated eReference is Classifier.generalization
- if(difference.getReference().equals(UMLPackage.eINSTANCE.getClassifier_Generalization())) {
- this.generalizationToReferenceChange.put((Generalization)difference.getValue(), difference);
+ if (difference.getReference().equals(UMLPackage.eINSTANCE.getClassifier_Generalization())) {
+ this.generalizationToReferenceChange.put((Generalization) difference.getValue(), difference);
}
}
/**
* Evaluates if the given difference concerns a change on a node (in the .notation)
* representing an inherited feature, and classifies it accordingly.
- *
+ *
* @param difference
- * The difference being evaluated
+ * The difference being evaluated
*/
protected void evaluateNodeForInheritedFeatureChange(NodeChange difference) {
Feature feature = null;
View view = null;
// Determines if the NodeChange concerns a View for a Feature
- if(difference.getView() != null && (difference.getView() instanceof View)) {
- view = (View)difference.getView();
+ if (difference.getView() != null && (difference.getView() instanceof View)) {
+ view = (View) difference.getView();
EObject semanticElement = view.getElement();
- if(semanticElement == null || !(semanticElement instanceof Feature)) {
+ if (semanticElement == null || !(semanticElement instanceof Feature)) {
return;
} else {
- feature = (Feature)semanticElement;
+ feature = (Feature) semanticElement;
}
}
// Determines if the View corresponds to an inherited Feature.
// Requires to retrieve the View for the Class containing this Feature
Class class_ = null;
EObject viewContainer = view.eContainer();
- while(viewContainer != null && class_ == null) {
- if(viewContainer instanceof View) {
- EObject semanticElement = ((View)viewContainer).getElement();
- if(semanticElement != null && semanticElement instanceof Class) {
- class_ = (Class)semanticElement;
+ while (viewContainer != null && class_ == null) {
+ if (viewContainer instanceof View) {
+ EObject semanticElement = ((View) viewContainer).getElement();
+ if (semanticElement != null && semanticElement instanceof Class) {
+ class_ = (Class) semanticElement;
}
}
viewContainer = viewContainer.eContainer();
}
- if(class_ == null) {
+ if (class_ == null) {
return;
}
- // The difference is added to the appropriate collections if the
+ // The difference is added to the appropriate collections if the
// corresponding feature is an inherited member of the Class
- if(class_.getInheritedMembers().contains(feature)) {
- if(difference.getKind() == DifferenceKind.ADD) {
- if(!this.classesWithNodeForInheritedFeature_ADDED.contains(class_)) {
+ if (class_.getInheritedMembers().contains(feature)) {
+ if (difference.getKind() == DifferenceKind.ADD) {
+ if (!this.classesWithNodeForInheritedFeature_ADDED.contains(class_)) {
this.classesWithNodeForInheritedFeature_ADDED.add(class_);
}
- } else if(difference.getKind() == DifferenceKind.DELETE) {
- if(!this.classesWithNodeForInheritedFeature_DELETED.contains(class_)) {
+ } else if (difference.getKind() == DifferenceKind.DELETE) {
+ if (!this.classesWithNodeForInheritedFeature_DELETED.contains(class_)) {
this.classesWithNodeForInheritedFeature_DELETED.add(class_);
}
}
@@ -179,15 +179,15 @@ public class GeneralizationChangesHelper {
/**
* Returns Classes for which there are changes on nodes representing inherited properties,
* with the given difference kind.
- *
+ *
* @param kind
- * The DifferenceKind for changes on nodes representing inherited properties
+ * The DifferenceKind for changes on nodes representing inherited properties
* @return Classes for which there are changes on nodes representing inherited properties, with the given DifferenceKind
*/
public List<Class> getClassesWithInheritedPropertyNode(DifferenceKind kind) {
- if(kind == DifferenceKind.ADD) {
+ if (kind == DifferenceKind.ADD) {
return this.classesWithNodeForInheritedFeature_ADDED;
- } else if(kind == DifferenceKind.DELETE) {
+ } else if (kind == DifferenceKind.DELETE) {
return this.classesWithNodeForInheritedFeature_DELETED;
}
// Not supposed to happen
@@ -197,9 +197,9 @@ public class GeneralizationChangesHelper {
/**
* Returns the Generalization path which enables the given classifier to inherit from the given feature.
* If no generalization path is found, returns an empty list
- *
+ *
* FIXME Currently returns the first Generalization path that matches. Since multiple inheritance is allowed in UML, there can be multiple paths
- *
+ *
* @param classifier
* @param inherited
* @return the Generalization path which enables the given classifier to inherit from the given feature.
@@ -207,7 +207,7 @@ public class GeneralizationChangesHelper {
public List<Generalization> getGeneralizationPath(Classifier classifier, Feature inherited) {
List<Generalization> path = null;
Map<Feature, List<Generalization>> inheritedFeatureToPath = this.classifierAndFeatureToGeneralizationPath.get(classifier);
- if(inheritedFeatureToPath != null) {
+ if (inheritedFeatureToPath != null) {
path = inheritedFeatureToPath.get(inherited);
}
return path != null ? path : new ArrayList<Generalization>();
@@ -216,17 +216,17 @@ public class GeneralizationChangesHelper {
/**
* From the inherited features of the given classifier, returns those for which the inherited features of
* the given classifier that are related to changes on graphical nodes.
- *
+ *
* @param classifier
* @return the inherited features of the given classifier that are related to change on graphical nodes
*/
public Set<Feature> getInheritedFeaturesWithNodeChange(Classifier classifier) {
Set<Feature> inheritedFeatures = null;
Map<Feature, List<Generalization>> inheritedFeatureToPath = this.classifierAndFeatureToGeneralizationPath.get(classifier);
- if(inheritedFeatureToPath != null) {
+ if (inheritedFeatureToPath != null) {
inheritedFeatures = inheritedFeatureToPath.keySet();
}
- if(inheritedFeatures == null) {
+ if (inheritedFeatures == null) {
inheritedFeatures = new HashSet<Feature>();
}
return inheritedFeatures;
@@ -234,9 +234,9 @@ public class GeneralizationChangesHelper {
/**
* Returns the generalization path that enables the given classifier to inherit from the given feature.
- *
+ *
* FIXME Currently returns the first Generalization path that matches. Since multiple inheritance is allowed in UML, there can be multiple paths
- *
+ *
* @param classifier
* @param inherited
* @return the generalization path that enables the given classifier to inherit from the given feature.
@@ -244,21 +244,21 @@ public class GeneralizationChangesHelper {
protected List<Generalization> computeGeneralizationPath(Classifier classifier, Feature inherited) {
Classifier featuringClassifier = inherited.getFeaturingClassifiers().get(0); // There is always 1 and only 1 featuring classifier
Generalization match = null;
- for(int i = 0; i < classifier.getGeneralizations().size() && match == null; i++) {
+ for (int i = 0; i < classifier.getGeneralizations().size() && match == null; i++) {
Generalization generalization = classifier.getGeneralizations().get(i);
- if(generalization.getGeneral() == featuringClassifier) {
+ if (generalization.getGeneral() == featuringClassifier) {
match = generalization;
}
}
List<Generalization> path = new ArrayList<Generalization>();
// if no match found, it means that the feature is not directly inherited.
// Repeat recursively on general classifiers of the classifier to construct the generalization path
- if(match == null) {
- for(int i = 0; i < classifier.getGeneralizations().size() && path.size() == 0; i++) {
+ if (match == null) {
+ for (int i = 0; i < classifier.getGeneralizations().size() && path.size() == 0; i++) {
Generalization generalization = classifier.getGeneralizations().get(i);
Classifier general = generalization.getGeneral();
List<Generalization> remaining = this.computeGeneralizationPath(general, inherited);
- if(remaining.size() != 0) {
+ if (remaining.size() != 0) {
path.add(generalization);
path.addAll(remaining);
}
@@ -273,17 +273,17 @@ public class GeneralizationChangesHelper {
/**
* Inserts a generalization path in the local map inheritedFeatureToGeneralizationPath,
* in the context of a specific classifier (cf. classifierAndFeatureToGeneralizationPath)
- *
+ *
* @param classifier
- * The context classifier that inherits the given feature
+ * The context classifier that inherits the given feature
* @param inherited
- * The feature inherited following the given path, in the context of the given classifier
+ * The feature inherited following the given path, in the context of the given classifier
* @param path
- * The generalization path (as a List) enabling the given classifier to inherit from the given feature
+ * The generalization path (as a List) enabling the given classifier to inherit from the given feature
*/
protected void insertGeneralizationPath(Classifier classifier, Feature inherited, List<Generalization> path) {
Map<Feature, List<Generalization>> inheritedFeatureToGeneralizationPath = this.classifierAndFeatureToGeneralizationPath.get(classifier);
- if(inheritedFeatureToGeneralizationPath == null) {
+ if (inheritedFeatureToGeneralizationPath == null) {
inheritedFeatureToGeneralizationPath = new HashMap<Feature, List<Generalization>>();
}
inheritedFeatureToGeneralizationPath.put(inherited, path);
@@ -293,7 +293,7 @@ public class GeneralizationChangesHelper {
/**
* From the comparison object from which this helper was constructed,
* returns the ReferenceChange diff corresponding to the given Generalization, if any.
- *
+ *
* @param generalization
* @return the ReferenceChange diff corresponding to the given Generalization, if any.
*/
@@ -304,7 +304,7 @@ public class GeneralizationChangesHelper {
/**
* From the comparison object from which this helper was constructed,
* returns the NodeChange diff corresponding to the given feature, if any.
- *
+ *
* @param feature
* @return
*/
diff --git a/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/Activator.java b/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/Activator.java
index c5b0f77b78b..d4830722a25 100644
--- a/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/Activator.java
+++ b/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/Activator.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2012 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
@@ -47,11 +47,11 @@ public class Activator extends AbstractUIPlugin {
*/
/**
* Start.
- *
+ *
* @param context
- * the context
+ * the context
* @throws Exception
- * the exception
+ * the exception
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
@@ -69,11 +69,11 @@ public class Activator extends AbstractUIPlugin {
*/
/**
* Stop.
- *
+ *
* @param context
- * the context
+ * the context
* @throws Exception
- * the exception
+ * the exception
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
*/
@@ -85,7 +85,7 @@ public class Activator extends AbstractUIPlugin {
/**
* Returns the shared instance.
- *
+ *
* @return the shared instance
*/
public static Activator getDefault() {
diff --git a/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/dialog/ExportProfilesIconsDialog.java b/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/dialog/ExportProfilesIconsDialog.java
index f0d1427d7af..2d23aaefc11 100644
--- a/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/dialog/ExportProfilesIconsDialog.java
+++ b/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/dialog/ExportProfilesIconsDialog.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2012 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
@@ -45,8 +45,10 @@ public class ExportProfilesIconsDialog extends TrayDialog {
/**
* Instantiates a new export profiles icons dialog.
*
- * @param shell the shell
- * @param profiles the profiles
+ * @param shell
+ * the shell
+ * @param profiles
+ * the profiles
*/
public ExportProfilesIconsDialog(Shell shell, Object[] profiles) {
super(shell);
@@ -59,7 +61,7 @@ public class ExportProfilesIconsDialog extends TrayDialog {
* @see org.eclipse.jface.dialogs.Dialog#create()
*
*/
-
+
@Override
public void create() {
// TODO Auto-generated method stub
@@ -75,11 +77,11 @@ public class ExportProfilesIconsDialog extends TrayDialog {
data = new GridData(GridData.FILL_HORIZONTAL);
data.horizontalSpan = 2;
- Composite parent = (Composite)getDialogArea();
- for(int i = 0; i < this.profiles.length; i++) {
+ Composite parent = (Composite) getDialogArea();
+ for (int i = 0; i < this.profiles.length; i++) {
this.profileIconEditors[i] = new StringFileSelector(parent, SWT.BORDER);
this.profileIconEditors[i].setLayoutData(data);
- this.profileIconEditors[i].setLabel("Icon for " + ((Profile)this.profiles[i]).getName());
+ this.profileIconEditors[i].setLabel("Icon for " + ((Profile) this.profiles[i]).getName());
this.profileIconEditors[i].setToolTipText("Enter the profile icon");
}
@@ -101,18 +103,19 @@ public class ExportProfilesIconsDialog extends TrayDialog {
/**
* Ok pressed.
- *
+ *
* @see org.eclipse.jface.dialogs.Dialog#okPressed()
*/
@Override
protected void okPressed() {
- loop: for(int i = 0; i < this.profileIconEditors.length; i++) {
- if(this.profileIconEditors[i] != null)
- this.profilesIcons[i] = (String)this.profileIconEditors[i].getValue();
- else
+ loop: for (int i = 0; i < this.profileIconEditors.length; i++) {
+ if (this.profileIconEditors[i] != null) {
+ this.profilesIcons[i] = (String) this.profileIconEditors[i].getValue();
+ } else {
break loop;
+ }
}
super.okPressed();
diff --git a/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/dialog/ExportProfilesParametersDialog.java b/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/dialog/ExportProfilesParametersDialog.java
index 056fb826ff5..eb3f8fb3414 100644
--- a/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/dialog/ExportProfilesParametersDialog.java
+++ b/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/dialog/ExportProfilesParametersDialog.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2012 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
@@ -62,17 +62,17 @@ public class ExportProfilesParametersDialog extends TrayDialog {
/**
* Instantiates a new export profiles parameters dialog.
- *
+ *
* @param shell
- * the shell
+ * the shell
* @param pluginName
- * the plugin name
+ * the plugin name
* @param pluginProvider
- * the plugin provider
+ * the plugin provider
* @param pluginVersion
- * the plugin version
+ * the plugin version
* @param execEnvironment
- * the exec environment
+ * the exec environment
*/
public ExportProfilesParametersDialog(Shell shell, String pluginName, String pluginProvider, String pluginVersion, String execEnvironment, Object[] profiles) {
super(shell);
@@ -87,7 +87,7 @@ public class ExportProfilesParametersDialog extends TrayDialog {
/**
* @see org.eclipse.jface.dialogs.Dialog#create()
- *
+ *
*/
@Override
@@ -108,7 +108,7 @@ public class ExportProfilesParametersDialog extends TrayDialog {
data.horizontalSpan = 2;
- Composite parent = (Composite)getDialogArea();
+ Composite parent = (Composite) getDialogArea();
this.pluginNameEditor = new StringEditor(parent, SWT.NONE, Messages.ExportProfilesParametersDialog_0);
@@ -133,15 +133,15 @@ public class ExportProfilesParametersDialog extends TrayDialog {
this.pluginExecEnvironmentEditor.setLayoutData(data);
this.pluginExecEnvironmentEditor.setToolTipText(Messages.ExportProfilesParametersDialog_11);
- for(int i = 0; i < this.profiles.length; i++) {
+ for (int i = 0; i < this.profiles.length; i++) {
this.profileIconEditors[i] = new StringFileSelector(parent, SWT.BORDER);
this.profileIconEditors[i].setLayoutData(data);
- this.profileIconEditors[i].setLabel("Icon for " + ((Profile)this.profiles[i]).getName());
+ this.profileIconEditors[i].setLabel("Icon for " + ((Profile) this.profiles[i]).getName());
this.profileIconEditors[i].setToolTipText("Enter the profile icon");
}
- //Configure the shell
+ // Configure the shell
getShell().setSize(800, 350);
getShell().setText(Messages.ExportProfilesParametersDialog_12);
@@ -154,24 +154,24 @@ public class ExportProfilesParametersDialog extends TrayDialog {
/**
* Ok pressed.
- *
+ *
* @see org.eclipse.jface.dialogs.Dialog#okPressed()
*/
@Override
protected void okPressed() {
- loop: for(int i = 0; i < this.profileIconEditors.length; i++) {
- if(this.profileIconEditors[i] != null) {
- this.profilesIcons[i] = (String)this.profileIconEditors[i].getValue();
+ loop: for (int i = 0; i < this.profileIconEditors.length; i++) {
+ if (this.profileIconEditors[i] != null) {
+ this.profilesIcons[i] = (String) this.profileIconEditors[i].getValue();
} else {
break loop;
}
}
- this.pluginExecEnvironment = (String)this.pluginExecEnvironmentEditor.getValue();
- this.pluginName = (String)this.pluginNameEditor.getValue();
- this.pluginProvider = (String)this.pluginProviderEditor.getValue();
- this.pluginVersion = (String)this.pluginVersionEditor.getValue();
+ this.pluginExecEnvironment = (String) this.pluginExecEnvironmentEditor.getValue();
+ this.pluginName = (String) this.pluginNameEditor.getValue();
+ this.pluginProvider = (String) this.pluginProviderEditor.getValue();
+ this.pluginVersion = (String) this.pluginVersionEditor.getValue();
super.okPressed();
@@ -179,7 +179,7 @@ public class ExportProfilesParametersDialog extends TrayDialog {
/**
* Gets the plugin name.
- *
+ *
* @return the plugin name
*/
public String getPluginName() {
@@ -188,9 +188,9 @@ public class ExportProfilesParametersDialog extends TrayDialog {
/**
* Sets the plugin name.
- *
+ *
* @param pluginName
- * the new plugin name
+ * the new plugin name
*/
private void setPluginName(String pluginName) {
this.pluginName = pluginName;
@@ -198,7 +198,7 @@ public class ExportProfilesParametersDialog extends TrayDialog {
/**
* Gets the plugin provider.
- *
+ *
* @return the plugin provider
*/
public String getPluginProvider() {
@@ -207,9 +207,9 @@ public class ExportProfilesParametersDialog extends TrayDialog {
/**
* Sets the plugin provider.
- *
+ *
* @param pluginProvider
- * the new plugin provider
+ * the new plugin provider
*/
private void setPluginProvider(String pluginProvider) {
this.pluginProvider = pluginProvider;
@@ -217,7 +217,7 @@ public class ExportProfilesParametersDialog extends TrayDialog {
/**
* Gets the plugin version.
- *
+ *
* @return the plugin version
*/
public String getPluginVersion() {
@@ -226,9 +226,9 @@ public class ExportProfilesParametersDialog extends TrayDialog {
/**
* Sets the plugin version.
- *
+ *
* @param pluginVersion
- * the new plugin version
+ * the new plugin version
*/
private void setPluginVersion(String pluginVersion) {
this.pluginVersion = pluginVersion;
@@ -236,7 +236,7 @@ public class ExportProfilesParametersDialog extends TrayDialog {
/**
* Gets the plugin exec environment.
- *
+ *
* @return the plugin exec environment
*/
public String getPluginExecEnvironment() {
@@ -245,9 +245,9 @@ public class ExportProfilesParametersDialog extends TrayDialog {
/**
* Sets the plugin exec environment.
- *
+ *
* @param execEnvironment
- * the new plugin exec environment
+ * the new plugin exec environment
*/
private void setPluginExecEnvironment(String execEnvironment) {
this.pluginExecEnvironment = execEnvironment;
diff --git a/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/dialog/ProfilesToExportSelectionDialog.java b/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/dialog/ProfilesToExportSelectionDialog.java
index 608f3330bb2..87b036a927e 100644
--- a/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/dialog/ProfilesToExportSelectionDialog.java
+++ b/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/dialog/ProfilesToExportSelectionDialog.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2012 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
@@ -49,15 +49,15 @@ public class ProfilesToExportSelectionDialog extends FilteredItemsSelectionDialo
/**
* Instantiates a new profiles to export selection dialog.
- *
+ *
* @param shell
- * the shell
+ * the shell
* @param multi
- * the multi
+ * the multi
* @param input
- * the input
+ * the input
* @param title
- * the title
+ * the title
*/
public ProfilesToExportSelectionDialog(Shell shell, boolean multi, Object[] input, String title) {
super(shell, multi);
@@ -71,33 +71,33 @@ public class ProfilesToExportSelectionDialog extends FilteredItemsSelectionDialo
/**
* @see org.eclipse.ui.dialogs.FilteredItemsSelectionDialog#getElementName(java.lang.Object)
- *
+ *
* @param item
* @return
*/
@Override
public String getElementName(Object item) {
- if(!(item instanceof Profile)) {
+ if (!(item instanceof Profile)) {
return null;
}
- //System.err.println(((Profile)item).getName());
+ // System.err.println(((Profile)item).getName());
- return ((Profile)item).getName();
+ return ((Profile) item).getName();
}
/**
* @see org.eclipse.ui.dialogs.FilteredItemsSelectionDialog#createExtendedContentArea(org.eclipse.swt.widgets.Composite)
- *
+ *
* @param parent
* @return
*/
@Override
protected Control createExtendedContentArea(Composite parent) {
- //nothing
+ // nothing
return null;
}
@@ -108,7 +108,7 @@ public class ProfilesToExportSelectionDialog extends FilteredItemsSelectionDialo
*/
/**
* @see org.eclipse.ui.dialogs.FilteredItemsSelectionDialog#createFilter()
- *
+ *
* @return
*/
@@ -128,7 +128,7 @@ public class ProfilesToExportSelectionDialog extends FilteredItemsSelectionDialo
*/
@Override
public boolean isConsistentItem(Object item) {
- if(item instanceof Profile) {
+ if (item instanceof Profile) {
return true;
}
return false;
@@ -136,14 +136,14 @@ public class ProfilesToExportSelectionDialog extends FilteredItemsSelectionDialo
/**
* @see org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.ItemsFilter#matchItem(java.lang.Object)
- *
+ *
* @param item
* @return
*/
@Override
public boolean matchItem(Object item) {
- if((item instanceof Profile)) {
+ if ((item instanceof Profile)) {
return true;
}
return false;
@@ -159,6 +159,7 @@ public class ProfilesToExportSelectionDialog extends FilteredItemsSelectionDialo
protected Comparator<Profile> getItemsComparator() {
Comparator<Profile> comp = new Comparator<Profile>() {
+ @Override
public int compare(Profile o1, Profile o2) {
return o1.getName().compareTo(o2.getName());
}
@@ -172,7 +173,7 @@ public class ProfilesToExportSelectionDialog extends FilteredItemsSelectionDialo
@Override
protected IDialogSettings getDialogSettings() {
IDialogSettings settings = Activator.getDefault().getDialogSettings().getSection(DIALOG_SETTINGS);
- if(settings == null) {
+ if (settings == null) {
settings = Activator.getDefault().getDialogSettings().addNewSection(DIALOG_SETTINGS);
}
return settings;
@@ -180,7 +181,7 @@ public class ProfilesToExportSelectionDialog extends FilteredItemsSelectionDialo
/**
* @see org.eclipse.ui.dialogs.FilteredItemsSelectionDialog#validateItem(java.lang.Object)
- *
+ *
* @param item
* @return
*/
@@ -198,14 +199,14 @@ public class ProfilesToExportSelectionDialog extends FilteredItemsSelectionDialo
*/
@Override
protected void fillContentProvider(AbstractContentProvider contentProvider, ItemsFilter itemsFilter, IProgressMonitor progressMonitor) throws CoreException {
- if(progressMonitor != null) {
+ if (progressMonitor != null) {
progressMonitor.beginTask(Messages.ProfilesToExportSelectionDialog_3, totalInput.length);
}
- for(int i = 0; i < totalInput.length; i++) {
+ for (int i = 0; i < totalInput.length; i++) {
contentProvider.add(totalInput[i], itemsFilter);
progressMonitor.worked(1);
}
- if(progressMonitor != null) {
+ if (progressMonitor != null) {
progressMonitor.done();
}
diff --git a/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/handlers/EditProfileApplicationAction.java b/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/handlers/EditProfileApplicationAction.java
index f5be935c83d..58e7b7a7fd3 100644
--- a/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/handlers/EditProfileApplicationAction.java
+++ b/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/handlers/EditProfileApplicationAction.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2012 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
@@ -48,6 +48,7 @@ import org.eclipse.jface.text.FindReplaceDocumentAdapter;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.window.Window;
import org.eclipse.papyrus.infra.core.resource.NotFoundException;
import org.eclipse.papyrus.uml.export.Activator;
import org.eclipse.papyrus.uml.export.dialog.ProfilesToExportSelectionDialog;
@@ -77,32 +78,32 @@ public class EditProfileApplicationAction extends ActionDelegate implements IAct
/**
* Gets the i file.
- *
+ *
* @param selectedObj
- * the selected obj
+ * the selected obj
* @return the i file
*/
public static IFile getIFile(Object selectedObj) {
IFile result = null;
- if(selectedObj instanceof IFile) {
- result = (IFile)selectedObj;
+ if (selectedObj instanceof IFile) {
+ result = (IFile) selectedObj;
}
// Try to adapt
- if(result == null && selectedObj instanceof IAdaptable) {
- result = (IFile)((IAdaptable)selectedObj).getAdapter(IFile.class);
+ if (result == null && selectedObj instanceof IAdaptable) {
+ result = (IFile) ((IAdaptable) selectedObj).getAdapter(IFile.class);
}
// adapt in ifile
- if(result == null) {
- result = (IFile)Platform.getAdapterManager().getAdapter(selectedObj, IFile.class);
+ if (result == null) {
+ result = (IFile) Platform.getAdapterManager().getAdapter(selectedObj, IFile.class);
}
- if(result == null) {
+ if (result == null) {
// try to check if it is a collection
- Collection<?> collec = (Collection<?>)Platform.getAdapterManager().getAdapter(selectedObj, Collection.class);
- if(collec != null) {
- for(Object o : collec) {
- if(o instanceof IFile) {
- IFile f = (IFile)o;
- if("uml".equals(f.getFileExtension())) {
+ Collection<?> collec = (Collection<?>) Platform.getAdapterManager().getAdapter(selectedObj, Collection.class);
+ if (collec != null) {
+ for (Object o : collec) {
+ if (o instanceof IFile) {
+ IFile f = (IFile) o;
+ if ("uml".equals(f.getFileExtension())) {
result = f;
break;
}
@@ -115,26 +116,26 @@ public class EditProfileApplicationAction extends ActionDelegate implements IAct
/**
* Checks if is profile application is editable.
- *
+ *
* @param selectedObj
- * the selected obj
+ * the selected obj
* @return true, if is profile application editable
*/
public static boolean isProfileApplicationEditable(Object selectedObj) {
IFile file = getIFile(selectedObj);
- if(file != null) {
+ if (file != null) {
ResourceSet resourceSet = new ResourceSetImpl();
Resource umlResource = WSFileUtil.loadResource(file.getFullPath().toString(), resourceSet);
- if(umlResource.getContents().isEmpty()) {
+ if (umlResource.getContents().isEmpty()) {
// The root doesn't exist.
return false;
}
EObject root = umlResource.getContents().get(0);
Object[] appliedProfiles = ProfileUtil.getAppliedProfilesFromWS(root);
- if(appliedProfiles != null) {
- for(int i = 0; i < appliedProfiles.length; i++) {
- String installedProfileURI = findCorrespondingInstalledProfile((Profile)appliedProfiles[i]);
- if(installedProfileURI != null) {
+ if (appliedProfiles != null) {
+ for (int i = 0; i < appliedProfiles.length; i++) {
+ String installedProfileURI = findCorrespondingInstalledProfile((Profile) appliedProfiles[i]);
+ if (installedProfileURI != null) {
return true;
}
@@ -147,29 +148,29 @@ public class EditProfileApplicationAction extends ActionDelegate implements IAct
/**
* {@inheritDoc}
- *
+ *
* @see org.eclipse.ui.actions.ActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
* @generated
*/
@Override
@SuppressWarnings("unchecked")
public void selectionChanged(IAction action, ISelection selection) {
- if(selection instanceof IStructuredSelection) {
- files = ((IStructuredSelection)selection).toList();
+ if (selection instanceof IStructuredSelection) {
+ files = ((IStructuredSelection) selection).toList();
}
}
/**
* Run.
- *
+ *
* @param action
- * the action
+ * the action
* @see org.eclipse.ui.actions.ActionDelegate#run(org.eclipse.jface.action.IAction)
*/
@Override
public void run(IAction action) {
- if(files != null) {
+ if (files != null) {
Iterator<IFile> filesIt = files.iterator();
final IFile file = filesIt.next();
ResourceSet resourceSet = new ResourceSetImpl();
@@ -185,7 +186,7 @@ public class EditProfileApplicationAction extends ActionDelegate implements IAct
final FindReplaceDocumentAdapter adapter = new FindReplaceDocumentAdapter(doc);
final MultiTextEdit multiEdit = new MultiTextEdit();
final Resource umlResource = WSFileUtil.loadResource(file.getFullPath().toString(), resourceSet);
- if(umlResource.getContents().isEmpty()) {
+ if (umlResource.getContents().isEmpty()) {
// The root doesn't exist.
try {
throw new NotFoundException(Messages.EditProfileApplicationAction_0);
@@ -197,39 +198,40 @@ public class EditProfileApplicationAction extends ActionDelegate implements IAct
EObject root = umlResource.getContents().get(0);
Object[] appliedProfiles = ProfileUtil.getAppliedProfilesFromWS(root);
ArrayList<Object> appliedLocalProfiles = new ArrayList<Object>();
- for(int i = 0; i < appliedProfiles.length; i++) {
- String installedProfileURI = findCorrespondingInstalledProfile((Profile)appliedProfiles[i]);
- if(installedProfileURI != null) {
+ for (int i = 0; i < appliedProfiles.length; i++) {
+ String installedProfileURI = findCorrespondingInstalledProfile((Profile) appliedProfiles[i]);
+ if (installedProfileURI != null) {
appliedLocalProfiles.add(appliedProfiles[i]);
}
}
- if(appliedLocalProfiles != null && !appliedLocalProfiles.isEmpty()) {
+ if (appliedLocalProfiles != null && !appliedLocalProfiles.isEmpty()) {
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
final ProfilesToExportSelectionDialog dialog = new ProfilesToExportSelectionDialog(shell, true, appliedLocalProfiles.toArray(), "Change profile application from local to installed");
dialog.open();
- if(Dialog.OK == dialog.getReturnCode()) {
+ if (Window.OK == dialog.getReturnCode()) {
IRunnableWithProgress operation = new IRunnableWithProgress() {
+ @Override
public void run(IProgressMonitor monitor) {
Object[] profiles = dialog.getResult();
- for(int i = 0; i < profiles.length; i++) {
- if(profiles[i] instanceof Profile) {
- //Absolute profile URI (platform:/resource/)
- URI localProfileURI = ((Profile)profiles[i]).eResource().getURI();
-
- //Absolute model URI (platform:/resource)
+ for (int i = 0; i < profiles.length; i++) {
+ if (profiles[i] instanceof Profile) {
+ // Absolute profile URI (platform:/resource/)
+ URI localProfileURI = ((Profile) profiles[i]).eResource().getURI();
+
+ // Absolute model URI (platform:/resource)
IPath filePath = file.getFullPath();
URI modelURI = umlResource.getURI();
-
- //Relative profile URI
+
+ // Relative profile URI
URI relativeProfileURI = localProfileURI.deresolve(modelURI);
- String installedProfileURI = findCorrespondingInstalledProfile((Profile)profiles[i]);
- if(installedProfileURI != null) {
+ String installedProfileURI = findCorrespondingInstalledProfile((Profile) profiles[i]);
+ if (installedProfileURI != null) {
try {
WSFileUtil.replaceString(localProfileURI.toString(), installedProfileURI, adapter, doc, 0, multiEdit);
@@ -244,7 +246,7 @@ public class EditProfileApplicationAction extends ActionDelegate implements IAct
}
- if(multiEdit.hasChildren()) {
+ if (multiEdit.hasChildren()) {
try {
multiEdit.apply(doc);
} catch (MalformedTreeException e) {
@@ -276,7 +278,7 @@ public class EditProfileApplicationAction extends ActionDelegate implements IAct
}
}
} else {
- //launch an error message
+ // launch an error message
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
MessageDialog.openError(shell, "Error", "No profile application to edit");
}
@@ -291,9 +293,9 @@ public class EditProfileApplicationAction extends ActionDelegate implements IAct
/**
* Find corresponding installed profile.
- *
+ *
* @param profile
- * the profile
+ * the profile
* @return the corresponding installed profile uri
*/
public static String findCorrespondingInstalledProfile(Profile profile) {
@@ -301,14 +303,14 @@ public class EditProfileApplicationAction extends ActionDelegate implements IAct
IEclipsePreferences preferences = InstanceScope.INSTANCE.getNode("org.eclipse.papyrus.uml.export"); //$NON-NLS-1$
org.osgi.service.prefs.Preferences node = preferences.node("installedProfilesUriCorrespondance");
String installedProfileURI = node.get(profile.eResource().getURI().toString(), "default"); //$NON-NLS-1$
- if((!installedProfileURI.equals("default"))) {
+ if ((!installedProfileURI.equals("default"))) {
URI uri = URI.createURI(installedProfileURI);
try {
ResourceSet resourceSet = new ResourceSetImpl();
Resource resource = resourceSet.getResource(uri, true);
- //verify that the profile is indeed installed in the platform before replacing the uri
- if((resource.isLoaded()) && (!(resource.getContents().isEmpty()))) {
- //System.err.println(installedProfileURI);
+ // verify that the profile is indeed installed in the platform before replacing the uri
+ if ((resource.isLoaded()) && (!(resource.getContents().isEmpty()))) {
+ // System.err.println(installedProfileURI);
return installedProfileURI;
}
} catch (WrappedException ex) {
diff --git a/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/handlers/ExportAppliedProfileHandler.java b/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/handlers/ExportAppliedProfileHandler.java
index 50e96a861ef..d3e17816d36 100644
--- a/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/handlers/ExportAppliedProfileHandler.java
+++ b/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/handlers/ExportAppliedProfileHandler.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* 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
@@ -31,20 +31,19 @@ public class ExportAppliedProfileHandler extends AbstractCommandHandler {
/**
- *
+ *
* {@inheritDoc}
*/
@Override
protected Command getCommand() {
- if(canExecute()) {
+ if (canExecute()) {
AbstractTransactionalCommand cmd = new ExportProfilesCommand(getEditingDomain(), Messages.ExportAppliedProfileHandler_0, null);
return new org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper(cmd);
- }
-
- else
+ } else {
return UnexecutableCommand.INSTANCE;
+ }
}
@@ -53,11 +52,11 @@ public class ExportAppliedProfileHandler extends AbstractCommandHandler {
/**
* Can execute.
- *
+ *
* @return true, if successful
*/
public boolean canExecute() {
- if(getSelectedElements().size() == 1) {
+ if (getSelectedElements().size() == 1) {
return (getSelectedElement() instanceof Package);
}
return false;
diff --git a/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/handlers/ExportProfilesCommand.java b/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/handlers/ExportProfilesCommand.java
index 2a031ac6622..029ad65e58b 100644
--- a/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/handlers/ExportProfilesCommand.java
+++ b/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/handlers/ExportProfilesCommand.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2012 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
@@ -41,6 +41,7 @@ import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCo
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.window.Window;
import org.eclipse.papyrus.eclipse.project.editors.file.ManifestEditor;
import org.eclipse.papyrus.infra.core.resource.ModelSet;
import org.eclipse.papyrus.infra.core.resource.NotFoundException;
@@ -83,13 +84,13 @@ public class ExportProfilesCommand extends AbstractTransactionalCommand {
/**
* Instantiates a new export profiles command.
- *
+ *
* @param domain
- * the domain
+ * the domain
* @param label
- * the label
+ * the label
* @param affectedFiles
- * the affected files
+ * the affected files
*/
public ExportProfilesCommand(TransactionalEditingDomain domain, String label, @SuppressWarnings("rawtypes") List affectedFiles) {
super(domain, label, affectedFiles);
@@ -115,23 +116,22 @@ public class ExportProfilesCommand extends AbstractTransactionalCommand {
/**
* Do execute with result.
- *
+ *
* @param monitor
- * the monitor
+ * the monitor
* @param info
- * the info
+ * the info
* @return the command result
* @throws ExecutionException
- * the execution exception
+ * the execution exception
* @see org.eclipse.core.commands.operations.AbstractOperation#canExecute()
*/
/**
- * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor,
- * org.eclipse.core.runtime.IAdaptable)
- *
+ * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
+ *
* @param monitor
* @param info
* @return
@@ -143,8 +143,8 @@ public class ExportProfilesCommand extends AbstractTransactionalCommand {
UmlModel openedModel;
try {
- openedModel = (UmlModel)((ModelSet)getEditingDomain().getResourceSet()).getModel(UmlModel.MODEL_ID);
- if(openedModel != null) {
+ openedModel = (UmlModel) ((ModelSet) getEditingDomain().getResourceSet()).getModel(UmlModel.MODEL_ID);
+ if (openedModel != null) {
EObject root = openedModel.lookupRoot();
@@ -156,24 +156,24 @@ public class ExportProfilesCommand extends AbstractTransactionalCommand {
ProfilesToExportSelectionDialog dialog = new ProfilesToExportSelectionDialog(shell, true, ProfileUtil.getAppliedProfilesFromWS(root), Messages.ExportProfilesCommand_6);
dialog.open();
- if(Dialog.OK == dialog.getReturnCode()) {
- // get the result, which is the set of libraries to export
- //then export the result
- //launch a window to set the user specified export parameters:
+ if (Window.OK == dialog.getReturnCode()) {
+ // get the result, which is the set of libraries to export
+ // then export the result
+ // launch a window to set the user specified export parameters:
// * name of the plugin that will contain the exported profiles and will be installed in the environement
// * version of the plugin
// * Provider of the plugin
- // * Execution Environment
+ // * Execution Environment
Object[] profiles = dialog.getResult();
- for(int i = 0; i < profiles.length; i++) {
- pluginToInstallName += ((Profile)profiles[i]).getName();
+ for (int i = 0; i < profiles.length; i++) {
+ pluginToInstallName += ((Profile) profiles[i]).getName();
}
ExportProfilesParametersDialog paramDialog = new ExportProfilesParametersDialog(DisplayUtils.getDefaultShell(), pluginToInstallName, pluginProvider, pluginVersion, execEnvironment, dialog.getResult());
- if(paramDialog.open() == Dialog.OK) {
+ if (paramDialog.open() == Window.OK) {
ExportProfilesUserParameters param = new ExportProfilesUserParameters(paramDialog.getPluginName(), paramDialog.getPluginProvider(), paramDialog.getPluginVersion(), paramDialog.getPluginExecEnvironment());
exportProfiles(shell, dialog.getResult(), param, paramDialog.getProfilesIcons());
@@ -216,22 +216,22 @@ public class ExportProfilesCommand extends AbstractTransactionalCommand {
/**
* Export profiles.
- *
+ *
* @param shell
- * the shell
+ * the shell
* @param appliedProfilesFromWS
- * the applied profiles from ws
+ * the applied profiles from ws
* @param param
- * User defined paprameters for the generation
+ * User defined paprameters for the generation
* @param profilesIcons
* @throws ParserConfigurationException
- * the parser configuration exception
+ * the parser configuration exception
* @throws SAXException
- * the sAX exception
+ * the sAX exception
* @throws IOException
- * Signals that an I/O exception has occurred.
+ * Signals that an I/O exception has occurred.
* @throws CoreException
- * the core exception
+ * the core exception
*/
protected void exportProfiles(final Shell shell, final Object[] appliedProfilesFromWS, final ExportProfilesUserParameters param, final String[] profilesIcons) throws ParserConfigurationException, SAXException, IOException, CoreException {
@@ -241,104 +241,105 @@ public class ExportProfilesCommand extends AbstractTransactionalCommand {
monitordialog.run(true, true, new IRunnableWithProgress() {
+ @Override
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
- //Construct the profile
+ // Construct the profile
String profilesConcatName = ""; //$NON-NLS-1$
- for(int i = 0; i < appliedProfilesFromWS.length; i++) {
+ for (int i = 0; i < appliedProfilesFromWS.length; i++) {
- profilesConcatName += ((Profile)appliedProfilesFromWS[i]).getName();
+ profilesConcatName += ((Profile) appliedProfilesFromWS[i]).getName();
}
String localPluginName = param.getPluginName();
- //this variable will store the imported libraries from WS, it will be used for the extensions generation in the manifest
+ // this variable will store the imported libraries from WS, it will be used for the extensions generation in the manifest
ArrayList<ImportedLibrary> importedLibrariesFromWS = new ArrayList<ImportedLibrary>();
IProject project = null;
final PluginExportUtil pluginCreator = new PluginExportUtil();
monitor.beginTask(Messages.ExportProfilesCommand_10, 100);
- //****************************************************************
- //1. Generating a Plugin in the WS that encapsulated the applied profiles
- //****************************************************************
+ // ****************************************************************
+ // 1. Generating a Plugin in the WS that encapsulated the applied profiles
+ // ****************************************************************
monitor.subTask(Messages.ExportProfilesCommand_11);
project = pluginCreator.createPlugin(monitor, param.getPluginName(), param.getPluginExecEnvironment(), param.getPluginVersion(), param.getPluginProvider());
monitor.worked(1);
try {
monitor.subTask(Messages.ExportProfilesCommand_12);
- //****************************************************************
- //1.0 Plugin customization: adding dependencies to Manifest
- //****************************************************************
+ // ****************************************************************
+ // 1.0 Plugin customization: adding dependencies to Manifest
+ // ****************************************************************
ManifestEditor editor = new ManifestEditor(project);
editor.init();
- editor.setSingleton(true);//we are going to add extensions to manifest, singleton must be set to true
+ editor.setSingleton(true);// we are going to add extensions to manifest, singleton must be set to true
editor.save();
- //***********************************************************************************
+ // ***********************************************************************************
// 1.1 Plugin customization: adding model directory and copying the profiles resources
- //************************************************************************************
+ // ************************************************************************************
- for(int i = 0; i < appliedProfilesFromWS.length; i++) {
+ for (int i = 0; i < appliedProfilesFromWS.length; i++) {
- ModelSet modelset = ServiceUtilsForResource.getInstance().getModelSet(((Profile)appliedProfilesFromWS[i]).eResource());
- String umlFileName = WSFileUtil.getFileName((Profile)appliedProfilesFromWS[i], "uml"); //$NON-NLS-1$
+ ModelSet modelset = ServiceUtilsForResource.getInstance().getModelSet(((Profile) appliedProfilesFromWS[i]).eResource());
+ String umlFileName = WSFileUtil.getFileName((Profile) appliedProfilesFromWS[i], "uml"); //$NON-NLS-1$
- Resource umlProfile = modelset.getAssociatedResource((Profile)appliedProfilesFromWS[i], "uml"); //$NON-NLS-1$
+ Resource umlProfile = modelset.getAssociatedResource((Profile) appliedProfilesFromWS[i], "uml"); //$NON-NLS-1$
- //Visits all proxies in the model set and tries to resolve them.
+ // Visits all proxies in the model set and tries to resolve them.
EcoreUtil.resolveAll(modelset);
- //copy the uml profile in the created plugin (xmi ids will be copied)
+ // copy the uml profile in the created plugin (xmi ids will be copied)
URI umlFilenewURI = URI.createPlatformResourceURI(localPluginName + resourcesFolderName + umlFileName, true);
URI umlFileoldURI = umlProfile.getURI();
umlProfile.setURI(umlFilenewURI);
umlProfile.save(null);
- //resave the resource with the original uri
+ // resave the resource with the original uri
umlProfile.setURI(umlFileoldURI);
umlProfile.save(null);
ResourceSet resourceSet = new ResourceSetImpl();
Resource newUmlProfileResource = resourceSet.getResource(umlFilenewURI, true);
EcoreUtil.resolveAll(resourceSet);
- //Verify that the uml model does not import packages. If it is the case, create the imported resources in the generated plugin and export them as well
- for(EObject obj : newUmlProfileResource.getContents()) {
- if(obj instanceof Profile) {
+ // Verify that the uml model does not import packages. If it is the case, create the imported resources in the generated plugin and export them as well
+ for (EObject obj : newUmlProfileResource.getContents()) {
+ if (obj instanceof Profile) {
- EList<Package> importedPackages = ((Profile)obj).getImportedPackages();
- for(Package pack : importedPackages) {
+ EList<Package> importedPackages = ((Profile) obj).getImportedPackages();
+ for (Package pack : importedPackages) {
- //if the package is stored in the workspace, export it in the resource directory of the created profile plugin
- if(pack.eResource() != null) {
- if(pack.eResource().getURI().isPlatformResource()) {
+ // if the package is stored in the workspace, export it in the resource directory of the created profile plugin
+ if (pack.eResource() != null) {
+ if (pack.eResource().getURI().isPlatformResource()) {
String umlPackageFileName = WSFileUtil.getFileName(pack, "uml"); //$NON-NLS-1$
- //Create the uml file that contain the library
+ // Create the uml file that contain the library
URI uri = pack.eResource().getURI();
URI newURI = URI.createPlatformResourceURI(localPluginName + resourcesFolderName + umlPackageFileName, true);
pack.eResource().setURI(newURI);
pack.eResource().save(null);
- //set the uri to the platform/plugin URI
+ // set the uri to the platform/plugin URI
pack.eResource().setURI(URI.createURI("platform:/plugin/" + localPluginName + resourcesFolderName + umlPackageFileName)); //$NON-NLS-1$
- //redefine the profile
- ((Profile)obj).define();
+ // redefine the profile
+ ((Profile) obj).define();
- //The variable importedLibrariesFromWS is used to store the libraries that will be declared in the extensions of plugin.xml
+ // The variable importedLibrariesFromWS is used to store the libraries that will be declared in the extensions of plugin.xml
importedLibrariesFromWS.add(new ImportedLibrary(pack, "platform:/plugin/" + localPluginName + resourcesFolderName + umlPackageFileName, uri, pack.getName())); //$NON-NLS-1$
@@ -354,14 +355,14 @@ public class ExportProfilesCommand extends AbstractTransactionalCommand {
- //****************************************************************
- //1.2 Plugin customization: adding extension points in plugin.xml
- //****************************************************************
+ // ****************************************************************
+ // 1.2 Plugin customization: adding extension points in plugin.xml
+ // ****************************************************************
final WorkspacePluginModelBase model = new WorkspacePluginModel(project.getProject().getFile("plugin.xml"), false); //$NON-NLS-1$
IPluginBase base = model.getPluginBase();
- //****************************************************************
- //1.2.1 Adding extension "org.eclipse.emf.ecore.uri_mapping"
- //****************************************************************
+ // ****************************************************************
+ // 1.2.1 Adding extension "org.eclipse.emf.ecore.uri_mapping"
+ // ****************************************************************
IPluginExtension uri_mapping_ext = model.createExtension();
base.add(uri_mapping_ext);
uri_mapping_ext.setPoint("org.eclipse.emf.ecore.uri_mapping"); //$NON-NLS-1$
@@ -374,11 +375,11 @@ public class ExportProfilesCommand extends AbstractTransactionalCommand {
uri_mapping_elem.setAttribute("target", "platform:/plugin/" + localPluginName + resourcesFolderName); //$NON-NLS-1$ //$NON-NLS-2$
model.setDirty(true);
model.save();
- //**********************************************************************
- //1.2.2Adding Extension "org.eclipse.papyrus.uml.extensionpoints.UMLProfile"
- //**********************************************************************
+ // **********************************************************************
+ // 1.2.2Adding Extension "org.eclipse.papyrus.uml.extensionpoints.UMLProfile"
+ // **********************************************************************
final List<InstalledProfileURI> installedProfilesUri = new ArrayList<InstalledProfileURI>();
- for(int i1 = 0; i1 < appliedProfilesFromWS.length; i1++) {
+ for (int i1 = 0; i1 < appliedProfilesFromWS.length; i1++) {
IPluginExtension ext = model.createExtension();
base.add(ext);
@@ -386,21 +387,21 @@ public class ExportProfilesCommand extends AbstractTransactionalCommand {
IPluginElement elem = model.createElement(ext);
ext.add(elem);
- Profile profile = (Profile)appliedProfilesFromWS[i1];
+ Profile profile = (Profile) appliedProfilesFromWS[i1];
String umlFileName = WSFileUtil.getFileName(profile, "uml"); //$NON-NLS-1$
elem.setName("profile"); //$NON-NLS-1$
- //mandatory attributes
+ // mandatory attributes
elem.setAttribute("name", profile.getName()); //$NON-NLS-1$
elem.setAttribute("path", "platform:/plugin/" + localPluginName + resourcesFolderName + umlFileName); //$NON-NLS-1$ //$NON-NLS-2$
- //optional attributes
+ // optional attributes
elem.setAttribute("description", "UML Profile " + profile.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- elem.setAttribute("provider", param.getPluginProvider()); //$NON-NLS-1$
- if(!(profilesIcons[i1] == null) && !(profilesIcons[i1].length() == 0)) {
+ elem.setAttribute("provider", param.getPluginProvider()); //$NON-NLS-1$
+ if (!(profilesIcons[i1] == null) && !(profilesIcons[i1].length() == 0)) {
File icon = FileUtil.getFile(profilesIcons[i1]);
String iconName = getFSFileName(icon.getAbsolutePath());
elem.setAttribute("iconpath", "icons/" + iconName);
- //copying icon file into created project
+ // copying icon file into created project
WSFileUtil.copyFile(project, icon, "icons/", iconName);
}
@@ -412,11 +413,11 @@ public class ExportProfilesCommand extends AbstractTransactionalCommand {
model.setDirty(true);
model.save();
}
- //**********************************************************************
- //1.2.3 Adding Extension "org.eclipse.papyrus.uml.extensionpoints.UMLLibrary"
- //**********************************************************************
- if(!importedLibrariesFromWS.isEmpty()) {
- for(ImportedLibrary importedLibrary : importedLibrariesFromWS) {
+ // **********************************************************************
+ // 1.2.3 Adding Extension "org.eclipse.papyrus.uml.extensionpoints.UMLLibrary"
+ // **********************************************************************
+ if (!importedLibrariesFromWS.isEmpty()) {
+ for (ImportedLibrary importedLibrary : importedLibrariesFromWS) {
IPluginExtension ext = model.createExtension();
base.add(ext);
ext.setPoint("org.eclipse.papyrus.uml.extensionpoints.UMLLibrary"); //$NON-NLS-1$
@@ -424,12 +425,12 @@ public class ExportProfilesCommand extends AbstractTransactionalCommand {
ext.add(elem);
elem.setName("library"); //$NON-NLS-1$
- //mandatory attributes
+ // mandatory attributes
elem.setAttribute("name", importedLibrary.getName()); //$NON-NLS-1$
elem.setAttribute("path", importedLibrary.getUri()); //$NON-NLS-1$
- //optional attributes
+ // optional attributes
elem.setAttribute("description", "UML Library " + importedLibrary.getName()); //$NON-NLS-1$ //$NON-NLS-2$
- elem.setAttribute("provider", param.getPluginProvider()); //$NON-NLS-1$
+ elem.setAttribute("provider", param.getPluginProvider()); //$NON-NLS-1$
model.setDirty(true);
model.save();
@@ -443,22 +444,23 @@ public class ExportProfilesCommand extends AbstractTransactionalCommand {
monitor.worked(1);
- //****************************************************************
- //1.3 Plugin customization: adding build properties to Manifest
- //****************************************************************
+ // ****************************************************************
+ // 1.3 Plugin customization: adding build properties to Manifest
+ // ****************************************************************
monitor.subTask("Plugin customization: adding build properties to Manifest ..."); //$NON-NLS-1$
BuildProperties buildproperties = new BuildProperties(project);
buildproperties.addBuildEntry("bin.includes", "META-INF/,.,plugin.xml,build.properties,model/,icons/"); //$NON-NLS-1$ //$NON-NLS-2$
monitor.worked(1);
- //****************************************************************
- //2. Export the plugin and install it
- //****************************************************************
+ // ****************************************************************
+ // 2. Export the plugin and install it
+ // ****************************************************************
monitor.subTask(Messages.ExportProfilesCommand_5);
final IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
final IPluginModel pluginModel = PluginExportUtil.getPluginModelForProject(project);
Display.getDefault().asyncExec(new Runnable() {
+ @Override
public void run() {
pluginCreator.exportProfilePlugin(shell, pluginModel, root.getLocation().toString() + "/.metadata/.plugins/org.eclipse.pde.core/install/", installedProfilesUri); //$NON-NLS-1$
@@ -509,15 +511,15 @@ public class ExportProfilesCommand extends AbstractTransactionalCommand {
/**
* Gets the fS file name.
- *
+ *
* @param path
- * the path
+ * the path
* @return the fS file name
*/
public static String getFSFileName(String path) {
String fileName;
- if(path.indexOf("\\") < 0) { //$NON-NLS-1$
+ if (path.indexOf("\\") < 0) { //$NON-NLS-1$
fileName = path;
} else {
fileName = path.substring(path.lastIndexOf("\\") + 1, path.length()); //$NON-NLS-1$
diff --git a/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/messages/Messages.java b/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/messages/Messages.java
index a03d924cee1..6b36ea4e870 100644
--- a/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/messages/Messages.java
+++ b/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/messages/Messages.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2012 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
diff --git a/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/AreThereAppliedProfilesFromWS.java b/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/AreThereAppliedProfilesFromWS.java
index 8e76f40ad1e..1c953f5bb19 100644
--- a/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/AreThereAppliedProfilesFromWS.java
+++ b/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/AreThereAppliedProfilesFromWS.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2012 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
@@ -40,7 +40,7 @@ public class AreThereAppliedProfilesFromWS extends PropertyTester {
/**
* @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
- *
+ *
* @param receiver
* @param property
* @param args
@@ -48,26 +48,27 @@ public class AreThereAppliedProfilesFromWS extends PropertyTester {
* @return
*/
+ @Override
public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
// Ensure Papyrus is the active editor
IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- if((editor == null) || (!(editor instanceof IMultiDiagramEditor))) {
+ if ((editor == null) || (!(editor instanceof IMultiDiagramEditor))) {
return false;
}
Object currentValue = null;
- if(ARE_THERE_APPLIED_PROFILES.equals(property)) {
+ if (ARE_THERE_APPLIED_PROFILES.equals(property)) {
- ServicesRegistry registry = ((IMultiDiagramEditor)editor).getServicesRegistry();
+ ServicesRegistry registry = ((IMultiDiagramEditor) editor).getServicesRegistry();
UmlModel openedModel;
try {
- openedModel = (UmlModel)ServiceUtils.getInstance().getModelSet(registry).getModel(UmlModel.MODEL_ID);
+ openedModel = (UmlModel) ServiceUtils.getInstance().getModelSet(registry).getModel(UmlModel.MODEL_ID);
EObject root = openedModel.lookupRoot();
Object[] profiles = ProfileUtil.getAppliedProfilesFromWS(root);
- for(int i = 0; i < profiles.length; i++) {
- if(profiles[i] instanceof Profile) {
+ for (int i = 0; i < profiles.length; i++) {
+ if (profiles[i] instanceof Profile) {
currentValue = true;
break;
}
diff --git a/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/BuildProperties.java b/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/BuildProperties.java
index a9437512334..94db4e95d49 100644
--- a/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/BuildProperties.java
+++ b/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/BuildProperties.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2012 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
@@ -45,9 +45,9 @@ public class BuildProperties {
/**
* Instantiates a new builds the properties.
- *
+ *
* @param project
- * the project
+ * the project
*/
public BuildProperties(IProject project) {
this.project = project;
@@ -57,22 +57,22 @@ public class BuildProperties {
* adds or overwrites an entry in the 'build.properties'.<br>
* returns <b>true</b> if adding was successful,<br>
* <b>false</b> is dialog did not confirm adding
- *
+ *
* @param key
- * the build property's name
+ * the build property's name
* @param value
- * the build property's value
+ * the build property's value
* @return <b>true</b> if adding was successful,<br>
* <b>false</b> is dialog did not confirm adding
* @throws CoreException
- * the core exception
+ * the core exception
*/
public boolean addBuildEntry(String key, String value) throws CoreException {
Assert.isNotNull(key);
Assert.isNotNull(value);
boolean writeEntry = true;
- if(hasBuildEntry(key)) {
- if(getBuild().getEntry(key).contains(value)) {
+ if (hasBuildEntry(key)) {
+ if (getBuild().getEntry(key).contains(value)) {
return true;
}
@@ -81,13 +81,13 @@ public class BuildProperties {
}
- if(writeEntry) {
+ if (writeEntry) {
IBuildModel buildModel = getBuildModel();
IBuildEntry buildEntry = buildModel.getFactory().createEntry(key);
buildEntry.addToken(value);
getBuild().add(buildEntry);
- ((WorkspaceBuildModel)buildModel).save();
+ ((WorkspaceBuildModel) buildModel).save();
}
return writeEntry;
}
@@ -96,24 +96,24 @@ public class BuildProperties {
/**
* removes an entry with the given name from the 'build.properties'
- *
+ *
* @param key
- * the build property's name
+ * the build property's name
* @throws CoreException
- * the core exception
+ * the core exception
*/
public void removeExistingBuildEntry(String key) throws CoreException {
IBuildEntry entry = getBuild().getEntry(key);
- if(entry != null) {
+ if (entry != null) {
getBuild().remove(entry);
}
}
/**
* returns whether an entry exists for the given key.
- *
+ *
* @param key
- * the build property's name
+ * the build property's name
* @return true, if successful
*/
public boolean hasBuildEntry(final String key) {
@@ -124,12 +124,12 @@ public class BuildProperties {
/**
* Gets the builds the.
- *
+ *
* @return the builds the
*/
private IBuild getBuild() {
IBuildModel buildModel = getBuildModel();
- if(buildModel == null) {
+ if (buildModel == null) {
return null;
}
return buildModel.getBuild();
@@ -138,9 +138,9 @@ public class BuildProperties {
/**
* Gets the properties.
- *
+ *
* @param key
- * the key
+ * the key
* @return the properties
*/
public String[] getProperties(String key) {
@@ -151,11 +151,11 @@ public class BuildProperties {
/**
* returns the Eclipse BuildModel.
- *
+ *
* @return the Eclipse BuildModel
*/
private IBuildModel getBuildModel() {
- if(itsBuildModel == null) {
+ if (itsBuildModel == null) {
IPluginModelBase pluginModel = PluginRegistry.findModel(this.project);
itsBuildModel = createBuildModel(pluginModel);
}
@@ -165,15 +165,15 @@ public class BuildProperties {
/**
* see org.eclipse.pde.internal.core.ClasspathUtilCore.getBuild
- *
+ *
* @param model
- * the model
+ * the model
* @return the i build model
*/
private IBuildModel createBuildModel(final IPluginModelBase model) {
IProject project = model.getUnderlyingResource().getProject();
IFile buildFile = project.getFile("build.properties"); //$NON-NLS-1$
- if(!buildFile.exists()) {
+ if (!buildFile.exists()) {
return null;
}
WorkspaceBuildModel buildModel = new WorkspaceBuildModel(buildFile);
diff --git a/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/ChangeProfileApplicationTester.java b/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/ChangeProfileApplicationTester.java
index 6c7c5ddda91..87ae0bb9be5 100644
--- a/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/ChangeProfileApplicationTester.java
+++ b/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/ChangeProfileApplicationTester.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2012 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
@@ -25,8 +25,9 @@ public class ChangeProfileApplicationTester extends org.eclipse.core.expressions
+ @Override
public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
- if("ChangeProfileApplication".equals(property) || EditProfileApplicationAction.getIFile(receiver) != null) {
+ if ("ChangeProfileApplication".equals(property) || EditProfileApplicationAction.getIFile(receiver) != null) {
return EditProfileApplicationAction.isProfileApplicationEditable(receiver);
diff --git a/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/ExportProfilesUserParameters.java b/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/ExportProfilesUserParameters.java
index 09807655544..001681da4e5 100644
--- a/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/ExportProfilesUserParameters.java
+++ b/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/ExportProfilesUserParameters.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2012 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
@@ -34,15 +34,15 @@ public class ExportProfilesUserParameters {
/**
* Instantiates a new export profiles user parameters.
- *
+ *
* @param pluginName
- * the plugin name
+ * the plugin name
* @param pluginProvider
- * the plugin provider
+ * the plugin provider
* @param pluginVersion
- * the plugin version
+ * the plugin version
* @param execEnvironment
- * the exec environment
+ * the exec environment
*/
public ExportProfilesUserParameters(String pluginName, String pluginProvider, String pluginVersion, String execEnvironment) {
this.pluginName = pluginName;
@@ -55,7 +55,7 @@ public class ExportProfilesUserParameters {
/**
* Gets the plugin name.
- *
+ *
* @return the plugin name
*/
public String getPluginName() {
@@ -64,9 +64,9 @@ public class ExportProfilesUserParameters {
/**
* Sets the plugin name.
- *
+ *
* @param pluginName
- * the new plugin name
+ * the new plugin name
*/
public void setPluginName(String pluginName) {
this.pluginName = pluginName;
@@ -74,7 +74,7 @@ public class ExportProfilesUserParameters {
/**
* Gets the plugin provider.
- *
+ *
* @return the plugin provider
*/
public String getPluginProvider() {
@@ -83,9 +83,9 @@ public class ExportProfilesUserParameters {
/**
* Sets the plugin provider.
- *
+ *
* @param pluginProvider
- * the new plugin provider
+ * the new plugin provider
*/
public void setPluginProvider(String pluginProvider) {
this.pluginProvider = pluginProvider;
@@ -93,7 +93,7 @@ public class ExportProfilesUserParameters {
/**
* Gets the plugin version.
- *
+ *
* @return the plugin version
*/
public String getPluginVersion() {
@@ -102,9 +102,9 @@ public class ExportProfilesUserParameters {
/**
* Sets the plugin version.
- *
+ *
* @param pluginVersion
- * the new plugin version
+ * the new plugin version
*/
public void setPluginVersion(String pluginVersion) {
this.pluginVersion = pluginVersion;
@@ -112,7 +112,7 @@ public class ExportProfilesUserParameters {
/**
* Gets the plugin exec environment.
- *
+ *
* @return the plugin exec environment
*/
public String getPluginExecEnvironment() {
@@ -121,9 +121,9 @@ public class ExportProfilesUserParameters {
/**
* Sets the plugin exec environment.
- *
+ *
* @param pluginExecEnvironment
- * the new plugin exec environment
+ * the new plugin exec environment
*/
public void setPluginExecEnvironment(String pluginExecEnvironment) {
this.pluginExecEnvironment = pluginExecEnvironment;
diff --git a/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/ImportedLibrary.java b/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/ImportedLibrary.java
index e71a4148467..31d08be950d 100644
--- a/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/ImportedLibrary.java
+++ b/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/ImportedLibrary.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2012 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
@@ -40,15 +40,15 @@ public class ImportedLibrary {
/**
* Instantiates a new imported library.
- *
+ *
* @param libraryModel
- * the library model
+ * the library model
* @param newUri
- * the new uri
+ * the new uri
* @param oldURI
- * the old uri
+ * the old uri
* @param libraryName
- * the library name
+ * the library name
*/
public ImportedLibrary(EObject libraryModel, String newUri, URI oldURI, String libraryName) {
super();
@@ -62,7 +62,7 @@ public class ImportedLibrary {
/**
* Gets the library model.
- *
+ *
* @return the library model
*/
public EObject getLibraryModel() {
@@ -71,9 +71,9 @@ public class ImportedLibrary {
/**
* Sets the library model.
- *
+ *
* @param libraryModel
- * the new library model
+ * the new library model
*/
public void setLibraryModel(EObject libraryModel) {
this.libraryModel = libraryModel;
@@ -81,7 +81,7 @@ public class ImportedLibrary {
/**
* Gets the uri.
- *
+ *
* @return the uri
*/
public String getUri() {
@@ -90,9 +90,9 @@ public class ImportedLibrary {
/**
* Sets the uri.
- *
+ *
* @param uri
- * the new uri
+ * the new uri
*/
public void setUri(String uri) {
this.newUri = uri;
@@ -101,7 +101,7 @@ public class ImportedLibrary {
/**
* Gets the name.
- *
+ *
* @return the name
*/
public String getName() {
@@ -111,9 +111,9 @@ public class ImportedLibrary {
/**
* Sets the name.
- *
+ *
* @param name
- * the new name
+ * the new name
*/
public void setName(String name) {
this.name = name;
@@ -122,7 +122,7 @@ public class ImportedLibrary {
/**
* Gets the old uri.
- *
+ *
* @return the old uri
*/
public URI getOldURI() {
@@ -132,9 +132,9 @@ public class ImportedLibrary {
/**
* Sets the old uri.
- *
+ *
* @param oldURI
- * the new old uri
+ * the new old uri
*/
public void setOldURI(URI oldURI) {
this.oldURI = oldURI;
diff --git a/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/InstalledProfileURI.java b/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/InstalledProfileURI.java
index 5f6f2b68802..ca5b70527be 100644
--- a/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/InstalledProfileURI.java
+++ b/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/InstalledProfileURI.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2012 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
@@ -22,11 +22,11 @@ public class InstalledProfileURI {
/**
* Instantiates a new installed profile uri.
- *
+ *
* @param uri_installed
- * the uri of the installed profile
+ * the uri of the installed profile
* @param uri_local
- * the uri of the corresponding local profile from which the installed profile has been copied
+ * the uri of the corresponding local profile from which the installed profile has been copied
*/
public InstalledProfileURI(String uri_installed, String uri_local) {
super();
@@ -42,7 +42,7 @@ public class InstalledProfileURI {
/**
* Gets the uri of the installed profile.
- *
+ *
* @return the uri of the installed profile
*/
public String getUri_installed() {
@@ -51,9 +51,9 @@ public class InstalledProfileURI {
/**
* Sets the uri of the installed profile.
- *
+ *
* @param uri_installed
- * the new uri of the installed profile
+ * the new uri of the installed profile
*/
public void setUri_installed(String uri_installed) {
this.uri_installed = uri_installed;
@@ -61,7 +61,7 @@ public class InstalledProfileURI {
/**
* Gets the uri of the local profile.
- *
+ *
* @return the uri of the local profile
*/
public String getUri_local() {
@@ -70,9 +70,9 @@ public class InstalledProfileURI {
/**
* Sets the uri of the local profile.
- *
+ *
* @param uri_local
- * the new uri of the local profile
+ * the new uri of the local profile
*/
public void setUri_local(String uri_local) {
this.uri_local = uri_local;
diff --git a/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/PluginExportUtil.java b/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/PluginExportUtil.java
index 933fc6455d9..f38914264f7 100644
--- a/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/PluginExportUtil.java
+++ b/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/PluginExportUtil.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2012 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
@@ -99,17 +99,17 @@ public class PluginExportUtil {
/**
* Creates the plugin.
- *
+ *
* @param progressMonitor
- * the progress monitor
+ * the progress monitor
* @param pluginName
- * the plugin name
+ * the plugin name
* @param executionEnvironment
- * the execution environment
+ * the execution environment
* @param pluginVersion
- * the plugin version
+ * the plugin version
* @param provider
- * the provider
+ * the provider
* @return the i project
*/
public IProject createPlugin(IProgressMonitor progressMonitor, final String pluginName, String executionEnvironment, String pluginVersion, String provider) {
@@ -148,16 +148,19 @@ public class PluginExportUtil {
IProjectProvider fProjectProvider = new IProjectProvider() {
+ @Override
public String getProjectName() {
// TODO Auto-generated method stub
return pluginName;
}
+ @Override
public IProject getProject() {
// TODO Auto-generated method stub
return project;
}
+ @Override
public IPath getLocationPath() {
// TODO Auto-generated method stub
return ResourcesPlugin.getWorkspace().getRoot().getLocation();
@@ -183,24 +186,24 @@ public class PluginExportUtil {
/**
* Export profile plugin.
- *
+ *
* @param shell
- * the shell
+ * the shell
* @param object
- * the object
+ * the object
* @param installationDirectory
- * the installation directory
+ * the installation directory
* @param installedProfilesUri
- * the installed profiles uri
+ * the installed profiles uri
* @return true, if successful
*/
public boolean exportProfilePlugin(Shell shell, Object object, String installationDirectory, List<InstalledProfileURI> installedProfilesUri) {
- if(!PlatformUI.getWorkbench().saveAllEditors(true)) {
+ if (!PlatformUI.getWorkbench().saveAllEditors(true)) {
return false;
}
- if(!performPreliminaryChecks(shell, object)) {
+ if (!performPreliminaryChecks(shell, object)) {
return false;
}
@@ -213,13 +216,13 @@ public class PluginExportUtil {
/**
* Schedule export job.
- *
+ *
* @param object
- * the object
+ * the object
* @param installationDirectory
- * the installation directory
+ * the installation directory
* @param installedProfilesUri
- * the installed profiles uri
+ * the installed profiles uri
*/
protected void scheduleExportJob(Object object, String installationDirectory, final List<InstalledProfileURI> installedProfilesUri) {
Object obj[] = new Object[1];
@@ -239,7 +242,7 @@ public class PluginExportUtil {
info.qualifier = null;
final boolean installAfterExport = true;
- if(installAfterExport) {
+ if (installAfterExport) {
RuntimeInstallJob.modifyInfoForInstall(info);
}
@@ -251,24 +254,25 @@ public class PluginExportUtil {
@Override
public void done(IJobChangeEvent event) {
- if(job.hasAntErrors()) {
+ if (job.hasAntErrors()) {
// If there were errors when running the ant scripts, inform the user where the logs can be found.
final File logLocation = new File(info.destinationDirectory, "logs.zip"); //$NON-NLS-1$
- if(logLocation.exists()) {
+ if (logLocation.exists()) {
PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
ExportErrorDialog dialog = new ExportErrorDialog(logLocation);
dialog.open();
}
});
}
- } else if(event.getResult().isOK() && installAfterExport) {
+ } else if (event.getResult().isOK() && installAfterExport) {
// Install the export into the current running platform
RuntimeInstallJob installJob = new RuntimeInstallJob(PDEUIMessages.PluginExportWizard_InstallJobName, info);
installJob.setUser(true);
installJob.setProperty(IProgressConstants.ICON_PROPERTY, PDEPluginImages.DESC_FEATURE_OBJ);
- //add preferences that contain the information about the correspondence between the installed and the local profiles
+ // add preferences that contain the information about the correspondence between the installed and the local profiles
editPreferences(installedProfilesUri);
installJob.schedule();
}
@@ -279,15 +283,15 @@ public class PluginExportUtil {
/**
* Edits the preferences.
- *
+ *
* @param installedProfilesUri
- * the installed profiles uri
+ * the installed profiles uri
*/
private void editPreferences(List<InstalledProfileURI> installedProfilesUri) {
// TODO Auto-generated method stub
IEclipsePreferences preferences = InstanceScope.INSTANCE.getNode("org.eclipse.papyrus.uml.export");
org.osgi.service.prefs.Preferences node = preferences.node("installedProfilesUriCorrespondance");
- for(InstalledProfileURI p : installedProfilesUri) {
+ for (InstalledProfileURI p : installedProfilesUri) {
node.put(p.getUri_local(), p.getUri_installed());
@@ -303,40 +307,40 @@ public class PluginExportUtil {
/**
* Perform preliminary checks.
- *
+ *
* @param shell
- * the shell
+ * the shell
* @param object
- * the object
+ * the object
* @return true, if successful
*/
@SuppressWarnings("unchecked")
protected boolean performPreliminaryChecks(Shell shell, Object object) {
// Check if we are going to overwrite an existing build.xml file
- if(!MessageDialogWithToggle.ALWAYS.equals(PDEPlugin.getDefault().getPreferenceStore().getString(IPreferenceConstants.OVERWRITE_BUILD_FILES_ON_EXPORT))) {
+ if (!MessageDialogWithToggle.ALWAYS.equals(PDEPlugin.getDefault().getPreferenceStore().getString(IPreferenceConstants.OVERWRITE_BUILD_FILES_ON_EXPORT))) {
@SuppressWarnings("rawtypes")
List problemModels = new ArrayList();
String installLocation = null;
IResource underlyingResource = null;
- if(object instanceof WorkspacePluginModelBase) {
- installLocation = ((WorkspacePluginModelBase)object).getInstallLocation();
- underlyingResource = ((WorkspacePluginModelBase)object).getUnderlyingResource();
- } else if(object instanceof WorkspaceFeatureModel) {
- installLocation = ((WorkspaceFeatureModel)object).getInstallLocation();
- underlyingResource = ((WorkspaceFeatureModel)object).getUnderlyingResource();
+ if (object instanceof WorkspacePluginModelBase) {
+ installLocation = ((WorkspacePluginModelBase) object).getInstallLocation();
+ underlyingResource = ((WorkspacePluginModelBase) object).getUnderlyingResource();
+ } else if (object instanceof WorkspaceFeatureModel) {
+ installLocation = ((WorkspaceFeatureModel) object).getInstallLocation();
+ underlyingResource = ((WorkspaceFeatureModel) object).getUnderlyingResource();
}
- if(installLocation != null && underlyingResource != null) {
+ if (installLocation != null && underlyingResource != null) {
File file = new File(installLocation, "build.xml"); //$NON-NLS-1$
- if(file.exists()) {
+ if (file.exists()) {
try {
IFile buildFile = PDEProject.getBuildProperties(underlyingResource.getProject());
IBuildModel buildModel = new WorkspaceBuildModel(buildFile);
buildModel.load();
- if(buildModel != null) {
+ if (buildModel != null) {
IBuildEntry entry = buildModel.getBuild().getEntry(IBuildPropertiesConstants.PROPERTY_CUSTOM);
- if(entry == null || !entry.contains(IBuildPropertiesConstants.TRUE)) {
+ if (entry == null || !entry.contains(IBuildPropertiesConstants.TRUE)) {
problemModels.add(object);
}
}
@@ -346,22 +350,23 @@ public class PluginExportUtil {
}
}
- if(problemModels.size() > 0) {
+ if (problemModels.size() > 0) {
StringBuffer buf = new StringBuffer();
PDELabelProvider labelProvider = new PDELabelProvider();
int maxCount = 10;
- for(Iterator<Object> iterator = problemModels.iterator(); iterator.hasNext();) {
+ for (Iterator<Object> iterator = problemModels.iterator(); iterator.hasNext();) {
buf.append(labelProvider.getText(iterator.next()));
buf.append('\n');
maxCount--;
- if(maxCount <= 0) {
+ if (maxCount <= 0) {
buf.append(Dialog.ELLIPSIS);
break;
}
}
- MessageDialogWithToggle dialog = MessageDialogWithToggle.openOkCancelConfirm(shell, PDEUIMessages.AntGeneratingExportWizard_0, MessageFormat.format(PDEUIMessages.AntGeneratingExportWizard_1, buf.toString()), PDEUIMessages.AntGeneratingExportWizard_2, false, PDEPlugin.getDefault().getPreferenceStore(), IPreferenceConstants.OVERWRITE_BUILD_FILES_ON_EXPORT);
- if(dialog.getReturnCode() == Window.CANCEL) {
+ MessageDialogWithToggle dialog = MessageDialogWithToggle.openOkCancelConfirm(shell, PDEUIMessages.AntGeneratingExportWizard_0, MessageFormat.format(PDEUIMessages.AntGeneratingExportWizard_1, buf.toString()),
+ PDEUIMessages.AntGeneratingExportWizard_2, false, PDEPlugin.getDefault().getPreferenceStore(), IPreferenceConstants.OVERWRITE_BUILD_FILES_ON_EXPORT);
+ if (dialog.getReturnCode() == Window.CANCEL) {
return false;
}
}
@@ -380,20 +385,20 @@ public class PluginExportUtil {
/**
* Instantiates a new export error dialog.
- *
+ *
* @param logLocation
- * the log location
+ * the log location
*/
public ExportErrorDialog(File logLocation) {
- super(PlatformUI.getWorkbench().getDisplay().getActiveShell(), PDECoreMessages.FeatureBasedExportOperation_ProblemDuringExport, null, null, MessageDialog.ERROR, new String[]{ IDialogConstants.OK_LABEL }, 0);
+ super(PlatformUI.getWorkbench().getDisplay().getActiveShell(), PDECoreMessages.FeatureBasedExportOperation_ProblemDuringExport, null, null, MessageDialog.ERROR, new String[] { IDialogConstants.OK_LABEL }, 0);
fLogLocation = logLocation;
}
/**
* Creates the message area.
- *
+ *
* @param composite
- * the composite
+ * the composite
* @return the control
* @see org.eclipse.jface.dialogs.IconAndMessageDialog#createMessageArea(org.eclipse.swt.widgets.Composite)
*/
@@ -424,53 +429,54 @@ public class PluginExportUtil {
}
}
- // public void createJarFromPlugin(final IProject project, Shell parentShell){
- // JarPackageData description= new JarPackageData();
- // IPath location= new Path("projectDir+File.separator+jarFileName");
- // description.setJarLocation(location);
- // description.setManifestMainClass(mainType);
- // description.setExportClassFiles(true);
- // description.setExportOutputFolders(false);
- // description.setExportErrors(true);
- // description.setExportWarnings(true);
- // description.setOverwrite(true);
- // description.setGenerateManifest(true);
- // description.setElements(filestoExport);
- // IJarExportRunnable runnable= description.createJarExportRunnable(parentShell);
- // try {
- // new ProgressMonitorDialog(parentShell).run(true,true, runnable);S
- // } catch (InvocationTargetException e) {
- // } catch (InterruptedException e) {
- // }
- // return;
- // }
+ // public void createJarFromPlugin(final IProject project, Shell parentShell){
+ // JarPackageData description= new JarPackageData();
+ // IPath location= new Path("projectDir+File.separator+jarFileName");
+ // description.setJarLocation(location);
+ // description.setManifestMainClass(mainType);
+ // description.setExportClassFiles(true);
+ // description.setExportOutputFolders(false);
+ // description.setExportErrors(true);
+ // description.setExportWarnings(true);
+ // description.setOverwrite(true);
+ // description.setGenerateManifest(true);
+ // description.setElements(filestoExport);
+ // IJarExportRunnable runnable= description.createJarExportRunnable(parentShell);
+ // try {
+ // new ProgressMonitorDialog(parentShell).run(true,true, runnable);S
+ // } catch (InvocationTargetException e) {
+ // } catch (InterruptedException e) {
+ // }
+ // return;
+ // }
/**
* Delete.
- *
+ *
* @param project
- * the project to delete.
+ * the project to delete.
* @throws CoreException
- * the core exception
+ * the core exception
*/
public void delete(final IProject project) throws CoreException {
IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
+ @Override
public void run(IProgressMonitor monitor) throws CoreException {
- // jproject.setRawClasspath(new IClasspathEntry[0], jproject
- // .getProject().getFullPath(), null);
- for(int i = 0; i < MAX_RETRY; i++) {
+ // jproject.setRawClasspath(new IClasspathEntry[0], jproject
+ // .getProject().getFullPath(), null);
+ for (int i = 0; i < MAX_RETRY; i++) {
try {
IProject tmpProject = project.getProject();
- synchronized(tmpProject) {
- if(tmpProject.exists()) {
+ synchronized (tmpProject) {
+ if (tmpProject.exists()) {
tmpProject.delete(true, true, null);
}
}
i = MAX_RETRY;
} catch (CoreException e) {
- if(i == MAX_RETRY - 1) {
+ if (i == MAX_RETRY - 1) {
throw e;
}
@@ -487,9 +493,9 @@ public class PluginExportUtil {
/**
* Gets the plugin model for project.
- *
+ *
* @param project
- * the project
+ * the project
* @return the plugin model for project
*/
public static IPluginModel getPluginModelForProject(final IProject project) {
@@ -497,11 +503,11 @@ public class PluginExportUtil {
PluginModelManager pmm = PDECore.getDefault().getModelManager();
IPluginModelBase[] wsPlugins = pmm.getWorkspaceModels();
- if(wsPlugins.length == 0) {
- //ErrorHandler.reportError("Project " + project.getName() + " is not a plugin project (no plugin projects)?", false);
+ if (wsPlugins.length == 0) {
+ // ErrorHandler.reportError("Project " + project.getName() + " is not a plugin project (no plugin projects)?", false);
return null;
}
- for(int i = 0; i < wsPlugins.length; i++) {
+ for (int i = 0; i < wsPlugins.length; i++) {
IPluginModelBase wsPlugin = wsPlugins[i];
@@ -509,26 +515,26 @@ public class PluginExportUtil {
// May get both workspace and project plugin models
// (although only the latter are of interest)
IPluginBase pmBase = wsPlugin.getPluginBase();
- if(pmBase == null) {
+ if (pmBase == null) {
continue;
}
String id = pmBase.getId();
- if(id == null) {
+ if (id == null) {
continue;
}
String projName = project.getName();
- if(projName == null) {
+ if (projName == null) {
continue;
}
String resourceLocation = pmBase.getModel().getUnderlyingResource().getLocation().toString();
- if(resourceLocation.endsWith(projName + "/META-INF/MANIFEST.MF")) {
- return (IPluginModel)wsPlugin;
+ if (resourceLocation.endsWith(projName + "/META-INF/MANIFEST.MF")) {
+ return (IPluginModel) wsPlugin;
}
}
- //ErrorHandler.reportError("Could not find plugin for project " + project.getName(), false);
+ // ErrorHandler.reportError("Could not find plugin for project " + project.getName(), false);
return null;
}
diff --git a/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/ProfileUtil.java b/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/ProfileUtil.java
index 380ee39c277..618658748f2 100644
--- a/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/ProfileUtil.java
+++ b/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/ProfileUtil.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2012 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
@@ -29,9 +29,9 @@ public class ProfileUtil {
/**
* Gets the applied profiles from ws.
- *
+ *
* @param openedModel
- * the opened model
+ * the opened model
* @return the applied profiles from ws
*/
public static Object[] getAppliedProfilesFromWS(EObject openedModel) {
@@ -40,12 +40,12 @@ public class ProfileUtil {
- //the list of root profiles, we will export only the root profiles and profiles that are applied from local workspace plugins
+ // the list of root profiles, we will export only the root profiles and profiles that are applied from local workspace plugins
// use of set to not having duplicate elements
Set<EObject> rootProfiles = new HashSet<EObject>();
- for(Profile p : ((org.eclipse.uml2.uml.Package)openedModel).getAllAppliedProfiles()) {
+ for (Profile p : ((org.eclipse.uml2.uml.Package) openedModel).getAllAppliedProfiles()) {
rootProfiles.add(getRootLocalProfile(p));
@@ -61,25 +61,28 @@ public class ProfileUtil {
/**
* Gets the root local profile.
- *
+ *
* @param p
- * the p
+ * the p
* @return the root local profile
*/
public static EObject getRootLocalProfile(EObject p) {
- if(p.eContainer() == null) {
+ if (p.eContainer() == null) {
Resource eResource = p.eResource();
- if(eResource != null) {
+ if (eResource != null) {
URI eUri = eResource.getURI();
- if(eUri.isPlatformResource()) {
+ if (eUri.isPlatformResource()) {
return p;
- } else
+ } else {
return null;
- } else
+ }
+ } else {
return null;
+ }
- } else
+ } else {
return getRootLocalProfile(p.eContainer());
+ }
}
diff --git a/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/ProfilesLabelProvider.java b/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/ProfilesLabelProvider.java
index deb037b6276..3b2df64db2b 100644
--- a/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/ProfilesLabelProvider.java
+++ b/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/ProfilesLabelProvider.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2012 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
@@ -33,19 +33,19 @@ public class ProfilesLabelProvider extends LabelProvider {
/**
* Gets the text.
- *
+ *
* @param element
- * the element
+ * the element
* @return the text
* @{inheritedDoc
*/
@Override
public String getText(Object element) {
- if(!(element instanceof Profile)) {
+ if (!(element instanceof Profile)) {
return super.getText(element);
}
- return ((Profile)element).getName();
+ return ((Profile) element).getName();
}
}
diff --git a/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/WSFileUtil.java b/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/WSFileUtil.java
index 5fbf773ca9a..a98ae0cb327 100644
--- a/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/WSFileUtil.java
+++ b/extraplugins/uml/org.eclipse.papyrus.uml.export/src/org/eclipse/papyrus/uml/export/util/WSFileUtil.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2012 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
@@ -46,14 +46,14 @@ public class WSFileUtil {
/**
* Gets the file name.
- *
+ *
* @param model
- * the model
+ * the model
* @param extension
- * the extension
+ * the extension
* @return the file name
* @throws ServiceException
- * the service exception
+ * the service exception
*/
public static String getFileName(EObject model, String extension) throws ServiceException {
@@ -66,21 +66,21 @@ public class WSFileUtil {
/**
* Load resource.
- *
+ *
* @param path
- * the path
+ * the path
* @param resourceSet
- * the resource set
+ * the resource set
* @return the resource
*/
@SuppressWarnings("deprecation")
public static Resource loadResource(String path, ResourceSet resourceSet) {
- //java.net.URL templateURL = Platform.getBundle(myPluginId).getResource(path);
- //String fullUri = templateURL.getPath();
+ // java.net.URL templateURL = Platform.getBundle(myPluginId).getResource(path);
+ // String fullUri = templateURL.getPath();
URI uri = URI.createPlatformResourceURI(path);
try {
Resource resource = resourceSet.getResource(uri, true);
- if(resource.isLoaded()) {
+ if (resource.isLoaded()) {
return resource;
}
} catch (WrappedException ex) {
@@ -93,29 +93,29 @@ public class WSFileUtil {
/**
* Search for a specific string in an xmi file and replace all its occurences by the new string.
- *
+ *
* @param oldString
- * the old uri
+ * the old uri
* @param newString
- * the new uri
+ * the new uri
* @param adapter
- * the adapter
+ * the adapter
* @param doc
- * the doc
+ * the doc
* @param offset
- * the offset
+ * the offset
* @param multiEdit
- * the multi text edit
+ * the multi text edit
* @throws BadLocationException
- * the bad location exception
+ * the bad location exception
*/
public static void replaceString(String oldString, String newString, FindReplaceDocumentAdapter adapter, IDocument doc, int offset, MultiTextEdit multiEdit) throws BadLocationException {
IRegion region = adapter.find(offset, oldString, true, true, false, true);
- if(region != null) {
+ if (region != null) {
multiEdit.addChild(new ReplaceEdit(region.getOffset(), region.getLength(), newString));
replaceString(oldString, newString, adapter, doc, region.getOffset() + region.getLength(), multiEdit);
- //return new ReplaceEdit(region.getOffset(), region.getLength(), installedURI);
+ // return new ReplaceEdit(region.getOffset(), region.getLength(), installedURI);
}
@@ -124,16 +124,16 @@ public class WSFileUtil {
/**
* Copy.
- *
+ *
* @param source
- * the source
+ * the source
* @param target
- * the target
+ * the target
* @throws IOException
- * Signals that an I/O exception has occurred.
+ * Signals that an I/O exception has occurred.
*/
public static void copy(InputStream source, File target) throws IOException {
- if(!target.getParentFile().exists()) {
+ if (!target.getParentFile().exists()) {
target.getParentFile().mkdirs();
}
@@ -145,7 +145,7 @@ public class WSFileUtil {
int len;
try {
- while((len = source.read(buf)) > 0) {
+ while ((len = source.read(buf)) > 0) {
out.write(buf, 0, len);
@@ -166,7 +166,7 @@ public class WSFileUtil {
// TODO Auto-generated method stub
File targetIconFile = FileUtil.getWorkspaceFile("/" + project.getName() + "/" + destinationDir + "/" + destFileName);
- if(!targetIconFile.getParentFile().exists()) {
+ if (!targetIconFile.getParentFile().exists()) {
targetIconFile.getParentFile().mkdirs();
}

Back to the top