Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: a5e695f9872955bd2e740d3911d6ee3f087bfc3c (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
/*****************************************************************************
 * 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
 *  Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Bug 496905
 *
 *****************************************************************************/

package org.eclipse.papyrus.uml.tools.utils;

import org.eclipse.papyrus.uml.internationalization.utils.utils.UMLLabelInternationalization;
import org.eclipse.uml2.uml.ExtensionPoint;

/**
 * Utility class for {@link ExtensionPoint}
 */
// @unused
public class ExtensionPointUtil {

	/**
	 * Returns the explanation for the extension point element
	 *
	 * @return the string defining explanation for the extension point element
	 */
	// @unused
	public static String getExplanation(ExtensionPoint extensionPoint) {
		String explanation = "";
		final String name = ((extensionPoint.getName() != null) ? UMLLabelInternationalization.getInstance().getLabel(extensionPoint) : "");
		int startIndexOfExplanation = name.lastIndexOf(":");
		if ((startIndexOfExplanation > 0) && (startIndexOfExplanation != name.length())) {
			explanation = name.substring(startIndexOfExplanation + 1).trim();
		}
		return explanation;
	}
}

Back to the top