Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor')
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/CompletionFilterSourceViewerConfiguration.java81
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/ILabelColorConstants.java72
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/LabelColorProvider.java116
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/LabelCompletionProcessor.java272
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/LabelContextType.java50
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/WhitespaceDetector.java43
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/WordDetector.java57
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/collaborationuselabel/CollaborationUseConfigurationForUML.java102
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/collaborationuselabel/CollaborationUseLabelColorProvider.java114
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/collaborationuselabel/CollaborationUseLabelCompletionProcessor.java173
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/collaborationuselabel/CollaborationUseLabelScanner.java97
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/collaborationuselabel/CollaborationUseLabelSourceViewerConfiguration.java136
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/collaborationuselabel/ICollaborationUseLabelColorConstants.java52
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/collaborationuselabel/IContext.java37
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/CollaborationCompletionProposalComputer.java123
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/DefaultValueCompletionProposal.java76
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/DerivedPropertyCompletionProposal.java76
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/DirectionCompletionProposal.java77
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/ICompletionProposalComputer.java40
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/MultiplicityCompletionProposal.java89
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/NameCompletionProposal.java74
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/ParameterModifierProposal.java102
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/ParameterModifiersProposal.java63
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/PropertyModifierProposal.java112
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/PropertyModifiersProposal.java63
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/PropertyRedefineProposal.java96
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/PropertySubsetsProposal.java96
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/TypeCompletionProposalComputer.java180
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/VSL_BooleanValue_CompletionProposal.java63
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/VSL_DefaultValue_CompletionProposal.java61
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/VSL_EnumerationLiteral_CompletionProposal.java92
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/VSL_Integer_CompletionProposal.java65
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/VSL_NFP_VS_CompletionProposal.java63
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/VSL_NullValue_CompletionProposal.java61
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/VSL_NumberLiteral_CompletionProposal.java62
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/VSL_Real_CompletionProposal.java64
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/VSL_StringLiteral_CompletionProposal.java60
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/VSL_Tuple_CompletionProposal.java101
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/VSL_UnlimitedNatural_CompletionProposal.java65
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/VisibilityCompletionProposal.java77
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/parameterlabel/IContext.java81
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/parameterlabel/IParameterLabelColorConstants.java53
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/parameterlabel/ParameterConfigurationForUML.java116
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/parameterlabel/ParameterLabelColorProvider.java109
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/parameterlabel/ParameterLabelCompletionProcessor.java249
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/parameterlabel/ParameterLabelPartitionScanner.java52
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/parameterlabel/ParameterLabelScanner.java105
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/parameterlabel/ParameterLabelSourceViewerConfiguration.java155
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/parameterlabel/ParameterWordDetector.java89
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/propertylabel/IContext.java90
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/propertylabel/IPropertyLabelColorConstants.java72
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/propertylabel/PropertyConfigurationForUML.java115
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/propertylabel/PropertyLabelColorProvider.java120
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/propertylabel/PropertyLabelCompletionProcessor.java244
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/propertylabel/PropertyLabelContextType.java50
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/propertylabel/PropertyLabelPartitionScanner.java51
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/propertylabel/PropertyLabelScanner.java112
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/propertylabel/PropertyLabelSourceViewerConfiguration.java154
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/propertylabel/PropertyLabelTemplateUI.java149
-rw-r--r--extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/propertylabel/PropertyWordDetector.java88
60 files changed, 0 insertions, 5757 deletions
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/CompletionFilterSourceViewerConfiguration.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/CompletionFilterSourceViewerConfiguration.java
deleted file mode 100644
index 529e52229d0..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/CompletionFilterSourceViewerConfiguration.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 Atos Origin.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.parsers.texteditor;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jface.text.source.SourceViewerConfiguration;
-
-/**
- * The Class CompletionFilterSourceViewerConfiguration.
- */
-public class CompletionFilterSourceViewerConfiguration extends SourceViewerConfiguration {
-
- ICompletionFilter filter = null;
-
- /**
- * Instantiates a new completion filter source viewer configuration without active filter
- */
- public CompletionFilterSourceViewerConfiguration() {
- filter = new NullCompletionFilter();
- }
-
- /**
- * Instantiates a new completion filter source viewer configuration with active filter
- *
- * @param filter
- * the filter
- */
- public CompletionFilterSourceViewerConfiguration(ICompletionFilter filter) {
- this.filter = filter;
- }
-
- /**
- * The Interface ICompletionFilter to set up the filter
- */
- public interface ICompletionFilter {
-
- /**
- * Filter.
- *
- * @param context
- * @param e
- *
- * @return true if object is filtered, false if it is not
- */
- public boolean filter(int context, EObject e);
- }
-
- /**
- * NullCompletionFilter to disable filter as default behavior
- */
- public static class NullCompletionFilter implements ICompletionFilter {
-
- /**
- * @see org.eclipse.papyrus.parsers.texteditor.CompletionFilterSourceViewerConfiguration.ICompletionFilter#filter(int, org.eclipse.emf.ecore.EObject)
- */
- public boolean filter(int context, EObject e) {
- return false;
- }
- }
-
- /**
- * Gets the filter.
- *
- * @return the filter
- */
- protected ICompletionFilter getFilter() {
- return filter;
- }
-
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/ILabelColorConstants.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/ILabelColorConstants.java
deleted file mode 100644
index 09a6fb970f7..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/ILabelColorConstants.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.parsers.texteditor;
-
-import org.eclipse.swt.graphics.RGB;
-
-/**
- *
- */
-public interface ILabelColorConstants {
-
- /**
- *
- */
- public final String DEFAULT = "default";
-
- /**
- *
- */
- public final String KEYWORD = "keyword";
-
- /**
- *
- */
- public final String STRING = "string";
-
- /**
- *
- */
- public final String SYMBOL = "symbol";
-
- /**
- *
- */
- public final RGB RGB_DEFAULT = new RGB(0, 0, 0);
-
- /**
- *
- */
- public final RGB RGB_CONSTANT = new RGB(120, 120, 120);
-
- /**
- *
- */
- public final RGB RGB_BACKGROUND = new RGB(255, 255, 255);
-
- /**
- *
- */
- public final RGB RGB_KEYWORD = new RGB(127, 0, 85);
-
- /**
- *
- */
- public final RGB RGB_STRING = new RGB(85, 200, 85);
-
- /**
- *
- */
- public final RGB RGB_SYMBOL = new RGB(42, 0, 255);
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/LabelColorProvider.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/LabelColorProvider.java
deleted file mode 100644
index 696c1cf76e0..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/LabelColorProvider.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.parsers.texteditor;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.papyrus.parsers.PapyrusParsersPlugin;
-import org.eclipse.papyrus.parsers.preferences.IPreferencesConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * Color provider for syntax highlight.
- */
-public class LabelColorProvider implements ILabelColorConstants {
-
- /**
- * singleton instance of this class.
- */
- private static LabelColorProvider instance;
-
- /**
- * Default constructor (private for singleton pattern).
- */
- private LabelColorProvider() {
- // private constructor for singleton pattern
- }
-
- /**
- * Returns the singleton instance.
- *
- * @return the singleton instance
- */
- public static LabelColorProvider getDefault() {
- if (instance == null) {
- instance = new LabelColorProvider();
- }
- return instance;
- }
-
- /**
- * Hashmap that stores a list of colors, given an identifier.
- */
- protected Map<String, Color> fColorTable = new HashMap<String, Color>(10);
-
- /**
- * Set default colors in given preference store.
- *
- * @param aStore
- * the pref store
- */
- public static void initializeDefaults(IPreferenceStore aStore) {
- PreferenceConverter.setDefault(aStore, IPreferencesConstants.COLOR_DEFAULT, ILabelColorConstants.RGB_DEFAULT);
- PreferenceConverter.setDefault(aStore, IPreferencesConstants.COLOR_KEYWORD, ILabelColorConstants.RGB_KEYWORD);
- PreferenceConverter.setDefault(aStore, IPreferencesConstants.COLOR_STRING, ILabelColorConstants.RGB_STRING);
- PreferenceConverter.setDefault(aStore, IPreferencesConstants.COLOR_SYMBOL, ILabelColorConstants.RGB_SYMBOL);
- }
-
- /**
- * Returns specified color that is stored in the color table. If color not found in color table
- * then a new instance is created from according preferences value and stored in color table.
- *
- * @param aName
- * the name of the color
- *
- * @return the color instance
- */
- public Color getColor(String aName) {
-
- Color color = this.fColorTable.get(aName);
- if (color == null) {
- IPreferenceStore store = PapyrusParsersPlugin.getDefault().getPreferenceStore();
-
- // PreferenceConverter.setValue(store, IPreferencesConstants.COLOR_KEYWORD,
- // ILabelColorConstants.RGB_KEYWORD);
- PreferenceConverter.setValue(store, IPreferencesConstants.COLOR_SYMBOL, ILabelColorConstants.RGB_SYMBOL);
-
- RGB rgb = PreferenceConverter.getColor(store, IPreferencesConstants.PREFIX_COLOR + aName);
- if (rgb != null) {
- color = new Color(Display.getCurrent(), rgb);
- } else {
- color = Display.getCurrent().getSystemColor(SWT.COLOR_LIST_FOREGROUND);
- PapyrusParsersPlugin.logError("Undefined color '" + aName + "'"); //$NON-NLS-1$//$NON-NLS-2$
- }
- this.fColorTable.put(aName, color);
- }
- return color;
- }
-
- /**
- * Release all of the color resources held onto by the color provider.
- */
- public void dispose() {
- Iterator<Color> colors = this.fColorTable.values().iterator();
- while (colors.hasNext()) {
- colors.next().dispose();
- }
- }
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/LabelCompletionProcessor.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/LabelCompletionProcessor.java
deleted file mode 100644
index 6a8efecbc47..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/LabelCompletionProcessor.java
+++ /dev/null
@@ -1,272 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.parsers.texteditor;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Vector;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.CompletionProposal;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.text.contentassist.IContextInformation;
-import org.eclipse.jface.text.contentassist.IContextInformationValidator;
-
-/**
- * Completion processor for action language. <BR>
- * Main class to process the different completions given by the texteditor to its user
- *
- * @author Remi SCHNEKENBURGER
- * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor
- * @see com.cea.actionlanguage.sharedresources.texteditor.IPortLabelKeywords
- */
-public class LabelCompletionProcessor implements IContentAssistProcessor {
-
- /**
- *
- */
- protected Map<String, Boolean> modifiersUsed;
-
- /**
- *
- */
- public LabelCompletionProcessor() {
- modifiersUsed = new HashMap<String, Boolean>();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.jface.text.contentassist.IContentAssistProcessor#computeCompletionProposals(org
- * .eclipse.jface.text.ITextViewer, int)
- */
- /**
- *
- *
- * @param viewer
- * @param documentOffset
- *
- * @return
- */
- public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int documentOffset) {
- return new ICompletionProposal[0];
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.jface.text.contentassist.IContentAssistProcessor#computeContextInformation(org
- * .eclipse.jface.text.ITextViewer, int)
- */
- /**
- *
- *
- * @param viewer
- * @param documentOffset
- *
- * @return
- */
- public IContextInformation[] computeContextInformation(ITextViewer viewer, int documentOffset) {
- return new IContextInformation[0];
- }
-
- /*
- * (non-Javadoc) Method declared on IContentAssistProcessor
- */
- /**
- *
- *
- * @return
- */
- public char[] getCompletionProposalAutoActivationCharacters() {
- return new char[] { ':' };
- }
-
- /*
- * (non-Javadoc) Method declared on IContentAssistProcessor
- */
- /**
- *
- *
- * @return
- */
- public char[] getContextInformationAutoActivationCharacters() {
- return new char[] { '#' };
- }
-
- /*
- * (non-Javadoc) Method declared on IContentAssistProcessor
- */
- /**
- *
- *
- * @return
- */
- public IContextInformationValidator getContextInformationValidator() {
- return null;
- }
-
- /*
- * (non-Javadoc) Method declared on IContentAssistProcessor
- */
- /**
- *
- *
- * @return
- */
- public String getErrorMessage() {
- return null;
- }
-
- /**
- * when computing completion proposals, this method retrieves the string on which the user is
- * computing proposals it checks recursively if the character at the precedent offset is also a
- * part of the string (is a Java identifier).
- *
- * @param viewer
- * the text viewer where the current document is shown
- * @param documentOffset
- * the offset on which the end of the calculated string is
- *
- * @return the string that will be completed
- */
- public String getPrefix(ITextViewer viewer, int documentOffset) {
- try {
- if (documentOffset != 0) {
- char c = viewer.getDocument().getChar(documentOffset - 1);
- if (Character.isJavaIdentifierPart(c) || (c == '\'')) {
- return getPrefix(viewer, documentOffset - 1) + c;
- }
- }
- } catch (BadLocationException e) {
- return "";
- }
- return "";
- }
-
-/**
- * when computing completion proposals, this method retrieves the string on
- * which the user is computing proposals it checks recursively if the
- * character at the precedent offset is also a part of the string (is a Java
- * identifier or '<' for Undefined type).
- *
- * @param viewer the text viewer where the current document is shown
- * @param documentOffset the offset on which the end of the calculated string is
- *
- * @return the string that will be completed
- */
- public String getPrefixForType(ITextViewer viewer, int documentOffset) {
- try {
- if (documentOffset != 0) {
- char c = viewer.getDocument().getChar(documentOffset - 1);
- if (Character.isJavaIdentifierPart(c) || (c == '<')) {
- return getPrefixForType(viewer, documentOffset - 1) + c;
- }
- }
- } catch (BadLocationException e) {
- return "";
- }
- return "";
- }
-
- /**
- *
- *
- * @param viewer
- * @param documentOffset
- *
- * @return
- */
- public String getPrefixForMultiplicity(ITextViewer viewer, int documentOffset) {
- try {
- if (documentOffset != 0) {
- char c = viewer.getDocument().getChar(documentOffset - 1);
- if (Character.isJavaIdentifierPart(c) || (c == '[') || (c == '.')) {
- return getPrefixForMultiplicity(viewer, documentOffset - 1) + c;
- }
- }
- } catch (BadLocationException e) {
- return "";
- }
- return "";
- }
-
- /**
- *
- *
- * @param viewer
- * @param selectionRange
- * @param context
- * @param documentOffset
- *
- * @return
- */
- public Collection<ICompletionProposal> computeCompletions(ITextViewer viewer, int context, int documentOffset,
- int selectionRange) {
- return new Vector<ICompletionProposal>();
- }
-
- /**
- *
- *
- * @param proposals
- * @param prefix
- * @param proposalsInfo
- * @param documentOffset
- *
- * @return
- */
- public Collection<ICompletionProposal> createCompletionProposals(String[] proposals, String[] proposalsInfo,
- String prefix, int documentOffset) {
- Vector<ICompletionProposal> v = new Vector<ICompletionProposal>();
- for (int i = 0; i < proposals.length; i++) {
- // test if the proposal starts with the prefix given in parameter
- if (proposals[i].startsWith(prefix)) {
- v.add(new CompletionProposal(proposals[i], documentOffset - prefix.length(), prefix.length(),
- proposals[i].length(), null, proposals[i], null, proposalsInfo[i]));
- }
- }
- return v;
- }
-
- /**
- *
- *
- * @param proposals
- * @param proposalsName
- * @param prefix
- * @param proposalsInfo
- * @param documentOffset
- *
- * @return
- */
- public Collection<ICompletionProposal> createCompletionProposalsWithDifferentName(String[] proposals,
- String[] proposalsInfo, String[] proposalsName, String prefix, int documentOffset) {
- Vector<ICompletionProposal> v = new Vector<ICompletionProposal>();
- for (int i = 0; i < proposals.length; i++) {
- // test if the proposal starts with the prefix given in parameter
- if (proposals[i].startsWith(prefix)) {
-
- v.add(new CompletionProposal(proposals[i], documentOffset - prefix.length(), prefix.length(),
- proposals[i].length(), null, proposalsName[i], null, proposalsInfo[i]));
- }
- }
- return v;
- }
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/LabelContextType.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/LabelContextType.java
deleted file mode 100644
index e933426e369..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/LabelContextType.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.parsers.texteditor;
-
-import org.eclipse.jface.text.templates.GlobalTemplateVariables;
-import org.eclipse.jface.text.templates.TemplateContextType;
-
-/**
- * A simple context type for PropertyUtil label.
- */
-public class LabelContextType extends TemplateContextType {
-
- /**
- * This context's id.
- */
- public static final String PROPERTYLABEL_CONTEXT_TYPE = "com.cea.papyrus.classdiagram.parsers.texteditor.propertylabel.type";
-
- /**
- * The constructor. Creates a new PROPERTY LABEL context type.
- */
- public LabelContextType() {
- addGlobalResolvers();
- }
-
- /**
- * adds a variable resolver to the context type.
- */
- private void addGlobalResolvers() {
- addResolver(new GlobalTemplateVariables.Cursor());
- addResolver(new GlobalTemplateVariables.WordSelection());
- addResolver(new GlobalTemplateVariables.LineSelection());
- addResolver(new GlobalTemplateVariables.Dollar());
- addResolver(new GlobalTemplateVariables.Date());
- addResolver(new GlobalTemplateVariables.Year());
- addResolver(new GlobalTemplateVariables.Time());
- addResolver(new GlobalTemplateVariables.User());
- }
-
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/WhitespaceDetector.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/WhitespaceDetector.java
deleted file mode 100644
index 4fb72cdb56c..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/WhitespaceDetector.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.parsers.texteditor;
-
-import org.eclipse.jface.text.rules.IWhitespaceDetector;
-
-/**
- * Basic whitespace detector for the scanner.<BR>
- * It defines the class by which WhitespaceRule determines whether a given character is to be
- * considered whitespace in the current context.
- *
- * @author Remi SCHNEKENBURGER
- * @see org.eclipse.jface.text.rules.IWhitespaceDetector
- */
-public class WhitespaceDetector implements IWhitespaceDetector {
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.rules.IWhitespaceDetector#isWhitespace(char)
- */
- /**
- *
- *
- * @param character
- *
- * @return
- */
- public boolean isWhitespace(char character) {
- return Character.isWhitespace(character);
- }
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/WordDetector.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/WordDetector.java
deleted file mode 100644
index a8c1ba8c1cb..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/WordDetector.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.parsers.texteditor;
-
-import org.eclipse.jface.text.rules.IWordDetector;
-
-/**
- * Basic word detector for the scanner.<BR>
- *
- * @author Remi SCHNEKENBURGER
- * @see org.eclipse.jface.text.rules.IWordDetector
- */
-public class WordDetector implements IWordDetector {
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.rules.IWordDetector#isWordPart(char)
- */
- /**
- *
- *
- * @param character
- *
- * @return
- */
- public boolean isWordPart(char character) {
- return Character.isLetter(character);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.rules.IWordDetector#isWordStart(char)
- */
- /**
- *
- *
- * @param character
- *
- * @return
- */
- public boolean isWordStart(char character) {
- return Character.isLetter(character);
- }
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/collaborationuselabel/CollaborationUseConfigurationForUML.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/collaborationuselabel/CollaborationUseConfigurationForUML.java
deleted file mode 100644
index e73f310aae4..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/collaborationuselabel/CollaborationUseConfigurationForUML.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - customization for CollaborationUse
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.parsers.texteditor.collaborationuselabel;
-
-import org.eclipse.jface.dialogs.IInputValidator;
-import org.eclipse.jface.text.source.SourceViewerConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.DefaultDirectEditorConfiguration;
-import org.eclipse.papyrus.parsers.modelgenerator.CollaborationUseGenerator;
-import org.eclipse.papyrus.uml.tools.utils.CollaborationUseUtil;
-import org.eclipse.uml2.uml.CollaborationUse;
-
-/**
- * Configuration Class for the direct edition of a UML property
- */
-public class CollaborationUseConfigurationForUML extends DefaultDirectEditorConfiguration {
-
- /** Configuration of the source viewer */
- final private CollaborationUseLabelSourceViewerConfiguration configuration;
-
- /**
- * Creates a new CollaborationUseConfigurationForUML.
- */
- public CollaborationUseConfigurationForUML() {
- configuration = new CollaborationUseLabelSourceViewerConfiguration();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public SourceViewerConfiguration getSourceViewerConfiguration() {
- return configuration;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public String getTextToEdit(Object editedObject) {
- if (editedObject instanceof CollaborationUse) {
- return CollaborationUseUtil.getLabel((CollaborationUse) editedObject);
- }
- return "not a CollaborationUse";
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Object preEditAction(Object objectToEdit) {
- if (objectToEdit instanceof CollaborationUse) {
- configuration.setCollaborationUse((CollaborationUse) objectToEdit);
- }
- return super.preEditAction(objectToEdit);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Object postEditAction(Object editedObject, String text) {
- // Should undo the various creations done in the property edition
- // (template binding, etc...)
- if (editedObject instanceof CollaborationUse) {
- CollaborationUseGenerator generator = new CollaborationUseGenerator(((CollaborationUse) editedObject));
- generator.parseAndModifyCollaborationUse(text);
- }
- return null;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public IInputValidator getInputValidator() {
- return new IInputValidator() {
-
- public String isValid(String newText) {
- if (getObjectToEdit() instanceof CollaborationUse) {
- CollaborationUseGenerator generator = new CollaborationUseGenerator(
- ((CollaborationUse) getObjectToEdit()));
- return generator.parseAndValidateCollaborationUse(newText);
- }
- return null;
- }
- };
- }
-
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/collaborationuselabel/CollaborationUseLabelColorProvider.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/collaborationuselabel/CollaborationUseLabelColorProvider.java
deleted file mode 100644
index d7379e4be40..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/collaborationuselabel/CollaborationUseLabelColorProvider.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - customization for CollaborationUse
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.parsers.texteditor.collaborationuselabel;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.papyrus.parsers.PapyrusParsersPlugin;
-import org.eclipse.papyrus.parsers.preferences.IPreferencesConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * Color provider to syntax highlight.
- */
-public class CollaborationUseLabelColorProvider implements ICollaborationUseLabelColorConstants {
-
- /** Default instance */
- private static CollaborationUseLabelColorProvider instance;
-
- /** Default constructor */
- private CollaborationUseLabelColorProvider() {
- }
-
- /**
- * Get singleton instance
- *
- * @return the default instance
- */
- public static CollaborationUseLabelColorProvider getDefault() {
- if (instance == null) {
- instance = new CollaborationUseLabelColorProvider();
- }
- return instance;
- }
-
- /** Used color table */
- protected Map<String, Color> fColorTable = new HashMap<String, Color>(10);
-
- /**
- * Set default colors in given preference store.
- *
- * @param aStore
- * the preference store
- */
- public static void initializeDefaults(IPreferenceStore aStore) {
- PreferenceConverter.setDefault(aStore, IPreferencesConstants.COLOR_DEFAULT,
- ICollaborationUseLabelColorConstants.RGB_DEFAULT);
- PreferenceConverter.setDefault(aStore, IPreferencesConstants.COLOR_KEYWORD,
- ICollaborationUseLabelColorConstants.RGB_KEYWORD);
- PreferenceConverter.setDefault(aStore, IPreferencesConstants.COLOR_STRING,
- ICollaborationUseLabelColorConstants.RGB_STRING);
- PreferenceConverter.setDefault(aStore, IPreferencesConstants.COLOR_SYMBOL,
- ICollaborationUseLabelColorConstants.RGB_SYMBOL);
- }
-
- /**
- * Returns specified color that is stored in the color table. If color not found in color table
- * then a new instance is created from according preferences value and stored in color table.
- *
- * @param aName
- * the name of the color
- *
- * @return the color instance
- */
- public Color getColor(String aName) {
-
- Color color = fColorTable.get(aName);
- if (color == null) {
- IPreferenceStore store = PapyrusParsersPlugin.getDefault().getPreferenceStore();
-
- PreferenceConverter.setValue(store, IPreferencesConstants.COLOR_SYMBOL,
- ICollaborationUseLabelColorConstants.RGB_SYMBOL);
-
- RGB rgb = PreferenceConverter.getColor(store, IPreferencesConstants.PREFIX_COLOR + aName);
- if (rgb != null) {
- color = new Color(Display.getCurrent(), rgb);
- } else {
- color = Display.getCurrent().getSystemColor(SWT.COLOR_LIST_FOREGROUND);
- PapyrusParsersPlugin.logError("Undefined color '" + aName + "'");
- }
- fColorTable.put(aName, color);
- }
- return color;
- }
-
- /**
- * Release all of the color resources held onto by the color provider.
- */
- public void dispose() {
- Iterator<Color> colors = fColorTable.values().iterator();
- while (colors.hasNext()) {
- colors.next().dispose();
- }
- }
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/collaborationuselabel/CollaborationUseLabelCompletionProcessor.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/collaborationuselabel/CollaborationUseLabelCompletionProcessor.java
deleted file mode 100644
index 59558e9ab49..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/collaborationuselabel/CollaborationUseLabelCompletionProcessor.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - customization for CollaborationUse
- *
- *****************************************************************************/
-package org.eclipse.papyrus.parsers.texteditor.collaborationuselabel;
-
-import java.util.Collection;
-import java.util.Vector;
-
-import org.antlr.runtime.ANTLRStringStream;
-import org.antlr.runtime.CommonTokenStream;
-import org.antlr.runtime.RecognitionException;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.papyrus.parsers.antlr.CollaborationUseLabelLexer;
-import org.eclipse.papyrus.parsers.antlr.CollaborationUseLabelParser;
-import org.eclipse.papyrus.parsers.texteditor.LabelCompletionProcessor;
-import org.eclipse.papyrus.parsers.texteditor.completionproposals.CollaborationCompletionProposalComputer;
-import org.eclipse.papyrus.parsers.texteditor.completionproposals.NameCompletionProposal;
-import org.eclipse.papyrus.parsers.texteditor.completionproposals.VisibilityCompletionProposal;
-import org.eclipse.papyrus.parsers.util.SimpleStringErrorReporter;
-import org.eclipse.uml2.uml.CollaborationUse;
-
-/**
- * Completion processor for action language. <BR>
- * Main class to process the different completions given by the texteditor to its user
- *
- * @author Remi SCHNEKENBURGER
- * @see org.eclipse.jface.text.templates.TemplateCompletionProcessor
- * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor
- * @see com.cea.actionlanguage.sharedresources.texteditor.IPropertyLabelKeywords
- */
-public class CollaborationUseLabelCompletionProcessor extends LabelCompletionProcessor implements IContext {
-
- /** The {@link CollaborationUse} to modify */
- private CollaborationUse collaborationUse;
-
- /**
- * Constructor
- *
- * @param collaborationUse
- * the parsed {@link CollaborationUse}
- */
- public CollaborationUseLabelCompletionProcessor(CollaborationUse collaborationUse) {
- this.collaborationUse = collaborationUse;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.cea.papyrus.classdiagram.parsers.texteditor.LabelCompletionProcessor
- * #computeCompletionProposals(org.eclipse.jface.text.ITextViewer, int)
- */
- /**
- * This method computes completion proposal for currently edited CollaborationUse label.
- *
- * @param viewer
- * @param documentOffset
- *
- * @return completion proposals
- */
- @Override
- public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int documentOffset) {
- String text;
- CollaborationUseLabelLexer lexer = null;
- CollaborationUseLabelParser parser = null;
- Collection<ICompletionProposal> result = null;
- int selectionRange = 0;
-
- try {
- text = viewer.getDocument().get(0, documentOffset);
-
- lexer = new CollaborationUseLabelLexer(new ANTLRStringStream(text));
- CommonTokenStream tokens = new CommonTokenStream(lexer);
-
- parser = new CollaborationUseLabelParser(tokens, collaborationUse, new SimpleStringErrorReporter());
- parser.setValidation(true);
- selectionRange = viewer.getSelectedRange().y;
- parser.label();
-
- result = computeCompletions(viewer, parser.getContext(), documentOffset, selectionRange);
- } catch (BadLocationException e) {
-
- } catch (RuntimeException e) {
- result = computeCompletions(viewer, parser.getContext(), documentOffset, selectionRange);
- } catch (RecognitionException e) {
- result = computeCompletions(viewer, parser.getContext(), documentOffset, selectionRange);
- }
-
- return result.toArray(new ICompletionProposal[] {});
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.cea.papyrus.classdiagram.parsers.texteditor.LabelCompletionProcessor
- * #computeCompletions(org.eclipse.jface.text.ITextViewer, int, int, int)
- */
- /**
- * Compute completion possibilities depending on existing edited label (prefix, it may not be
- * complete).
- *
- * @param viewer
- * @param selectionRange
- * @param context
- * @param documentOffset
- *
- * @return
- */
- @Override
- public Collection<ICompletionProposal> computeCompletions(ITextViewer viewer, int context, int documentOffset,
- int selectionRange) {
- Vector<ICompletionProposal> v = new Vector<ICompletionProposal>();
-
- String prefix = getPrefix(viewer, documentOffset);
- switch (context) {
-
- // DEFAULT : visibility or name
- case IContext.DEFAULT:
- v.addAll(new VisibilityCompletionProposal().generateCompletionProposals(documentOffset, selectionRange,
- prefix));
- v.addAll(new NameCompletionProposal().generateCompletionProposals(documentOffset, selectionRange, prefix));
- break;
-
- // VISIBILITY : name
- case IContext.VISIBILITY:
- v.addAll(new NameCompletionProposal().generateCompletionProposals(documentOffset, selectionRange, prefix));
- break;
-
- // NAME: either ':' or ":undefined"
- case IContext.NAME:
- v.addAll(createCompletionProposalsWithDifferentName(new String[] { ": ", ": <Undefined>" }, new String[] {
- "CollaborationUse type", "Undefined CollaborationUse type" }, new String[] {
- ": <Collaboration Name>", ": <Undefined>" }, "", documentOffset));
- break;
-
- // PROPERTY TYPE (after ":") model types or undefined
- case IContext.AFTER_COLON:
- // create properties visible in the model
- // specific prefix for type... ('<' possible at the beginning)
- prefix = getPrefixForType(viewer, documentOffset);
- // generate completion for TypeUtil
- CollaborationCompletionProposalComputer computer = new CollaborationCompletionProposalComputer();
- computer.setElement(collaborationUse);
- v.addAll(computer.generateCompletionProposals(documentOffset, selectionRange, prefix));
- break;
-
- // MULTIPLICITY: multiplicity or default value or property modifiers
- case IContext.COLLABORATION_USE_TYPE:
- // specific prefix for type... ('<' possible at the beginning)
- prefix = getPrefixForType(viewer, documentOffset);
- computer = new CollaborationCompletionProposalComputer();
- computer.setElement(collaborationUse);
- v.addAll(computer.generateCompletionProposals(documentOffset, selectionRange, prefix));
- break;
- default:
- break;
- }
-
- return v;
- }
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/collaborationuselabel/CollaborationUseLabelScanner.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/collaborationuselabel/CollaborationUseLabelScanner.java
deleted file mode 100644
index 4c4a2a70b88..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/collaborationuselabel/CollaborationUseLabelScanner.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - customization for CollaborationUse
- *
- *****************************************************************************/
-package org.eclipse.papyrus.parsers.texteditor.collaborationuselabel;
-
-import org.eclipse.jface.text.TextAttribute;
-import org.eclipse.jface.text.rules.IRule;
-import org.eclipse.jface.text.rules.IToken;
-import org.eclipse.jface.text.rules.RuleBasedScanner;
-import org.eclipse.jface.text.rules.Token;
-import org.eclipse.jface.text.rules.WhitespaceRule;
-import org.eclipse.jface.text.rules.WordRule;
-import org.eclipse.papyrus.parsers.texteditor.WhitespaceDetector;
-import org.eclipse.papyrus.parsers.texteditor.completionproposals.VisibilityCompletionProposal;
-import org.eclipse.papyrus.parsers.texteditor.propertylabel.PropertyWordDetector;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-
-/**
- * Scanner for the action language.<BR>
- * It implements the interface IALKeywords, which contains the different keywords available in the
- * action language
- *
- * @author Remi SCHNEKENBURGER
- * @see org.eclipse.jface.text.rules.RuleBasedScanner
- * @see com.cea.actionlanguage.sharedresources.texteditor.IRTActionKeywords
- */
-public class CollaborationUseLabelScanner extends RuleBasedScanner implements ICollaborationUseLabelColorConstants {
-
- /** Color for the default token */
- private Color defaultColor;
-
- /** Color for keywords */
- // private Color keywordColor;
-
- /** Color for special chars */
- private Color symbolColor;
-
- /**
- * Creates a new rule based scanner.
- */
- public CollaborationUseLabelScanner() {
- defaultColor = CollaborationUseLabelColorProvider.getDefault().getColor(DEFAULT);
- // keywordColor = CollaborationUseLabelColorProvider.getDefault().getColor(KEYWORD);
- symbolColor = CollaborationUseLabelColorProvider.getDefault().getColor(SYMBOL);
-
- IToken other = new Token(new TextAttribute(defaultColor));
- // IToken keyword = new Token(new TextAttribute(keywordColor, null, SWT.BOLD));
- IToken symbol = new Token(new TextAttribute(symbolColor, null, SWT.BOLD));
-
- IRule[] rules = new IRule[2];
-
- WordRule wordRule = new WordRule(new PropertyWordDetector(), other);
- for (int i = 0; i < VisibilityCompletionProposal.visibilityStrings.length; i++) {
- // wordRule.addWord(getWordWithoutQuotes(visibilityStrings[i]), keyword);
- }
-
- wordRule.addWord("+", symbol);
- wordRule.addWord("-", symbol);
- wordRule.addWord("#", symbol);
- wordRule.addWord("~", symbol);
- wordRule.addWord("/", symbol);
- wordRule.addWord("+/", symbol);
- wordRule.addWord("-/", symbol);
- wordRule.addWord("#/", symbol);
- wordRule.addWord(":", symbol);
-
- rules[0] = wordRule;
- rules[1] = new WhitespaceRule(new WhitespaceDetector());
-
- setRules(rules);
- }
-
- /**
- * returns the word for the scanner, without quotes.
- *
- * @param word
- *
- * @return
- */
- public static String getWordWithoutQuotes(String word) {
- String tmp = "";
- tmp = word.replaceAll("'", "");
- return tmp;
- }
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/collaborationuselabel/CollaborationUseLabelSourceViewerConfiguration.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/collaborationuselabel/CollaborationUseLabelSourceViewerConfiguration.java
deleted file mode 100644
index 88362e0df8b..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/collaborationuselabel/CollaborationUseLabelSourceViewerConfiguration.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - customization for CollaborationUse
- *
- *****************************************************************************/
-package org.eclipse.papyrus.parsers.texteditor.collaborationuselabel;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.TextAttribute;
-import org.eclipse.jface.text.contentassist.ContentAssistant;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.text.contentassist.IContentAssistant;
-import org.eclipse.jface.text.presentation.IPresentationReconciler;
-import org.eclipse.jface.text.presentation.PresentationReconciler;
-import org.eclipse.jface.text.rules.BufferedRuleBasedScanner;
-import org.eclipse.jface.text.rules.DefaultDamagerRepairer;
-import org.eclipse.jface.text.rules.Token;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.jface.text.source.SourceViewerConfiguration;
-import org.eclipse.papyrus.parsers.texteditor.propertylabel.PropertyLabelPartitionScanner;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.uml2.uml.CollaborationUse;
-
-/**
- * This class bundles the configuration space of the action language source viewer. Instances of
- * this class are passed to the configure method of <code>SourceViewer</code>.
- *
- * @see org.eclipse.jface.text.source.SourceViewerConfiguration
- */
-public class CollaborationUseLabelSourceViewerConfiguration extends SourceViewerConfiguration {
-
- /** Edited {@link CollaborationUse} */
- private CollaborationUse collaborationUse;
-
- /**
- * Creates a new CollaborationUseLabelSourceViewerConfiguration
- *
- * @param collaborationUse
- * the {@link CollaborationUse} to edit
- */
- public CollaborationUseLabelSourceViewerConfiguration(CollaborationUse collaborationUse) {
- setCollaborationUse(collaborationUse);
- }
-
- /**
- * Creates a new CollaborationUseLabelSourceViewerConfiguration
- */
- public CollaborationUseLabelSourceViewerConfiguration() {
- this(null);
- }
-
- /**
- * Token scanner
- */
- static class SingleTokenScanner extends BufferedRuleBasedScanner {
-
- /**
- * Constructor
- *
- * @param attribute
- */
- public SingleTokenScanner(TextAttribute attribute) {
- setDefaultReturnToken(new Token(attribute));
- }
- };
-
- /**
- * {@inheritDoc}
- */
- @Override
- public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
- PresentationReconciler reconciler = new PresentationReconciler();
-
- // creating damager/repairer for single line comments
- Color colorString = CollaborationUseLabelColorProvider.getDefault().getColor(
- ICollaborationUseLabelColorConstants.STRING);
- DefaultDamagerRepairer dr = new DefaultDamagerRepairer(new SingleTokenScanner(new TextAttribute(colorString)));
-
- reconciler.setDamager(dr, PropertyLabelPartitionScanner.PROPERTY_MODIFIERS_STRING);
- reconciler.setRepairer(dr, PropertyLabelPartitionScanner.PROPERTY_MODIFIERS_STRING);
-
- // creating damager/repairer for other zones (action language zone)
- dr = new DefaultDamagerRepairer(new CollaborationUseLabelScanner());
- reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE);
- reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE);
-
- return reconciler;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
- ContentAssistant assistant = new ContentAssistant();
-
- IContentAssistProcessor processor = new CollaborationUseLabelCompletionProcessor(collaborationUse);
- assistant.setContentAssistProcessor(processor, IDocument.DEFAULT_CONTENT_TYPE);
-
- // IInformationControlCreator
- assistant.setInformationControlCreator(getInformationControlCreator(sourceViewer));
-
- assistant.enableAutoActivation(true);
- assistant.setAutoActivationDelay(500);
-
- return assistant;
- }
-
- /**
- * Returns the edited {@link CollaborationUse}
- *
- * @return the {@link CollaborationUse} to edit
- */
- public CollaborationUse getCollaborationUse() {
- return collaborationUse;
- }
-
- /**
- * Sets the {@link CollaborationUse} to Edit
- *
- * @param collaborationUse
- * the {@link CollaborationUse} to edit
- */
- public void setCollaborationUse(CollaborationUse collaborationUse) {
- this.collaborationUse = collaborationUse;
- }
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/collaborationuselabel/ICollaborationUseLabelColorConstants.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/collaborationuselabel/ICollaborationUseLabelColorConstants.java
deleted file mode 100644
index deb33fa1270..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/collaborationuselabel/ICollaborationUseLabelColorConstants.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.parsers.texteditor.collaborationuselabel;
-
-import org.eclipse.swt.graphics.RGB;
-
-/**
- * Used colors constants definitions.
- */
-public interface ICollaborationUseLabelColorConstants {
-
- /** DEFAULT definition */
- public final String DEFAULT = "default";
-
- /** KEYWORD definition */
- public final String KEYWORD = "keyword";
-
- /** STRING definition */
- public final String STRING = "string";
-
- /** SYMBOL definition */
- public final String SYMBOL = "symbol";
-
- /** DEFAULT color value definition */
- public final RGB RGB_DEFAULT = new RGB(0, 0, 0);
-
- /** CONSTANT color value definition */
- public final RGB RGB_CONSTANT = new RGB(120, 120, 120);
-
- /** BACKGROUND color value definition */
- public final RGB RGB_BACKGROUND = new RGB(255, 255, 255);
-
- /** KEYWORD color value definition */
- public final RGB RGB_KEYWORD = new RGB(127, 0, 85);
-
- /** STRING color value definition */
- public final RGB RGB_STRING = new RGB(85, 200, 85);
-
- /** SYMBOL color value definition */
- public final RGB RGB_SYMBOL = new RGB(42, 0, 255);
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/collaborationuselabel/IContext.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/collaborationuselabel/IContext.java
deleted file mode 100644
index 1ffff588902..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/collaborationuselabel/IContext.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - customization for CollaborationUse
- *
- *****************************************************************************/
-package org.eclipse.papyrus.parsers.texteditor.collaborationuselabel;
-
-/**
- * Definitions for the parsing context.
- */
-public abstract interface IContext {
-
- /** Default position */
- public static final int DEFAULT = 0;
-
- /** Parsing Visibility */
- public static final int VISIBILITY = 1;
-
- /** Parsing Name */
- public static final int NAME = 2;
-
- /** Parsing before CollaborationUse type */
- public static final int AFTER_COLON = 3;
-
- /** Parsing CollaborationUse type */
- public static final int COLLABORATION_USE_TYPE = 4;
-
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/CollaborationCompletionProposalComputer.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/CollaborationCompletionProposalComputer.java
deleted file mode 100644
index f63c63d8e44..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/CollaborationCompletionProposalComputer.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2008, 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- * Yann TANGUY (CEA LIST) yann.tanguy@cea.fr
- *
- *****************************************************************************/
-package org.eclipse.papyrus.parsers.texteditor.completionproposals;
-
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.Vector;
-
-import org.eclipse.jface.text.contentassist.CompletionProposal;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.papyrus.uml.tools.utils.PackageUtil;
-import org.eclipse.papyrus.uml.tools.utils.TypeUtil;
-import org.eclipse.uml2.uml.Collaboration;
-import org.eclipse.uml2.uml.Element;
-
-/**
- *
- */
-public class CollaborationCompletionProposalComputer implements ICompletionProposalComputer {
-
- /**
- *
- */
- private Element element;
-
- /**
- *
- */
- private static final String UNDEFINED_TYPE = "<Undefined>";
-
- /**
- *
- *
- * @return the element
- */
- public Element getElement() {
- return element;
- }
-
- /**
- *
- *
- * @param element
- * the element to set
- */
- public void setElement(Element element) {
- this.element = element;
- }
-
- /**
- *
- *
- * @param selectionRange
- * @param prefix
- * @param documentOffset
- *
- * @return
- */
- public List<ICompletionProposal> generateCompletionProposals(int documentOffset, int selectionRange, String prefix) {
- Vector<ICompletionProposal> v = new Vector<ICompletionProposal>();
-
- // adds each Completion proposal
- ICompletionProposal proposal = null;
-
- // first, add <Undefined>
- if (UNDEFINED_TYPE.startsWith(prefix)) {
- proposal = new CompletionProposal(UNDEFINED_TYPE, documentOffset - prefix.length(), prefix.length()
- + selectionRange, UNDEFINED_TYPE.length(), null, UNDEFINED_TYPE, null, "Undefined Type");
- v.add(proposal);
- }
-
- if (element != null) {
- // then, all accessible types, by alphabetic order...
- Set<Collaboration> types = computeAccessibleCollaborationList(element);
- // generate the list of types, in alphabetical order
- Iterator<Collaboration> it = types.iterator();
- while (it.hasNext()) {
- Collaboration type = it.next();
- String name = type.getName();
- if (name.startsWith(prefix)) {
- // create a completion processor for the type if prefix
- // corresponds
- proposal = new CompletionProposal(name, documentOffset - prefix.length(), prefix.length()
- + selectionRange, name.length(), null, TypeUtil.getInfoString(type), null, "");
- v.add(proposal);
- }
- }
- }
- return v;
- }
-
- /**
- *
- *
- * @param element
- *
- * @return
- */
- public Set<Collaboration> computeAccessibleCollaborationList(Element element) {
- LinkedHashSet<Collaboration> list = new LinkedHashSet<Collaboration>();
- // adds directly accessible elements
- list.addAll(PackageUtil.getAccessibleCollaborations(element.getNearestPackage()));
-
- // adds all elements
- list.addAll(PackageUtil.getAllCollaborations(element.getNearestPackage()));
-
- return list;
- }
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/DefaultValueCompletionProposal.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/DefaultValueCompletionProposal.java
deleted file mode 100644
index bf587ebe025..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/DefaultValueCompletionProposal.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.parsers.texteditor.completionproposals;
-
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.jface.text.contentassist.CompletionProposal;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-
-/**
- * Completion proposal computer for names.
- */
-public class DefaultValueCompletionProposal implements ICompletionProposalComputer {
-
- /**
- * Text inserted in the editor.
- */
- final static private String[] defaultValueStrings = { "= ", };
-
- /**
- * Text displayed in the information window.
- */
- final static private String[] defaultValueStringsInfo = { "Default value", };
-
- /**
- * Text displayed in the completion area window.
- */
- final static private String[] defaultValueStringsName = { "= <Expression>", };
-
- /*
- * (non-Javadoc)
- *
- * @see
- * com.cea.papyrus.classdiagram.parsers.texteditor.completionproposals.ICompletionProposalComputer
- * #generateCompletionProposals(int, int, java.lang.String)
- */
- /**
- *
- *
- * @param selectionRange
- * @param prefix
- * @param documentOffset
- *
- * @return
- */
- public List<ICompletionProposal> generateCompletionProposals(int documentOffset, int selectionRange, String prefix) {
- Vector<ICompletionProposal> v = new Vector<ICompletionProposal>();
-
- // adds each Completion proposal
- ICompletionProposal proposal = null;
-
- // adds all name (static strings...)
- for (int i = 0; i < defaultValueStrings.length; i++) {
- if (defaultValueStrings[i].startsWith(prefix)) {
- proposal = new CompletionProposal(defaultValueStrings[i], documentOffset - prefix.length(), prefix
- .length()
- + selectionRange, defaultValueStrings[i].length(), null, defaultValueStringsName[i], null,
- defaultValueStringsInfo[i]);
- v.add(proposal);
- }
- }
- return v;
- }
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/DerivedPropertyCompletionProposal.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/DerivedPropertyCompletionProposal.java
deleted file mode 100644
index d9fc5e36205..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/DerivedPropertyCompletionProposal.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.parsers.texteditor.completionproposals;
-
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.jface.text.contentassist.CompletionProposal;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-
-/**
- * Completion proposal computer for visibilities.
- */
-public class DerivedPropertyCompletionProposal implements ICompletionProposalComputer {
-
- /**
- * Text inserted in the editor.
- */
- final static public String[] derivedPropertyStrings = { "/", };
-
- /**
- * Text displayed in the information window.
- */
- final static public String[] derivedPropertyStringsInfo = { "Derived Property", };
-
- /**
- * Text displayed in the completion area window.
- */
- final static public String[] derivedPropertyStringsName = { "/", };
-
- /*
- * (non-Javadoc)
- *
- * @see
- * com.cea.papyrus.classdiagram.parsers.texteditor.completionproposals.ICompletionProposalComputer
- * #generateCompletionProposals(int, int, java.lang.String)
- */
- /**
- *
- *
- * @param selectionRange
- * @param prefix
- * @param documentOffset
- *
- * @return
- */
- public List<ICompletionProposal> generateCompletionProposals(int documentOffset, int selectionRange, String prefix) {
- Vector<ICompletionProposal> v = new Vector<ICompletionProposal>();
-
- // adds each Completion proposal
- ICompletionProposal proposal = null;
-
- // adds all standard multiplicities (static strings...)
- for (int i = 0; i < derivedPropertyStrings.length; i++) {
- if (derivedPropertyStrings[i].startsWith(prefix)) {
- proposal = new CompletionProposal(derivedPropertyStrings[i], documentOffset - prefix.length(), prefix
- .length()
- + selectionRange, derivedPropertyStrings[i].length(), null, derivedPropertyStringsName[i],
- null, derivedPropertyStringsInfo[i]);
- v.add(proposal);
- }
- }
- return v;
- }
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/DirectionCompletionProposal.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/DirectionCompletionProposal.java
deleted file mode 100644
index 0043c20191b..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/DirectionCompletionProposal.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.parsers.texteditor.completionproposals;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.text.contentassist.CompletionProposal;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-
-/**
- * Completion proposal computer for direction.
- */
-public class DirectionCompletionProposal implements ICompletionProposalComputer {
-
- /**
- * Text inserted in the editor.
- */
- final static public String[] directionStrings = { "in", "out", "inout", "return", };
-
- /**
- * Text displayed in the information window.
- */
- final static public String[] directionStringsInfo = { "in direction", "out direction", "inout direction",
- "return direction", };
-
- /**
- * Text displayed in the completion area window.
- */
- final static public String[] directionStringsName = { "in", "out", "inout", "return", };
-
- /*
- * (non-Javadoc)
- *
- * @see
- * com.cea.papyrus.classdiagram.parsers.texteditor.completionproposals.ICompletionProposalComputer
- * #generateCompletionProposals(int, int, java.lang.String)
- */
- /**
- *
- *
- * @param selectionRange
- * @param prefix
- * @param documentOffset
- *
- * @return
- */
- public List<ICompletionProposal> generateCompletionProposals(int documentOffset, int selectionRange, String prefix) {
- List<ICompletionProposal> list = new ArrayList<ICompletionProposal>();
-
- // adds each Completion proposal
- ICompletionProposal proposal = null;
-
- // adds all standard multiplicities (static strings...)
- for (int i = 0; i < directionStrings.length; i++) {
- if (directionStrings[i].startsWith(prefix)) {
- proposal = new CompletionProposal(directionStrings[i], documentOffset - prefix.length(), prefix
- .length()
- + selectionRange, directionStrings[i].length(), null, directionStringsName[i], null,
- directionStringsInfo[i]);
- list.add(proposal);
- }
- }
- return list;
- }
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/ICompletionProposalComputer.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/ICompletionProposalComputer.java
deleted file mode 100644
index 9c287e129da..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/ICompletionProposalComputer.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.parsers.texteditor.completionproposals;
-
-import java.util.List;
-
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-
-/**
- *
- */
-public interface ICompletionProposalComputer {
-
- /** set of text completions */
- /** set of text completions information */
- /**
- * set of text completions text.
- *
- * @param selectionRange
- * @param prefix
- * @param documentOffset
- *
- * @return
- */
-
- // String[] proposals, String[] proposalsInfo, String prefix,
- public List<ICompletionProposal> generateCompletionProposals(int documentOffset, int selectionRange, String prefix);
-
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/MultiplicityCompletionProposal.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/MultiplicityCompletionProposal.java
deleted file mode 100644
index d166bc6d955..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/MultiplicityCompletionProposal.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.parsers.texteditor.completionproposals;
-
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.jface.text.contentassist.CompletionProposal;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-
-/**
- * Completion proposal computer for multiplicity strings.
- */
-public class MultiplicityCompletionProposal implements ICompletionProposalComputer {
-
- /**
- *
- */
- private static final String EMPTY_MULTIPLICITY = "[]";
-
- /**
- * Text inserted in the editor.
- */
- final static private String[] multiplicityStrings = { "[0..1] ", "[0..*] ", "[1] ", "[1..*] ", };
-
- /**
- * Text displayed in the information window.
- */
- final static private String[] multiplicityStringsInfo = { "Multiplicity: [0..1]", "Multiplicity: [0..*]",
- "Multiplicity: [1]", "Multiplicity: [1..*]", };
-
- /**
- * Text displayed in the completion area window.
- */
- final static private String[] multiplicityStringName = { "[0..1]", "[0..*]", "[1]", "[1..*]", };
-
- /*
- * (non-Javadoc)
- *
- * @see
- * com.cea.papyrus.classdiagram.parsers.texteditor.completionproposals.ICompletionProposalComputer
- * #generateCompletionProposals(int, int, java.lang.String)
- */
- /**
- *
- *
- * @param selectionRange
- * @param prefix
- * @param documentOffset
- *
- * @return
- */
- public List<ICompletionProposal> generateCompletionProposals(int documentOffset, int selectionRange, String prefix) {
- Vector<ICompletionProposal> v = new Vector<ICompletionProposal>();
-
- // adds each Completion proposal
- ICompletionProposal proposal = null;
-
- // first, add [] ans set the cursor after left curly
- if (EMPTY_MULTIPLICITY.startsWith(prefix)) {
- proposal = new CompletionProposal(EMPTY_MULTIPLICITY, documentOffset - prefix.length(), prefix.length()
- + selectionRange, 1, null, "[m..n]", null, "Multiplicity");
- v.add(proposal);
- }
-
- // adds all standard multiplicities (static strings...)
- for (int i = 0; i < multiplicityStrings.length; i++) {
- if (multiplicityStrings[i].startsWith(prefix)) {
- proposal = new CompletionProposal(multiplicityStrings[i], documentOffset - prefix.length(), prefix
- .length()
- + selectionRange, multiplicityStrings[i].length(), null, multiplicityStringName[i], null,
- multiplicityStringsInfo[i]);
- v.add(proposal);
- }
- }
- return v;
- }
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/NameCompletionProposal.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/NameCompletionProposal.java
deleted file mode 100644
index 7b737a1bd24..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/NameCompletionProposal.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.parsers.texteditor.completionproposals;
-
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.jface.text.contentassist.CompletionProposal;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-
-/**
- * Completion proposal computer for names.
- */
-public class NameCompletionProposal implements ICompletionProposalComputer {
-
- /**
- * Text inserted in the editor.
- */
- final static private String[] nameStrings = { "", };
-
- /**
- * Text displayed in the information window.
- */
- final static private String[] nameStringsInfo = { "Name of the element", };
-
- /**
- * Text displayed in the completion area window.
- */
- final static private String[] nameStringsName = { "<Name>", };
-
- /*
- * (non-Javadoc)
- *
- * @see
- * com.cea.papyrus.classdiagram.parsers.texteditor.completionproposals.ICompletionProposalComputer
- * #generateCompletionProposals(int, int, java.lang.String)
- */
- /**
- *
- *
- * @param selectionRange
- * @param prefix
- * @param documentOffset
- *
- * @return
- */
- public List<ICompletionProposal> generateCompletionProposals(int documentOffset, int selectionRange, String prefix) {
- Vector<ICompletionProposal> v = new Vector<ICompletionProposal>();
-
- // adds each Completion proposal
- ICompletionProposal proposal = null;
-
- // adds all name (static strings...)
- for (int i = 0; i < nameStrings.length; i++) {
- if (nameStrings[i].startsWith(prefix)) {
- proposal = new CompletionProposal(nameStrings[i], documentOffset - prefix.length(), prefix.length()
- + selectionRange, nameStrings[i].length(), null, nameStringsName[i], null, nameStringsInfo[i]);
- v.add(proposal);
- }
- }
- return v;
- }
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/ParameterModifierProposal.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/ParameterModifierProposal.java
deleted file mode 100644
index 5b8ebcbf12c..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/ParameterModifierProposal.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.parsers.texteditor.completionproposals;
-
-import java.util.List;
-import java.util.Map;
-import java.util.Vector;
-
-import org.eclipse.jface.text.contentassist.CompletionProposal;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-
-/**
- * Completion proposal computer for parameter modifiers strings.
- */
-public class ParameterModifierProposal implements ICompletionProposalComputer {
-
- // vector that keeps modifiers already used (used for completion)
- /**
- *
- */
- public Map<String, Boolean> modifiersUsed;
-
- /**
- *
- *
- * @return the modifiersUsed
- */
- public Map<String, Boolean> getModifiersUsed() {
- return modifiersUsed;
- }
-
- /**
- *
- *
- * @param modifiersUsed
- * the modifiersUsed to set
- */
- public void setModifiersUsed(Map<String, Boolean> modifiersUsed) {
- this.modifiersUsed = modifiersUsed;
- }
-
- /**
- * Text inserted in the editor.
- */
- final static public String[] modifiersStrings = { "ordered", "unique", "nonunique", "exception", "stream", };
-
- /**
- * Text displayed in the information window.
- */
- final static public String[] modifiersStringsInfo = { "Ordered collection property", "No duplicates allowed in the collection", "Duplicates allowed in the collection", "Exception parameter", "Stream parameter", };
-
- /**
- * Text displayed in the completion area window.
- */
- final static public String[] modifiersStringsName = { "ordered", "unique", "nonunique", "exception", "stream", };
-
- /*
- * (non-Javadoc)
- *
- * @see
- * com.cea.papyrus.classdiagram.parsers.texteditor.completionproposals.ICompletionProposalComputer
- * #generateCompletionProposals(int, int, java.lang.String)
- */
- /**
- *
- *
- * @param selectionRange
- * @param prefix
- * @param documentOffset
- *
- * @return
- */
- public List<ICompletionProposal> generateCompletionProposals(int documentOffset, int selectionRange, String prefix) {
- Vector<ICompletionProposal> v = new Vector<ICompletionProposal>();
-
- // adds each Completion proposal
- ICompletionProposal proposal = null;
-
- // adds all standard multiplicities (static strings...)
- for (int i = 0; i < modifiersStrings.length; i++) {
- // test if this modifier is valid (already used or othe contrary has alreday been used.
- if (!getModifiersUsed().get(modifiersStrings[i])) {
- if (modifiersStrings[i].startsWith(prefix)) {
- proposal = new CompletionProposal(modifiersStrings[i], documentOffset - prefix.length(), prefix.length() + selectionRange, modifiersStrings[i].length(), null, modifiersStringsName[i], null, modifiersStringsInfo[i]);
- v.add(proposal);
- }
- }
- }
- return v;
- }
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/ParameterModifiersProposal.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/ParameterModifiersProposal.java
deleted file mode 100644
index 852ee134db3..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/ParameterModifiersProposal.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.parsers.texteditor.completionproposals;
-
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.jface.text.contentassist.CompletionProposal;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-
-/**
- * Completion proposal computer for parameter modifiers strings.
- */
-public class ParameterModifiersProposal implements ICompletionProposalComputer {
-
- /**
- *
- */
- private static final String EMPTY_MODIFIERS = "{}";
-
- /*
- * (non-Javadoc)
- *
- * @see
- * com.cea.papyrus.classdiagram.parsers.texteditor.completionproposals.ICompletionProposalComputer
- * #generateCompletionProposals(int, int, java.lang.String)
- */
- /**
- *
- *
- * @param selectionRange
- * @param prefix
- * @param documentOffset
- *
- * @return
- */
- public List<ICompletionProposal> generateCompletionProposals(int documentOffset, int selectionRange, String prefix) {
- Vector<ICompletionProposal> v = new Vector<ICompletionProposal>();
-
- // adds each Completion proposal
- ICompletionProposal proposal = null;
-
- // first, add [] ans set the cursor after left curly
- if (EMPTY_MODIFIERS.startsWith(prefix)) {
- proposal = new CompletionProposal(EMPTY_MODIFIERS, documentOffset - prefix.length(), prefix.length()
- + selectionRange, 1, null, "{ <ParameterModifiers> }", null, "Parameter modifiers");
- v.add(proposal);
- }
-
- return v;
- }
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/PropertyModifierProposal.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/PropertyModifierProposal.java
deleted file mode 100644
index f7de3b6e652..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/PropertyModifierProposal.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.parsers.texteditor.completionproposals;
-
-import java.util.List;
-import java.util.Map;
-import java.util.Vector;
-
-import org.eclipse.jface.text.contentassist.CompletionProposal;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-
-/**
- * Completion proposal computer for property modifiers strings.
- */
-public class PropertyModifierProposal implements ICompletionProposalComputer {
-
- // vector that keeps modifiers already used (used for completion)
- /**
- *
- */
- public Map<String, Boolean> modifiersUsed;
-
- /**
- *
- *
- * @return the modifiersUsed
- */
- public Map<String, Boolean> getModifiersUsed() {
- return modifiersUsed;
- }
-
- /**
- *
- *
- * @param modifiersUsed
- * the modifiersUsed to set
- */
- public void setModifiersUsed(Map<String, Boolean> modifiersUsed) {
- this.modifiersUsed = modifiersUsed;
- }
-
- /**
- * Text inserted in the editor.
- */
- final static public String[] modifiersStrings = { "readOnly", "union", "ordered", "unique", "nonunique",
- "subsets ", "redefines ", };
-
- /**
- * Text displayed in the information window.
- */
- final static public String[] modifiersStringsInfo = {
- "ReadOnly property",
- "Specifies whether the property is derived as\n " + "the union of all of the properties that are\n"
- + "constrained to subset it. ", "ordered collection property",
- "No duplicates allowed in the collection", "Duplicates allowed in the collection", "Property subset",
- "Property redefinition", };
-
- /**
- * Text displayed in the completion area window.
- */
- final static public String[] modifiersStringsName = { "readOnly", "union", "ordered", "unique", "nonunique",
- "subsets <PropertyName>", "redefines <PropertyName>", };
-
- /*
- * (non-Javadoc)
- *
- * @see
- * com.cea.papyrus.classdiagram.parsers.texteditor.completionproposals.ICompletionProposalComputer
- * #generateCompletionProposals(int, int, java.lang.String)
- */
- /**
- *
- *
- * @param selectionRange
- * @param prefix
- * @param documentOffset
- *
- * @return
- */
- public List<ICompletionProposal> generateCompletionProposals(int documentOffset, int selectionRange, String prefix) {
- Vector<ICompletionProposal> v = new Vector<ICompletionProposal>();
-
- // adds each Completion proposal
- ICompletionProposal proposal = null;
-
- // adds all standard multiplicities (static strings...)
- for (int i = 0; i < modifiersStrings.length; i++) {
- // test if this modifier is valid (already used or othe contrary has alreday been used.
- if (!modifiersUsed.get(modifiersStrings[i])) {
- if (modifiersStrings[i].startsWith(prefix)) {
- proposal = new CompletionProposal(modifiersStrings[i], documentOffset - prefix.length(), prefix
- .length()
- + selectionRange, modifiersStrings[i].length(), null, modifiersStringsName[i], null,
- modifiersStringsInfo[i]);
- v.add(proposal);
- }
- }
- }
- return v;
- }
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/PropertyModifiersProposal.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/PropertyModifiersProposal.java
deleted file mode 100644
index 4ae94e44d00..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/PropertyModifiersProposal.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.parsers.texteditor.completionproposals;
-
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.jface.text.contentassist.CompletionProposal;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-
-/**
- * Completion proposal computer for property modifiers strings.
- */
-public class PropertyModifiersProposal implements ICompletionProposalComputer {
-
- /**
- *
- */
- private static final String EMPTY_MODIFIERS = "{}";
-
- /*
- * (non-Javadoc)
- *
- * @see
- * com.cea.papyrus.classdiagram.parsers.texteditor.completionproposals.ICompletionProposalComputer
- * #generateCompletionProposals(int, int, java.lang.String)
- */
- /**
- *
- *
- * @param selectionRange
- * @param prefix
- * @param documentOffset
- *
- * @return
- */
- public List<ICompletionProposal> generateCompletionProposals(int documentOffset, int selectionRange, String prefix) {
- Vector<ICompletionProposal> v = new Vector<ICompletionProposal>();
-
- // adds each Completion proposal
- ICompletionProposal proposal = null;
-
- // first, add [] ans set the cursor after left curly
- if (EMPTY_MODIFIERS.startsWith(prefix)) {
- proposal = new CompletionProposal(EMPTY_MODIFIERS, documentOffset - prefix.length(), prefix.length()
- + selectionRange, 1, null, "{ <PropertyModifiers> }", null, "Property modifiers");
- v.add(proposal);
- }
-
- return v;
- }
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/PropertyRedefineProposal.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/PropertyRedefineProposal.java
deleted file mode 100644
index 0f201d3942f..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/PropertyRedefineProposal.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2008, 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- * Yann TANGUY (CEA LIST) yann.tanguy@cea.fr
- *
- *****************************************************************************/
-package org.eclipse.papyrus.parsers.texteditor.completionproposals;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.jface.text.contentassist.CompletionProposal;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.papyrus.uml.tools.utils.PropertyUtil;
-import org.eclipse.uml2.uml.Property;
-
-/**
- * Completion proposal computer for multiplicity strings.
- */
-public class PropertyRedefineProposal implements ICompletionProposalComputer {
-
- /**
- *
- *
- * @param property
- */
- public PropertyRedefineProposal(Property property) {
- this.property = property;
- }
-
- /**
- *
- */
- private Property property;
-
- /**
- *
- *
- * @return the property
- */
- public Property getProperty() {
- return property;
- }
-
- /**
- *
- *
- * @param property
- * the property to set
- */
- public void setProperty(Property property) {
- this.property = property;
- }
-
- /*
- * (non-Javadoc)
- *
- * @seecom.cea.papyrus.classdiagram.parsers.texteditor.completionproposals.
- * ICompletionProposalComputer#generateCompletionProposals(int, int, java.lang.String)
- */
- /**
- *
- *
- * @param selectionRange
- * @param prefix
- * @param documentOffset
- *
- * @return
- */
- public List<ICompletionProposal> generateCompletionProposals(int documentOffset, int selectionRange, String prefix) {
- Vector<ICompletionProposal> v = new Vector<ICompletionProposal>();
-
- Iterator<Property> it = PropertyUtil.getRedefinableProperties(property).iterator();
- while (it.hasNext()) {
- Property prop = it.next();
- String name = prop.getName();
-
- if (name.startsWith(prefix)) {
- v
- .add(new CompletionProposal(prop.getName(), documentOffset - prefix.length(), prefix.length()
- + selectionRange, prop.getName().length(), null, prop.getName(), null, prop
- .getQualifiedName()));
- }
- }
- return v;
- }
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/PropertySubsetsProposal.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/PropertySubsetsProposal.java
deleted file mode 100644
index f05de9265c9..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/PropertySubsetsProposal.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2008, 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- * Yann TANGUY (CEA LIST) yann.tanguy@cea.fr
- *
- *****************************************************************************/
-package org.eclipse.papyrus.parsers.texteditor.completionproposals;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.jface.text.contentassist.CompletionProposal;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.papyrus.uml.tools.utils.PropertyUtil;
-import org.eclipse.uml2.uml.Property;
-
-/**
- * Completion proposal computer for multiplicity strings.
- */
-public class PropertySubsetsProposal implements ICompletionProposalComputer {
-
- /**
- *
- *
- * @param property
- */
- public PropertySubsetsProposal(Property property) {
- this.property = property;
- }
-
- /**
- *
- */
- private Property property;
-
- /**
- *
- *
- * @return the property
- */
- public Property getProperty() {
- return property;
- }
-
- /**
- *
- *
- * @param property
- * the property to set
- */
- public void setProperty(Property property) {
- this.property = property;
- }
-
- /*
- * (non-Javadoc)
- *
- * @seecom.cea.papyrus.classdiagram.parsers.texteditor.completionproposals.
- * ICompletionProposalComputer#generateCompletionProposals(int, int, java.lang.String)
- */
- /**
- *
- *
- * @param selectionRange
- * @param prefix
- * @param documentOffset
- *
- * @return
- */
- public List<ICompletionProposal> generateCompletionProposals(int documentOffset, int selectionRange, String prefix) {
- Vector<ICompletionProposal> v = new Vector<ICompletionProposal>();
-
- Iterator<Property> it = PropertyUtil.getSubsettablesProperties(property, true).iterator();
- while (it.hasNext()) {
- Property prop = it.next();
- String name = prop.getName();
-
- if (name.startsWith(prefix)) {
- v
- .add(new CompletionProposal(prop.getName(), documentOffset - prefix.length(), prefix.length()
- + selectionRange, prop.getName().length(), null, prop.getName(), null, prop
- .getQualifiedName()));
- }
- }
- return v;
- }
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/TypeCompletionProposalComputer.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/TypeCompletionProposalComputer.java
deleted file mode 100644
index 0a9465c05ef..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/TypeCompletionProposalComputer.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2008, 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- * Yann TANGUY (CEA LIST) yann.tanguy@cea.fr
- *
- *****************************************************************************/
-package org.eclipse.papyrus.parsers.texteditor.completionproposals;
-
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.Vector;
-
-import org.eclipse.jface.text.contentassist.CompletionProposal;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.papyrus.parsers.texteditor.CompletionFilterSourceViewerConfiguration;
-import org.eclipse.papyrus.parsers.texteditor.CompletionFilterSourceViewerConfiguration.ICompletionFilter;
-import org.eclipse.papyrus.uml.tools.utils.PackageUtil;
-import org.eclipse.papyrus.uml.tools.utils.TemplateSignatureUtil;
-import org.eclipse.papyrus.uml.tools.utils.TypeUtil;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.TemplateableElement;
-import org.eclipse.uml2.uml.Type;
-
-/**
- *
- */
-public class TypeCompletionProposalComputer implements ICompletionProposalComputer {
-
- private static final String UNDEFINED_TYPE = "<Undefined>";
-
- private Element element;
-
- /** set up a filter for choice of values */
- private ICompletionFilter completionFilter;
-
- /** Type of the filtered property */
- private final int propertyType;
-
- /**
- * Instantiates a new type completion proposal computer without active filter
- */
- public TypeCompletionProposalComputer() {
- this.completionFilter = new CompletionFilterSourceViewerConfiguration.NullCompletionFilter();
- this.propertyType = -1;
- }
-
- /**
- * Instantiates a new type completion proposal computer with active filter on property
- *
- * @param completionFilter
- * the i completion filter
- * @param propertyType
- * the property type
- */
- public TypeCompletionProposalComputer(ICompletionFilter completionFilter, int propertyType) {
- this.completionFilter = completionFilter == null ? new CompletionFilterSourceViewerConfiguration.NullCompletionFilter()
- : completionFilter;
- this.propertyType = propertyType;
- }
-
- /**
- *
- *
- * @return the element
- */
- public Element getElement() {
- return element;
- }
-
- /**
- *
- *
- * @param element
- * the element to set
- */
- public void setElement(Element element) {
- this.element = element;
- }
-
- /**
- *
- *
- * @param selectionRange
- * @param prefix
- * @param documentOffset
- *
- * @return
- */
- public List<ICompletionProposal> generateCompletionProposals(int documentOffset, int selectionRange, String prefix) {
- Vector<ICompletionProposal> v = new Vector<ICompletionProposal>();
-
- // adds each Completion proposal
- ICompletionProposal proposal = null;
-
- // first, add <Undefined>
- if (UNDEFINED_TYPE.startsWith(prefix)) {
- proposal = new CompletionProposal(UNDEFINED_TYPE, documentOffset - prefix.length(), prefix.length()
- + selectionRange, UNDEFINED_TYPE.length(), null, UNDEFINED_TYPE, null, "Undefined Type");
- v.add(proposal);
- }
-
- if (element != null) {
- // then, all accessible types, by alphabetic order...
- Set<Type> types = computeAccessibleTypeList(element);
- // generate the list of types, in alphabetical order
- Iterator<Type> it = types.iterator();
- while (it.hasNext()) {
- Type type = it.next();
- if (!completionFilter.filter(propertyType, type)) {
- String name = type.getName();
- if (name != null && name.startsWith(prefix)) {
- // create a completion processor for the type if prefix
- // corresponds
- proposal = new CompletionProposal(name, documentOffset - prefix.length(), prefix.length()
- + selectionRange, name.length(), null, TypeUtil.getInfoString(type), null, "");
- v.add(proposal);
- }
- }
- }
- }
- return v;
- }
-
- /**
- *
- *
- * @param element
- *
- * @return
- */
- public Set<Type> computeAccessibleTypeList(Element element) {
- LinkedHashSet<Type> list = new LinkedHashSet<Type>();
- // adds directly accessible elements
- list.addAll(PackageUtil.getAccessibleTypes(element.getNearestPackage()));
-
- // In the context where element is owned by a template,
- // types declared in the context of the template must also be added
- if (element.getOwner() != null && element.getOwner() instanceof TemplateableElement) {
- TemplateableElement template = (TemplateableElement) element.getOwner();
- if (template.isTemplate()) {
- list.addAll(TemplateSignatureUtil.getAccessibleTypes(template.getOwnedTemplateSignature()));
- }
- }
-
- // adds all elements
- list.addAll(PackageUtil.getAllTypes(element.getNearestPackage()));
-
- return list;
- }
-
- /**
- * Simple comparator for types, based on their names.
- */
- private class TypeNameComparator implements Comparator<Type> {
-
- /**
- *
- *
- * @param o2
- * @param o1
- *
- * @return
- */
- public int compare(Type o1, Type o2) {
- return o1.getName().compareTo(o2.getName());
- }
-
- }
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/VSL_BooleanValue_CompletionProposal.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/VSL_BooleanValue_CompletionProposal.java
deleted file mode 100644
index f918eddc75b..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/VSL_BooleanValue_CompletionProposal.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.parsers.texteditor.completionproposals;
-
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.jface.text.contentassist.CompletionProposal;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.papyrus.parsers.messages.NFPMessages;
-
-public class VSL_BooleanValue_CompletionProposal implements ICompletionProposalComputer {
-
- /** Text inserted in the editor */
- final static private String[] TVL_BooleanValue_Strings = { "true", "false", };
-
- /** Text displayed in the information window */
- final static private String[] TVL_BooleanValue_StringsInfo = { NFPMessages.BooleanValue_True_StringsInfo,
- NFPMessages.BooleanValue_False_StringsInfo, };
-
- /** Text displayed in the completion area window */
- final static private String[] TVL_BooleanValue_StringName = { NFPMessages.BooleanValue_True_StringName,
- NFPMessages.BooleanValue_False_StringName, };
-
- /*
- * (non-Javadoc)
- *
- * @see
- * com.cea.papyrus.classdiagram.parsers.texteditor.completionproposals.ICompletionProposalComputer
- * #generateCompletionProposals(int, int, java.lang.String)
- */
- public List<ICompletionProposal> generateCompletionProposals(int documentOffset, int selectionRange, String prefix) {
- Vector<ICompletionProposal> v = new Vector<ICompletionProposal>();
-
- // adds each Completion proposal
- ICompletionProposal proposal = null;
-
- // adds all name (static strings...)
- for (int i = 0; i < TVL_BooleanValue_Strings.length; i++) {
- if (TVL_BooleanValue_Strings[i].startsWith(prefix)) {
- proposal = new CompletionProposal(TVL_BooleanValue_Strings[i], documentOffset - prefix.length(), prefix
- .length()
- + selectionRange, TVL_BooleanValue_Strings[i].length(), null, TVL_BooleanValue_StringName[i],
- null, TVL_BooleanValue_StringsInfo[i]);
- v.add(proposal);
- }
- }
-
- return v;
- }
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/VSL_DefaultValue_CompletionProposal.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/VSL_DefaultValue_CompletionProposal.java
deleted file mode 100644
index a0e2e112f0c..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/VSL_DefaultValue_CompletionProposal.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.parsers.texteditor.completionproposals;
-
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.jface.text.contentassist.CompletionProposal;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.papyrus.parsers.messages.NFPMessages;
-
-public class VSL_DefaultValue_CompletionProposal implements ICompletionProposalComputer {
-
- /** Text inserted in the editor */
- final static private String[] TVL_DefaultValue_Strings = { "-", };
-
- /** Text displayed in the information window */
- final static private String[] TVL_DefaultValue_StringsInfo = { NFPMessages.DefaultValue_StringsInfo, };
-
- /** Text displayed in the completion area window */
- final static private String[] TVL_DefaultValue_StringName = { NFPMessages.DefaultValue_StringName, };
-
- /*
- * (non-Javadoc)
- *
- * @see
- * com.cea.papyrus.classdiagram.parsers.texteditor.completionproposals.ICompletionProposalComputer
- * #generateCompletionProposals(int, int, java.lang.String)
- */
- public List<ICompletionProposal> generateCompletionProposals(int documentOffset, int selectionRange, String prefix) {
- Vector<ICompletionProposal> v = new Vector<ICompletionProposal>();
-
- // adds each Completion proposal
- ICompletionProposal proposal = null;
-
- // adds all name (static strings...)
- for (int i = 0; i < TVL_DefaultValue_Strings.length; i++) {
- if (TVL_DefaultValue_Strings[i].startsWith(prefix)) {
- proposal = new CompletionProposal(TVL_DefaultValue_Strings[i], documentOffset - prefix.length(), prefix
- .length()
- + selectionRange, TVL_DefaultValue_Strings[i].length(), null, TVL_DefaultValue_StringName[i],
- null, TVL_DefaultValue_StringsInfo[i]);
- v.add(proposal);
- }
- }
-
- return v;
- }
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/VSL_EnumerationLiteral_CompletionProposal.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/VSL_EnumerationLiteral_CompletionProposal.java
deleted file mode 100644
index 23edb6414df..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/VSL_EnumerationLiteral_CompletionProposal.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.parsers.texteditor.completionproposals;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.jface.text.contentassist.CompletionProposal;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.papyrus.parsers.messages.NFPMessages;
-import org.eclipse.uml2.uml.DataType;
-import org.eclipse.uml2.uml.Enumeration;
-import org.eclipse.uml2.uml.EnumerationLiteral;
-
-public class VSL_EnumerationLiteral_CompletionProposal implements ICompletionProposalComputer {
-
- private static ArrayList<String> enumLiterals;
-
- private static Enumeration enumeration;
-
- public void setDataType(DataType datatype) {
- enumeration = (Enumeration) datatype;
- }
-
- // /** Text inserted in the editor */
- // final static private String[] TVL_EnumLiteral_Strings = {
- // "true",
- // "false",
- // };
-
- /** Text displayed in the information window */
- final static private String[] TVL_Enumeration_StringsInfo = { NFPMessages.Enumeration_StringsInfo, };
-
- /** Text displayed in the completion area window */
- final static private String[] TVL_Enumeration_StringName = { NFPMessages.Enumeration_StringName, };
-
- public static void computeTVL_Enumeration_String() {
- enumLiterals = new ArrayList<String>();
-
- if (enumeration != null) {
- Iterator<EnumerationLiteral> iter = enumeration.getOwnedLiterals().iterator();
- while (iter.hasNext()) {
- EnumerationLiteral enumLiteral = iter.next();
- enumLiterals.add(enumLiteral.getName());
- }
- } else {
- enumLiterals.add("<EnumerationLiteral>");
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * com.cea.papyrus.classdiagram.parsers.texteditor.completionproposals.ICompletionProposalComputer
- * #generateCompletionProposals(int, int, java.lang.String)
- */
- public List<ICompletionProposal> generateCompletionProposals(int documentOffset, int selectionRange, String prefix) {
- Vector<ICompletionProposal> v = new Vector<ICompletionProposal>();
-
- // adds each Completion proposal
- ICompletionProposal proposal = null;
- computeTVL_Enumeration_String();
-
- // adds all name (static strings...)
- for (int i = 0; i < enumLiterals.size(); i++) {
- if (enumLiterals.get(i).startsWith(prefix)) {
- proposal = new CompletionProposal(enumLiterals.get(i), documentOffset - prefix.length(), prefix
- .length()
- + selectionRange, enumLiterals.get(i).length(), null, enumLiterals.get(i), null,
- TVL_Enumeration_StringsInfo[0]);
- v.add(proposal);
- }
- }
-
- return v;
- }
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/VSL_Integer_CompletionProposal.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/VSL_Integer_CompletionProposal.java
deleted file mode 100644
index 0352d8b23bd..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/VSL_Integer_CompletionProposal.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.parsers.texteditor.completionproposals;
-
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.jface.text.contentassist.CompletionProposal;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.papyrus.parsers.messages.NFPMessages;
-
-// TODO: DONE: add (+/-) to the grammar in order to be able to handle positive and negative integers. this remark applies to real as well
-// TODO: Integers accept ".". We have to fix this error in the grammar.
-public class VSL_Integer_CompletionProposal implements ICompletionProposalComputer {
-
- /** Text inserted in the editor */
- final static private String[] TVL_Integer_Strings = { "", "0x", };
-
- /** Text displayed in the information window */
- final static private String[] TVL_Integer_StringsInfo = { NFPMessages.Integer_Decimal_StringsInfo,
- NFPMessages.Integer_Hexadecimal_StringsInfo, };
-
- /** Text displayed in the completion area window */
- final static private String[] TVL_Integer_StringName = { NFPMessages.Integer_Decimal_StringName,
- NFPMessages.Integer_Hexadecimal_StringName, };
-
- /*
- * (non-Javadoc)
- *
- * @see
- * com.cea.papyrus.classdiagram.parsers.texteditor.completionproposals.ICompletionProposalComputer
- * #generateCompletionProposals(int, int, java.lang.String)
- */
- public List<ICompletionProposal> generateCompletionProposals(int documentOffset, int selectionRange, String prefix) {
- Vector<ICompletionProposal> v = new Vector<ICompletionProposal>();
-
- // adds each Completion proposal
- ICompletionProposal proposal = null;
-
- // adds all name (static strings...)
- for (int i = 0; i < TVL_Integer_Strings.length; i++) {
- if (TVL_Integer_Strings[i].startsWith(prefix)) {
- proposal = new CompletionProposal(TVL_Integer_Strings[i], documentOffset - prefix.length(), prefix
- .length()
- + selectionRange, TVL_Integer_Strings[i].length(), null, TVL_Integer_StringName[i], null,
- TVL_Integer_StringsInfo[i]);
- v.add(proposal);
- }
- }
-
- return v;
- }
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/VSL_NFP_VS_CompletionProposal.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/VSL_NFP_VS_CompletionProposal.java
deleted file mode 100644
index 4ed75311a6f..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/VSL_NFP_VS_CompletionProposal.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.parsers.texteditor.completionproposals;
-
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.jface.text.contentassist.CompletionProposal;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.papyrus.parsers.messages.NFPMessages;
-
-public class VSL_NFP_VS_CompletionProposal implements ICompletionProposalComputer {
-
- /** Text inserted in the editor */
- final static private String[] TVL_NFP_VS_Strings = { "literal ", "interval ", };
-
- /** Text displayed in the information window */
- final static private String[] TVL_NFP_VS_StringsInfo = { NFPMessages.NFP_VS_Literal_StringsInfo,
- NFPMessages.NFP_VS_Interval_StringsInfo, };
-
- /** Text displayed in the completion area window */
- final static private String[] TVL_NFP_VS_StringName = { NFPMessages.NFP_VS_Literal_StringName,
- NFPMessages.NFP_VS_Interval_StringName, };
-
- /*
- * (non-Javadoc)
- *
- * @see
- * com.cea.papyrus.classdiagram.parsers.texteditor.completionproposals.ICompletionProposalComputer
- * #generateCompletionProposals(int, int, java.lang.String)
- */
- public List<ICompletionProposal> generateCompletionProposals(int documentOffset, int selectionRange, String prefix) {
- Vector<ICompletionProposal> v = new Vector<ICompletionProposal>();
-
- // adds each Completion proposal
- ICompletionProposal proposal = null;
-
- // adds all name (static strings...)
- for (int i = 0; i < TVL_NFP_VS_Strings.length; i++) {
- if (TVL_NFP_VS_Strings[i].startsWith(prefix)) {
- proposal = new CompletionProposal(TVL_NFP_VS_Strings[i], documentOffset - prefix.length(), prefix
- .length()
- + selectionRange, TVL_NFP_VS_Strings[i].length(), null, TVL_NFP_VS_StringName[i], null,
- TVL_NFP_VS_StringsInfo[i]);
- v.add(proposal);
- }
- }
-
- return v;
- }
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/VSL_NullValue_CompletionProposal.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/VSL_NullValue_CompletionProposal.java
deleted file mode 100644
index 3122e6a4e55..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/VSL_NullValue_CompletionProposal.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.parsers.texteditor.completionproposals;
-
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.jface.text.contentassist.CompletionProposal;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.papyrus.parsers.messages.NFPMessages;
-
-public class VSL_NullValue_CompletionProposal implements ICompletionProposalComputer {
-
- /** Text inserted in the editor */
- final static private String[] TVL_NullValue_Strings = { "null", };
-
- /** Text displayed in the information window */
- final static private String[] TVL_NullValue_StringsInfo = { NFPMessages.NullValue_StringsInfo, };
-
- /** Text displayed in the completion area window */
- final static private String[] TVL_NullValue_StringName = { NFPMessages.NullValue_StringName, };
-
- /*
- * (non-Javadoc)
- *
- * @see
- * com.cea.papyrus.classdiagram.parsers.texteditor.completionproposals.ICompletionProposalComputer
- * #generateCompletionProposals(int, int, java.lang.String)
- */
- public List<ICompletionProposal> generateCompletionProposals(int documentOffset, int selectionRange, String prefix) {
- Vector<ICompletionProposal> v = new Vector<ICompletionProposal>();
-
- // adds each Completion proposal
- ICompletionProposal proposal = null;
-
- // adds all name (static strings...)
- for (int i = 0; i < TVL_NullValue_Strings.length; i++) {
- if (TVL_NullValue_Strings[i].startsWith(prefix)) {
- proposal = new CompletionProposal(TVL_NullValue_Strings[i], documentOffset - prefix.length(), prefix
- .length()
- + selectionRange, TVL_NullValue_Strings[i].length(), null, TVL_NullValue_StringName[i], null,
- TVL_NullValue_StringsInfo[i]);
- v.add(proposal);
- }
- }
-
- return v;
- }
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/VSL_NumberLiteral_CompletionProposal.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/VSL_NumberLiteral_CompletionProposal.java
deleted file mode 100644
index c3a39baf4ef..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/VSL_NumberLiteral_CompletionProposal.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.parsers.texteditor.completionproposals;
-
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.jface.text.contentassist.CompletionProposal;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.papyrus.parsers.messages.NFPMessages;
-
-public class VSL_NumberLiteral_CompletionProposal implements ICompletionProposalComputer {
-
- /** Text inserted in the editor */
- final static private String[] TVL_NumberLiteral_Strings = { "", "", };
-
- /** Text displayed in the information window */
- final static private String[] TVL_NumberLiteral_StringsInfo = { NFPMessages.NumberLiteral_Integer_StringsInfo,
- NFPMessages.NumberLiteral_Real_StringsInfo, };
-
- /** Text displayed in the completion area window */
- final static private String[] TVL_NumberLiteral_StringName = { NFPMessages.NumberLiteral_Integer_StringName,
- NFPMessages.NumberLiteral_Real_StringName, };
-
- /*
- * (non-Javadoc)
- *
- * @see
- * com.cea.papyrus.classdiagram.parsers.texteditor.completionproposals.ICompletionProposalComputer
- * #generateCompletionProposals(int, int, java.lang.String)
- */
- public List<ICompletionProposal> generateCompletionProposals(int documentOffset, int selectionRange, String prefix) {
- Vector<ICompletionProposal> v = new Vector<ICompletionProposal>();
-
- // adds each Completion proposal
- ICompletionProposal proposal = null;
-
- // adds all name (static strings...)
- for (int i = 0; i < TVL_NumberLiteral_Strings.length; i++) {
- if (TVL_NumberLiteral_Strings[i].startsWith(prefix)) {
- proposal = new CompletionProposal(TVL_NumberLiteral_Strings[i], documentOffset - prefix.length(),
- prefix.length() + selectionRange, TVL_NumberLiteral_Strings[i].length(), null,
- TVL_NumberLiteral_StringName[i], null, TVL_NumberLiteral_StringsInfo[i]);
- v.add(proposal);
- }
- }
-
- return v;
- }
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/VSL_Real_CompletionProposal.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/VSL_Real_CompletionProposal.java
deleted file mode 100644
index ccb3edd5ad9..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/VSL_Real_CompletionProposal.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.parsers.texteditor.completionproposals;
-
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.jface.text.contentassist.CompletionProposal;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.papyrus.parsers.messages.NFPMessages;
-
-// TODO: handle cases of float and double types
-
-public class VSL_Real_CompletionProposal implements ICompletionProposalComputer {
-
- /** Text inserted in the editor */
- final static private String[] TVL_Real_Strings = { ".", "E-", };
-
- /** Text displayed in the information window */
- final static private String[] TVL_Real_StringsInfo = { NFPMessages.RealPoint_StringsInfo,
- NFPMessages.RealExpo_StringsInfo, };
-
- /** Text displayed in the completion area window */
- final static private String[] TVL_Real_StringsName = { NFPMessages.RealPoint_StringsName,
- NFPMessages.RealExpo_StringsName, };
-
- /*
- * (non-Javadoc)
- *
- * @see
- * com.cea.papyrus.classdiagram.parsers.texteditor.completionproposals.ICompletionProposalComputer
- * #generateCompletionProposals(int, int, java.lang.String)
- */
- public List<ICompletionProposal> generateCompletionProposals(int documentOffset, int selectionRange, String prefix) {
- Vector<ICompletionProposal> v = new Vector<ICompletionProposal>();
-
- // adds each Completion proposal
- ICompletionProposal proposal = null;
- // adds all name (static strings...)
- for (int i = 0; i < TVL_Real_Strings.length; i++) {
- if (TVL_Real_Strings[i].startsWith(prefix)) {
- proposal = new CompletionProposal(TVL_Real_Strings[i], documentOffset - prefix.length(), prefix
- .length()
- + selectionRange, TVL_Real_Strings[i].length(), null, TVL_Real_StringsName[i], null,
- TVL_Real_StringsInfo[i]);
- v.add(proposal);
- }
- }
-
- return v;
- }
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/VSL_StringLiteral_CompletionProposal.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/VSL_StringLiteral_CompletionProposal.java
deleted file mode 100644
index 4c30f20949d..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/VSL_StringLiteral_CompletionProposal.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.parsers.texteditor.completionproposals;
-
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.jface.text.contentassist.CompletionProposal;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.papyrus.parsers.messages.NFPMessages;
-
-public class VSL_StringLiteral_CompletionProposal implements ICompletionProposalComputer {
-
- /** Text inserted in the editor */
- final static private String[] TVL_StringLiteral_Strings = { "\'\'", };
-
- /** Text displayed in the information window */
- final static private String[] TVL_StringLiteral_StringsInfo = { NFPMessages.StringLiteral_StringsInfo, };
-
- /** Text displayed in the completion area window */
- final static private String[] TVL_StringLiteral_StringName = { NFPMessages.StringLiteral_StringName, };
-
- /*
- * (non-Javadoc)
- *
- * @see
- * com.cea.papyrus.classdiagram.parsers.texteditor.completionproposals.ICompletionProposalComputer
- * #generateCompletionProposals(int, int, java.lang.String)
- */
- public List<ICompletionProposal> generateCompletionProposals(int documentOffset, int selectionRange, String prefix) {
- Vector<ICompletionProposal> v = new Vector<ICompletionProposal>();
-
- // adds each Completion proposal
- ICompletionProposal proposal = null;
-
- // adds all name (static strings...)
- for (int i = 0; i < TVL_StringLiteral_Strings.length; i++) {
- if (TVL_StringLiteral_Strings[i].startsWith(prefix)) {
- proposal = new CompletionProposal(TVL_StringLiteral_Strings[i], documentOffset - prefix.length(),
- prefix.length() + selectionRange, TVL_StringLiteral_Strings[i].length() - 1, null,
- TVL_StringLiteral_StringName[i], null, TVL_StringLiteral_StringsInfo[i]);
- v.add(proposal);
- }
- }
-
- return v;
- }
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/VSL_Tuple_CompletionProposal.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/VSL_Tuple_CompletionProposal.java
deleted file mode 100644
index 9aa3e4fda5d..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/VSL_Tuple_CompletionProposal.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.parsers.texteditor.completionproposals;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.jface.text.contentassist.CompletionProposal;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.papyrus.parsers.messages.NFPMessages;
-import org.eclipse.uml2.uml.DataType;
-import org.eclipse.uml2.uml.Property;
-
-public class VSL_Tuple_CompletionProposal implements ICompletionProposalComputer {
-
- private static DataType dataType;
-
- private static String tupleTypeString;
-
- public void setDataType(DataType datatype) {
- dataType = datatype;
- }
-
- /**
- *
- * @return returns the string containing properties of the data type for completion
- */
- public static String computeTVL_Tuple_String() {
- String tupleString = "(";
- tupleTypeString = "(";
- // if datatype is defined
- if (dataType != null) {
- if (dataType.getOwnedAttributes().size() > 0) {
- Iterator<Property> propIter = dataType.getAllAttributes().iterator();
- while (propIter.hasNext()) {
- Property prop = propIter.next();
- DataType propType = (DataType) prop.getType();
- tupleString += prop.getName() + "=";
- if (prop.getDefault() != null) {
- tupleString += prop.getDefault();
- }
- tupleString += " , ";
- tupleTypeString += prop.getName() + ": " + propType.getName() + ", ";
- }
- } else {
- tupleString = dataType.getName();
- }
- }
-
- tupleString = tupleString.substring(0, tupleString.length() - 3);
- tupleString += ")";
- tupleTypeString = tupleTypeString.substring(0, tupleTypeString.length() - 2);
- tupleTypeString += ")";
- return tupleString;
- }
-
- /** Text inserted in the editor */
- /*
- * final static private String[] TVL_Tuple_Strings = { computeTVL_Tuple_String(), };
- */
-
- /** Text displayed in the information window */
- final static private String[] TVL_Tuple_StringsInfo = { NFPMessages.Tuple_StringsInfo, };
-
- /** Text displayed in the completion area window */
- final static private String[] TVL_Tuple_StringName = { NFPMessages.Tuple_StringName, };
-
- /*
- * (non-Javadoc)
- *
- * @see
- * com.cea.papyrus.classdiagram.parsers.texteditor.completionproposals.ICompletionProposalComputer
- * #generateCompletionProposals(int, int, java.lang.String)
- */
- public List<ICompletionProposal> generateCompletionProposals(int documentOffset, int selectionRange, String prefix) {
- Vector<ICompletionProposal> v = new Vector<ICompletionProposal>();
-
- // adds each Completion proposal
- ICompletionProposal proposal = null;
- String tupleString = computeTVL_Tuple_String();
- if (tupleString.startsWith(prefix)) {
- proposal = new CompletionProposal(tupleString, documentOffset - prefix.length(), prefix.length()
- + selectionRange, tupleString.length() - 1, null, tupleTypeString, null, TVL_Tuple_StringsInfo[0]);
- v.add(proposal);
- }
- return v;
- }
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/VSL_UnlimitedNatural_CompletionProposal.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/VSL_UnlimitedNatural_CompletionProposal.java
deleted file mode 100644
index 3d534abd137..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/VSL_UnlimitedNatural_CompletionProposal.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.parsers.texteditor.completionproposals;
-
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.jface.text.contentassist.CompletionProposal;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.papyrus.parsers.messages.NFPMessages;
-
-//unlimited natural
-// TODO: To change the symbol of Infinity='*' (UML2 & MARTE) because it conflict with multiplication operator
-public class VSL_UnlimitedNatural_CompletionProposal implements ICompletionProposalComputer {
-
- /** Text inserted in the editor */
- final static private String[] TVL_UnlimitedNatural_Strings = { "", "0x", "*", };
-
- /** Text displayed in the information window */
- final static private String[] TVL_UnlimitedNatural_StringsInfo = {
- NFPMessages.UnlimitedNatural_Decimal_StringsInfo, NFPMessages.UnlimitedNatural_Hexadecimal_StringsInfo,
- NFPMessages.UnlimitedNatural_Star_StringsInfo, };
-
- /** Text displayed in the completion area window */
- final static private String[] TVL_UnlimitedNatural_StringName = { NFPMessages.UnlimitedNatural_Decimal_StringName,
- NFPMessages.UnlimitedNatural_Hexadecimal_StringName, NFPMessages.UnlimitedNatural_Star_StringName, };
-
- /*
- * (non-Javadoc)
- *
- * @see
- * com.cea.papyrus.classdiagram.parsers.texteditor.completionproposals.ICompletionProposalComputer
- * #generateCompletionProposals(int, int, java.lang.String)
- */
- public List<ICompletionProposal> generateCompletionProposals(int documentOffset, int selectionRange, String prefix) {
- Vector<ICompletionProposal> v = new Vector<ICompletionProposal>();
-
- // adds each Completion proposal
- ICompletionProposal proposal = null;
-
- // adds all name (static strings...)
- for (int i = 0; i < TVL_UnlimitedNatural_Strings.length; i++) {
- if (TVL_UnlimitedNatural_Strings[i].startsWith(prefix)) {
- proposal = new CompletionProposal(TVL_UnlimitedNatural_Strings[i], documentOffset - prefix.length(),
- prefix.length() + selectionRange, TVL_UnlimitedNatural_Strings[i].length(), null,
- TVL_UnlimitedNatural_StringName[i], null, TVL_UnlimitedNatural_StringsInfo[i]);
- v.add(proposal);
- }
- }
-
- return v;
- }
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/VisibilityCompletionProposal.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/VisibilityCompletionProposal.java
deleted file mode 100644
index 8dfbd352a49..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/completionproposals/VisibilityCompletionProposal.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.parsers.texteditor.completionproposals;
-
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.jface.text.contentassist.CompletionProposal;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-
-/**
- * Completion proposal computer for visibilities.
- */
-public class VisibilityCompletionProposal implements ICompletionProposalComputer {
-
- /**
- * Text inserted in the editor.
- */
- final static public String[] visibilityStrings = { "+", "-", "#", "~", };
-
- /**
- * Text displayed in the information window.
- */
- final static public String[] visibilityStringsInfo = { "Public visibility", "Private visibility",
- "Protected visibility", "Package visibility", };
-
- /**
- * Text displayed in the completion area window.
- */
- final static public String[] visibilityStringsName = { "+", "-", "#", "~", };
-
- /*
- * (non-Javadoc)
- *
- * @see
- * com.cea.papyrus.classdiagram.parsers.texteditor.completionproposals.ICompletionProposalComputer
- * #generateCompletionProposals(int, int, java.lang.String)
- */
- /**
- *
- *
- * @param selectionRange
- * @param prefix
- * @param documentOffset
- *
- * @return
- */
- public List<ICompletionProposal> generateCompletionProposals(int documentOffset, int selectionRange, String prefix) {
- Vector<ICompletionProposal> v = new Vector<ICompletionProposal>();
-
- // adds each Completion proposal
- ICompletionProposal proposal = null;
-
- // adds all standard multiplicities (static strings...)
- for (int i = 0; i < visibilityStrings.length; i++) {
- if (visibilityStrings[i].startsWith(prefix)) {
- proposal = new CompletionProposal(visibilityStrings[i], documentOffset - prefix.length(), prefix
- .length()
- + selectionRange, visibilityStrings[i].length(), null, visibilityStringsName[i], null,
- visibilityStringsInfo[i]);
- v.add(proposal);
- }
- }
- return v;
- }
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/parameterlabel/IContext.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/parameterlabel/IContext.java
deleted file mode 100644
index 7b506f887ca..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/parameterlabel/IContext.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - customization for Parameter
- *
- *****************************************************************************/
-package org.eclipse.papyrus.parsers.texteditor.parameterlabel;
-
-/**
- *
- */
-public abstract interface IContext {
-
- /**
- *
- */
- public static final int DEFAULT = 0;
-
- /**
- *
- */
- public static final int VISIBILITY = 1;
-
- /**
- *
- */
- public static final int DIRECTION = 2;
-
- /**
- *
- */
- public static final int NAME = 3;
-
- /**
- *
- */
- public static final int AFTER_COLON = 4;
-
- /**
- *
- */
- public static final int PARAMETER_TYPE = 5;
-
- /**
- *
- */
- public static final int MULTIPLICITY = 6;
-
- /**
- *
- */
- public static final int DEFAULT_VALUE = 7;
-
- /**
- *
- */
- public static final int PARAMETER_MODIFIERS = 8;
-
- /**
- *
- */
- public static final int PARAMETER_MODIFIER = 9;
-
- /**
- *
- */
- public static final int IN_MULTIPLICITY = 10;
-
- /**
- *
- */
- public static final int AFTER_MULTIPLICITY = 11;
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/parameterlabel/IParameterLabelColorConstants.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/parameterlabel/IParameterLabelColorConstants.java
deleted file mode 100644
index 9d54b75f77c..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/parameterlabel/IParameterLabelColorConstants.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - customization for Parameter
- *
- *****************************************************************************/
-package org.eclipse.papyrus.parsers.texteditor.parameterlabel;
-
-import org.eclipse.swt.graphics.RGB;
-
-/**
- * Used colors constants definitions.
- */
-public interface IParameterLabelColorConstants {
-
- /** DEFAULT definition */
- public final String DEFAULT = "default";
-
- /** KEYWORD definition */
- public final String KEYWORD = "keyword";
-
- /** STRING definition */
- public final String STRING = "string";
-
- /** SYMBOL definition */
- public final String SYMBOL = "symbol";
-
- /** DEFAULT color value definition */
- public final RGB RGB_DEFAULT = new RGB(0, 0, 0);
-
- /** CONSTANT color value definition */
- public final RGB RGB_CONSTANT = new RGB(120, 120, 120);
-
- /** BACKGROUND color value definition */
- public final RGB RGB_BACKGROUND = new RGB(255, 255, 255);
-
- /** KEYWORD color value definition */
- public final RGB RGB_KEYWORD = new RGB(127, 0, 85);
-
- /** STRING color value definition */
- public final RGB RGB_STRING = new RGB(85, 200, 85);
-
- /** SYMBOL color value definition */
- public final RGB RGB_SYMBOL = new RGB(42, 0, 255);
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/parameterlabel/ParameterConfigurationForUML.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/parameterlabel/ParameterConfigurationForUML.java
deleted file mode 100644
index 111b83a23db..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/parameterlabel/ParameterConfigurationForUML.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - customization for Parameter
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.parsers.texteditor.parameterlabel;
-
-import org.eclipse.jface.dialogs.IInputValidator;
-import org.eclipse.jface.text.source.SourceViewerConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.DefaultDirectEditorConfiguration;
-import org.eclipse.papyrus.parsers.modelgenerator.ParameterGenerator;
-import org.eclipse.papyrus.uml.tools.utils.NamedElementUtil;
-import org.eclipse.papyrus.uml.tools.utils.ParameterUtil;
-import org.eclipse.uml2.uml.Parameter;
-
-/**
- * Configuration Class for the direct edition of a UML property
- */
-public class ParameterConfigurationForUML extends DefaultDirectEditorConfiguration {
-
- /** Configuration of the source viewer */
- final private ParameterLabelSourceViewerConfiguration configuration;
-
- /**
- * Creates a new ParameterConfigurationForUML.
- */
- public ParameterConfigurationForUML() {
- configuration = new ParameterLabelSourceViewerConfiguration();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public SourceViewerConfiguration getSourceViewerConfiguration() {
- return configuration;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public String getTextToEdit(Object editedObject) {
- if (editedObject instanceof Parameter) {
- return ParameterUtil.getLabel((Parameter) editedObject);
- }
- return "not a Parameter";
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Object preEditAction(Object objectToEdit) {
- if (objectToEdit instanceof Parameter) {
- configuration.setParameter((Parameter) objectToEdit);
- }
- return super.preEditAction(objectToEdit);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Object postEditAction(Object editedObject, String text) {
- // Should undo the various creations done in the property edition
- // (template binding, etc...)
- if (editedObject instanceof Parameter) {
- ParameterGenerator generator = new ParameterGenerator(((Parameter) editedObject));
- generator.parseAndModifyParameter(text);
- }
- return null;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public IInputValidator getInputValidator() {
- return new IInputValidator() {
-
- public String isValid(String newText) {
- if (getObjectToEdit() instanceof Parameter) {
- ParameterGenerator generator = new ParameterGenerator(((Parameter) getObjectToEdit()));
- return generator.parseAndValidateParameter(newText);
- }
- return null;
- }
- };
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Selection getTextSelection(String value, Object editedObject) {
- if (editedObject instanceof Parameter) {
- Parameter parameter = (Parameter) editedObject;
- String name = NamedElementUtil.getName(parameter);
- int start = value.indexOf(name);
- int length = name.length();
- return new Selection(start, length);
- }
- return super.getTextSelection(value, editedObject);
- }
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/parameterlabel/ParameterLabelColorProvider.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/parameterlabel/ParameterLabelColorProvider.java
deleted file mode 100644
index c7582007e13..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/parameterlabel/ParameterLabelColorProvider.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - customization for Parameter
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.parsers.texteditor.parameterlabel;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.papyrus.parsers.PapyrusParsersPlugin;
-import org.eclipse.papyrus.parsers.preferences.IPreferencesConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * Color provider to syntax highlight.
- */
-public class ParameterLabelColorProvider implements IParameterLabelColorConstants {
-
- /** Default instance */
- private static ParameterLabelColorProvider instance;
-
- /** Default constructor */
- private ParameterLabelColorProvider() {
- }
-
- /**
- * Get singleton instance
- *
- * @return the default instance
- */
- public static ParameterLabelColorProvider getDefault() {
- if (instance == null) {
- instance = new ParameterLabelColorProvider();
- }
- return instance;
- }
-
- /** Used color table */
- protected Map<String, Color> fColorTable = new HashMap<String, Color>(10);
-
- /**
- * Set default colors in given preference store.
- *
- * @param aStore
- * the preference store
- */
- public static void initializeDefaults(IPreferenceStore aStore) {
- PreferenceConverter.setDefault(aStore, IPreferencesConstants.COLOR_DEFAULT, IParameterLabelColorConstants.RGB_DEFAULT);
- PreferenceConverter.setDefault(aStore, IPreferencesConstants.COLOR_KEYWORD, IParameterLabelColorConstants.RGB_KEYWORD);
- PreferenceConverter.setDefault(aStore, IPreferencesConstants.COLOR_STRING, IParameterLabelColorConstants.RGB_STRING);
- PreferenceConverter.setDefault(aStore, IPreferencesConstants.COLOR_SYMBOL, IParameterLabelColorConstants.RGB_SYMBOL);
- }
-
- /**
- * Returns specified color that is stored in the color table. If color not found in color table
- * then a new instance is created from according preferences value and stored in color table.
- *
- * @param aName
- * the name of the color
- *
- * @return the color instance
- */
- public Color getColor(String aName) {
-
- Color color = fColorTable.get(aName);
- if (color == null) {
- IPreferenceStore store = PapyrusParsersPlugin.getDefault().getPreferenceStore();
-
- PreferenceConverter.setValue(store, IPreferencesConstants.COLOR_SYMBOL, IParameterLabelColorConstants.RGB_SYMBOL);
-
- RGB rgb = PreferenceConverter.getColor(store, IPreferencesConstants.PREFIX_COLOR + aName);
- if (rgb != null) {
- color = new Color(Display.getCurrent(), rgb);
- } else {
- color = Display.getCurrent().getSystemColor(SWT.COLOR_LIST_FOREGROUND);
- PapyrusParsersPlugin.logError("Undefined color '" + aName + "'");
- }
- fColorTable.put(aName, color);
- }
- return color;
- }
-
- /**
- * Release all of the color resources held onto by the color provider.
- */
- public void dispose() {
- Iterator<Color> colors = fColorTable.values().iterator();
- while (colors.hasNext()) {
- colors.next().dispose();
- }
- }
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/parameterlabel/ParameterLabelCompletionProcessor.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/parameterlabel/ParameterLabelCompletionProcessor.java
deleted file mode 100644
index fd143ac9f45..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/parameterlabel/ParameterLabelCompletionProcessor.java
+++ /dev/null
@@ -1,249 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - customization for Parameter
- *
- *****************************************************************************/
-package org.eclipse.papyrus.parsers.texteditor.parameterlabel;
-
-import java.util.Collection;
-import java.util.Map;
-import java.util.Vector;
-
-import org.antlr.runtime.ANTLRStringStream;
-import org.antlr.runtime.CommonTokenStream;
-import org.antlr.runtime.RecognitionException;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.papyrus.parsers.antlr.ParameterLabelLexer;
-import org.eclipse.papyrus.parsers.antlr.ParameterLabelParser;
-import org.eclipse.papyrus.parsers.texteditor.CompletionFilterSourceViewerConfiguration;
-import org.eclipse.papyrus.parsers.texteditor.CompletionFilterSourceViewerConfiguration.ICompletionFilter;
-import org.eclipse.papyrus.parsers.texteditor.LabelCompletionProcessor;
-import org.eclipse.papyrus.parsers.texteditor.completionproposals.DefaultValueCompletionProposal;
-import org.eclipse.papyrus.parsers.texteditor.completionproposals.DirectionCompletionProposal;
-import org.eclipse.papyrus.parsers.texteditor.completionproposals.MultiplicityCompletionProposal;
-import org.eclipse.papyrus.parsers.texteditor.completionproposals.NameCompletionProposal;
-import org.eclipse.papyrus.parsers.texteditor.completionproposals.ParameterModifierProposal;
-import org.eclipse.papyrus.parsers.texteditor.completionproposals.ParameterModifiersProposal;
-import org.eclipse.papyrus.parsers.texteditor.completionproposals.TypeCompletionProposalComputer;
-import org.eclipse.papyrus.parsers.texteditor.completionproposals.VisibilityCompletionProposal;
-import org.eclipse.papyrus.parsers.util.SimpleStringErrorReporter;
-import org.eclipse.uml2.uml.Parameter;
-
-/**
- * Completion processor for action language. <BR>
- * Main class to process the different completions given by the texteditor to its user
- *
- * @author Remi SCHNEKENBURGER
- * @see org.eclipse.jface.text.templates.TemplateCompletionProcessor
- * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor
- * @see com.cea.actionlanguage.sharedresources.texteditor.IPropertyLabelKeywords
- */
-public class ParameterLabelCompletionProcessor extends LabelCompletionProcessor implements IContext {
-
- /** The completion filter. */
- private final ICompletionFilter completionFilter;
-
- /** The {@link Parameter} to modify */
- private Parameter parameter;
-
- /** The modifiers used. */
- private Map<String, Boolean> modifiersUsed;
-
- /**
- * Constructor
- *
- * @param parameter
- * the parsed {@link Parameter}
- */
- public ParameterLabelCompletionProcessor(Parameter parameter) {
- this.parameter = parameter;
- this.completionFilter = new CompletionFilterSourceViewerConfiguration.NullCompletionFilter();
- }
-
- /**
- * The Constructor.
- *
- * @param property
- * the property
- * @param iCompletionFilter
- * the i completion filter
- */
- public ParameterLabelCompletionProcessor(Parameter parameter, ICompletionFilter iCompletionFilter) {
- this.parameter = parameter;
- this.completionFilter = iCompletionFilter;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.cea.papyrus.classdiagram.parsers.texteditor.LabelCompletionProcessor
- * #computeCompletionProposals(org.eclipse.jface.text.ITextViewer, int)
- */
- /**
- * This method computes completion proposal for currently edited Parameter label.
- *
- * @param viewer
- * @param documentOffset
- *
- * @return completion proposals
- */
- @Override
- public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int documentOffset) {
- String text;
- String prefix = "";
- ParameterLabelLexer lexer = null;
- ParameterLabelParser parser = null;
- Collection<ICompletionProposal> result = null;
- int selectionRange = 0;
-
- try {
- text = viewer.getDocument().get(0, documentOffset);
- lexer = new ParameterLabelLexer(new ANTLRStringStream(text));
- CommonTokenStream tokens = new CommonTokenStream(lexer);
-
- parser = new ParameterLabelParser(tokens, parameter, new SimpleStringErrorReporter());
- parser.setValidation(true);
- selectionRange = viewer.getSelectedRange().y;
- parser.label();
- modifiersUsed = parser.getModifiersUsed();
- result = computeCompletions(viewer, parser.getContext(), documentOffset, selectionRange);
- } catch (BadLocationException e) {
- e.printStackTrace();
- } catch (RuntimeException e) {
- modifiersUsed = parser.getModifiersUsed();
- prefix = getPrefix(viewer, documentOffset);
- result = computeCompletions(viewer, parser.getContext(), documentOffset, selectionRange);
- } catch (RecognitionException e) {
- modifiersUsed = parser.getModifiersUsed();
- prefix = getPrefix(viewer, documentOffset);
- result = computeCompletions(viewer, parser.getContext(), documentOffset, selectionRange);
- }
-
- return result.toArray(new ICompletionProposal[] {});
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.cea.papyrus.classdiagram.parsers.texteditor.LabelCompletionProcessor
- * #computeCompletions(org.eclipse.jface.text.ITextViewer, int, int, int)
- */
- /**
- * Compute completion possibilities depending on existing edited label (prefix, it may not be
- * complete).
- *
- * @param viewer
- * @param selectionRange
- * @param context
- * @param documentOffset
- *
- * @return
- */
- @Override
- public Collection<ICompletionProposal> computeCompletions(ITextViewer viewer, int context, int documentOffset, int selectionRange) {
- Vector<ICompletionProposal> v = new Vector<ICompletionProposal>();
- ParameterModifierProposal modifierProposalComputer = new ParameterModifierProposal();
- modifierProposalComputer.setModifiersUsed(modifiersUsed);
-
- String prefix = getPrefix(viewer, documentOffset);
- switch (context) {
-
- // DEFAULT : visibility or direction or name
- case IContext.DEFAULT:
- v.addAll(new VisibilityCompletionProposal().generateCompletionProposals(documentOffset, selectionRange, prefix));
- v.addAll(new DirectionCompletionProposal().generateCompletionProposals(documentOffset, selectionRange, prefix));
- v.addAll(new NameCompletionProposal().generateCompletionProposals(documentOffset, selectionRange, prefix));
- break;
-
- // VISIBILITY : direction or name
- case IContext.VISIBILITY:
- v.addAll(new DirectionCompletionProposal().generateCompletionProposals(documentOffset, selectionRange, prefix));
- v.addAll(new NameCompletionProposal().generateCompletionProposals(documentOffset, selectionRange, prefix));
- break;
-
- // DIRECTION : name
- case IContext.DIRECTION:
- v.addAll(new NameCompletionProposal().generateCompletionProposals(documentOffset, selectionRange, prefix));
- break;
-
- // NAME: either ':' or ":undefined"
- case IContext.NAME:
- v.addAll(createCompletionProposalsWithDifferentName(new String[] { ": ", ": <Undefined>" }, new String[] { "Parameter type", "Undefined Parameter type" }, new String[] { ": <Type Name>", ": <Undefined>" }, "", documentOffset));
- break;
-
- // PROPERTY TYPE (after ":") model types or undefined
- case IContext.AFTER_COLON:
- // create properties visible in the model
- // specific prefix for type... ('<' possible at the beginning)
- prefix = getPrefixForType(viewer, documentOffset);
- // generate completion for TypeUtil
- TypeCompletionProposalComputer computer = new TypeCompletionProposalComputer(completionFilter, IContext.AFTER_COLON);
- computer.setElement(parameter);
- v.addAll(computer.generateCompletionProposals(documentOffset, selectionRange, prefix));
- break;
-
- // MULTIPLICITY: multiplicity or default value or property modifiers
- case IContext.PARAMETER_TYPE:
- // specific prefix for type... ('<' possible at the beginning)
- prefix = getPrefixForType(viewer, documentOffset);
- computer = new TypeCompletionProposalComputer(completionFilter, IContext.PARAMETER_TYPE);
- computer.setElement(parameter);
- v.addAll(computer.generateCompletionProposals(documentOffset, selectionRange, prefix));
- break;
-
- // IN_MULTIPLICITY(after '['): does nothing
- case IContext.MULTIPLICITY:
- // create properties visible in the model
- // specific prefix for type... ('<' possible at the beginning)
- prefix = getPrefixForType(viewer, documentOffset);
- // generate completion for TypeUtil
- computer = new TypeCompletionProposalComputer(completionFilter, IContext.AFTER_COLON);
- computer.setElement(parameter);
- v.addAll(computer.generateCompletionProposals(documentOffset, selectionRange, prefix));
- v.addAll(new MultiplicityCompletionProposal().generateCompletionProposals(documentOffset, selectionRange, prefix));
- v.addAll(new DefaultValueCompletionProposal().generateCompletionProposals(documentOffset, selectionRange, prefix));
- v.addAll(new ParameterModifiersProposal().generateCompletionProposals(documentOffset, selectionRange, prefix));
- break;
-
- // : default value or property modifiers
- case IContext.IN_MULTIPLICITY:
- prefix = getPrefixForMultiplicity(viewer, documentOffset);
- v.addAll(new MultiplicityCompletionProposal().generateCompletionProposals(documentOffset, selectionRange, prefix));
- break;
-
- // AFTER_MULTIPLICITY(after ']')
- case IContext.AFTER_MULTIPLICITY:
- v.addAll(new DefaultValueCompletionProposal().generateCompletionProposals(documentOffset, selectionRange, prefix));
- v.addAll(new ParameterModifiersProposal().generateCompletionProposals(documentOffset, selectionRange, prefix));
- break;
-
- // DEFAULT_VALUE: property modifiers
- case IContext.DEFAULT_VALUE:
- v.addAll(new ParameterModifiersProposal().generateCompletionProposals(documentOffset, selectionRange, prefix));
- break;
-
- case IContext.PARAMETER_MODIFIERS:
- v.addAll(modifierProposalComputer.generateCompletionProposals(documentOffset, selectionRange, prefix));
- break;
-
- case IContext.PARAMETER_MODIFIER:
- v.addAll(modifierProposalComputer.generateCompletionProposals(documentOffset, selectionRange, prefix));
- break;
- default:
- break;
- }
-
- return v;
- }
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/parameterlabel/ParameterLabelPartitionScanner.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/parameterlabel/ParameterLabelPartitionScanner.java
deleted file mode 100644
index 6ecc5be5846..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/parameterlabel/ParameterLabelPartitionScanner.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - customization for Parameter
- *
- *****************************************************************************/
-package org.eclipse.papyrus.parsers.texteditor.parameterlabel;
-
-import org.eclipse.jface.text.rules.IPredicateRule;
-import org.eclipse.jface.text.rules.IToken;
-import org.eclipse.jface.text.rules.MultiLineRule;
-import org.eclipse.jface.text.rules.RuleBasedPartitionScanner;
-import org.eclipse.jface.text.rules.Token;
-
-/**
- * Scanner that splits document into several parts<BR>
- * Two different rules at this time :
- * <ul>
- * <li>RTACTION_STRING</li>
- * <li>Multi line comment</li>
- * </ul>
- * .
- *
- * @author Remi SCHNEKENBURGER
- * @see org.eclipse.jface.text.rules.RuleBasedPartitionScanner
- */
-public class ParameterLabelPartitionScanner extends RuleBasedPartitionScanner {
-
- /**
- *
- */
- public static final String PARAMETER_MODIFIERS_STRING = "_rt_action_string";
-
- /**
- * Creates a partition scanner dedicated to the action language.
- */
- public ParameterLabelPartitionScanner() {
- IToken tagString = new Token(PARAMETER_MODIFIERS_STRING);
- IPredicateRule[] rules = new IPredicateRule[1];
- rules[0] = new MultiLineRule("{", "}", tagString, (char) 0, true);
- setPredicateRules(rules);
- }
-
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/parameterlabel/ParameterLabelScanner.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/parameterlabel/ParameterLabelScanner.java
deleted file mode 100644
index 7e483ac186e..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/parameterlabel/ParameterLabelScanner.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - customization for Parameter
- *
- *****************************************************************************/
-package org.eclipse.papyrus.parsers.texteditor.parameterlabel;
-
-import org.eclipse.jface.text.TextAttribute;
-import org.eclipse.jface.text.rules.IRule;
-import org.eclipse.jface.text.rules.IToken;
-import org.eclipse.jface.text.rules.RuleBasedScanner;
-import org.eclipse.jface.text.rules.Token;
-import org.eclipse.jface.text.rules.WhitespaceRule;
-import org.eclipse.jface.text.rules.WordRule;
-import org.eclipse.papyrus.parsers.texteditor.WhitespaceDetector;
-import org.eclipse.papyrus.parsers.texteditor.completionproposals.ParameterModifierProposal;
-import org.eclipse.papyrus.parsers.texteditor.completionproposals.VisibilityCompletionProposal;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-
-/**
- * Scanner for the action language.<BR>
- * It implements the interface IALKeywords, which contains the different keywords available in the
- * action language
- *
- * @author Remi SCHNEKENBURGER
- * @see org.eclipse.jface.text.rules.RuleBasedScanner
- * @see com.cea.actionlanguage.sharedresources.texteditor.IRTActionKeywords
- */
-public class ParameterLabelScanner extends RuleBasedScanner implements IParameterLabelColorConstants {
-
- /** Color for the default token */
- private Color defaultColor;
-
- /** Color for keywords */
- private Color keywordColor;
-
- /** Color for special chars */
- private Color symbolColor;
-
- /**
- * Creates a new rule based scanner.
- */
- public ParameterLabelScanner() {
- defaultColor = ParameterLabelColorProvider.getDefault().getColor(DEFAULT);
- keywordColor = ParameterLabelColorProvider.getDefault().getColor(KEYWORD);
- symbolColor = ParameterLabelColorProvider.getDefault().getColor(SYMBOL);
-
- IToken other = new Token(new TextAttribute(defaultColor));
- IToken keyword = new Token(new TextAttribute(keywordColor, null, SWT.BOLD));
- IToken symbol = new Token(new TextAttribute(symbolColor, null, SWT.BOLD));
-
- IRule[] rules = new IRule[2];
-
- WordRule wordRule = new WordRule(new ParameterWordDetector(), other);
- for (int i = 0; i < VisibilityCompletionProposal.visibilityStrings.length; i++) {
- // wordRule.addWord(getWordWithoutQuotes(visibilityStrings[i]), keyword);
- }
-
- for (int i = 0; i < ParameterModifierProposal.modifiersStrings.length; i++) {
- wordRule.addWord(ParameterModifierProposal.modifiersStrings[i].trim(), keyword);
- }
-
- wordRule.addWord("+", symbol);
- wordRule.addWord("-", symbol);
- wordRule.addWord("#", symbol);
- wordRule.addWord("~", symbol);
- wordRule.addWord("/", symbol);
- wordRule.addWord("+/", symbol);
- wordRule.addWord("-/", symbol);
- wordRule.addWord("#/", symbol);
- wordRule.addWord(":", symbol);
- wordRule.addWord("in", symbol);
- wordRule.addWord("out", symbol);
- wordRule.addWord("inout", symbol);
- wordRule.addWord("return", symbol);
-
- rules[0] = wordRule;
- rules[1] = new WhitespaceRule(new WhitespaceDetector());
-
- setRules(rules);
- }
-
- /**
- * returns the word for the scanner, without quotes.
- *
- * @param word
- *
- * @return
- */
- public static String getWordWithoutQuotes(String word) {
- String tmp = "";
- tmp = word.replaceAll("'", "");
- return tmp;
- }
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/parameterlabel/ParameterLabelSourceViewerConfiguration.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/parameterlabel/ParameterLabelSourceViewerConfiguration.java
deleted file mode 100644
index b750c7799fc..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/parameterlabel/ParameterLabelSourceViewerConfiguration.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - customization for Parameter
- *
- *****************************************************************************/
-package org.eclipse.papyrus.parsers.texteditor.parameterlabel;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.TextAttribute;
-import org.eclipse.jface.text.contentassist.ContentAssistant;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.text.contentassist.IContentAssistant;
-import org.eclipse.jface.text.presentation.IPresentationReconciler;
-import org.eclipse.jface.text.presentation.PresentationReconciler;
-import org.eclipse.jface.text.rules.BufferedRuleBasedScanner;
-import org.eclipse.jface.text.rules.DefaultDamagerRepairer;
-import org.eclipse.jface.text.rules.Token;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.papyrus.parsers.texteditor.CompletionFilterSourceViewerConfiguration;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.uml2.uml.Parameter;
-
-/**
- * This class bundles the configuration space of the action language source viewer. Instances of
- * this class are passed to the configure method of <code>SourceViewer</code>.
- *
- * @see org.eclipse.jface.text.source.SourceViewerConfiguration
- */
-public class ParameterLabelSourceViewerConfiguration extends CompletionFilterSourceViewerConfiguration {
-
- /** Edited {@link Parameter} */
- private Parameter parameter;
-
- /**
- * Creates a new ParameterLabelSourceViewerConfiguration
- *
- * @param parameter
- * the {@link Parameter} to edit
- */
- public ParameterLabelSourceViewerConfiguration(Parameter parameter) {
- super(null);
- setParameter(parameter);
- }
-
- /**
- * Creates a new ParameterLabelSourceViewerConfiguration
- */
- public ParameterLabelSourceViewerConfiguration() {
- this(null, null);
- }
-
- /**
- * Instantiates a new property label source viewer configuration.
- *
- * @param property
- * the property
- * @param filter
- * the filter
- */
- public ParameterLabelSourceViewerConfiguration(Parameter parameter, ICompletionFilter filter) {
- super(filter);
- setParameter(parameter);
- }
-
- /**
- * @param filter
- */
- public ParameterLabelSourceViewerConfiguration(ICompletionFilter filter) {
- this(null, filter);
- }
-
- /**
- * Token scanner
- */
- static class SingleTokenScanner extends BufferedRuleBasedScanner {
-
- /**
- * Constructor
- *
- * @param attribute
- */
- public SingleTokenScanner(TextAttribute attribute) {
- setDefaultReturnToken(new Token(attribute));
- }
- };
-
- /**
- * {@inheritDoc}
- */
- @Override
- public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
- PresentationReconciler reconciler = new PresentationReconciler();
-
- // creating damager/repairer for single line comments
- Color colorString = ParameterLabelColorProvider.getDefault().getColor(IParameterLabelColorConstants.STRING);
- DefaultDamagerRepairer dr = new DefaultDamagerRepairer(new SingleTokenScanner(new TextAttribute(colorString)));
-
- reconciler.setDamager(dr, ParameterLabelPartitionScanner.PARAMETER_MODIFIERS_STRING);
- reconciler.setRepairer(dr, ParameterLabelPartitionScanner.PARAMETER_MODIFIERS_STRING);
-
- // creating damager/repairer for other zones (action language zone)
- dr = new DefaultDamagerRepairer(new ParameterLabelScanner());
- reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE);
- reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE);
-
- return reconciler;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
- ContentAssistant assistant = new ContentAssistant();
-
- IContentAssistProcessor processor = new ParameterLabelCompletionProcessor(parameter, getFilter());
- assistant.setContentAssistProcessor(processor, IDocument.DEFAULT_CONTENT_TYPE);
-
- // IInformationControlCreator
- assistant.setInformationControlCreator(getInformationControlCreator(sourceViewer));
-
- assistant.enableAutoActivation(true);
- assistant.setAutoActivationDelay(500);
-
- return assistant;
- }
-
- /**
- * Returns the edited {@link Parameter}
- *
- * @return the {@link Parameter} to edit
- */
- public Parameter getParameter() {
- return parameter;
- }
-
- /**
- * Sets the {@link Parameter} to Edit
- *
- * @param collaborationUse
- * the {@link Parameter} to edit
- */
- public void setParameter(Parameter parameter) {
- this.parameter = parameter;
- }
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/parameterlabel/ParameterWordDetector.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/parameterlabel/ParameterWordDetector.java
deleted file mode 100644
index 43ed392d051..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/parameterlabel/ParameterWordDetector.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - customization for Parameter
- *
- *****************************************************************************/
-package org.eclipse.papyrus.parsers.texteditor.parameterlabel;
-
-import org.eclipse.jface.text.rules.IWordDetector;
-
-/**
- * Basic word detector for the scanner.<BR>
- *
- * @author Remi SCHNEKENBURGER
- * @see org.eclipse.jface.text.rules.IWordDetector
- */
-public class ParameterWordDetector implements IWordDetector {
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.rules.IWordDetector#isWordPart(char)
- */
- /**
- *
- *
- * @param character
- *
- * @return
- */
- public boolean isWordPart(char character) {
- Character ch = Character.valueOf(character);
-
- if (ch.compareTo('+') == 0) {
- return true;
- } else if (ch.compareTo('-') == 0) {
- return true;
- } else if (ch.compareTo('#') == 0) {
- return true;
- } else if (ch.compareTo('~') == 0) {
- return true;
- } else if (ch.compareTo('/') == 0) {
- return true;
- } else if (ch.compareTo(':') == 0) {
- return true;
- }
-
- return Character.isLetter(character);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.rules.IWordDetector#isWordStart(char)
- */
- /**
- *
- *
- * @param character
- *
- * @return
- */
- public boolean isWordStart(char character) {
- Character ch = Character.valueOf(character);
-
- if (ch.compareTo('+') == 0) {
- return true;
- } else if (ch.compareTo('-') == 0) {
- return true;
- } else if (ch.compareTo('#') == 0) {
- return true;
- } else if (ch.compareTo('~') == 0) {
- return true;
- } else if (ch.compareTo('/') == 0) {
- return true;
- } else if (ch.compareTo(':') == 0) {
- return true;
- }
- return Character.isLetter(character);
- }
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/propertylabel/IContext.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/propertylabel/IContext.java
deleted file mode 100644
index d60aece9c52..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/propertylabel/IContext.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.parsers.texteditor.propertylabel;
-
-/**
- *
- */
-public abstract interface IContext {
-
- /**
- *
- */
- public static final int DEFAULT = 0;
-
- /**
- *
- */
- public static final int VISIBILITY = 1;
-
- /**
- *
- */
- public static final int IS_DERIVED = 2;
-
- /**
- *
- */
- public static final int NAME = 3;
-
- /**
- *
- */
- public static final int AFTER_COLON = 4;
-
- /**
- *
- */
- public static final int PROPERTY_TYPE = 5;
-
- /**
- *
- */
- public static final int MULTIPLICITY = 6;
-
- /**
- *
- */
- public static final int DEFAULT_VALUE = 7;
-
- /**
- *
- */
- public static final int PROPERTY_MODIFIERS = 8;
-
- /**
- *
- */
- public static final int PROPERTY_MODIFIER = 9;
-
- /**
- *
- */
- public static final int IN_MULTIPLICITY = 10;
-
- /**
- *
- */
- public static final int SUBSET_PROPERTY = 11;
-
- /**
- *
- */
- public static final int REDEFINE_PROPERTY = 12;
-
- /**
- *
- */
- public static final int AFTER_MULTIPLICITY = 13;
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/propertylabel/IPropertyLabelColorConstants.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/propertylabel/IPropertyLabelColorConstants.java
deleted file mode 100644
index 84a231bc9e7..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/propertylabel/IPropertyLabelColorConstants.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.parsers.texteditor.propertylabel;
-
-import org.eclipse.swt.graphics.RGB;
-
-/**
- *
- */
-public interface IPropertyLabelColorConstants {
-
- /**
- *
- */
- public final String DEFAULT = "default";
-
- /**
- *
- */
- public final String KEYWORD = "keyword";
-
- /**
- *
- */
- public final String STRING = "string";
-
- /**
- *
- */
- public final String SYMBOL = "symbol";
-
- /**
- *
- */
- public final RGB RGB_DEFAULT = new RGB(0, 0, 0);
-
- /**
- *
- */
- public final RGB RGB_CONSTANT = new RGB(120, 120, 120);
-
- /**
- *
- */
- public final RGB RGB_BACKGROUND = new RGB(255, 255, 255);
-
- /**
- *
- */
- public final RGB RGB_KEYWORD = new RGB(127, 0, 85);
-
- /**
- *
- */
- public final RGB RGB_STRING = new RGB(85, 200, 85);
-
- /**
- *
- */
- public final RGB RGB_SYMBOL = new RGB(42, 0, 255);
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/propertylabel/PropertyConfigurationForUML.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/propertylabel/PropertyConfigurationForUML.java
deleted file mode 100644
index bc02792a89f..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/propertylabel/PropertyConfigurationForUML.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.parsers.texteditor.propertylabel;
-
-import org.eclipse.jface.dialogs.IInputValidator;
-import org.eclipse.jface.text.source.SourceViewerConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.DefaultDirectEditorConfiguration;
-import org.eclipse.papyrus.parsers.modelgenerator.PropertyGenerator;
-import org.eclipse.papyrus.uml.tools.utils.PropertyUtil;
-import org.eclipse.uml2.uml.Property;
-
-/**
- * Configuration Class for the direct edition of a UML property
- */
-public class PropertyConfigurationForUML extends DefaultDirectEditorConfiguration {
-
- /** configuration of the source viewer */
- final private PropertyLabelSourceViewerConfiguration configuration;
-
- /**
- * Creates a new PropertyConfigurationForUML.
- */
- public PropertyConfigurationForUML() {
- configuration = new PropertyLabelSourceViewerConfiguration();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public SourceViewerConfiguration getSourceViewerConfiguration() {
- return configuration;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public String getTextToEdit(Object editedObject) {
- if (editedObject instanceof Property) {
- return PropertyUtil.getLabel((Property) editedObject);
- }
- return "not a Property";
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Object preEditAction(Object objectToEdit) {
- if (objectToEdit instanceof Property) {
- configuration.setProperty((Property) objectToEdit);
- }
- return super.preEditAction(objectToEdit);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Object postEditAction(Object editedObject, String text) {
- // should undo the various creations done in the property edition
- // (template binding, etc...)
- if (editedObject instanceof Property) {
- PropertyGenerator generator = new PropertyGenerator(((Property) editedObject));
- generator.parseAndModifyProperty(text);
- }
- return null;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public IInputValidator getInputValidator() {
- return new IInputValidator() {
-
- public String isValid(String newText) {
- if (getObjectToEdit() instanceof Property) {
- PropertyGenerator generator = new PropertyGenerator(((Property) getObjectToEdit()));
- return generator.parseAndValidateProperty(newText);
- }
- return null;
- }
- };
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Selection getTextSelection(String value, Object editedObject) {
- if (editedObject instanceof Property) {
- Property property = (Property) editedObject;
- String name = PropertyUtil.getName(property);
- int start = value.indexOf(name);
- int length = name.length();
- return new Selection(start, length);
- }
- return super.getTextSelection(value, editedObject);
- }
-
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/propertylabel/PropertyLabelColorProvider.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/propertylabel/PropertyLabelColorProvider.java
deleted file mode 100644
index 951ca7c9b53..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/propertylabel/PropertyLabelColorProvider.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.parsers.texteditor.propertylabel;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.papyrus.parsers.PapyrusParsersPlugin;
-import org.eclipse.papyrus.parsers.preferences.IPreferencesConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * Color provider to syntax highlight.
- */
-public class PropertyLabelColorProvider implements IPropertyLabelColorConstants {
-
- /**
- *
- */
- private static PropertyLabelColorProvider instance;
-
- /**
- *
- */
- private PropertyLabelColorProvider() {
- }
-
- /**
- *
- *
- * @return
- */
- public static PropertyLabelColorProvider getDefault() {
- if (instance == null) {
- instance = new PropertyLabelColorProvider();
- }
- return instance;
- }
-
- /**
- *
- */
- protected Map<String, Color> fColorTable = new HashMap<String, Color>(10);
-
- /**
- * Set default colors in given preference store.
- *
- * @param aStore
- * the pref store
- */
- public static void initializeDefaults(IPreferenceStore aStore) {
- PreferenceConverter.setDefault(aStore, IPreferencesConstants.COLOR_DEFAULT,
- IPropertyLabelColorConstants.RGB_DEFAULT);
- PreferenceConverter.setDefault(aStore, IPreferencesConstants.COLOR_KEYWORD,
- IPropertyLabelColorConstants.RGB_KEYWORD);
- PreferenceConverter.setDefault(aStore, IPreferencesConstants.COLOR_STRING,
- IPropertyLabelColorConstants.RGB_STRING);
- PreferenceConverter.setDefault(aStore, IPreferencesConstants.COLOR_SYMBOL,
- IPropertyLabelColorConstants.RGB_SYMBOL);
- }
-
- /**
- * Returns specified color that is stored in the color table. If color not found in color table
- * then a new instance is created from according preferences value and stored in color table.
- *
- * @param aName
- * the name of the color
- *
- * @return the color instance
- */
- public Color getColor(String aName) {
-
- Color color = fColorTable.get(aName);
- if (color == null) {
- IPreferenceStore store = PapyrusParsersPlugin.getDefault().getPreferenceStore();
-
- // PreferenceConverter.setValue(store, IPreferencesConstants.COLOR_KEYWORD,
- // ILabelColorConstants.RGB_KEYWORD);
- PreferenceConverter.setValue(store, IPreferencesConstants.COLOR_SYMBOL,
- IPropertyLabelColorConstants.RGB_SYMBOL);
-
- RGB rgb = PreferenceConverter.getColor(store, IPreferencesConstants.PREFIX_COLOR + aName);
- if (rgb != null) {
- color = new Color(Display.getCurrent(), rgb);
- } else {
- color = Display.getCurrent().getSystemColor(SWT.COLOR_LIST_FOREGROUND);
- PapyrusParsersPlugin.logError("Undefined color '" + aName + "'");
- }
- fColorTable.put(aName, color);
- }
- return color;
- }
-
- /**
- * Release all of the color resources held onto by the color provider.
- */
- public void dispose() {
- Iterator colors = fColorTable.values().iterator();
- while (colors.hasNext()) {
- ((Color) colors.next()).dispose();
- }
- }
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/propertylabel/PropertyLabelCompletionProcessor.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/propertylabel/PropertyLabelCompletionProcessor.java
deleted file mode 100644
index a7dc09c6f74..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/propertylabel/PropertyLabelCompletionProcessor.java
+++ /dev/null
@@ -1,244 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.parsers.texteditor.propertylabel;
-
-import java.util.Collection;
-import java.util.Map;
-import java.util.Vector;
-
-import org.antlr.runtime.ANTLRStringStream;
-import org.antlr.runtime.CommonTokenStream;
-import org.antlr.runtime.RecognitionException;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.papyrus.parsers.antlr.PropertyLabelLexer;
-import org.eclipse.papyrus.parsers.antlr.PropertyLabelParser;
-import org.eclipse.papyrus.parsers.texteditor.CompletionFilterSourceViewerConfiguration;
-import org.eclipse.papyrus.parsers.texteditor.CompletionFilterSourceViewerConfiguration.ICompletionFilter;
-import org.eclipse.papyrus.parsers.texteditor.LabelCompletionProcessor;
-import org.eclipse.papyrus.parsers.texteditor.completionproposals.DefaultValueCompletionProposal;
-import org.eclipse.papyrus.parsers.texteditor.completionproposals.DerivedPropertyCompletionProposal;
-import org.eclipse.papyrus.parsers.texteditor.completionproposals.MultiplicityCompletionProposal;
-import org.eclipse.papyrus.parsers.texteditor.completionproposals.NameCompletionProposal;
-import org.eclipse.papyrus.parsers.texteditor.completionproposals.PropertyModifierProposal;
-import org.eclipse.papyrus.parsers.texteditor.completionproposals.PropertyModifiersProposal;
-import org.eclipse.papyrus.parsers.texteditor.completionproposals.PropertyRedefineProposal;
-import org.eclipse.papyrus.parsers.texteditor.completionproposals.PropertySubsetsProposal;
-import org.eclipse.papyrus.parsers.texteditor.completionproposals.TypeCompletionProposalComputer;
-import org.eclipse.papyrus.parsers.texteditor.completionproposals.VisibilityCompletionProposal;
-import org.eclipse.papyrus.parsers.util.SimpleStringErrorReporter;
-import org.eclipse.uml2.uml.Property;
-
-/**
- * Completion processor for action language. <BR>
- * Main class to process the different completions given by the texteditor to its user
- *
- * @author Remi SCHNEKENBURGER
- * @see org.eclipse.jface.text.templates.TemplateCompletionProcessor
- * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor
- * @see com.cea.actionlanguage.sharedresources.texteditor.IPropertyLabelKeywords
- */
-public class PropertyLabelCompletionProcessor extends LabelCompletionProcessor implements IContext {
-
-
- /** The completion filter. */
- private final ICompletionFilter completionFilter;
-
- /** The filtered property */
- private Property property;
-
- /** The modifiers used. */
- private Map<String, Boolean> modifiersUsed;
-
- /**
- * Instantiates a new property label completion processor.
- *
- * @param property
- * the property
- */
- public PropertyLabelCompletionProcessor(Property property) {
- this.property = property;
- this.completionFilter = new CompletionFilterSourceViewerConfiguration.NullCompletionFilter();
- }
-
- /**
- * The Constructor.
- *
- * @param property
- * the property
- * @param iCompletionFilter
- * the i completion filter
- */
- public PropertyLabelCompletionProcessor(Property property, ICompletionFilter iCompletionFilter) {
- this.property = property;
- this.completionFilter = iCompletionFilter;
- }
-
- /**
- * Compute completion proposals.
- *
- * @param viewer
- * the viewer
- * @param documentOffset
- * the document offset
- *
- * @return the i completion proposal[]
- */
- @Override
- public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int documentOffset) {
- String text;
- String prefix = "";
- PropertyLabelLexer lexer = null;
- PropertyLabelParser parser = null;
- Collection<ICompletionProposal> result = null;
- int selectionRange = 0;
-
- try {
- text = viewer.getDocument().get(0, documentOffset);
- lexer = new PropertyLabelLexer(new ANTLRStringStream(text));
- CommonTokenStream tokens = new CommonTokenStream(lexer);
-
- parser = new PropertyLabelParser(tokens, property, new SimpleStringErrorReporter());
- parser.setValidation(true);
- selectionRange = viewer.getSelectedRange().y;
- parser.label();
- modifiersUsed = parser.getModifiersUsed();
- result = computeCompletions(viewer, parser.getContext(), documentOffset, selectionRange);
- } catch (BadLocationException e) {
- e.printStackTrace();
- } catch (RuntimeException e) {
- modifiersUsed = parser.getModifiersUsed();
- prefix = getPrefix(viewer, documentOffset);
- result = computeCompletions(viewer, parser.getContext(), documentOffset, selectionRange);
- } catch (RecognitionException e) {
- modifiersUsed = parser.getModifiersUsed();
- prefix = getPrefix(viewer, documentOffset);
- result = computeCompletions(viewer, parser.getContext(), documentOffset, selectionRange);
- }
-
- return result.toArray(new ICompletionProposal[] {});
- }
-
- /**
- * @see com.cea.papyrus.classdiagram.parsers.texteditor.LabelCompletionProcessor #computeCompletions(org.eclipse.jface.text.ITextViewer, int, int, int)
- */
-
- @Override
- public Collection<ICompletionProposal> computeCompletions(ITextViewer viewer, int context, int documentOffset, int selectionRange) {
- Vector<ICompletionProposal> v = new Vector<ICompletionProposal>();
- PropertyModifierProposal modifierProposalComputer = new PropertyModifierProposal();
- ;
- modifierProposalComputer.setModifiersUsed(modifiersUsed);
-
- String prefix = getPrefix(viewer, documentOffset);
- switch (context) {
-
- // DEFAULT : visibility, isDerived or name
- case IContext.DEFAULT:
- v.addAll(new VisibilityCompletionProposal().generateCompletionProposals(documentOffset, selectionRange, prefix));
- v.addAll(new DerivedPropertyCompletionProposal().generateCompletionProposals(documentOffset, selectionRange, prefix));
- v.addAll(new NameCompletionProposal().generateCompletionProposals(documentOffset, selectionRange, prefix));
- break;
-
- // VISIBILITY : isDerived or name
- case IContext.VISIBILITY:
- v.addAll(new DerivedPropertyCompletionProposal().generateCompletionProposals(documentOffset, selectionRange, prefix));
- v.addAll(new NameCompletionProposal().generateCompletionProposals(documentOffset, selectionRange, prefix));
- break;
-
- // IS_DERIVED: name
- case IContext.IS_DERIVED:
- v.addAll(new NameCompletionProposal().generateCompletionProposals(documentOffset, selectionRange, prefix));
- break;
-
- // NAME: either ':' or ":undefined"
- case IContext.NAME:
- v.addAll(createCompletionProposalsWithDifferentName(new String[] { ": ", ": <Undefined>" }, new String[] { "Property type", "Undefined property type" }, new String[] { ": <Type Name>", ": <Undefined>" }, "", documentOffset));
- break;
-
- // PROPERTY TYPE (after ":") model types or undefined
- case IContext.AFTER_COLON:
- // create properties visible in the model
- // specific prefix for type... ('<' possible at the beginning)
- prefix = getPrefixForType(viewer, documentOffset);
- // generate completion for TypeUtil
- TypeCompletionProposalComputer computer = new TypeCompletionProposalComputer(completionFilter, IContext.AFTER_COLON);
- computer.setElement(property);
- v.addAll(computer.generateCompletionProposals(documentOffset, selectionRange, prefix));
- break;
-
- // MULTIPLICITY: multiplicity or default value or property modifiers
- case IContext.PROPERTY_TYPE:
- // specific prefix for type... ('<' possible at the beginning)
- prefix = getPrefixForType(viewer, documentOffset);
- computer = new TypeCompletionProposalComputer(completionFilter, IContext.PROPERTY_TYPE);
- computer.setElement(property);
- v.addAll(computer.generateCompletionProposals(documentOffset, selectionRange, prefix));
- break;
-
- // IN_MULTIPLICITY(after '['): does nothing
- case IContext.MULTIPLICITY:
- // create properties visible in the model
- // specific prefix for type... ('<' possible at the beginning)
- prefix = getPrefixForType(viewer, documentOffset);
- // generate completion for TypeUtil
- computer = new TypeCompletionProposalComputer(completionFilter, IContext.AFTER_COLON);
- computer.setElement(property);
- v.addAll(computer.generateCompletionProposals(documentOffset, selectionRange, prefix));
- v.addAll(new MultiplicityCompletionProposal().generateCompletionProposals(documentOffset, selectionRange, prefix));
- v.addAll(new DefaultValueCompletionProposal().generateCompletionProposals(documentOffset, selectionRange, prefix));
- v.addAll(new PropertyModifiersProposal().generateCompletionProposals(documentOffset, selectionRange, prefix));
- break;
-
- // : default value or property modifiers
- case IContext.IN_MULTIPLICITY:
- prefix = getPrefixForMultiplicity(viewer, documentOffset);
- v.addAll(new MultiplicityCompletionProposal().generateCompletionProposals(documentOffset, selectionRange, prefix));
- break;
-
- // AFTER_MULTIPLICITY(after ']')
- case IContext.AFTER_MULTIPLICITY:
- v.addAll(new DefaultValueCompletionProposal().generateCompletionProposals(documentOffset, selectionRange, prefix));
- v.addAll(new PropertyModifiersProposal().generateCompletionProposals(documentOffset, selectionRange, prefix));
- break;
-
- // DEFAULT_VALUE: property modifiers
- case IContext.DEFAULT_VALUE:
- v.addAll(new PropertyModifiersProposal().generateCompletionProposals(documentOffset, selectionRange, prefix));
- break;
-
- case IContext.PROPERTY_MODIFIERS:
- v.addAll(modifierProposalComputer.generateCompletionProposals(documentOffset, selectionRange, prefix));
- break;
-
- case IContext.PROPERTY_MODIFIER:
- v.addAll(modifierProposalComputer.generateCompletionProposals(documentOffset, selectionRange, prefix));
- break;
-
- case IContext.SUBSET_PROPERTY:
- v.addAll(new PropertySubsetsProposal(property).generateCompletionProposals(documentOffset, selectionRange, prefix));
- break;
-
- case IContext.REDEFINE_PROPERTY:
- v.addAll(new PropertyRedefineProposal(property).generateCompletionProposals(documentOffset, selectionRange, prefix));
- break;
- default:
- break;
-
- }
- return v;
- }
-
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/propertylabel/PropertyLabelContextType.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/propertylabel/PropertyLabelContextType.java
deleted file mode 100644
index f4b10e65a86..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/propertylabel/PropertyLabelContextType.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.parsers.texteditor.propertylabel;
-
-import org.eclipse.jface.text.templates.GlobalTemplateVariables;
-import org.eclipse.jface.text.templates.TemplateContextType;
-
-/**
- * A simple context type for PropertyUtil label.
- */
-public class PropertyLabelContextType extends TemplateContextType {
-
- /**
- * This context's id.
- */
- public static final String PROPERTYLABEL_CONTEXT_TYPE = "com.cea.papyrus.classdiagram.parsers.texteditor.propertylabel.type";
-
- /**
- * The constructor. Creates a new PROPERTY LABEL context type.
- */
- public PropertyLabelContextType() {
- addGlobalResolvers();
- }
-
- /**
- * adds a variable resolver to the context type.
- */
- private void addGlobalResolvers() {
- addResolver(new GlobalTemplateVariables.Cursor());
- addResolver(new GlobalTemplateVariables.WordSelection());
- addResolver(new GlobalTemplateVariables.LineSelection());
- addResolver(new GlobalTemplateVariables.Dollar());
- addResolver(new GlobalTemplateVariables.Date());
- addResolver(new GlobalTemplateVariables.Year());
- addResolver(new GlobalTemplateVariables.Time());
- addResolver(new GlobalTemplateVariables.User());
- }
-
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/propertylabel/PropertyLabelPartitionScanner.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/propertylabel/PropertyLabelPartitionScanner.java
deleted file mode 100644
index 1b0268e560f..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/propertylabel/PropertyLabelPartitionScanner.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.parsers.texteditor.propertylabel;
-
-import org.eclipse.jface.text.rules.IPredicateRule;
-import org.eclipse.jface.text.rules.IToken;
-import org.eclipse.jface.text.rules.MultiLineRule;
-import org.eclipse.jface.text.rules.RuleBasedPartitionScanner;
-import org.eclipse.jface.text.rules.Token;
-
-/**
- * Scanner that splits document into several parts<BR>
- * Two different rules at this time :
- * <ul>
- * <li>RTACTION_STRING</li>
- * <li>Multi line comment</li>
- * </ul>
- * .
- *
- * @author Remi SCHNEKENBURGER
- * @see org.eclipse.jface.text.rules.RuleBasedPartitionScanner
- */
-public class PropertyLabelPartitionScanner extends RuleBasedPartitionScanner {
-
- /**
- *
- */
- public static final String PROPERTY_MODIFIERS_STRING = "_rt_action_string";
-
- /**
- * Creates a partition scanner dedicated to the action language.
- */
- public PropertyLabelPartitionScanner() {
- IToken tagString = new Token(PROPERTY_MODIFIERS_STRING);
- IPredicateRule[] rules = new IPredicateRule[1];
- rules[0] = new MultiLineRule("{", "}", tagString, (char) 0, true);
- setPredicateRules(rules);
- }
-
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/propertylabel/PropertyLabelScanner.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/propertylabel/PropertyLabelScanner.java
deleted file mode 100644
index abcc0fffb69..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/propertylabel/PropertyLabelScanner.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.parsers.texteditor.propertylabel;
-
-import org.eclipse.jface.text.TextAttribute;
-import org.eclipse.jface.text.rules.IRule;
-import org.eclipse.jface.text.rules.IToken;
-import org.eclipse.jface.text.rules.RuleBasedScanner;
-import org.eclipse.jface.text.rules.Token;
-import org.eclipse.jface.text.rules.WhitespaceRule;
-import org.eclipse.jface.text.rules.WordRule;
-import org.eclipse.papyrus.parsers.texteditor.WhitespaceDetector;
-import org.eclipse.papyrus.parsers.texteditor.completionproposals.DerivedPropertyCompletionProposal;
-import org.eclipse.papyrus.parsers.texteditor.completionproposals.PropertyModifierProposal;
-import org.eclipse.papyrus.parsers.texteditor.completionproposals.VisibilityCompletionProposal;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-
-/**
- * Scanner for the action language.<BR>
- * It implements the interface IALKeywords, which contains the different keywords available in the
- * action language
- *
- * @author Remi SCHNEKENBURGER
- * @see org.eclipse.jface.text.rules.RuleBasedScanner
- * @see com.cea.actionlanguage.sharedresources.texteditor.IRTActionKeywords
- */
-public class PropertyLabelScanner extends RuleBasedScanner implements IPropertyLabelColorConstants {
-
- // Color for the default token
- /**
- *
- */
- private Color defaultColor;
-
- // Color for keywords
- /**
- *
- */
- private Color keywordColor;
-
- // Color for special chars
- /**
- *
- */
- private Color symbolColor;
-
- /**
- * Creates a new rule based scanner.
- */
- public PropertyLabelScanner() {
- defaultColor = PropertyLabelColorProvider.getDefault().getColor(DEFAULT);
- keywordColor = PropertyLabelColorProvider.getDefault().getColor(KEYWORD);
- symbolColor = PropertyLabelColorProvider.getDefault().getColor(SYMBOL);
-
- IToken other = new Token(new TextAttribute(defaultColor));
- IToken keyword = new Token(new TextAttribute(keywordColor, null, SWT.BOLD));
- IToken symbol = new Token(new TextAttribute(symbolColor, null, SWT.BOLD));
-
- IRule[] rules = new IRule[2];
-
- WordRule wordRule = new WordRule(new PropertyWordDetector(), other);
- for (int i = 0; i < VisibilityCompletionProposal.visibilityStrings.length; i++) {
- // wordRule.addWord(getWordWithoutQuotes(visibilityStrings[i]), keyword);
- }
- for (int i = 0; i < DerivedPropertyCompletionProposal.derivedPropertyStrings.length; i++) {
- // wordRule.addWord(getWordWithoutQuotes(isDerivedStrings[i]), keyword);
- }
- for (int i = 0; i < PropertyModifierProposal.modifiersStrings.length; i++) {
- wordRule.addWord(PropertyModifierProposal.modifiersStrings[i].trim(), keyword);
- }
-
- wordRule.addWord("+", symbol);
- wordRule.addWord("-", symbol);
- wordRule.addWord("#", symbol);
- wordRule.addWord("~", symbol);
- wordRule.addWord("/", symbol);
- wordRule.addWord("+/", symbol);
- wordRule.addWord("-/", symbol);
- wordRule.addWord("#/", symbol);
- wordRule.addWord(":", symbol);
-
- rules[0] = wordRule;
- rules[1] = new WhitespaceRule(new WhitespaceDetector());
-
- setRules(rules);
- }
-
- /**
- * returns the word for the scanner, without quotes.
- *
- * @param word
- *
- * @return
- */
- public static String getWordWithoutQuotes(String word) {
- String tmp = "";
- tmp = word.replaceAll("'", "");
- return tmp;
- }
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/propertylabel/PropertyLabelSourceViewerConfiguration.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/propertylabel/PropertyLabelSourceViewerConfiguration.java
deleted file mode 100644
index 412efd85553..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/propertylabel/PropertyLabelSourceViewerConfiguration.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.parsers.texteditor.propertylabel;
-
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.TextAttribute;
-import org.eclipse.jface.text.contentassist.ContentAssistant;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.text.contentassist.IContentAssistant;
-import org.eclipse.jface.text.presentation.IPresentationReconciler;
-import org.eclipse.jface.text.presentation.PresentationReconciler;
-import org.eclipse.jface.text.rules.BufferedRuleBasedScanner;
-import org.eclipse.jface.text.rules.DefaultDamagerRepairer;
-import org.eclipse.jface.text.rules.Token;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.papyrus.parsers.texteditor.CompletionFilterSourceViewerConfiguration;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.uml2.uml.Property;
-
-/**
- * This class bundles the configuration space of the action language source viewer. Instances of
- * this class are passed to the configure method of <code>SourceViewer</code>.
- *
- * @see org.eclipse.jface.text.source.SourceViewerConfiguration
- */
-public class PropertyLabelSourceViewerConfiguration extends CompletionFilterSourceViewerConfiguration {
-
- /** edited PropertyUtil */
- private Property property;
-
- /**
- * Creates a new PropertyLabelSourceViewerConfiguration
- */
- public PropertyLabelSourceViewerConfiguration() {
- this(null, null);
- }
-
- /**
- * Creates a new PropertyLabelSourceViewerConfiguration
- *
- * @param property
- * the property to edit
- */
- public PropertyLabelSourceViewerConfiguration(Property property) {
- super(null);
- setProperty(property);
- }
-
- /**
- * Instantiates a new property label source viewer configuration.
- *
- * @param property
- * the property
- * @param filter
- * the filter
- */
- public PropertyLabelSourceViewerConfiguration(Property property, ICompletionFilter filter) {
- super(filter);
- setProperty(property);
- }
-
- /**
- * @param filter
- */
- public PropertyLabelSourceViewerConfiguration(ICompletionFilter filter) {
- this(null, filter);
- }
-
- /**
- *
- */
- static class SingleTokenScanner extends BufferedRuleBasedScanner {
-
- /**
- *
- *
- * @param attribute
- */
- public SingleTokenScanner(TextAttribute attribute) {
- setDefaultReturnToken(new Token(attribute));
- }
- };
-
- /**
- * {@inheritDoc}
- */
- @Override
- public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
- PresentationReconciler reconciler = new PresentationReconciler();
-
- // creating damager/repairer for single line comments
- Color colorString = PropertyLabelColorProvider.getDefault().getColor(IPropertyLabelColorConstants.STRING);
- DefaultDamagerRepairer dr = new DefaultDamagerRepairer(new SingleTokenScanner(new TextAttribute(colorString)));
-
- reconciler.setDamager(dr, PropertyLabelPartitionScanner.PROPERTY_MODIFIERS_STRING);
- reconciler.setRepairer(dr, PropertyLabelPartitionScanner.PROPERTY_MODIFIERS_STRING);
-
- // creating damager/repairer for other zones (action language zone)
- dr = new DefaultDamagerRepairer(new PropertyLabelScanner());
- reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE);
- reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE);
-
- return reconciler;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
- ContentAssistant assistant = new ContentAssistant();
-
- IContentAssistProcessor processor = new PropertyLabelCompletionProcessor(property, getFilter());
- assistant.setContentAssistProcessor(processor, IDocument.DEFAULT_CONTENT_TYPE);
-
- // IInformationControlCreator
- assistant.setInformationControlCreator(getInformationControlCreator(sourceViewer));
-
- assistant.enableAutoActivation(true);
- assistant.setAutoActivationDelay(500);
-
- return assistant;
- }
-
- /**
- * Returns the edited PropertyUtil
- *
- * @return the property to edit
- */
- public Property getProperty() {
- return property;
- }
-
- /**
- * Sets the property to Edit
- *
- * @param property
- * the property to edit
- */
- public void setProperty(Property property) {
- this.property = property;
- }
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/propertylabel/PropertyLabelTemplateUI.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/propertylabel/PropertyLabelTemplateUI.java
deleted file mode 100644
index 91a65be249a..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/propertylabel/PropertyLabelTemplateUI.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.parsers.texteditor.propertylabel;
-
-import java.io.IOException;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.jface.text.templates.ContextTypeRegistry;
-import org.eclipse.jface.text.templates.persistence.TemplateStore;
-import org.eclipse.papyrus.parsers.PapyrusParsersPlugin;
-import org.eclipse.ui.editors.text.templates.ContributionContextTypeRegistry;
-import org.eclipse.ui.editors.text.templates.ContributionTemplateStore;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-
-/**
- * Template management for the text editor.
- */
-public class PropertyLabelTemplateUI {
-
- /**
- * Key to store custom templates.
- */
- private static final String CUSTOM_TEMPLATES_KEY = "com.cea.accorduml.view.rtaction.texteditor.customtemplates";
-
- /**
- * The shared instance.
- */
- private static PropertyLabelTemplateUI fInstance;
-
- /**
- * The template store.
- */
- private TemplateStore fStore;
-
- /**
- * The context type registry.
- */
- private ContributionContextTypeRegistry fRegistry;
-
- /**
- *
- */
- private PropertyLabelTemplateUI() {
- }
-
- /**
- * Returns the shared instance.
- *
- * @return the shared instance
- */
- public static PropertyLabelTemplateUI getDefault() {
- if (fInstance == null) {
- fInstance = new PropertyLabelTemplateUI();
- }
- return fInstance;
- }
-
- /**
- * Returns this plug-in's template store.
- *
- * @return the template store of this plug-in instance
- */
- public TemplateStore getTemplateStore() {
- if (fStore == null) {
- fStore = new ContributionTemplateStore(getContextTypeRegistry(), PapyrusParsersPlugin.getDefault()
- .getPreferenceStore(), CUSTOM_TEMPLATES_KEY);
- try {
- fStore.load();
- } catch (IOException e) {
- PapyrusParsersPlugin.logException(e);
- }
- }
- return fStore;
- }
-
- /**
- * Returns this plug-in's context type registry.
- *
- * @return the context type registry for this plug-in instance
- */
- public ContextTypeRegistry getContextTypeRegistry() {
- if (fRegistry == null) {
- // create an configure the contexts available in the template editor
- fRegistry = new ContributionContextTypeRegistry();
- fRegistry.addContextType(PropertyLabelContextType.PROPERTYLABEL_CONTEXT_TYPE);
- }
- return fRegistry;
- }
-
- /* Forward plug-in methods to javaeditor example plugin default instance */
- /**
- *
- *
- * @return
- */
- public ImageRegistry getImageRegistry() {
- return PapyrusParsersPlugin.getDefault().getImageRegistry();
- }
-
- /**
- * Creates and returns the <code>ImageDescriptor</code> for an image from a plugin.
- *
- * @param imageFilePath
- * relative path to the file that stores the image
- * @param pluginId
- * the identifier of the plugin
- *
- * @return the image descriptor
- *
- * @see AbstractUIPlugin#imageDescriptorFromPlugin(java.lang.String, java.lang.String)
- */
- public static ImageDescriptor imageDescriptorFromPlugin(String pluginId, String imageFilePath) {
- return AbstractUIPlugin.imageDescriptorFromPlugin(pluginId, imageFilePath);
- }
-
- /**
- * Returns the preference store of the plugin.
- *
- * @return the preference store of the plugin
- *
- * @see AbstractUIPlugin#getPreferenceStore()
- */
- public IPreferenceStore getPreferenceStore() {
- return PapyrusParsersPlugin.getDefault().getPreferenceStore();
- }
-
- /**
- * Save plugin preferences.
- *
- * @see org.eclipse.core.runtime.Plugin#savePluginPreferences()
- */
- public void savePluginPreferences() {
- PapyrusParsersPlugin.getDefault().savePluginPreferences();
- }
-
-}
diff --git a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/propertylabel/PropertyWordDetector.java b/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/propertylabel/PropertyWordDetector.java
deleted file mode 100644
index 2ac93f4ac22..00000000000
--- a/extraplugins/marte/org.eclipse.papyrus.parsers/src/org/eclipse/papyrus/parsers/texteditor/propertylabel/PropertyWordDetector.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) Remi.Schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.parsers.texteditor.propertylabel;
-
-import org.eclipse.jface.text.rules.IWordDetector;
-
-/**
- * Basic word detector for the scanner.<BR>
- *
- * @author Remi SCHNEKENBURGER
- * @see org.eclipse.jface.text.rules.IWordDetector
- */
-public class PropertyWordDetector implements IWordDetector {
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.rules.IWordDetector#isWordPart(char)
- */
- /**
- *
- *
- * @param character
- *
- * @return
- */
- public boolean isWordPart(char character) {
- Character ch = Character.valueOf(character);
-
- if (ch.compareTo('+') == 0) {
- return true;
- } else if (ch.compareTo('-') == 0) {
- return true;
- } else if (ch.compareTo('#') == 0) {
- return true;
- } else if (ch.compareTo('~') == 0) {
- return true;
- } else if (ch.compareTo('/') == 0) {
- return true;
- } else if (ch.compareTo(':') == 0) {
- return true;
- }
-
- return Character.isLetter(character);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.rules.IWordDetector#isWordStart(char)
- */
- /**
- *
- *
- * @param character
- *
- * @return
- */
- public boolean isWordStart(char character) {
- Character ch = Character.valueOf(character);
-
- if (ch.compareTo('+') == 0) {
- return true;
- } else if (ch.compareTo('-') == 0) {
- return true;
- } else if (ch.compareTo('#') == 0) {
- return true;
- } else if (ch.compareTo('~') == 0) {
- return true;
- } else if (ch.compareTo('/') == 0) {
- return true;
- } else if (ch.compareTo(':') == 0) {
- return true;
- }
- return Character.isLetter(character);
- }
-}

Back to the top