Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcletavernie2012-02-29 12:47:49 +0000
committercletavernie2012-02-29 12:47:49 +0000
commitbddc13bbb5a8c6e252d111b89364e3e2814c5b67 (patch)
tree788c033b37d63ccfb99fbdc6c4eb5f70b56b4c11 /plugins/views
parent42593b3c1f703fb980ee56d9017db87a5fcaea20 (diff)
downloadorg.eclipse.papyrus-bddc13bbb5a8c6e252d111b89364e3e2814c5b67.tar.gz
org.eclipse.papyrus-bddc13bbb5a8c6e252d111b89364e3e2814c5b67.tar.xz
org.eclipse.papyrus-bddc13bbb5a8c6e252d111b89364e3e2814c5b67.zip
370797: [Theme] Papyrus should provide a support for CSS files on its diagrams
https://bugs.eclipse.org/bugs/show_bug.cgi?id=370797
Diffstat (limited to 'plugins/views')
-rw-r--r--plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/modelelement/AbstractModelElement.java13
-rw-r--r--plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/modelelement/EMFModelElement.java6
-rw-r--r--plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/widgets/AbstractPropertyEditor.java8
-rw-r--r--plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/widgets/MultiString.java1
-rw-r--r--plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/widgets/ViewEditor.java8
5 files changed, 16 insertions, 20 deletions
diff --git a/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/modelelement/AbstractModelElement.java b/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/modelelement/AbstractModelElement.java
index cc6adff3b7b..c5d0a8f1628 100644
--- a/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/modelelement/AbstractModelElement.java
+++ b/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/modelelement/AbstractModelElement.java
@@ -19,9 +19,7 @@ import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.papyrus.infra.widgets.creation.ReferenceValueFactory;
import org.eclipse.papyrus.infra.widgets.providers.EmptyContentProvider;
import org.eclipse.papyrus.infra.widgets.providers.IStaticContentProvider;
-import org.eclipse.papyrus.views.properties.contexts.Property;
import org.eclipse.papyrus.views.properties.creation.PropertyEditorFactory;
-import org.eclipse.papyrus.views.properties.runtime.ConfigurationManager;
/**
* Provides a default implementation for ModelElement methods applied on the
@@ -77,17 +75,6 @@ public abstract class AbstractModelElement implements ModelElement {
}
/**
- * Finds the property associated to the given propertyPath
- *
- * @param propertyPath
- * The name of the property to retrieve
- * @return the property associated to the given propertyPath
- */
- protected Property getProperty(String propertyPath) {
- return ConfigurationManager.instance.getProperty(propertyPath, dataSource.getView().getContext());
- }
-
- /**
* @see org.eclipse.papyrus.views.properties.modelelement.ModelElement#getValueFactory(java.lang.String)
*
* @param propertyPath
diff --git a/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/modelelement/EMFModelElement.java b/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/modelelement/EMFModelElement.java
index d233e84b95d..81bfa96e9bf 100644
--- a/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/modelelement/EMFModelElement.java
+++ b/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/modelelement/EMFModelElement.java
@@ -187,8 +187,10 @@ public class EMFModelElement extends AbstractModelElement {
public IStaticContentProvider getContentProvider(String propertyPath) {
FeaturePath featurePath = getFeaturePath(propertyPath);
EStructuralFeature feature = getFeature(featurePath);
-
- return new EMFContentProvider(getSource(featurePath), feature);
+ if(feature != null) {
+ return new EMFContentProvider(getSource(featurePath), feature);
+ }
+ return super.getContentProvider(propertyPath);
}
@Override
diff --git a/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/widgets/AbstractPropertyEditor.java b/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/widgets/AbstractPropertyEditor.java
index 3f10a1f0b8b..b0c89cbc8a0 100644
--- a/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/widgets/AbstractPropertyEditor.java
+++ b/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/widgets/AbstractPropertyEditor.java
@@ -48,9 +48,9 @@ public abstract class AbstractPropertyEditor implements IChangeListener, Customi
*/
protected DataSource input;
- private boolean readOnly = false;
+ protected boolean readOnly = false;
- private boolean isEditable = true;
+ protected boolean isEditable = true;
/**
* The SWT Widget (For list properties only)
@@ -377,7 +377,7 @@ public abstract class AbstractPropertyEditor implements IChangeListener, Customi
try {
observableList = (IObservableList)input.getObservable(propertyPath);
} catch (Exception ex) {
- Activator.log.error("Cannot find a valid IObservable for " + propertyPath, ex); //$NON-NLS-1$
+ Activator.log.error("Cannot find a valid IObservableList for " + propertyPath, ex); //$NON-NLS-1$
}
}
@@ -393,7 +393,7 @@ public abstract class AbstractPropertyEditor implements IChangeListener, Customi
try {
observableValue = (IObservableValue)input.getObservable(propertyPath);
} catch (Exception ex) {
- Activator.log.error("Cannot find a valid IObservable for " + propertyPath, ex); //$NON-NLS-1$
+ Activator.log.error("Cannot find a valid IObservableValue for " + propertyPath, ex); //$NON-NLS-1$
}
}
diff --git a/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/widgets/MultiString.java b/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/widgets/MultiString.java
index 1469b893014..5c9a9fe3332 100644
--- a/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/widgets/MultiString.java
+++ b/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/widgets/MultiString.java
@@ -47,6 +47,7 @@ public class MultiString extends AbstractPropertyEditor {
protected void doBinding() {
editor.setOrdered(input.isOrdered(propertyPath));
editor.setUnique(input.isUnique(propertyPath));
+ editor.setDirectCreation(input.getDirectCreation(propertyPath));
if(getInputObservableList() instanceof ICommitListener) {
editor.addCommitListener((ICommitListener)getInputObservableList());
diff --git a/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/widgets/ViewEditor.java b/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/widgets/ViewEditor.java
index 25ec219ebbf..e4d5c3bd02f 100644
--- a/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/widgets/ViewEditor.java
+++ b/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/widgets/ViewEditor.java
@@ -133,7 +133,7 @@ public class ViewEditor extends AbstractPropertyEditor {
return;
}
- IObservable observable = input.getObservable(propertyPath);
+ IObservable observable = getInputObservable();
if(observable == null) {
return;
}
@@ -222,6 +222,12 @@ public class ViewEditor extends AbstractPropertyEditor {
}
@Override
+ protected IObservable getInputObservable() {
+ //Override the generic behavior: ViewEditor doesn't rely on an AbstractEditor
+ return input.getObservable(propertyPath);
+ }
+
+ @Override
public void setReadOnly(boolean readOnly) {
super.setReadOnly(readOnly);
updateControls();

Back to the top