Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Davis2012-09-11 19:31:59 +0000
committerMatthew Davis2012-09-11 19:31:59 +0000
commitc23fcbf565b9adcaf70353ab231ab0558216237a (patch)
tree4365a1d2f6860518094e055f072c9255bc482425
parented880a602777c86a6dc906cf54f0f9f5e00f8a64 (diff)
downloadorg.eclipse.stem-c23fcbf565b9adcaf70353ab231ab0558216237a.tar.gz
org.eclipse.stem-c23fcbf565b9adcaf70353ab231ab0558216237a.tar.xz
org.eclipse.stem-c23fcbf565b9adcaf70353ab231ab0558216237a.zip
Moving String Provider Class from anonymous to static internal class for modelgen extensibility purposes
git-svn-id: http://dev.eclipse.org/svnroot/technology/org.eclipse.stem/trunk@3357 92a21009-5b66-0410-b83a-dc787c41c6e9
-rw-r--r--models/epidemiology/org.eclipse.stem.ui.diseasemodels.globalinfluenzamodel/src/org/eclipse/stem/ui/diseasemodels/globalinfluenzamodel/presentation/GlobalinfluenzamodelPropertyStringProviderAdapterFactory.java105
1 files changed, 52 insertions, 53 deletions
diff --git a/models/epidemiology/org.eclipse.stem.ui.diseasemodels.globalinfluenzamodel/src/org/eclipse/stem/ui/diseasemodels/globalinfluenzamodel/presentation/GlobalinfluenzamodelPropertyStringProviderAdapterFactory.java b/models/epidemiology/org.eclipse.stem.ui.diseasemodels.globalinfluenzamodel/src/org/eclipse/stem/ui/diseasemodels/globalinfluenzamodel/presentation/GlobalinfluenzamodelPropertyStringProviderAdapterFactory.java
index a3dfbba24..f2a6b3f9c 100644
--- a/models/epidemiology/org.eclipse.stem.ui.diseasemodels.globalinfluenzamodel/src/org/eclipse/stem/ui/diseasemodels/globalinfluenzamodel/presentation/GlobalinfluenzamodelPropertyStringProviderAdapterFactory.java
+++ b/models/epidemiology/org.eclipse.stem.ui.diseasemodels.globalinfluenzamodel/src/org/eclipse/stem/ui/diseasemodels/globalinfluenzamodel/presentation/GlobalinfluenzamodelPropertyStringProviderAdapterFactory.java
@@ -28,7 +28,7 @@ import org.eclipse.ui.IStartup;
* This class represents
*/
public class GlobalinfluenzamodelPropertyStringProviderAdapterFactory extends
- GlobalinfluenzamodelAdapterFactory implements
+ GlobalinfluenzamodelAdapterFactory implements
PropertyStringProviderAdapterFactory, IStartup {
PropertyStringProviderAdapter adapter = null;
@@ -47,7 +47,8 @@ public class GlobalinfluenzamodelPropertyStringProviderAdapterFactory extends
public void earlyStartup() {
// Nothing to do here. This method is called after the constructor has
// run which is the entire point of early activation which causes the
- // factory to be added to the PropertyStringProviderAdapterFactory.INSTANCE
+ // factory to be added to the
+ // PropertyStringProviderAdapterFactory.INSTANCE
}
/**
@@ -67,59 +68,57 @@ public class GlobalinfluenzamodelPropertyStringProviderAdapterFactory extends
// Have we created one before?
if (adapter == null) {
// No
- adapter = new StandardPropertyStringProviderAdapterFactory.StandardPropertyStringProviderAdapter() {
-
- /**
- * @param descriptor
- * @return the NLS'd name of the property to display to the user
- */
- public String getPropertyName(IItemPropertyDescriptor descriptor) {
- try {
- return GlobalinfluenzamodelWizardMessages
- .getString(((EStructuralFeature) descriptor
- .getFeature(null)).getName());
- } catch (MissingResourceException e) {
- return super.getPropertyName(descriptor);
- }
- } // getPropertyName
-
- /**
- * @param descriptor
- * @return the NLS'd tool tip text that describes the property
- */
- public String getPropertyToolTip(
- IItemPropertyDescriptor descriptor) {
- try {
- final EStructuralFeature feature = (EStructuralFeature) descriptor
- .getFeature(null);
- return GlobalinfluenzamodelWizardMessages.getString(feature
- .getName()
- + TT_SUFFIX);
- } catch (MissingResourceException e) {
- return super.getPropertyToolTip(descriptor);
- }
- } // getPropertyToolTip
-
- /**
- * @param descriptor
- * @return the NLS'd text that represents the units of the
- * property
- */
- public String getPropertyUnits(
- IItemPropertyDescriptor descriptor) {
- try {
- final EStructuralFeature feature = (EStructuralFeature) descriptor
- .getFeature(null);
- return GlobalinfluenzamodelWizardMessages.getString(feature
- .getName()
- + UNIT_SUFFIX);
- } catch (MissingResourceException e) {
- return super.getPropertyUnits(descriptor);
- }
- } // getPropertyUnits
- };
+ adapter = new GlobalinfluenzePropertyStringProviderAdapter();
} // if we didn't create one before
return adapter;
}// createForcingDiseaseModelAdapter()
+ public static class GlobalinfluenzePropertyStringProviderAdapter
+ extends
+ StandardPropertyStringProviderAdapterFactory.StandardPropertyStringProviderAdapter {
+
+ /**
+ * @param descriptor
+ * @return the NLS'd name of the property to display to the user
+ */
+ public String getPropertyName(IItemPropertyDescriptor descriptor) {
+ try {
+ return GlobalinfluenzamodelWizardMessages
+ .getString(((EStructuralFeature) descriptor
+ .getFeature(null)).getName());
+ } catch (MissingResourceException e) {
+ return super.getPropertyName(descriptor);
+ }
+ } // getPropertyName
+
+ /**
+ * @param descriptor
+ * @return the NLS'd tool tip text that describes the property
+ */
+ public String getPropertyToolTip(IItemPropertyDescriptor descriptor) {
+ try {
+ final EStructuralFeature feature = (EStructuralFeature) descriptor
+ .getFeature(null);
+ return GlobalinfluenzamodelWizardMessages.getString(feature
+ .getName() + TT_SUFFIX);
+ } catch (MissingResourceException e) {
+ return super.getPropertyToolTip(descriptor);
+ }
+ } // getPropertyToolTip
+
+ /**
+ * @param descriptor
+ * @return the NLS'd text that represents the units of the property
+ */
+ public String getPropertyUnits(IItemPropertyDescriptor descriptor) {
+ try {
+ final EStructuralFeature feature = (EStructuralFeature) descriptor
+ .getFeature(null);
+ return GlobalinfluenzamodelWizardMessages.getString(feature
+ .getName() + UNIT_SUFFIX);
+ } catch (MissingResourceException e) {
+ return super.getPropertyUnits(descriptor);
+ }
+ } // getPropertyUnits
+ };
} // ForcingPropertyStringProviderAdapterFactory

Back to the top