diff options
author | Christian W. Damus | 2016-01-15 18:27:40 +0000 |
---|---|---|
committer | Christian W. Damus | 2016-01-22 15:57:12 +0000 |
commit | 929e9738301b35cef5cc1ab00f47047671940bd5 (patch) | |
tree | 3557a10c2577b834d83909689755a39b86162517 /plugins/views | |
parent | 652333238a0a1651c1b69a4563b72961250c5398 (diff) | |
download | org.eclipse.papyrus-929e9738301b35cef5cc1ab00f47047671940bd5.tar.gz org.eclipse.papyrus-929e9738301b35cef5cc1ab00f47047671940bd5.tar.xz org.eclipse.papyrus-929e9738301b35cef5cc1ab00f47047671940bd5.zip |
Bug 485220: [Architecture] Provide a more modular architecture
https://bugs.eclipse.org/bugs/show_bug.cgi?id=485220
Move UI-dependent APIs from the org.eclipse.papyrus.infra.constraints
bundle to a new org.eclipse.papyrus.infra.constraints.ui bundle.
Replace usage of ISelection and IStructuredSelection in Constraint and
ConstraintEngine API methods with Object and Collection<?>,
respectively.
Move the ElementTypesPreferences class from the
infra.elementtypesconfigurations bundle to a new
infra.elementtypesconfigurations.ui bundle. For compatibility, it still
persists its data via an `IMemento` in the preferences of the
core `infra.elementtypesconfigurations` bundle. It implements a new
provider extension interface that allows the core bundle's
element-type registry to call out to it to get user-defined element
types from the workspace.
Move the RuntimeValuesEditionAdviceEditHelperAdvice class and some of
its attendants from the infra.elementtypesconfigurations.emf bundle to
the new infra.elementtypesconfigurations.ui bundle because it needs to
open the EditionDialog to let the user edit objects.
Likewise the similar APIs in the infra.extendedtypes bundle, including
also the entire providers package for action-providers, with the
ExtendedElementTypeActionService class, the
IExtendedElementTypeActionProvider interface, and the corresponding
extension point namespace.
Move the ElementTypeValidator class from the infra.services.edit bundle
to a new infra.services.edit.ui bundle.
Other fixes for simple inessential UI dependencies and also conflicts in
bundle classpaths (such as in the Sequence Diagram particularly) that
cause deadlocks in class loading in a complete Papyrus environment, such
as the AllTests suite.
Factor the UI dependencies out of the infra.onefile bundle into a new
infra.onefile.ui bundle.
Tests all still pass (inasmuch as they do in the nightly master builds).
Change-Id: I43510c84f54c3e0e52cd7d2aa3ca6aca95b894a7
Diffstat (limited to 'plugins/views')
2 files changed, 14 insertions, 5 deletions
diff --git a/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/runtime/ViewConstraintEngineImpl.java b/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/runtime/ViewConstraintEngineImpl.java index 58946400481..424facc1b67 100644 --- a/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/runtime/ViewConstraintEngineImpl.java +++ b/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/runtime/ViewConstraintEngineImpl.java @@ -29,6 +29,10 @@ import org.eclipse.papyrus.views.properties.contexts.View; */
public class ViewConstraintEngineImpl extends DefaultConstraintEngine<View> implements ViewConstraintEngine {
+ public ViewConstraintEngineImpl() {
+ super(View.class);
+ }
+
@Override
public synchronized void refresh() {
constraints.clear();
@@ -40,6 +44,7 @@ public class ViewConstraintEngineImpl extends DefaultConstraintEngine<View> impl fireConstraintsChanged();
}
+ @Override
public void addContext(final Context context) {
for (View view : context.getViews()) {
for (ConstraintDescriptor descriptor : view.getConstraints()) {
@@ -48,6 +53,7 @@ public class ViewConstraintEngineImpl extends DefaultConstraintEngine<View> impl }
}
+ @Override
public Set<View> getViews(final ISelection forSelection) {
return getDisplayUnits(forSelection);
}
diff --git a/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/xwt/XWTSection.java b/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/xwt/XWTSection.java index 717773d10db..4eb0e5a4837 100644 --- a/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/xwt/XWTSection.java +++ b/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/xwt/XWTSection.java @@ -1,5 +1,5 @@ /*****************************************************************************
- * Copyright (c) 2010, 2014 CEA LIST and others.
+ * Copyright (c) 2010, 2016 CEA LIST, Christian W. Damus, and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -8,13 +8,14 @@ *
* Contributors:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
- * Christian W. Damus (CEA) - bug 435420
- * Christian W. Damus (CEA) - bug 417409
+ * Christian W. Damus (CEA) - bugs 435420, 417409
+ * Christian W. Damus - bug 485220
*
*****************************************************************************/
package org.eclipse.papyrus.views.properties.xwt;
import java.util.HashSet;
+import java.util.List;
import java.util.Set;
import org.eclipse.core.databinding.observable.ChangeEvent;
@@ -175,7 +176,7 @@ public class XWTSection extends AbstractPropertySection implements IChangeListen * any constraint, or if at least one of its constraints match the current selection
*
* @return
- * True if the section should be displayed
+ * True if the section should be displayed
*/
protected boolean isApplied() {
if (getConstraints().isEmpty()) {
@@ -183,11 +184,12 @@ public class XWTSection extends AbstractPropertySection implements IChangeListen }
ISelection selection = getSelection();
+ List<?> selectionList = ((IStructuredSelection) selection).toList();
// Return true only if at least one constraint matches the selection
for (Constraint constraint : getConstraints()) {
- if (constraint.match((IStructuredSelection) selection)) {
+ if (constraint.match(selectionList)) {
return true;
}
}
@@ -237,6 +239,7 @@ public class XWTSection extends AbstractPropertySection implements IChangeListen return "XWTSection : " + section.getName(); //$NON-NLS-1$
}
+ @Override
public void handleChange(ChangeEvent event) {
display(true);
}
|