blob: 981d0fa0d8375a3944a858300af58025e975debf (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
/*****************************************************************************
* Copyright (c) 2015, 2017 CEA LIST.
*
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* CEA LIST - Initial API and implementation
*
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.deployment.custom.providers;
import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
import org.eclipse.papyrus.uml.diagram.common.keyword.KeywordLabel;
import org.eclipse.papyrus.uml.diagram.common.parser.stereotype.AppliedKeywordParser;
import org.eclipse.papyrus.uml.diagram.common.parser.stereotype.AppliedStereotypeParser;
import org.eclipse.papyrus.uml.diagram.deployment.edit.parts.DeploymentAppliedStereotypeEditPart;
import org.eclipse.papyrus.uml.diagram.deployment.edit.parts.ManifestationAppliedStereotypeEditPart;
import org.eclipse.papyrus.uml.diagram.deployment.providers.UMLParserProvider;
public class CustomUMLParserProvider extends UMLParserProvider {
public CustomUMLParserProvider() {
super();
}
protected IParser getAppliedStereotypeParser(String defaultEditString) {
return new AppliedStereotypeParser(defaultEditString);
}
/**
* @since 3.0
*/
protected IParser getAppliedKeywordParser(String defaultPrintString) {
return new AppliedKeywordParser(defaultPrintString);
}
@Override
protected IParser getParser(String visualID) {
switch (visualID) {
case DeploymentAppliedStereotypeEditPart.VISUAL_ID:
return getAppliedKeywordParser(KeywordLabel.DEPLOY);
case ManifestationAppliedStereotypeEditPart.VISUAL_ID:
return getAppliedKeywordParser(KeywordLabel.MANIFEST);
}
return super.getParser(visualID);
}
}
|