package com.nomagic.magicdraw.examples.mypatterns; import com.nomagic.magicdraw.properties.Property; import com.nomagic.magicdraw.properties.PropertyResourceProvider; public class MyResourceProvider implements PropertyResourceProvider { /** * Instance of this provider. */ private static MyResourceProvider mInstance; /** * Returns shared instance of this provider. * * @return shared instance. */ public static MyResourceProvider getInstance() { if (mInstance == null) { mInstance = new MyResourceProvider(); } return mInstance; } /** * Returns resource for given key. * * @param key a resource key. * @return the resource for given key. */ public String getString(String key) { switch (key) { case MyPatternProperties.METHOD_NAME: return "Method Name"; case MyPatternProperties.TARGET_CLASS: return "Target Class"; case MyPatternProperties.GENERAL: return "General"; } return key; } @Override public String getString(String key, Property property) { return getString(key); } }