You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by al...@apache.org on 2006/12/01 22:56:07 UTC

svn commit: r481417 - in /incubator/uima/uimaj/trunk/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui: GeneralSection.java PrimitiveSection.java

Author: alally
Date: Fri Dec  1 13:56:06 2006
New Revision: 481417

URL: http://svn.apache.org/viewvc?view=rev&rev=481417
Log:
UIMA-24: improved error message given when descriptor has an invalid frameworkImplementation.
Also removed the support for "JEDII" and "TAF" as framework implementations,
and create constants holding the correct framework implementation names rather than
having the string literals repeated in several places.
https://issues.apache.org/jira/browse/UIMA-24?page=comments

Modified:
    incubator/uima/uimaj/trunk/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/GeneralSection.java
    incubator/uima/uimaj/trunk/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/PrimitiveSection.java

Modified: incubator/uima/uimaj/trunk/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/GeneralSection.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/GeneralSection.java?view=diff&rev=481417&r1=481416&r2=481417
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/GeneralSection.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/GeneralSection.java Fri Dec  1 13:56:06 2006
@@ -19,6 +19,7 @@
 
 package org.apache.uima.taeconfigurator.editors.ui;
 
+import org.apache.uima.Constants;
 import org.apache.uima.UIMAFramework;
 import org.apache.uima.analysis_engine.metadata.FlowConstraints;
 import org.apache.uima.resource.ExternalResourceDependency;
@@ -44,16 +45,16 @@
   public void enable() {
   }
 
-  private Button tafButton;
+  private Button cppButton;
 
-  private Button jediiButton;
+  private Button javaButton;
 
   private Button primitiveButton;
 
   private Button aggregateButton;
 
   /**
-   * Creates a section to edit general information like primitive or aggregate and TAF or JEDII
+   * Creates a section to edit general information like primitive or aggregate and C++ or Java
    * 
    * @param editor
    *          the referenced multipage editor
@@ -78,8 +79,8 @@
               "Choose the implementation language here.");
 
       Composite buttons = new2ColumnComposite(sectionClient);
-      tafButton = newRadioButton(buttons, "C/C++", "C/C++", NOT_SELECTED);
-      jediiButton = newRadioButton(buttons, "Java", "Java", SELECTED);
+      cppButton = newRadioButton(buttons, "C/C++", "C/C++", NOT_SELECTED);
+      javaButton = newRadioButton(buttons, "Java", "Java", SELECTED);
 
       // DescriptorType choose, 2 radio buttons
       toolkit.createLabel(sectionClient, "Engine Type").setToolTipText(
@@ -107,11 +108,8 @@
 
       // select C++ or Java
       String implType = editor.getAeDescription().getFrameworkImplementation();
-      tafButton.setSelection("TAF".equals(implType) || // TAF is deprecated
-              "org.apache.uima.cpp".equals(implType));
-      jediiButton.setSelection("org.apache.uima.java".equals(implType) || "JEDII".equals(implType)); // JEDII
-      // is
-      // deprecated
+      cppButton.setSelection(Constants.CPP_FRAMEWORK_NAME.equals(implType));
+      javaButton.setSelection(Constants.JAVA_FRAMEWORK_NAME.equals(implType));
     }
   }
 
@@ -170,8 +168,8 @@
       } catch (ResourceInitializationException e) {
         throw new InternalErrorCDE("invalid state", e);
       }
-      jediiButton.setEnabled(isPrimitive);
-      tafButton.setEnabled(isPrimitive);
+      javaButton.setEnabled(isPrimitive);
+      cppButton.setEnabled(isPrimitive);
       HeaderPage page = editor.getAggregatePage();
       if (null != page)
         page.markStale();
@@ -194,15 +192,15 @@
       if (null != page)
         page.markStale();
     }
-    if (event.widget == jediiButton || event.widget == tafButton) {
+    if (event.widget == javaButton || event.widget == cppButton) {
       valueChanged = false;
-      if (tafButton.getSelection()) {
+      if (cppButton.getSelection()) {
         editor.getAeDescription().setFrameworkImplementation(
-                setValueChanged("org.apache.uima.cpp", editor.getAeDescription()
+                setValueChanged(Constants.CPP_FRAMEWORK_NAME, editor.getAeDescription()
                         .getFrameworkImplementation()));
       } else {
         editor.getAeDescription().setFrameworkImplementation(
-                setValueChanged("org.apache.uima.java", editor.getAeDescription()
+                setValueChanged(Constants.JAVA_FRAMEWORK_NAME, editor.getAeDescription()
                         .getFrameworkImplementation()));
       }
       if (!valueChanged)

Modified: incubator/uima/uimaj/trunk/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/PrimitiveSection.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/PrimitiveSection.java?view=diff&rev=481417&r1=481416&r2=481417
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/PrimitiveSection.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/PrimitiveSection.java Fri Dec  1 13:56:06 2006
@@ -21,6 +21,7 @@
 
 import java.text.MessageFormat;
 
+import org.apache.uima.Constants;
 import org.apache.uima.resource.metadata.OperationalProperties;
 import org.apache.uima.taeconfigurator.InternalErrorCDE;
 import org.apache.uima.taeconfigurator.editors.MultiPageEditor;
@@ -116,7 +117,7 @@
 
     // set description for enter field (either .class or .dll file)
     String implKind = editor.getAeDescription().getFrameworkImplementation();
-    if ("TAF".equals(implKind) || "org.apache.uima.cpp".equals(implKind)) {
+    if (Constants.CPP_FRAMEWORK_NAME.equals(implKind)) {
       implNameLabel.setText("Name of the .dll file");
       implName.setToolTipText("Enter the name of the .dll file here.");
       findButton.setToolTipText("Browse the file system for the .dll file.");
@@ -162,7 +163,7 @@
       String className = null;
       try {
         String implKind = editor.getAeDescription().getFrameworkImplementation();
-        if ("TAF".equals(implKind) || "org.apache.uima.cpp".equals(implKind)) {
+        if (Constants.CPP_FRAMEWORK_NAME.equals(implKind)) {
           FileDialog dialog = new FileDialog(getSection().getShell(), SWT.NONE);
           String[] extensions = { "*.dll" };
           dialog.setFilterExtensions(extensions);