diff options
author | Benoit Maggi | 2017-11-24 10:23:46 +0000 |
---|---|---|
committer | Benoit Maggi | 2017-12-14 08:38:21 +0000 |
commit | ac3c027356a20993ee782d09486c33df0456c5a3 (patch) | |
tree | de44ac6d3f53fd9f3e0a7b23d5a5b3b902363b56 /plugins/infra/ui | |
parent | 9e0e11f6bf5ca4222f9eefcfd4f65b0307e18636 (diff) | |
download | org.eclipse.papyrus-ac3c027356a20993ee782d09486c33df0456c5a3.tar.gz org.eclipse.papyrus-ac3c027356a20993ee782d09486c33df0456c5a3.tar.xz org.eclipse.papyrus-ac3c027356a20993ee782d09486c33df0456c5a3.zip |
Bug 518317 - [UMLPropertiesView] Autocompletion for type of properties
- new auto-completion editor:
- no binding to uml element
- available in example for property type
- add a predicate filter for INameResolutionHelper
- add completion proposal and processor for UML NamedElements
- fix a bunch of quality warnings for Java 8
Change-Id: I38722b6782c13fb8de511c8d0e253ba491c27136
Signed-off-by: Benoit Maggi <benoit.maggi@cea.fr>
Diffstat (limited to 'plugins/infra/ui')
2 files changed, 16 insertions, 4 deletions
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/StyledTextStringEditor.java b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/StyledTextStringEditor.java index becc57dd823..439658d91e3 100644 --- a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/StyledTextStringEditor.java +++ b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/StyledTextStringEditor.java @@ -206,8 +206,6 @@ public class StyledTextStringEditor extends AbstractValueEditor implements KeyLi controlDecoration.hide(); // we ignore the indentation - // data.horizontalIndent = FieldDecorationRegistry.getDefault().getMaximumDecorationWidth(); - // we remove the margin GridLayout layout = (GridLayout) this.getLayout(); layout.marginHeight = 0; diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/util/INameResolutionHelper.java b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/util/INameResolutionHelper.java index 6272fd11b9f..eabdb5de8e8 100644 --- a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/util/INameResolutionHelper.java +++ b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/util/INameResolutionHelper.java @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (c) 2015 CEA LIST and others. + * Copyright (c) 2015, 2017 CEA LIST and others. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -8,12 +8,13 @@ * * Contributors: * CEA LIST - Initial API and implementation - * + * Benoit Maggi (CEA LIST) - Bug 518317 Autocompletion for type of properties *****************************************************************************/ package org.eclipse.papyrus.infra.widgets.util; import java.util.List; +import java.util.function.Predicate; /** * Common interface to use to find elements from a given string @@ -30,6 +31,17 @@ public interface INameResolutionHelper { */ public List<?> getMatchingElements(final String aString); + + /** + * Use a {@link java.util.function.Predicate} to get matching elements. + * + * @param predicate to match the elements + * @return all elements whose match the predicate + */ + public default List<?> getMatchingElements(final Predicate<?> predicate){ + return getElementsByName(""); //$NON-NLS-1$ TODO: remove default when bumping plugin to 4.0.0 + } + /** * * @param aString @@ -65,4 +77,6 @@ public interface INameResolutionHelper { */ public List<String> getShortestQualifiedNames(final Object element, final boolean manageDuplicate); + + } |