Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcletavernie2012-02-23 07:45:04 -0500
committercletavernie2012-02-23 07:45:04 -0500
commit039cf10e06b3f873a81c64ac6ef45a7968fabe50 (patch)
treeab1017f31a8116d93e3669c6407e3ea1af103ffa /plugins
parent36a05b721aa31c92b6cf77bf668a954e939ae521 (diff)
downloadorg.eclipse.papyrus-039cf10e06b3f873a81c64ac6ef45a7968fabe50.tar.gz
org.eclipse.papyrus-039cf10e06b3f873a81c64ac6ef45a7968fabe50.tar.xz
org.eclipse.papyrus-039cf10e06b3f873a81c64ac6ef45a7968fabe50.zip
335332: [Property View] Papyrus shall provide an extensible property view runtime
https://bugs.eclipse.org/bugs/show_bug.cgi?id=335332
Diffstat (limited to 'plugins')
-rw-r--r--plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/modelelement/DataSource.java12
-rw-r--r--plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/widgets/AbstractPropertyEditor.java5
2 files changed, 8 insertions, 9 deletions
diff --git a/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/modelelement/DataSource.java b/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/modelelement/DataSource.java
index e3f9471f4fb..a8915d88f19 100644
--- a/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/modelelement/DataSource.java
+++ b/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/modelelement/DataSource.java
@@ -80,16 +80,14 @@ public class DataSource implements IChangeListener {
public ModelElement getModelElement(String propertyPath) {
//ConfigurationManager.instance.getProperty(propertyPath)
String key = propertyPath.substring(0, propertyPath.lastIndexOf(":")); //$NON-NLS-1$
- ModelElement element = elements.get(key);
- if(element == null) { //Try to resolve the modelElements on-the-fly
- element = DataSourceFactory.instance.getModelElementFromPropertyPath(this, propertyPath);
+ if(!elements.containsKey(key)) { //Try to resolve the modelElements on-the-fly
+ ModelElement element = DataSourceFactory.instance.getModelElementFromPropertyPath(this, propertyPath);
if(element == null) {
Activator.log.warn("Unable to find a ModelElement for " + propertyPath + ". Elements : " + elements); //$NON-NLS-1$ //$NON-NLS-2$
- return null;
}
elements.put(key, element);
}
- return element;
+ return elements.get(key);
}
private String getLocalPropertyPath(String propertyPath) {
@@ -340,7 +338,9 @@ public class DataSource implements IChangeListener {
*/
public void dispose() {
for(ModelElement element : elements.values()) {
- element.dispose();
+ if(element != null) {
+ element.dispose();
+ }
}
elements.clear();
}
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 72b022c8b23..3f10a1f0b8b 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
@@ -168,8 +168,6 @@ public abstract class AbstractPropertyEditor implements IChangeListener, Customi
* Binds the AbstractEditor (Either List or Value editor) to the semantic element
*/
protected void doBinding() {
- boolean isReadOnly = getReadOnly();
-
if(listEditor != null) {
IObservableList inputObservableList = getInputObservableList();
@@ -185,6 +183,7 @@ public abstract class AbstractPropertyEditor implements IChangeListener, Customi
}
}
+ boolean isReadOnly = getReadOnly();
applyReadOnly(isReadOnly);
if(input.forceRefresh(propertyPath)) {
@@ -365,7 +364,7 @@ public abstract class AbstractPropertyEditor implements IChangeListener, Customi
* True if this editor is read-only
*/
public boolean getReadOnly() {
- boolean result = readOnly || !isEditable;
+ boolean result = readOnly || !isEditable || getInputObservable() == null;
return result;
}

Back to the top