Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre-Charles David2017-01-27 15:17:35 +0000
committerPierre-Charles David2017-04-19 07:53:46 +0000
commitcf865e177307774678976d2b0a6bc94dd1f0a647 (patch)
tree6a612a8e89d228a8b3c7d2fe6a32e6cc72f3f287
parenta5a69d327c368ecaad0af06e1c43ce5a87b3cc85 (diff)
downloadorg.eclipse.eef-cf865e177307774678976d2b0a6bc94dd1f0a647.tar.gz
org.eclipse.eef-cf865e177307774678976d2b0a6bc94dd1f0a647.tar.xz
org.eclipse.eef-cf865e177307774678976d2b0a6bc94dd1f0a647.zip
[513254] Add support for read-only status decorator
Bug: 513254 Change-Id: If1ca0d47fab31c4d9c51a3445a551421de5d7dbf Cherry-picks: I5a73bfc6387ce0683088fbf20a6ff6b04801a1e1 Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
-rw-r--r--plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/LockStatusChangeEvent.java4
-rw-r--r--plugins/org.eclipse.eef.ide.ui/icons/full/permission_no_write.gifbin0 -> 870 bytes
-rw-r--r--plugins/org.eclipse.eef.ide.ui/plugin.properties1
-rw-r--r--plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/api/widgets/AbstractEEFWidgetLifecycleManager.java19
-rw-r--r--plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/EEFIdeUiPlugin.java1
-rw-r--r--plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/Icons.java5
-rw-r--r--plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/Messages.java3
7 files changed, 33 insertions, 0 deletions
diff --git a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/LockStatusChangeEvent.java b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/LockStatusChangeEvent.java
index 7c3867b50..7d1901858 100644
--- a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/LockStatusChangeEvent.java
+++ b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/LockStatusChangeEvent.java
@@ -35,6 +35,10 @@ public class LockStatusChangeEvent {
*/
LOCKED_BY_OTHER,
/**
+ * Status to indicate that a EObject is locked because of a permission issue.
+ */
+ LOCKED_PERMISSION,
+ /**
* Status to indicate that a EObject is not locked.
*/
UNLOCKED
diff --git a/plugins/org.eclipse.eef.ide.ui/icons/full/permission_no_write.gif b/plugins/org.eclipse.eef.ide.ui/icons/full/permission_no_write.gif
new file mode 100644
index 000000000..6fb2e1a4d
--- /dev/null
+++ b/plugins/org.eclipse.eef.ide.ui/icons/full/permission_no_write.gif
Binary files differ
diff --git a/plugins/org.eclipse.eef.ide.ui/plugin.properties b/plugins/org.eclipse.eef.ide.ui/plugin.properties
index 91654f2f3..07bb99c2a 100644
--- a/plugins/org.eclipse.eef.ide.ui/plugin.properties
+++ b/plugins/org.eclipse.eef.ide.ui/plugin.properties
@@ -36,3 +36,4 @@ EEFValidationRulesPage_label=Select a message:
AbstractEEFWidgetLifecycleManager_noDescriptionAvailable=No description available
AbstractEEFWidgetLifecycleManager_lockedByOther=This widget is locked by another user
AbstractEEFWidgetLifecycleManager_lockedByMe=This widget is locked for other users
+AbstractEEFWidgetLifecycleManager_lockedNoWrite=This widget is locked because of a permission issue
diff --git a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/api/widgets/AbstractEEFWidgetLifecycleManager.java b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/api/widgets/AbstractEEFWidgetLifecycleManager.java
index 7414fdffe..922f32ec7 100644
--- a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/api/widgets/AbstractEEFWidgetLifecycleManager.java
+++ b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/api/widgets/AbstractEEFWidgetLifecycleManager.java
@@ -339,6 +339,9 @@ public abstract class AbstractEEFWidgetLifecycleManager extends AbstractEEFLifec
case LOCKED_BY_OTHER:
AbstractEEFWidgetLifecycleManager.this.lockedByOther();
break;
+ case LOCKED_PERMISSION:
+ AbstractEEFWidgetLifecycleManager.this.lockedNoWrite();
+ break;
case UNLOCKED:
AbstractEEFWidgetLifecycleManager.this.unlocked();
break;
@@ -390,6 +393,22 @@ public abstract class AbstractEEFWidgetLifecycleManager extends AbstractEEFLifec
/**
* Sets the appearance and behavior of the widget in order to indicate that the semantic element used by the widget
+ * cannot be modified by the user. As a result, it will set the user interface in a disable mode with a grey lock
+ * next to the widget.
+ */
+ protected void lockedNoWrite() {
+ this.setEnabled(false);
+
+ if (this.controlDecoration.getControl() != null) {
+ this.controlDecoration.hide();
+ this.controlDecoration.setDescriptionText(Messages.AbstractEEFWidgetLifecycleManager_lockedNoWrite);
+ this.controlDecoration.setImage(EEFIdeUiPlugin.getPlugin().getImageRegistry().get(Icons.PERMISSION_NO_WRITE));
+ this.controlDecoration.show();
+ }
+ }
+
+ /**
+ * Sets the appearance and behavior of the widget in order to indicate that the semantic element used by the widget
* is currently unlocked. As a result, it will set back the widget to its default state.
*/
protected void unlocked() {
diff --git a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/EEFIdeUiPlugin.java b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/EEFIdeUiPlugin.java
index ad7d46f63..d83f8dd73 100644
--- a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/EEFIdeUiPlugin.java
+++ b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/EEFIdeUiPlugin.java
@@ -126,6 +126,7 @@ public class EEFIdeUiPlugin extends EMFPlugin {
this.imageRegistry.put(Icons.PERMISSION_DENIED, this.getImageDescriptor(Icons.PERMISSION_DENIED));
this.imageRegistry.put(Icons.PERMISSION_GRANTED_TO_CURRENT_USER_EXCLUSIVELY,
this.getImageDescriptor(Icons.PERMISSION_GRANTED_TO_CURRENT_USER_EXCLUSIVELY));
+ this.imageRegistry.put(Icons.PERMISSION_NO_WRITE, this.getImageDescriptor(Icons.PERMISSION_NO_WRITE));
}
/**
diff --git a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/Icons.java b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/Icons.java
index 5fd0edc7c..5d07c7d91 100644
--- a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/Icons.java
+++ b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/Icons.java
@@ -80,4 +80,9 @@ public interface Icons {
* Permission Granted to current user exclusively.
*/
String PERMISSION_GRANTED_TO_CURRENT_USER_EXCLUSIVELY = "icons/full/permission_granted_to_current_user_exclusively.gif"; //$NON-NLS-1$
+
+ /**
+ * Permission No Write.
+ */
+ String PERMISSION_NO_WRITE = "icons/full/permission_no_write.gif"; //$NON-NLS-1$
}
diff --git a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/Messages.java b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/Messages.java
index f212b5bc0..8a930b27a 100644
--- a/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/Messages.java
+++ b/plugins/org.eclipse.eef.ide.ui/src/org/eclipse/eef/ide/ui/internal/Messages.java
@@ -79,6 +79,9 @@ public final class Messages {
@TranslatableMessage
public static String AbstractEEFWidgetLifecycleManager_lockedByMe;
+ @TranslatableMessage
+ public static String AbstractEEFWidgetLifecycleManager_lockedNoWrite;
+
// CHECKSTYLE:ON
/**

Back to the top