Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 207359 Details for
Bug 357618
Respect readonly properties
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Solves the bug.
patch_for_357618.txt (text/plain), 9.68 KB, created by
David
on 2011-11-22 09:11:08 EST
(
hide
)
Description:
Solves the bug.
Filename:
MIME Type:
Creator:
David
Created:
2011-11-22 09:11:08 EST
Size:
9.68 KB
patch
obsolete
>commit 52466832a1c169ff8bd177545acd73b5d68a0af4 >Author: dfu <davidfu42@gmail.com> >Date: Fri Nov 11 12:03:59 2011 +0100 > > changes for bug fix 357618 > >diff --git a/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/MEBoolControl.java b/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/MEBoolControl.java >index 33d1530..7c06add 100644 >--- a/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/MEBoolControl.java >+++ b/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/MEBoolControl.java >@@ -45,6 +45,9 @@ public class MEBoolControl extends AbstractMEControl { > Object feature = getItemPropertyDescriptor().getFeature(getModelElement()); > this.attribute = (EAttribute) feature; > check = getToolkit().createButton(parent, "", SWT.CHECK); >+ if (!getItemPropertyDescriptor().canSetProperty(getModelElement())) { >+ check.setEnabled(false); >+ } > IObservableValue model = EMFEditObservables.observeValue(getEditingDomain(), getModelElement(), attribute); > EMFDataBindingContext dbc = new EMFDataBindingContext(); > dbc.bindValue(SWTObservables.observeSelection(check), model, null, null); >diff --git a/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/MEDoubleControl.java b/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/MEDoubleControl.java >index e9f8fc0..115cae1 100644 >--- a/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/MEDoubleControl.java >+++ b/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/MEDoubleControl.java >@@ -65,6 +65,9 @@ public class MEDoubleControl extends AbstractMEControl { > spinner.setDigits(digits); > spinner.setMinimum(-1000000); > spinner.setMaximum(1000000); >+ if (!getItemPropertyDescriptor().canSetProperty(getModelElement())) { >+ spinner.setEnabled(false); >+ } > IObservableValue model = EMFEditObservables.observeValue(getEditingDomain(), getModelElement(), attribute); > EMFDataBindingContext dbc = new EMFDataBindingContext(); > DoubleSpinnerObservable spinnerObservable = new DoubleSpinnerObservable(spinner); >diff --git a/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/MEIntControl.java b/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/MEIntControl.java >index 6bf5156..7ba28d1 100644 >--- a/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/MEIntControl.java >+++ b/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/MEIntControl.java >@@ -46,6 +46,9 @@ public class MEIntControl extends AbstractMEControl { > spinner = new Spinner(parent, style); > spinner.setMinimum(-1000); > spinner.setMaximum(1000); >+ if (!getItemPropertyDescriptor().canSetProperty(getModelElement())) { >+ spinner.setEnabled(false); >+ } > IObservableValue model = EMFEditObservables.observeValue(getEditingDomain(), getModelElement(), attribute); > EMFDataBindingContext dbc = new EMFDataBindingContext(); > dbc.bindValue(SWTObservables.observeSelection(spinner), model, null, null); >diff --git a/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/MERichTextControl.java b/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/MERichTextControl.java >index 59fae5d..6339131 100644 >--- a/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/MERichTextControl.java >+++ b/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/MERichTextControl.java >@@ -91,7 +91,6 @@ public class MERichTextControl extends AbstractMEControl { > > private void createText() { > text = new Text(composite, SWT.BORDER | SWT.MULTI | SWT.WRAP | SWT.V_SCROLL); >- > text.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE)); > text.setSize(10, 100); > text.addFocusListener(new FocusAdapter() { >@@ -110,6 +109,10 @@ public class MERichTextControl extends AbstractMEControl { > spec.grabExcessVerticalSpace = true; > spec.heightHint = 200; > text.setLayoutData(spec); >+ >+ if (!getItemPropertyDescriptor().canSetProperty(getModelElement())) { >+ text.setEnabled(false); >+ } > } > > private void createToolBar() { >diff --git a/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/MESWTDateAndTimeControl.java b/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/MESWTDateAndTimeControl.java >index ed0a5ee..5e38e93 100644 >--- a/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/MESWTDateAndTimeControl.java >+++ b/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/MESWTDateAndTimeControl.java >@@ -80,6 +80,10 @@ public class MESWTDateAndTimeControl extends AbstractMEControl { > timeWidget = new DateTime(dateComposite, SWT.TIME | SWT.SHORT); > timeWidget.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); > >+ if (!getItemPropertyDescriptor().canSetProperty(getModelElement())) { >+ dateWidget.setEnabled(false); >+ timeWidget.setEnabled(false); >+ } > dateDeleteButton = new ImageHyperlink(dateComposite, SWT.TOP); > dateDeleteButton.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_TOOL_DELETE)); > dateDeleteButton.addMouseListener(new MouseAdapter() { >diff --git a/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/MELinkControl.java b/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/MELinkControl.java >index 2df6ec9..e9bf3cf 100644 >--- a/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/MELinkControl.java >+++ b/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/MELinkControl.java >@@ -57,7 +57,7 @@ public class MELinkControl { > protected FormToolkit toolkit; > private org.eclipse.emf.ecp.editor.ModelElementChangeListener modelElementChangeListener; > private ECPModelelementContext context; >- >+ private IItemPropertyDescriptor pDescriptor; > public ECPModelelementContext getContext() { > return context; > } >@@ -66,12 +66,14 @@ public class MELinkControl { > this.context = context; > } > >+ > /** > * {@inheritDoc} > */ > public Control createControl(final Composite parent, int style, IItemPropertyDescriptor itemPropertyDescriptor, > final EObject link, EObject contextModelElement, FormToolkit toolkit, ECPModelelementContext context) { > this.context = context; >+ pDescriptor=itemPropertyDescriptor; > Object feature = itemPropertyDescriptor.getFeature(link); > this.eReference = (EReference) feature; > this.link = link; >@@ -84,7 +86,9 @@ public class MELinkControl { > protected Control createControl(final Composite parent, int style) { > linkComposite = toolkit.createComposite(parent, style); > linkComposite.setLayout(new GridLayout(3, false)); >- >+ if (!pDescriptor.canSetProperty(contextModelElement)) { >+ linkComposite.setEnabled(false); >+ } > createHyperlink(parent, style); > createDeleteAction(style); > return linkComposite; >diff --git a/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/MEMultiLinkControl.java b/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/MEMultiLinkControl.java >index 65e02e0..4db193a 100644 >--- a/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/MEMultiLinkControl.java >+++ b/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/MEMultiLinkControl.java >@@ -190,6 +190,9 @@ public class MEMultiLinkControl extends AbstractMEControl { > createSectionToolbar(section, getToolkit()); > composite = getToolkit().createComposite(section, style); > composite.setLayout(tableLayout); >+ if (!getItemPropertyDescriptor().canSetProperty(getModelElement())) { >+ composite.setEnabled(false); >+ } > > rebuildLinkSection(); > >diff --git a/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/MESingleLinkControl.java b/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/MESingleLinkControl.java >index b27880e..b37907e 100644 >--- a/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/MESingleLinkControl.java >+++ b/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/melinkcontrol/MESingleLinkControl.java >@@ -72,6 +72,9 @@ public class MESingleLinkControl extends AbstractMEControl { > this.eReference = (EReference) feature; > composite = getToolkit().createComposite(parent, style); > composite.setLayout(new GridLayout(3, false)); >+ if (!getItemPropertyDescriptor().canSetProperty(getModelElement())) { >+ composite.setEnabled(false); >+ } > GridLayoutFactory.fillDefaults().spacing(0, 0).numColumns(3).equalWidth(false).applyTo(composite); > this.parent = parent; > this.style = style; >diff --git a/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/multiattributecontrol/MultiAttributeControl.java b/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/multiattributecontrol/MultiAttributeControl.java >index fc3ff5c..b71341e 100644 >--- a/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/multiattributecontrol/MultiAttributeControl.java >+++ b/org.eclipse.emf.ecp.editor/src/org/eclipse/emf/ecp/editor/mecontrols/multiattributecontrol/MultiAttributeControl.java >@@ -95,7 +95,9 @@ public abstract class MultiAttributeControl extends AbstractMEControl { > setComposite(getToolkit().createComposite(parent, style | SWT.BORDER)); > configureGridLayout(); > getComposite().setLayout(gridLayout); >- >+ if (!getItemPropertyDescriptor().canSetProperty(getModelElement())) { >+ getComposite().setEnabled(false); >+ } > // re-set upper bound... needed because canRender() was called in an other instance > upperBound = feature.getUpperBound(); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
eclipse
:
iplog+
Actions:
View
|
Diff
Attachments on
bug 357618
:
206971
| 207359