Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/infra/emf')
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf.types.ui.properties/src/org/eclipse/papyrus/infra/emf/types/ui/properties/providers/ViewContentProvider.java15
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf.types.ui.properties/src/org/eclipse/papyrus/infra/emf/types/ui/properties/widgets/FeatureNameValueEditor.java19
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf.types.ui.properties/src/org/eclipse/papyrus/infra/emf/types/ui/properties/widgets/ViewToDisplayValueEditor.java7
3 files changed, 31 insertions, 10 deletions
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.types.ui.properties/src/org/eclipse/papyrus/infra/emf/types/ui/properties/providers/ViewContentProvider.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.types.ui.properties/src/org/eclipse/papyrus/infra/emf/types/ui/properties/providers/ViewContentProvider.java
index e8edbae6b29..37dee81d76f 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.types.ui.properties/src/org/eclipse/papyrus/infra/emf/types/ui/properties/providers/ViewContentProvider.java
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.types.ui.properties/src/org/eclipse/papyrus/infra/emf/types/ui/properties/providers/ViewContentProvider.java
@@ -19,12 +19,12 @@ import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.papyrus.infra.properties.contexts.Context;
import org.eclipse.papyrus.infra.properties.contexts.View;
import org.eclipse.papyrus.infra.properties.ui.runtime.PropertiesRuntime;
-import org.eclipse.papyrus.infra.widgets.providers.IStaticContentProvider;
+import org.eclipse.papyrus.infra.widgets.providers.FilteredContentProvider;
/**
* A {@link ITreeContentProvider} for {@link View}.
*/
-public class ViewContentProvider implements ITreeContentProvider, IStaticContentProvider {
+public class ViewContentProvider extends FilteredContentProvider {
/**
* {@inheritDoc}
@@ -80,4 +80,15 @@ public class ViewContentProvider implements ITreeContentProvider, IStaticContent
return features.toArray();
}
+ /**
+ * @see org.eclipse.papyrus.infra.widgets.providers.EncapsulatedContentProvider#isValidValue(java.lang.Object)
+ *
+ * @param element
+ * @return
+ */
+ @Override
+ public boolean isValidValue(final Object element) {
+ return element instanceof View;
+ }
+
} \ No newline at end of file
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.types.ui.properties/src/org/eclipse/papyrus/infra/emf/types/ui/properties/widgets/FeatureNameValueEditor.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.types.ui.properties/src/org/eclipse/papyrus/infra/emf/types/ui/properties/widgets/FeatureNameValueEditor.java
index 30583fec8f5..67a490345c6 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.types.ui.properties/src/org/eclipse/papyrus/infra/emf/types/ui/properties/widgets/FeatureNameValueEditor.java
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.types.ui.properties/src/org/eclipse/papyrus/infra/emf/types/ui/properties/widgets/FeatureNameValueEditor.java
@@ -22,14 +22,14 @@ import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider;
import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider;
import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.StyledString;
import org.eclipse.jface.window.Window;
import org.eclipse.papyrus.infra.emf.types.ui.properties.messages.Messages;
import org.eclipse.papyrus.infra.ui.emf.providers.EMFLabelProvider;
import org.eclipse.papyrus.infra.widgets.Activator;
-import org.eclipse.papyrus.infra.widgets.editors.ElementsExplorerDialog;
import org.eclipse.papyrus.infra.widgets.editors.StringEditor;
+import org.eclipse.papyrus.infra.widgets.editors.TreeSelectorDialog;
+import org.eclipse.papyrus.infra.widgets.providers.FilteredContentProvider;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
@@ -45,7 +45,7 @@ public class FeatureNameValueEditor extends StringEditor {
/**
* Content provider for the feature viewer.
*/
- protected class FeatureContentProvider implements IStructuredContentProvider {
+ protected class FeatureContentProvider extends FilteredContentProvider {
/** current edited Eclass */
protected EClass currentEClass;
@@ -75,6 +75,17 @@ public class FeatureNameValueEditor extends StringEditor {
return features.toArray();
}
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.papyrus.infra.widgets.providers.EncapsulatedContentProvider#isFlat()
+ */
+ @Override
+ public boolean isFlat() {
+ return true;
+ }
+
+
}
/**
@@ -178,7 +189,7 @@ public class FeatureNameValueEditor extends StringEditor {
* Handles action when user press the Manage bundle button in the combo area
*/
protected void handleManageBrowseButtonPressed() {
- ElementsExplorerDialog dialog = new ElementsExplorerDialog(getParent().getShell());
+ TreeSelectorDialog dialog = new TreeSelectorDialog(getParent().getShell());
dialog.setContentProvider(new FeatureContentProvider());
dialog.setLabelProvider(new FeatureStyledLabelProvider());
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.types.ui.properties/src/org/eclipse/papyrus/infra/emf/types/ui/properties/widgets/ViewToDisplayValueEditor.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.types.ui.properties/src/org/eclipse/papyrus/infra/emf/types/ui/properties/widgets/ViewToDisplayValueEditor.java
index bd617aa201e..7a1d6227638 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf.types.ui.properties/src/org/eclipse/papyrus/infra/emf/types/ui/properties/widgets/ViewToDisplayValueEditor.java
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf.types.ui.properties/src/org/eclipse/papyrus/infra/emf/types/ui/properties/widgets/ViewToDisplayValueEditor.java
@@ -18,8 +18,8 @@ import org.eclipse.papyrus.infra.emf.types.ui.properties.providers.ViewContentPr
import org.eclipse.papyrus.infra.emf.types.ui.properties.providers.ViewLabelProvider;
import org.eclipse.papyrus.infra.properties.contexts.View;
import org.eclipse.papyrus.infra.widgets.Activator;
-import org.eclipse.papyrus.infra.widgets.editors.ElementsExplorerDialog;
import org.eclipse.papyrus.infra.widgets.editors.ReferenceDialog;
+import org.eclipse.papyrus.infra.widgets.editors.TreeSelectorDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
@@ -120,12 +120,11 @@ public class ViewToDisplayValueEditor extends ReferenceDialog {
* Handles action when user press the Manage bundle button in the combo area
*/
protected void handleManageBrowseButtonPressed() {
- ElementsExplorerDialog dialog = new ElementsExplorerDialog(getParent().getShell());
+ TreeSelectorDialog dialog = new TreeSelectorDialog(getParent().getShell());
dialog.setContentProvider(new ViewContentProvider());
dialog.setLabelProvider(new ViewLabelProvider());
- // Set the return type.
- dialog.setReturnTypeClass(View.class);
+
dialog.setTitle(Messages.ViewToDisplayValueEditor_dialogTitle);
dialog.setMessage(Messages.ViewToDisplayValueEditor_dialogMessage);

Back to the top