You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opennlp.apache.org by jo...@apache.org on 2011/07/19 19:49:33 UTC

svn commit: r1148461 - in /incubator/opennlp/sandbox/opennlp-caseditor-plugin: plugin.xml src/main/java/org/apache/opennlp/caseditor/namefinder/ src/main/java/org/apache/opennlp/caseditor/namefinder/NameFinderPreferencePage.java

Author: joern
Date: Tue Jul 19 17:49:32 2011
New Revision: 1148461

URL: http://svn.apache.org/viewvc?rev=1148461&view=rev
Log:
OPENNLP-235 Added preference page

Added:
    incubator/opennlp/sandbox/opennlp-caseditor-plugin/src/main/java/org/apache/opennlp/caseditor/namefinder/
    incubator/opennlp/sandbox/opennlp-caseditor-plugin/src/main/java/org/apache/opennlp/caseditor/namefinder/NameFinderPreferencePage.java   (with props)
Modified:
    incubator/opennlp/sandbox/opennlp-caseditor-plugin/plugin.xml

Modified: incubator/opennlp/sandbox/opennlp-caseditor-plugin/plugin.xml
URL: http://svn.apache.org/viewvc/incubator/opennlp/sandbox/opennlp-caseditor-plugin/plugin.xml?rev=1148461&r1=1148460&r2=1148461&view=diff
==============================================================================
--- incubator/opennlp/sandbox/opennlp-caseditor-plugin/plugin.xml (original)
+++ incubator/opennlp/sandbox/opennlp-caseditor-plugin/plugin.xml Tue Jul 19 17:49:32 2011
@@ -27,5 +27,12 @@
           class="org.apache.opennlp.caseditor.OpenNLPPreferenceInitializer">
     </initializer>
  </extension>
-
+ 
+  <extension point="org.eclipse.ui.preferencePages">
+    <page
+          class="org.apache.opennlp.caseditor.namefinder.NameFinderPreferencePage"
+          id="org.apache.opennlp.caseditor.NameFinderPreference"
+          name="OpenNLP Name Finder">
+    </page>
+ </extension>
 </plugin>

Added: incubator/opennlp/sandbox/opennlp-caseditor-plugin/src/main/java/org/apache/opennlp/caseditor/namefinder/NameFinderPreferencePage.java
URL: http://svn.apache.org/viewvc/incubator/opennlp/sandbox/opennlp-caseditor-plugin/src/main/java/org/apache/opennlp/caseditor/namefinder/NameFinderPreferencePage.java?rev=1148461&view=auto
==============================================================================
--- incubator/opennlp/sandbox/opennlp-caseditor-plugin/src/main/java/org/apache/opennlp/caseditor/namefinder/NameFinderPreferencePage.java (added)
+++ incubator/opennlp/sandbox/opennlp-caseditor-plugin/src/main/java/org/apache/opennlp/caseditor/namefinder/NameFinderPreferencePage.java Tue Jul 19 17:49:32 2011
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.opennlp.caseditor.namefinder;
+
+import org.apache.opennlp.caseditor.OpenNLPPlugin;
+import org.apache.opennlp.caseditor.OpenNLPPreferenceConstants;
+import org.eclipse.jface.preference.FieldEditorPreferencePage;
+import org.eclipse.jface.preference.StringFieldEditor;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+public class NameFinderPreferencePage extends FieldEditorPreferencePage
+    implements IWorkbenchPreferencePage {
+
+  private StringFieldEditor modelPath;
+  
+  private StringFieldEditor sentenceType;
+  private StringFieldEditor tokenType;
+  private StringFieldEditor nameType;
+  
+  
+  public NameFinderPreferencePage() {
+    setPreferenceStore(OpenNLPPlugin.getDefault().getPreferenceStore());
+    setDescription("UIMA Annotation Editor Preferences.");
+  }
+
+  @Override
+  public void init(IWorkbench workbench) {
+  }
+
+  @Override
+  protected void createFieldEditors() {
+    // editor line length hint
+    modelPath = new StringFieldEditor(
+            OpenNLPPreferenceConstants.MODEL_PATH,
+            "Model Path", getFieldEditorParent());
+    addField(modelPath);
+    
+    sentenceType = new StringFieldEditor(
+        OpenNLPPreferenceConstants.SENTENCE_TYPE,
+        "Sentence Type", getFieldEditorParent());
+    addField(sentenceType);
+    
+    tokenType = new StringFieldEditor(
+        OpenNLPPreferenceConstants.TOKEN_TYPE,
+        "Token Type", getFieldEditorParent());
+    addField(tokenType);
+    
+    nameType = new StringFieldEditor(
+        OpenNLPPreferenceConstants.NAME_TYPE,
+        "Name Type", getFieldEditorParent());
+    addField(nameType);
+  }
+  
+}

Propchange: incubator/opennlp/sandbox/opennlp-caseditor-plugin/src/main/java/org/apache/opennlp/caseditor/namefinder/NameFinderPreferencePage.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain