You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by sc...@apache.org on 2007/02/20 20:01:20 UTC

svn commit: r509708 [7/7] - in /incubator/uima/sandbox/trunk/CasEditor: ./ META-INF/ src/main/assembly/ src/main/java/org/apache/uima/caseditor/ src/main/java/org/apache/uima/caseditor/core/ src/main/java/org/apache/uima/caseditor/core/model/ src/main/...

Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/model/UimaSourceFolderAdapter.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/model/UimaSourceFolderAdapter.java?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/model/UimaSourceFolderAdapter.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/model/UimaSourceFolderAdapter.java Tue Feb 20 11:01:12 2007
@@ -1,62 +1,59 @@
-/*
- * 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.uima.caseditor.ui.model;
-
-import java.util.Collection;
-
-
-import org.apache.uima.caseditor.core.model.UimaConfigurationElement;
-import org.apache.uima.caseditor.core.model.UimaSourceFolder;
-import org.apache.uima.caseditor.ui.Images;
-import org.apache.uima.caseditor.ui.TaeUiPlugin;
-import org.eclipse.jface.resource.ImageDescriptor;
-
-/**
- * The <code>IWorkbenchAdapter</code> for the
- * <code>UIMASourceFolder</code>.
- * 
- * @author <a href="mailto:kottmann@gmail.com">Joern Kottmann</a>
- */
-class UimaSourceFolderAdapter extends
-        AbstractElementAdapter
-{
-    /**
-     * Retrives the children of the current <code>UIMASourceFolder</code>.
-     */
-    public Object[] getChildren(Object o)
-    {
-        UimaSourceFolder sourceFolder = (UimaSourceFolder) o;
-        
-        Collection<UimaConfigurationElement> uimaConfigs = sourceFolder
-                .getUimaConfigurationElements();
-        
-        return uimaConfigs.toArray(new UimaConfigurationElement[uimaConfigs
-                .size()]);
-    }
-    
-    /**
-     * Retrives the <code>ImageDescriptor</code> for uima folder.
-     */
-    public ImageDescriptor getImageDescriptor(Object object)
-    {
-        return TaeUiPlugin.getTaeImageDescriptor(
-                Images.MODEL_SOURCE_FOLDER);
-    }
+/*
+ * 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.uima.caseditor.ui.model;
+
+import java.util.Collection;
+
+import org.apache.uima.caseditor.CasEditorPlugin;
+import org.apache.uima.caseditor.Images;
+import org.apache.uima.caseditor.core.model.UimaConfigurationElement;
+import org.apache.uima.caseditor.core.model.UimaSourceFolder;
+import org.eclipse.jface.resource.ImageDescriptor;
+
+/**
+ * The <code>IWorkbenchAdapter</code> for the
+ * <code>UIMASourceFolder</code>.
+ */
+class UimaSourceFolderAdapter extends
+        AbstractElementAdapter
+{
+    /**
+     * Retrives the children of the current <code>UIMASourceFolder</code>.
+     */
+    public Object[] getChildren(Object o)
+    {
+        UimaSourceFolder sourceFolder = (UimaSourceFolder) o;
+        
+        Collection<UimaConfigurationElement> uimaConfigs = sourceFolder
+                .getUimaConfigurationElements();
+        
+        return uimaConfigs.toArray(new UimaConfigurationElement[uimaConfigs
+                .size()]);
+    }
+    
+    /**
+     * Retrives the <code>ImageDescriptor</code> for uima folder.
+     */
+    public ImageDescriptor getImageDescriptor(Object object)
+    {
+        return CasEditorPlugin.getTaeImageDescriptor(
+                Images.MODEL_SOURCE_FOLDER);
+    }
 }

Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/package.html
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/package.html?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/package.html (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/package.html Tue Feb 20 11:01:12 2007
@@ -3,7 +3,7 @@
 
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
 	<head>
-		<title>net.sf.tae.corpusview</title>
+		<title>org.apache.uima.caseditor.corpusview</title>
 	</head>
 
 	<body>

Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/property/AnnotationPropertyPage.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/property/AnnotationPropertyPage.java?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/property/AnnotationPropertyPage.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/property/AnnotationPropertyPage.java Tue Feb 20 11:01:12 2007
@@ -22,7 +22,6 @@
 import java.awt.Color;
 import java.util.Vector;
 
-
 import org.apache.uima.cas.CAS;
 import org.apache.uima.cas.Type;
 import org.apache.uima.cas.TypeSystem;
@@ -52,9 +51,6 @@
  * This is the <code>AnnotationPropertyPage</code>. this page configures 
  * the project dependent and type dependent annotation appaereance in the 
  * <code>AnnotationEditor</code>.
- * 
- * @author <a href="mailto:kottmann@gmail.com">Joern Kottmann</a>
- * @version $Revision: 1.7.2.1 $, $Date: 2007/01/04 14:37:52 $
  */
 public class AnnotationPropertyPage extends PropertyPage
 {

Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/property/ComboFieldEditor.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/property/ComboFieldEditor.java?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/property/ComboFieldEditor.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/property/ComboFieldEditor.java Tue Feb 20 11:01:12 2007
@@ -24,9 +24,6 @@
 
 /**
  * TODO: add javadoc here
- * 
- * @author <a href="mailto:kottmann@gmail.com">Joern Kottmann</a>
- * @version $Revision: 1.1.2.1 $, $Date: 2007/01/04 14:37:52 $
  */
 public class ComboFieldEditor extends FieldEditor
 {

Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/property/DocumentPropertyPage.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/property/DocumentPropertyPage.java?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/property/DocumentPropertyPage.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/property/DocumentPropertyPage.java Tue Feb 20 11:01:12 2007
@@ -22,6 +22,7 @@
 
 import org.apache.uima.cas.CAS;
 import org.apache.uima.caseditor.core.model.DocumentElement;
+import org.eclipse.core.runtime.CoreException;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Composite;
@@ -33,9 +34,6 @@
 /**
  * This is the <code>DocumentElement</code> property page.
  * It shows information about the selected document.
- * 
- * @author <a href="mailto:kottmann@gmail.com">Joern Kottmann</a>
- * @version $Revision: 1.3.2.1 $, $Date: 2007/01/04 14:37:52 $
  */
 public class DocumentPropertyPage extends PropertyPage
 {
@@ -48,7 +46,12 @@
     {
         DocumentElement document = (DocumentElement) getElement();
         
-        mCAS = document.getCAS();
+        try {
+			mCAS = document.getDocument().getCAS();
+		} catch (CoreException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
         
         Composite base = new Composite(parent, SWT.NONE);
         

Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/property/DotCorpusPreferenceStore.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/property/DotCorpusPreferenceStore.java?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/property/DotCorpusPreferenceStore.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/property/DotCorpusPreferenceStore.java Tue Feb 20 11:01:12 2007
@@ -24,7 +24,6 @@
 import java.util.Collection;
 import java.util.StringTokenizer;
 
-
 import org.apache.uima.caseditor.core.model.DotCorpusElement;
 import org.eclipse.core.resources.IFolder;
 import org.eclipse.core.runtime.CoreException;
@@ -33,9 +32,6 @@
 
 /**
  * TODO: add javdoc here
- * 
- * @author <a href="mailto:kottmann@gmail.com">Joern Kottmann</a>
- * @version $Revision: 1.1.2.1 $, $Date: 2007/01/04 14:37:52 $
  */
 public class DotCorpusPreferenceStore implements IPersistentPreferenceStore
 {

Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/property/FileSelectionFieldEditor.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/property/FileSelectionFieldEditor.java?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/property/FileSelectionFieldEditor.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/property/FileSelectionFieldEditor.java Tue Feb 20 11:01:12 2007
@@ -19,8 +19,7 @@
 
 package org.apache.uima.caseditor.ui.property;
 
-
-import org.apache.uima.caseditor.core.TaeCorePlugin;
+import org.apache.uima.caseditor.CasEditorPlugin;
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.runtime.IStatus;
@@ -34,9 +33,6 @@
 
 /**
  * TODO: add javadoc here
- * 
- * @author <a href="mailto:kottmann@gmail.com">Joern Kottmann</a>
- * @version $Revision: 1.1.2.1 $, $Date: 2007/01/04 14:37:52 $
  */
 class FileSelectionFieldEditor extends StringButtonFieldEditor
 {
@@ -83,7 +79,7 @@
                     }
                 }
                 
-                return new Status(IStatus.ERROR, TaeCorePlugin.ID, 0,
+                return new Status(IStatus.ERROR, CasEditorPlugin.ID, 0,
                         "Please select a file!", null);
             }
         });

Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/property/FolderFieldEditor.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/property/FolderFieldEditor.java?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/property/FolderFieldEditor.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/property/FolderFieldEditor.java Tue Feb 20 11:01:12 2007
@@ -19,8 +19,7 @@
 
 package org.apache.uima.caseditor.ui.property;
 
-
-import org.apache.uima.caseditor.core.TaeCorePlugin;
+import org.apache.uima.caseditor.CasEditorPlugin;
 import org.eclipse.core.resources.IFolder;
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.runtime.IStatus;
@@ -34,9 +33,6 @@
 
 /**
  * TODO: add javadoc here
- * 
- * @author <a href="mailto:kottmann@gmail.com">Joern Kottmann</a>
- * @version $Revision: 1.1.2.1 $, $Date: 2007/01/04 14:37:52 $
  */
 class FolderFieldEditor extends StringButtonFieldEditor
 {
@@ -74,7 +70,7 @@
                     }
                 }
                 
-                return new Status(IStatus.ERROR, TaeCorePlugin.ID, 0,
+                return new Status(IStatus.ERROR, CasEditorPlugin.ID, 0,
                         "Please select a folder!", null);
             }
         });

Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/property/FolderPathEditor.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/property/FolderPathEditor.java?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/property/FolderPathEditor.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/property/FolderPathEditor.java Tue Feb 20 11:01:12 2007
@@ -19,8 +19,7 @@
 
 package org.apache.uima.caseditor.ui.property;
 
-
-import org.apache.uima.caseditor.core.TaeCorePlugin;
+import org.apache.uima.caseditor.CasEditorPlugin;
 import org.eclipse.core.resources.IFolder;
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.runtime.IStatus;
@@ -33,11 +32,9 @@
 import org.eclipse.ui.model.WorkbenchLabelProvider;
 
 /**
- * TODO: add javadoc here TODO: Remove the up and down buttons, they are not
+ * TODO: add javadoc here 
+ * TODO: Remove the up and down buttons, they are not
  * needed
- * 
- * @author <a href="mailto:kottmann@gmail.com">Joern Kottmann</a>
- * @version $Revision: 1.1.2.1 $, $Date: 2007/01/04 14:37:52 $
  */
 class FolderPathEditor extends PathEditor
 {
@@ -73,7 +70,7 @@
                     }
                 }
                 
-                return new Status(IStatus.ERROR, TaeCorePlugin.ID, 0,
+                return new Status(IStatus.ERROR, CasEditorPlugin.ID, 0,
                         "Please select a folder!", null);
             }
         });

Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/property/NlpProjectFieldEditorPage.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/property/NlpProjectFieldEditorPage.java?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/property/NlpProjectFieldEditorPage.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/property/NlpProjectFieldEditorPage.java Tue Feb 20 11:01:12 2007
@@ -31,9 +31,6 @@
 
 /**
  * TODO: add javadoc here
- * 
- * @author <a href="mailto:kottmann@gmail.com">Joern Kottmann</a>
- * @version $Revision: 1.3.2.1 $, $Date: 2007/01/04 14:37:52 $
  */
 public abstract class NlpProjectFieldEditorPage extends FieldEditorPreferencePage
         implements IWorkbenchPropertyPage

Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/property/ProjectPropertyPage.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/property/ProjectPropertyPage.java?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/property/ProjectPropertyPage.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/property/ProjectPropertyPage.java Tue Feb 20 11:01:12 2007
@@ -21,7 +21,6 @@
 
 import java.io.IOException;
 
-
 import org.apache.uima.caseditor.core.model.INlpElement;
 import org.apache.uima.caseditor.core.model.NlpProject;
 import org.eclipse.core.resources.IProject;
@@ -32,9 +31,6 @@
 
 /**
  * TODO: add javadoc here
- * 
- * @author <a href="mailto:kottmann@gmail.com">Joern Kottmann</a>
- * @version $Revision: 1.6.2.1 $, $Date: 2007/01/04 14:37:52 $
  */
 public class ProjectPropertyPage extends NlpProjectFieldEditorPage
 {

Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/property/package.html
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/property/package.html?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/property/package.html (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/property/package.html Tue Feb 20 11:01:12 2007
@@ -3,7 +3,7 @@
 
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
 	<head>
-		<title>net.sf.tae.corpusview</title>
+		<title>org.apache.uima.caseditor.corpusview</title>
 	</head>
 
 	<body>

Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/wizards/DocumentImportStructureProvider.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/wizards/DocumentImportStructureProvider.java?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/wizards/DocumentImportStructureProvider.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/wizards/DocumentImportStructureProvider.java Tue Feb 20 11:01:12 2007
@@ -33,8 +33,7 @@
 import javax.swing.text.StyledDocument;
 import javax.swing.text.rtf.RTFEditorKit;
 
-
-import org.apache.uima.caseditor.core.TaeCorePlugin;
+import org.apache.uima.caseditor.CasEditorPlugin;
 import org.apache.uima.caseditor.core.model.NlpProject;
 import org.apache.uima.caseditor.core.uima.DocumentUimaImpl;
 import org.eclipse.core.resources.IProject;
@@ -47,9 +46,6 @@
 
 /**
  * TODO: add javadoc here
- * 
- * @author <a href="mailto:kottmann@gmail.com">Joern Kottmann</a>
- * @version $Revision: 1.3.2.1 $, $Date: 2007/01/04 14:37:51 $
  */
 final class DocumentImportStructureProvider implements IImportStructureProvider
 {
@@ -225,7 +221,7 @@
     
     private InputStream getDocument(String text)
     {
-        NlpProject nlpProject = (NlpProject) TaeCorePlugin.getNlpModel()
+        NlpProject nlpProject = (NlpProject) CasEditorPlugin.getNlpModel()
                 .findMember(mProject);
         
         DocumentUimaImpl gateDocument = new DocumentUimaImpl(nlpProject);

Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/wizards/ImportDocumentWizard.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/wizards/ImportDocumentWizard.java?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/wizards/ImportDocumentWizard.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/wizards/ImportDocumentWizard.java Tue Feb 20 11:01:12 2007
@@ -27,9 +27,6 @@
 /**
  * read files, convert them and save them in the folder select project select
  * dst folder select src
- * 
- * @author <a href="mailto:kottmann@gmail.com">Joern Kottmann</a>
- * @version $Revision: 1.1.2.1 $, $Date: 2007/01/04 14:37:51 $
  */
 public final class ImportDocumentWizard extends Wizard implements IImportWizard
 {

Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/wizards/ImportDocumentWizard2.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/wizards/ImportDocumentWizard2.java?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/wizards/ImportDocumentWizard2.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/wizards/ImportDocumentWizard2.java Tue Feb 20 11:01:12 2007
@@ -32,9 +32,6 @@
  * Notes:
  * If two files have the same name but a differnt file extension. The
  * second file gets a number attached.
- * 
- * @author <a href="mailto:kottmann@gmail.com">Joern Kottmann</a>
- * @version $Revision: 1.1.2.1 $, $Date: 2007/01/04 14:37:51 $
  */
 public class ImportDocumentWizard2 extends Wizard implements IImportWizard
 {

Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/wizards/ImportDocumentWizardMainPage.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/wizards/ImportDocumentWizardMainPage.java?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/wizards/ImportDocumentWizardMainPage.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/wizards/ImportDocumentWizardMainPage.java Tue Feb 20 11:01:12 2007
@@ -26,9 +26,6 @@
 
 /**
  * TODO: add javadoc here
- * 
- * @author <a href="mailto:kottmann@gmail.com">Joern Kottmann</a>
- * @version $Revision: 1.1.2.1 $, $Date: 2007/01/04 14:37:51 $
  */
 public class ImportDocumentWizardMainPage extends WizardResourceImportPage
 {

Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/wizards/ImportDocumentWizardPage.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/wizards/ImportDocumentWizardPage.java?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/wizards/ImportDocumentWizardPage.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/wizards/ImportDocumentWizardPage.java Tue Feb 20 11:01:12 2007
@@ -31,9 +31,6 @@
 
 /**
  * The main page of the ImportDocumentWizard.
- * 
- * @author <a href="mailto:kottmann@gmail.com">Joern Kottmann</a>
- * @version $Revision: 1.2.2.1 $, $Date: 2007/01/04 14:37:51 $
  */
 final class ImportDocumentWizardPage extends
         WizardFileSystemResourceImportPage1

Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/wizards/NewCorpusWizard.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/wizards/NewCorpusWizard.java?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/wizards/NewCorpusWizard.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/wizards/NewCorpusWizard.java Tue Feb 20 11:01:12 2007
@@ -32,13 +32,10 @@
 
 /**
  * TODO: add javadoc here
- * 
- * @author <a href="mailto:kottmann@gmail.com">Joern Kottmann</a>
- * @version $Revision: 1.1.2.1 $, $Date: 2007/01/04 14:37:51 $
  */
 public final class NewCorpusWizard extends Wizard implements INewWizard
 {
-    public static String ID = "net.sf.tae.wizards.NewDocumentWizard";
+    public static String ID = "org.apache.uima.caseditor.wizards.NewDocumentWizard";
     
     private WizardNewFolderMainPage mMainPage;
     

Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/wizards/NewCorpusWizardPage.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/wizards/NewCorpusWizardPage.java?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/wizards/NewCorpusWizardPage.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/wizards/NewCorpusWizardPage.java Tue Feb 20 11:01:12 2007
@@ -29,9 +29,6 @@
 
 /**
  * TODO: add javadoc here
- * 
- * @author <a href="mailto:kottmann@gmail.com">Joern Kottmann</a>
- * @version $Revision: 1.1.2.1 $, $Date: 2007/01/04 14:37:51 $
  */
 final class NewCorpusWizardPage extends WizardPage
 {

Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/wizards/NlpProjectWizard.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/wizards/NlpProjectWizard.java?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/wizards/NlpProjectWizard.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/wizards/NlpProjectWizard.java Tue Feb 20 11:01:12 2007
@@ -35,16 +35,13 @@
 /**
  * New wizard for nlp projects. TODO: exception handling TODO: refactor this
  * wizard
- * 
- * @author <a href="mailto:kottmann@gmail.com">Joern Kottmann</a>
- * @version $Revision: 1.2.2.1 $, $Date: 2007/01/04 14:37:51 $
  */
 final public class NlpProjectWizard extends Wizard implements INewWizard
 {
     /**
      * The ID of the new nlp porject wizard.
      */
-    public static final String ID = "net.sf.tae.wizards.NLPProjectWizard";
+    public static final String ID = "org.apache.uima.caseditor.wizards.NLPProjectWizard";
     
     private WizardNewProjectCreationPage mMainPage;
     

Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/wizards/package.html
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/wizards/package.html?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/wizards/package.html (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/wizards/package.html Tue Feb 20 11:01:12 2007
@@ -3,7 +3,7 @@
 
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
 	<head>
-		<title>net.sf.tae.corpusview</title>
+		<title>org.apache.uima.caseditor.corpusview</title>
 	</head>
 
 	<body>

Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/uima/CorporaCollectionReader.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/uima/CorporaCollectionReader.java?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/uima/CorporaCollectionReader.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/uima/CorporaCollectionReader.java Tue Feb 20 11:01:12 2007
@@ -23,7 +23,6 @@
 import java.util.Iterator;
 import java.util.LinkedList;
 
-
 import org.apache.uima.cas.CAS;
 import org.apache.uima.cas_data.CasData;
 import org.apache.uima.caseditor.core.model.CorpusElement;
@@ -32,13 +31,11 @@
 import org.apache.uima.collection.CollectionReader_ImplBase;
 import org.apache.uima.collection.impl.CasConverter;
 import org.apache.uima.util.Progress;
+import org.eclipse.core.runtime.CoreException;
 
 /**
  * This is a collection reader which reads the documents from
  * a {@link Collection} of {@link CorpusElement}s.
- * 
- * @author <a href="mailto:kottmann@gmail.com">Joern Kottmann</a>
- * @version $Revision: 1.4.2.2 $, $Date: 2007/01/04 15:01:27 $
  */
 public class CorporaCollectionReader extends CollectionReader_ImplBase {
   private Iterator mDocumentIterator;
@@ -68,7 +65,14 @@
   public void getNext(CAS cas) throws CollectionException {
     DocumentElement document = (DocumentElement) mDocumentIterator.next();
 
-    CAS documentCas = document.getCAS();
+    CAS documentCas = null;
+    
+	try {
+		documentCas = document.getDocument().getCAS();
+	} catch (CoreException e) {
+		// TODO Auto-generated catch block
+		e.printStackTrace();
+	}
 
     CasConverter converter = new CasConverter();
 

Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/uima/DummyAnnotator.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/uima/DummyAnnotator.java?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/uima/DummyAnnotator.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/uima/DummyAnnotator.java Tue Feb 20 11:01:12 2007
@@ -31,11 +31,9 @@
 /**
  * This Annotator does nothing. You can use it when you need to supply a valid TextAnnotator
  * implementation, but not need a TextAnnotator.
- * 
- * @author <a href="mailto:kottmann@gmail.com">Joern Kottmann</a>
- * @version $Revision: 1.1.2.2 $, $Date: 2007/01/04 15:01:27 $
  */
 public class DummyAnnotator implements TextAnnotator {
+	
   /**
    * Dummy process method, does nothing.
    */

Added: incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/Annotator.ann
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/Annotator.ann?view=auto&rev=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/Annotator.ann (added)
+++ incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/Annotator.ann Tue Feb 20 11:01:12 2007
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<taeDescription xmlns="http://uima.watson.ibm.com/resourceSpecifier">
+<frameworkImplementation>com.ibm.uima.java</frameworkImplementation>
+<primitive>true</primitive>
+<annotatorImplementationName>none</annotatorImplementationName>
+<analysisEngineMetaData>
+<name>TestAnnotator</name>
+<description></description>
+<version>1.0</version>
+<vendor>org.apache.uima.caseditor</vendor>
+
+<configurationParameters>
+</configurationParameters>
+
+<configurationParameterSettings>
+</configurationParameterSettings>
+
+<typeSystemDescription/>
+<capabilities>
+<capability>
+<inputs/>
+<outputs/>
+<languagesSupported>
+<language>en</language>
+</languagesSupported>
+</capability>
+</capabilities>
+<operationalProperties>
+<modifiesCas>true</modifiesCas>
+<multipleDeploymentAllowed>true</multipleDeploymentAllowed>
+</operationalProperties>
+</analysisEngineMetaData>
+<resourceManagerConfiguration/>
+</taeDescription>

Added: incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/Consumer.con
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/Consumer.con?view=auto&rev=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/Consumer.con (added)
+++ incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/Consumer.con Tue Feb 20 11:01:12 2007
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<casConsumerDescription xmlns="http://uima.watson.ibm.com/resourceSpecifier">
+<frameworkImplementation>com.ibm.uima.java</frameworkImplementation>
+<implementationName>none</implementationName>
+<processingResourceMetaData>
+<name>TokenizerTrainer</name>
+<description></description>
+<version>1.0</version>
+<vendor>org.apache.uima.caseditor</vendor>
+
+<configurationParameters>
+</configurationParameters>
+
+<configurationParameterSettings>
+</configurationParameterSettings>
+
+<typeSystemDescription/>
+<typePriorities/>
+<fsIndexCollection/>
+<capabilities/>
+<operationalProperties>
+<modifiesCas>false</modifiesCas>
+<multipleDeploymentAllowed>false</multipleDeploymentAllowed>
+</operationalProperties>
+</processingResourceMetaData>
+</casConsumerDescription>

Added: incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/DefectiveNlpModelTest.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/DefectiveNlpModelTest.java?view=auto&rev=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/DefectiveNlpModelTest.java (added)
+++ incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/DefectiveNlpModelTest.java Tue Feb 20 11:01:12 2007
@@ -0,0 +1,163 @@
+/*
+ * 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.uima.caseditor.core.test;
+
+import static org.junit.Assert.assertTrue;
+
+import java.io.ByteArrayInputStream;
+
+import org.apache.uima.caseditor.CasEditorPlugin;
+import org.apache.uima.caseditor.core.model.AnnotatorElement;
+import org.apache.uima.caseditor.core.model.ConsumerElement;
+import org.apache.uima.caseditor.core.model.DocumentElement;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ */
+public class DefectiveNlpModelTest {
+  private TestProject mProject;
+
+  /**
+   * Initializes the current instance.
+   */
+  public DefectiveNlpModelTest() {
+    mProject = new TestProject();
+  }
+
+  /**
+   * @throws CoreException
+   */
+  @Before
+  public void clearWorkspace() throws CoreException {
+    WorkspaceUtil.clearWorkspace();
+  }
+
+  @Test
+  public void testInvalidDotCorpus() throws CoreException {
+    mProject.createProject();
+    mProject.createProjectContent();
+
+    // create invalid dot corpus
+    mProject.getDotCorpus().create(new ByteArrayInputStream(new byte[0]), true, null);
+
+    // check for default dotCorpus file
+    assertTrue(CasEditorPlugin.getNlpModel().findMember(mProject.getDotCorpus()) != null);
+
+    // check that no content elements exist
+    for (IResource resource : mProject.getResources()) {
+      assertTrue(CasEditorPlugin.getNlpModel().findMember(resource) == null);
+    }
+  }
+
+  @Test
+  public void testFolderDotCorpus() throws CoreException {
+    mProject.createProject();
+    mProject.createProjectContent();
+
+    // create invalid dot corpus
+    IFolder dotCorpusFolder = mProject.getProject().getFolder(".corpus");
+    dotCorpusFolder.create(true, true, null);
+
+    // check for default dotCorpus file
+    assertTrue(CasEditorPlugin.getNlpModel().findMember(mProject.getDotCorpus()) != null);
+
+    // check that no content elements exist
+    for (IResource resource : mProject.getResources()) {
+      assertTrue(CasEditorPlugin.getNlpModel().findMember(resource) == null);
+    }
+  }
+
+  @Test
+  public void testInvalidDocument() throws CoreException {
+    mProject.createProject();
+    mProject.createProjectContent();
+    mProject.createDotCorpus();
+
+    mProject.getDocument().setContents(new ByteArrayInputStream(new byte[0]), true, true, null);
+
+    assertTrue(((DocumentElement) CasEditorPlugin.getNlpModel().findMember(mProject.getDocument()))
+            .getCAS() == null);
+  }
+
+  @Test
+  public void testInvalidAnnotator() throws CoreException {
+    mProject.createProject();
+    mProject.createProjectContent();
+    mProject.createDotCorpus();
+
+    mProject.getAnnotatorFile()
+            .setContents(new ByteArrayInputStream(new byte[0]), true, true, null);
+
+    assertTrue(((AnnotatorElement) CasEditorPlugin.getNlpModel().findMember(
+            mProject.getAnnotatorFile())).getAnnotatorConfiguration() == null);
+  }
+
+  @Test
+  public void testInvalidConsumer() throws CoreException {
+    mProject.createProject();
+    mProject.createProjectContent();
+    mProject.createDotCorpus();
+
+    mProject.getConsumerFile().setContents(new ByteArrayInputStream(new byte[0]), true, true, null);
+
+    assertTrue(((ConsumerElement) CasEditorPlugin.getNlpModel()
+            .findMember(mProject.getConsumerFile())).getConsumerConfiguration() == null);
+  }
+
+  @Test
+  public void testInvalidTypesystem() throws CoreException {
+    mProject.createProject();
+    mProject.createProjectContent();
+    mProject.createDotCorpus();
+
+    mProject.getTypesystem().setContents(new ByteArrayInputStream(new byte[0]), true, true, null);
+
+    assertTrue(CasEditorPlugin.getNlpModel().findMember(mProject.getTypesystem()) == null);
+  }
+
+  @Test
+  public void testFileForCorpusFolder() throws CoreException {
+    mProject.createProject();
+    mProject.createDotCorpus();
+
+    IFile corpusFile = mProject.getProject().getFile("corpus");
+    corpusFile.create(new ByteArrayInputStream(new byte[0]), true, null);
+
+    // check that model and project creation did not failed
+    assertTrue(CasEditorPlugin.getNlpModel().findMember(mProject.getProject()) != null);
+  }
+
+  @Test
+  public void testFileForSourceFolder() throws CoreException {
+    mProject.createProject();
+    mProject.createDotCorpus();
+
+    IFile corpusFile = mProject.getProject().getFile("UimaSourceFolder");
+    corpusFile.create(new ByteArrayInputStream(new byte[0]), true, null);
+
+    // check that model and project creation did not failed
+    assertTrue(CasEditorPlugin.getNlpModel().findMember(mProject.getProject()) != null);
+  }
+}

Added: incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/Document.xcas
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/Document.xcas?view=auto&rev=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/Document.xcas (added)
+++ incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/Document.xcas Tue Feb 20 11:01:12 2007
@@ -0,0 +1,119 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CAS>
+    <uima.cas.Sofa _indexed="0" _id="1" sofaNum="1"
+        sofaID="_InitialView" mimeType="text" sofaString="On March 15, there was an accident near Munich. The driver got badly&#xd;&#xa;injured. Driving alone not far from her home, the middle-aged woman&#xd;&#xa;crashed at high speed into a tree. A resident, who lives near the&#xd;&#xa;street where the accident took place, called instantly the police. He &#xd;&#xa;reported what had happened and gave his name and address to the officer.&#xd;&#xa;He's called Peter Schubert and he lives at Max-Löw-Straße 13 in&#xd;&#xa;84630 Gauting. The police arrived ten minutes later and brought&#xd;&#xa;the woman into hospital. Although she had multiple trauma, she's &#xd;&#xa;out of mortal danger.&#xd;&#xa;"/>
+    <uima.tcas.DocumentAnnotation _indexed="1" _id="12" _ref_sofa="1"
+        begin="0" end="572" language="x-unspecified"/>
+    <org.apache.uima.caseditor.Token _indexed="1" _id="17" _ref_sofa="1" begin="0"
+        end="2" pos="IN"/>
+    <org.apache.uima.caseditor.Token _indexed="1" _id="22" _ref_sofa="1" begin="9"
+        end="11" pos="CD"/>
+    <org.apache.uima.caseditor.Token _indexed="1" _id="27" _ref_sofa="1" begin="11"
+        end="12" pos=","/>
+    <org.apache.uima.caseditor.Token _indexed="1" _id="32" _ref_sofa="1" begin="13"
+        end="18" pos="EX"/>
+    <org.apache.uima.caseditor.Token _indexed="1" _id="37" _ref_sofa="1" begin="19"
+        end="22" pos="VBD"/>
+    <org.apache.uima.caseditor.Token _indexed="1" _id="42" _ref_sofa="1" begin="23"
+        end="25" pos="DT"/>
+    <org.apache.uima.caseditor.Token _indexed="1" _id="47" _ref_sofa="1" begin="26"
+        end="34" pos="NN"/>
+    <org.apache.uima.caseditor.Token _indexed="1" _id="52" _ref_sofa="1" begin="35"
+        end="39" pos="IN"/>
+    <org.apache.uima.caseditor.Token _indexed="1" _id="57" _ref_sofa="1" begin="40"
+        end="46" pos="NNP"/>
+    <org.apache.uima.caseditor.Token _indexed="1" _id="62" _ref_sofa="1" begin="46"
+        end="47" pos="."/>
+    <org.apache.uima.caseditor.Token _indexed="1" _id="67" _ref_sofa="1" begin="48"
+        end="51" pos="DT"/>
+    <org.apache.uima.caseditor.Token _indexed="1" _id="72" _ref_sofa="1" begin="52"
+        end="58" pos="NN"/>
+    <org.apache.uima.caseditor.Token _indexed="1" _id="77" _ref_sofa="1" begin="59"
+        end="62" pos="VBD"/>
+    <org.apache.uima.caseditor.Token _indexed="1" _id="82" _ref_sofa="1" begin="63"
+        end="68" pos="RB"/>
+    <org.apache.uima.caseditor.Token _indexed="1" _id="87" _ref_sofa="1" begin="70"
+        end="77" pos="VBN"/>
+    <org.apache.uima.caseditor.Token _indexed="1" _id="92" _ref_sofa="1" begin="77"
+        end="78" pos="."/>
+    <org.apache.uima.caseditor.Token _indexed="1" _id="97" _ref_sofa="1" begin="79"
+        end="86" pos="VBG"/>
+    <org.apache.uima.caseditor.Token _indexed="1" _id="102" _ref_sofa="1" begin="93"
+        end="96" pos="RB"/>
+    <org.apache.uima.caseditor.Token _indexed="1" _id="107" _ref_sofa="1" begin="97"
+        end="100" pos="RB"/>
+    <org.apache.uima.caseditor.Token _indexed="1" _id="112" _ref_sofa="1" begin="101"
+        end="105" pos="IN"/>
+    <org.apache.uima.caseditor.Token _indexed="1" _id="117" _ref_sofa="1" begin="106"
+        end="109" pos="PRP$"/>
+    <org.apache.uima.caseditor.Token _indexed="1" _id="122" _ref_sofa="1" begin="110"
+        end="114" pos="NN"/>
+    <org.apache.uima.caseditor.Token _indexed="1" _id="127" _ref_sofa="1" begin="114"
+        end="115" pos=","/>
+    <org.apache.uima.caseditor.Token _indexed="1" _id="132" _ref_sofa="1" begin="116"
+        end="119" pos="DT"/>
+    <org.apache.uima.caseditor.Token _indexed="1" _id="137" _ref_sofa="1" begin="120"
+        end="131" pos="JJ"/>
+    <org.apache.uima.caseditor.Token _indexed="1" _id="142" _ref_sofa="1" begin="132"
+        end="137" pos="NN"/>
+    <org.apache.uima.caseditor.Token _indexed="1" _id="147" _ref_sofa="1" begin="147"
+        end="149" pos="IN"/>
+    <org.apache.uima.caseditor.Token _indexed="1" _id="152" _ref_sofa="1" begin="139"
+        end="146" pos="VBD"/>
+    <org.apache.uima.caseditor.Sentence _indexed="1" _id="157" _ref_sofa="1" begin="0" end="47"/>
+    <org.apache.uima.caseditor.Sentence _indexed="1" _id="161" _ref_sofa="1" begin="48" end="78"/>
+    <org.apache.uima.caseditor.Sentence _indexed="1" _id="165" _ref_sofa="1" begin="79" end="173"/>
+    <org.apache.uima.caseditor.City _indexed="1" _id="169" _ref_sofa="1" begin="40" end="46"/>
+    <org.apache.uima.caseditor.Address _indexed="1" _id="173" _ref_person="305"
+        _ref_street="301" _ref_city="297" _ref_zip="293"/>
+    <org.apache.uima.caseditor.Parse _indexed="1" _id="178" _ref_sofa="1" begin="3"
+        end="11" type="NP"/>
+    <org.apache.uima.caseditor.Parse _indexed="1" _id="183" _ref_sofa="1" begin="0"
+        end="11" type="PP"/>
+    <org.apache.uima.caseditor.Parse _indexed="1" _id="188" _ref_sofa="1" begin="13"
+        end="18" type="NP"/>
+    <org.apache.uima.caseditor.Parse _indexed="1" _id="193" _ref_sofa="1" begin="23"
+        end="34" type="NP"/>
+    <org.apache.uima.caseditor.Parse _indexed="1" _id="198" _ref_sofa="1" begin="40"
+        end="46" type="NP"/>
+    <org.apache.uima.caseditor.Parse _indexed="1" _id="203" _ref_sofa="1" begin="35"
+        end="46" type="PP"/>
+    <org.apache.uima.caseditor.Parse _indexed="1" _id="208" _ref_sofa="1" begin="23"
+        end="46" type="NP"/>
+    <org.apache.uima.caseditor.Parse _indexed="1" _id="213" _ref_sofa="1" begin="19"
+        end="46" type="VP"/>
+    <org.apache.uima.caseditor.Parse _indexed="1" _id="218" _ref_sofa="1" begin="0"
+        end="47" type="S"/>
+    <org.apache.uima.caseditor.Parse _indexed="1" _id="223" _ref_sofa="1" begin="48"
+        end="58" type="NP"/>
+    <org.apache.uima.caseditor.Parse _indexed="1" _id="228" _ref_sofa="1" begin="63"
+        end="68" type="ADVP"/>
+    <org.apache.uima.caseditor.Parse _indexed="1" _id="233" _ref_sofa="1" begin="70"
+        end="77" type="VP"/>
+    <org.apache.uima.caseditor.Parse _indexed="1" _id="238" _ref_sofa="1" begin="59"
+        end="77" type="VP"/>
+    <org.apache.uima.caseditor.Parse _indexed="1" _id="243" _ref_sofa="1" begin="48"
+        end="78" type="S"/>
+    <org.apache.uima.caseditor.Parse _indexed="1" _id="248" _ref_sofa="1" begin="106"
+        end="114" type="NP"/>
+    <org.apache.uima.caseditor.Parse _indexed="1" _id="253" _ref_sofa="1" begin="101"
+        end="114" type="PP"/>
+    <org.apache.uima.caseditor.Parse _indexed="1" _id="258" _ref_sofa="1" begin="93"
+        end="114" type="ADVP"/>
+    <org.apache.uima.caseditor.Parse _indexed="1" _id="263" _ref_sofa="1" begin="79"
+        end="114" type="VP"/>
+    <org.apache.uima.caseditor.Parse _indexed="1" _id="268" _ref_sofa="1" begin="79"
+        end="114" type="S"/>
+    <org.apache.uima.caseditor.Parse _indexed="1" _id="273" _ref_sofa="1" begin="116"
+        end="137" type="NP"/>
+    <org.apache.uima.caseditor.Parse _indexed="1" _id="278" _ref_sofa="1" begin="147"
+        end="172" type="PP"/>
+    <org.apache.uima.caseditor.Parse _indexed="1" _id="283" _ref_sofa="1" begin="139"
+        end="172" type="VP"/>
+    <org.apache.uima.caseditor.Parse _indexed="1" _id="288" _ref_sofa="1" begin="79"
+        end="173" type="S"/>
+    <org.apache.uima.caseditor.Zip _id="293" _ref_sofa="1" begin="417" end="422"/>
+    <org.apache.uima.caseditor.City _id="297" _ref_sofa="1" begin="423" end="430"/>
+    <org.apache.uima.caseditor.Street _id="301" _ref_sofa="1" begin="395" end="412"/>
+    <org.apache.uima.caseditor.Person _id="305" _ref_sofa="1" begin="364" end="378"/>
+</CAS>

Added: incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/NlpModelTest.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/NlpModelTest.java?view=auto&rev=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/NlpModelTest.java (added)
+++ incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/NlpModelTest.java Tue Feb 20 11:01:12 2007
@@ -0,0 +1,231 @@
+/*
+ * 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.uima.caseditor.core.test;
+
+import static org.junit.Assert.assertTrue;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.uima.caseditor.CasEditorPlugin;
+import org.apache.uima.caseditor.core.model.INlpElement;
+import org.apache.uima.caseditor.core.model.delta.INlpElementDelta;
+import org.apache.uima.caseditor.core.model.delta.INlpModelChangeListener;
+import org.apache.uima.caseditor.core.model.delta.Kind;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ */
+public class NlpModelTest {
+  private TestProject mProject;
+
+  /**
+   * Initializes the current instance.
+   */
+  public NlpModelTest() {
+    mProject = new TestProject();
+  }
+
+  /**
+   * @throws CoreException
+   */
+  @Before
+  public void clearWorkspace() throws CoreException {
+    WorkspaceUtil.clearWorkspace();
+  }
+
+  /**
+   * Creates the nlp project from an existing project structure.
+   * 
+   * @throws CoreException
+   */
+  @Test
+  public void testCreationFromExistingProject() throws CoreException {
+    mProject.createProject();
+    mProject.createProjectContent();
+    mProject.createDotCorpus();
+
+    // creates implicit the nlp model
+    mProject.validateNlpProject();
+  }
+
+  /**
+   * Adds the dotcorpus to an empty existing nlp project.
+   * 
+   * @throws CoreException
+   */
+  @Test
+  public void testAddDotCorpus() throws CoreException {
+    CasEditorPlugin.destroyNlpModelForTesting();
+
+    mProject.createProject();
+    mProject.createProjectContent();
+
+    // create the nlp model now
+    CasEditorPlugin.getNlpModel();
+
+    mProject.createDotCorpus();
+
+    mProject.validateNlpProject();
+  }
+
+  /**
+   * This creates an nlp project. Then it creates the dot corpus and the NlpModel.
+   * 
+   * After that all resources are added to the project.
+   * 
+   * @throws CoreException
+   */
+  @Test
+  public void testAddNlpElements() throws CoreException {
+    CasEditorPlugin.destroyNlpModelForTesting();
+
+    mProject.createProject();
+    mProject.createDotCorpus();
+
+    CasEditorPlugin.getNlpModel();
+
+    mProject.createProjectContent();
+
+    mProject.validateNlpProject();
+  }
+
+  /**
+   * 1. create project with nlp nature 2. then create the dot corpus file 3. add all folders and
+   * files
+   * 
+   * Note: the listener must be removed after the test
+   * 
+   * @throws CoreException
+   */
+  @Test
+  public void testAddChangeEventListener() throws CoreException {
+    CasEditorPlugin.destroyNlpModelForTesting();
+
+    final Set<IResource> addedElements = new HashSet<IResource>();
+
+    INlpModelChangeListener listener = new INlpModelChangeListener() {
+      public void refresh(INlpElement element) {
+      }
+
+      public void resourceChanged(INlpElementDelta delta) {
+        if (delta.getKind().equals(Kind.ADDED) && delta.getNlpElement() != null) {
+          addedElements.add(delta.getResource());
+        }
+
+        for (INlpElementDelta child : delta.getAffectedChildren()) {
+          resourceChanged(child);
+        }
+      }
+    };
+
+    CasEditorPlugin.getNlpModel().addNlpModelChangeListener(listener);
+
+    try {
+      mProject.createProject();
+      mProject.createDotCorpus();
+      mProject.createProjectContent();
+
+      // check for add events
+      for (IResource resource : mProject.getResources()) {
+        assertTrue(resource.getName() + " add event is missing!", addedElements.contains(resource));
+      }
+    } finally {
+      CasEditorPlugin.getNlpModel().removeNlpModelChangeListener(listener);
+    }
+  }
+
+  /**
+   * Tests if a project can be removed.
+   * 
+   * @throws CoreException
+   */
+  @Test
+  public void testRemoveProject() throws CoreException {
+    CasEditorPlugin.destroyNlpModelForTesting();
+
+    mProject.createProject();
+    mProject.createDotCorpus();
+    mProject.createProjectContent();
+
+    CasEditorPlugin.getNlpModel();
+
+    mProject.removeProjectContent();
+
+    mProject.removeProject();
+
+    // check if nlp elements are all gone
+    for (IResource resource : mProject.getResources()) {
+      assertTrue(resource.getName() + " must not exist!", CasEditorPlugin.getNlpModel().findMember(
+              resource) == null);
+    }
+
+    // TODO: check if all resources are there
+  }
+
+  /**
+   * Note: the listener must be removed after the test.
+   * 
+   * @throws CoreException
+   */
+  @Test
+  public void testRemoveChangeListener() throws CoreException {
+    mProject.createProject();
+    mProject.createDotCorpus();
+    mProject.createProjectContent();
+
+    final Set<IResource> removedElements = new HashSet<IResource>();
+
+    INlpModelChangeListener listener = new INlpModelChangeListener() {
+      public void refresh(INlpElement element) {
+      }
+
+      public void resourceChanged(INlpElementDelta delta) {
+        if (delta.getKind().equals(Kind.REMOVED) && delta.getNlpElement() != null) {
+          removedElements.add(delta.getResource());
+        }
+
+        for (INlpElementDelta child : delta.getAffectedChildren()) {
+          resourceChanged(child);
+        }
+      }
+
+    };
+
+    CasEditorPlugin.getNlpModel().addNlpModelChangeListener(listener);
+
+    try {
+      mProject.removeProjectContent();
+
+      mProject.removeProject();
+
+      // check for removed events
+      for (IResource resource : mProject.getResources()) {
+        assertTrue(resource.getName() + " remove event is missing!", removedElements
+                .contains(resource));
+      }
+    } finally {
+      CasEditorPlugin.getNlpModel().removeNlpModelChangeListener(listener);
+    }
+  }
+}

Added: incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/TestProject.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/TestProject.java?view=auto&rev=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/TestProject.java (added)
+++ incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/TestProject.java Tue Feb 20 11:01:12 2007
@@ -0,0 +1,205 @@
+/*
+ * 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.uima.caseditor.core.test;
+
+import static org.junit.Assert.assertTrue;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+
+import org.apache.uima.caseditor.CasEditorPlugin;
+import org.apache.uima.caseditor.core.model.NlpProject;
+import org.apache.uima.caseditor.core.model.dotcorpus.DotCorpus;
+import org.apache.uima.caseditor.core.model.dotcorpus.DotCorpusSerializer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+
+/**
+ */
+public class TestProject {
+  private IProject mProject;
+
+  private IFile mDotCorpus;
+
+  private IFolder mCorpusFolder;
+
+  private IFolder mSourceFolder;
+
+  private IFolder mConfiguration;
+
+  private IFile mTypesystem;
+
+  private IFile mDocument;
+
+  private IFile mAnnotatorFile;
+
+  private IFile mConsumerFile;
+
+  private IResource mContentResources[];
+
+  public TestProject() {
+    mProject = ResourcesPlugin.getWorkspace().getRoot().getProject("JUnitTestProject");
+
+    mDotCorpus = mProject.getFile(".corpus");
+
+    mCorpusFolder = mProject.getFolder("corpus");
+
+    mSourceFolder = mProject.getFolder("UimaSourceFolder");
+    mConfiguration = mProject.getFolder("UimaSourceFolder/Config");
+
+    mTypesystem = mProject.getFile("Typesystem.xml");
+    mDocument = mCorpusFolder.getFile("Document.xcas");
+    mAnnotatorFile = mConfiguration.getFile("Annotator.ann");
+    mConsumerFile = mConfiguration.getFile("Consumer.con");
+
+    mContentResources = new IResource[] { mCorpusFolder, mSourceFolder, mConfiguration, mDocument,
+        mAnnotatorFile, mConsumerFile };
+  }
+
+  IFile getDotCorpus() {
+    return mDotCorpus;
+  }
+
+  IResource[] getResources() {
+    return mContentResources;
+  }
+
+  IFile getAnnotatorFile() {
+    return mAnnotatorFile;
+  }
+
+  IFolder getConfiguration() {
+    return mConfiguration;
+  }
+
+  IFile getConsumerFile() {
+    return mConsumerFile;
+  }
+
+  IFolder getCorpusFolder() {
+    return mCorpusFolder;
+  }
+
+  IFile getDocument() {
+    return mDocument;
+  }
+
+  IFolder getSourceFolder() {
+    return mSourceFolder;
+  }
+
+  IFile getTypesystem() {
+    return mTypesystem;
+  }
+
+  IProject getProject() {
+    return mProject;
+  }
+
+  /**
+   * Creates an emtpy project with nlp nature.
+   * 
+   * @throws CoreException
+   */
+  void createProject() throws CoreException {
+    mProject.create(null);
+
+    mProject.open(null);
+
+    NlpProject.addNLPNature(mProject);
+  }
+
+  /**
+   * Creates the Nlp Project content.
+   * 
+   * @throws CoreException
+   */
+  void createProjectContent() throws CoreException {
+    // create corpus folder
+    mCorpusFolder.create(true, true, null);
+
+    // create source folder
+    mSourceFolder.create(true, true, null);
+
+    // create config folder
+    mConfiguration.create(true, true, null);
+
+    // create a typesystem file here ...
+    mTypesystem.create(getClass().getResourceAsStream("/org/apache/uima/caseditor/core/test/Typesystem.xml"),
+            true, null);
+
+    // create annotator.ann
+    mAnnotatorFile.create(getClass().getResourceAsStream("/org/apache/uima/caseditor/core/test/Annotator.ann"),
+            true, null);
+
+    // careate consumer.con
+    mConsumerFile.create(getClass().getResourceAsStream("/org/apache/uima/caseditor/core/test/Consumer.con"),
+            true, null);
+
+    // create a document
+    mDocument.create(getClass().getResourceAsStream("/org/apache/uima/caseditor/core/test/Document.xcas"), true,
+            null);
+  }
+
+  /**
+   * 
+   * @throws CoreException
+   */
+  void createDotCorpus() throws CoreException {
+    DotCorpus dotCorpus = new DotCorpus();
+
+    dotCorpus.addCorpusFolder(mCorpusFolder.getName());
+    dotCorpus.setUimaConfigFolderName(mSourceFolder.getName());
+    dotCorpus.setTypeSystemFilename(mTypesystem.getName());
+
+    ByteArrayOutputStream out = new ByteArrayOutputStream();
+    DotCorpusSerializer.serialize(dotCorpus, out);
+
+    InputStream in = new ByteArrayInputStream(out.toByteArray());
+
+    mDotCorpus.create(in, true, null);
+  }
+
+  void removeProject() throws CoreException {
+    mProject.delete(true, null);
+  }
+
+  void removeProjectContent() throws CoreException {
+    mDocument.delete(true, null);
+    mCorpusFolder.delete(true, null);
+    mAnnotatorFile.delete(true, null);
+    mConsumerFile.delete(true, null);
+    mConfiguration.delete(true, null);
+    mSourceFolder.delete(true, null);
+  }
+
+  void validateNlpProject() {
+    // TODO: add nlp project validation
+    for (IResource resource : mContentResources) {
+      assertTrue(resource.getName() + " does not exist!", (CasEditorPlugin.getNlpModel().findMember(
+              resource) != null));
+    }
+  }
+}

Added: incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/Typesystem.xml
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/Typesystem.xml?view=auto&rev=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/Typesystem.xml (added)
+++ incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/Typesystem.xml Tue Feb 20 11:01:12 2007
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<typeSystemDescription xmlns="http://uima.watson.ibm.com/resourceSpecifier">
+	<name>TutorialTypeSystemTutorialTypeSystem</name>
+	<description>Sample project typesystem</description>
+	<version>1.0</version>
+	<vendor>IBM</vendor>
+	<types>
+		<typeDescription>
+			<name>org.apache.uima.caseditor.Test</name>
+			<description>a test</description>
+			<supertypeName>uima.tcas.Annotation</supertypeName>
+		</typeDescription>
+</types>
+</typeSystemDescription>

Added: incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/WorkspaceUtil.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/WorkspaceUtil.java?view=auto&rev=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/WorkspaceUtil.java (added)
+++ incubator/uima/sandbox/trunk/CasEditor/src/plugintest/java/org/apache/uima/caseditor/core/test/WorkspaceUtil.java Tue Feb 20 11:01:12 2007
@@ -0,0 +1,58 @@
+/*
+ * 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.uima.caseditor.core.test;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+
+/**
+ */
+class WorkspaceUtil {
+  /**
+   * Deletes all projects inside the workspace.
+   * 
+   * Will be run after every test.
+   * 
+   * @throws CoreException
+   *           is thrown if deletion goes wrong
+   */
+  static void clearWorkspace() throws CoreException {
+    IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+
+    IProject projects[] = root.getProjects();
+
+    for (IProject project : projects) {
+      project.delete(true, null);
+    }
+  }
+
+  static boolean containsIFolder(IResource resources[], String name) {
+    for (IResource resource : resources) {
+      if (name.equals(resource.getName())) {
+        return true;
+      }
+    }
+
+    return false;
+  }
+}

Modified: incubator/uima/sandbox/trunk/CasEditor/src/test/java/org/apache/uima/caseditor/core/model/dotcorpus/AnnotationStyleTest.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/test/java/org/apache/uima/caseditor/core/model/dotcorpus/AnnotationStyleTest.java?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/test/java/org/apache/uima/caseditor/core/model/dotcorpus/AnnotationStyleTest.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/test/java/org/apache/uima/caseditor/core/model/dotcorpus/AnnotationStyleTest.java Tue Feb 20 11:01:12 2007
@@ -1,56 +1,56 @@
-/*
- * 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.uima.caseditor.core.model.dotcorpus;
-
-import java.awt.Color;
-
-import org.apache.uima.caseditor.core.model.dotcorpus.AnnotationStyle;
-
-/**
- * Unit test for the {@link AnnotationStyle} class.
- * 
- * @author <a href="mailto:kottmann@gmail.com">Joern Kottmann</a>
- * @version $Revision: 1.4.2.2 $, $Date: 2007/01/04 14:56:25 $
- */
-public class AnnotationStyleTest {
-  /**
-   * Tests the {@link AnnotationStyle#equals(Object)} method.
-   */
-  @Test
-  public void testEquals() {
-    AnnotationStyle a = new AnnotationStyle("testType", AnnotationStyle.Style.BRACKET, Color.BLACK);
-
-    AnnotationStyle b = new AnnotationStyle("testType", AnnotationStyle.Style.BRACKET, Color.BLACK);
-
-    assertEquals(a, b);
-  }
-
-  /**
-   * Test the {@link AnnotationStyle#hashCode()} method.
-   * 
-   */
-  public void testHashCode() {
-    AnnotationStyle a = new AnnotationStyle("testType", AnnotationStyle.Style.BRACKET, Color.BLACK);
-
-    AnnotationStyle b = new AnnotationStyle("testType", AnnotationStyle.Style.BRACKET, Color.BLACK);
-
-    assertEquals(a.hashCode(), b.hashCode());
-  }
+/*
+ * 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.uima.caseditor.core.model.dotcorpus;
+
+import static org.junit.Assert.assertEquals;
+
+import java.awt.Color;
+
+import org.apache.uima.caseditor.core.model.dotcorpus.AnnotationStyle;
+import org.junit.Test;
+
+/**
+ * Unit test for the {@link AnnotationStyle} class.
+ */
+public class AnnotationStyleTest {
+  /**
+   * Tests the {@link AnnotationStyle#equals(Object)} method.
+   */
+  @Test
+  public void testEquals() {
+    AnnotationStyle a = new AnnotationStyle("testType", AnnotationStyle.Style.BRACKET, Color.BLACK);
+
+    AnnotationStyle b = new AnnotationStyle("testType", AnnotationStyle.Style.BRACKET, Color.BLACK);
+
+    assertEquals(a, b);
+  }
+
+  /**
+   * Test the {@link AnnotationStyle#hashCode()} method.
+   * 
+   */
+  public void testHashCode() {
+    AnnotationStyle a = new AnnotationStyle("testType", AnnotationStyle.Style.BRACKET, Color.BLACK);
+
+    AnnotationStyle b = new AnnotationStyle("testType", AnnotationStyle.Style.BRACKET, Color.BLACK);
+
+    assertEquals(a.hashCode(), b.hashCode());
+  }
 }

Modified: incubator/uima/sandbox/trunk/CasEditor/src/test/java/org/apache/uima/caseditor/core/model/dotcorpus/DotCorpusSerializerTest.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/test/java/org/apache/uima/caseditor/core/model/dotcorpus/DotCorpusSerializerTest.java?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/test/java/org/apache/uima/caseditor/core/model/dotcorpus/DotCorpusSerializerTest.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/test/java/org/apache/uima/caseditor/core/model/dotcorpus/DotCorpusSerializerTest.java Tue Feb 20 11:01:12 2007
@@ -1,61 +1,63 @@
-/*
- * 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.uima.caseditor.core.model.dotcorpus;
-
-import java.awt.Color;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
-
-import org.apache.uima.caseditor.core.model.dotcorpus.AnnotationStyle;
-import org.apache.uima.caseditor.core.model.dotcorpus.DotCorpus;
-import org.apache.uima.caseditor.core.model.dotcorpus.DotCorpusSerializer;
-import org.eclipse.core.runtime.CoreException;
-
-/**
- * TODO: add javadoc here
- * 
- * @author <a href="mailto:kottmann@gmail.com">Joern Kottmann</a>
- * @version $Revision: 1.4.2.2 $, $Date: 2007/01/04 14:56:25 $
- */
-public class DotCorpusSerializerTest {
-  /**
-   * Tests if serialization and recreations creates and object that is equal to the original.
-   * 
-   * @throws CoreException
-   */
-  @Test
-  public void testSerializeAndCreate() throws CoreException {
-    DotCorpus original = new DotCorpus();
-    original.setTypeSystemFilename("typesystem");
-    original.setUimaConfigFolderName("uima config folder");
-    original.setStyle(new AnnotationStyle("test", Style.BRACKET, Color.GRAY));
-    original.addCorpusFolder("corpus");
-
-    ByteArrayOutputStream out = new ByteArrayOutputStream();
-    DotCorpusSerializer.serialize(original, out);
-
-    InputStream in = new ByteArrayInputStream(out.toByteArray());
-
-    DotCorpus recreated = DotCorpusSerializer.parseDotCorpus(in);
-
-    assertEquals(original, recreated);
-  }
-}
+/*
+ * 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.uima.caseditor.core.model.dotcorpus;
+
+import static org.junit.Assert.assertEquals;
+
+import java.awt.Color;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+
+
+import org.apache.uima.caseditor.core.model.dotcorpus.AnnotationStyle;
+import org.apache.uima.caseditor.core.model.dotcorpus.DotCorpus;
+import org.apache.uima.caseditor.core.model.dotcorpus.DotCorpusSerializer;
+import org.apache.uima.caseditor.core.model.dotcorpus.AnnotationStyle.Style;
+import org.eclipse.core.runtime.CoreException;
+import org.junit.Test;
+
+/**
+ * TODO: add javadoc here
+ */
+public class DotCorpusSerializerTest {
+  /**
+   * Tests if serialization and recreations creates and object that is equal to the original.
+   * 
+   * @throws CoreException
+   */
+  @Test
+  public void testSerializeAndCreate() throws CoreException {
+    DotCorpus original = new DotCorpus();
+    original.setTypeSystemFilename("typesystem");
+    original.setUimaConfigFolderName("uima config folder");
+    original.setStyle(new AnnotationStyle("test", Style.BRACKET, Color.GRAY));
+    original.addCorpusFolder("corpus");
+
+    ByteArrayOutputStream out = new ByteArrayOutputStream();
+    DotCorpusSerializer.serialize(original, out);
+
+    InputStream in = new ByteArrayInputStream(out.toByteArray());
+
+    DotCorpus recreated = DotCorpusSerializer.parseDotCorpus(in);
+
+    assertEquals(original, recreated);
+  }
+}

Modified: incubator/uima/sandbox/trunk/CasEditor/src/test/java/org/apache/uima/caseditor/core/util/SpanTest.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/test/java/org/apache/uima/caseditor/core/util/SpanTest.java?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/test/java/org/apache/uima/caseditor/core/util/SpanTest.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/test/java/org/apache/uima/caseditor/core/util/SpanTest.java Tue Feb 20 11:01:12 2007
@@ -1,159 +1,160 @@
-/*
- * 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.uima.caseditor.core.util;
-
-import org.apache.uima.caseditor.core.util.Span;
-
-/**
- * Unit test for the <code>Span</code> class.
- * 
- * @author <a href="mailto:kottmann@gmail.com">Joern Kottmann</a>
- * @version $Revision: 1.6.2.2 $, $Date: 2007/01/04 14:56:26 $
- */
-public class SpanTest {
-  /**
-   * Test the Span.equals() method.
-   */
-  @Test
-  public void testEquals() {
-    Span a = new Span(100, 1000);
-    Span b = new Span(100, 1000);
-
-    assertEquals(a.equals(b), true);
-  }
-
-  /**
-   * Test the Span.equals() method.
-   */
-  @Test
-  public void testEqualsWithAnotherObject() {
-    Span a = new Span(0, 0);
-
-    assertFalse(Boolean.TRUE.equals(a));
-  }
-
-  /**
-   * Test the Span.equals() method.
-   */
-  @Test
-  public void testEqualsWithNull() {
-    Span a = new Span(0, 0);
-
-    assertEquals(a.equals(null), false);
-  }
-
-  /**
-   * Test the Span.compareTo(Object) method.
-   */
-  @Test
-  public void testCompareToWithBiggerSpan() {
-    Span a = new Span(100, 1000);
-    Span b = new Span(5000, 900);
-
-    assertEquals(true, a.compareTo(b) > 0);
-  }
-
-  /**
-   * Test the Span.compareTo(Object) method.
-   */
-  @Test
-  public void testCompareToWithBiggerIntersectSpan() {
-    Span a = new Span(100, 1000);
-    Span b = new Span(900, 900);
-
-    assertEquals(true, a.compareTo(b) > 0);
-  }
-
-  /**
-   * Test the Span.compareTo(Object) method.
-   */
-  @Test
-  public void testCompareToWithLowerSpan() {
-    Span a = new Span(5000, 900);
-    Span b = new Span(100, 1000);
-
-    assertEquals(true, a.compareTo(b) < 0);
-  }
-
-  /**
-   * Test the Span.compareTo(Object) method.
-   */
-  @Test
-  public void testCompareToWithLowerIntersectSpan() {
-    Span a = new Span(5000, 900);
-    Span b = new Span(4900, 1000);
-
-    assertEquals(true, a.compareTo(b) < 0);
-  }
-
-  /**
-   * Test the Span.compareTo(Object) method.
-   */
-  @Test
-  public void testCompareToEquals() {
-    Span a = new Span(4900, 1000);
-    Span b = new Span(4900, 1000);
-
-    assertEquals(true, a.compareTo(b) == 0);
-  }
-
-  /**
-   * Test the Span.IsContaining(Span) method.
-   */
-  @Test
-  public void testIsContaining() {
-    Span a = new Span(5000, 900);
-    Span b = new Span(5200, 600);
-
-    assertEquals(true, a.isContaining(b));
-  }
-
-  /**
-   * Test the Span.IsContaining(Span) method.
-   */
-  @Test
-  public void testIsContainingWithEqual() {
-    Span a = new Span(5000, 900);
-
-    assertEquals(true, a.isContaining(a));
-  }
-
-  /**
-   * Test the Span.IsContaining(Span) method.
-   */
-  @Test
-  public void testIsContainingWithLowerIntersect() {
-    Span a = new Span(5000, 900);
-    Span b = new Span(4500, 1000);
-
-    assertEquals(false, a.isContaining(b));
-  }
-
-  /**
-   * Test the Span.IsContaining(Span) method.
-   */
-  @Test
-  public void testIsContainingWithHigherIntersect() {
-    Span a = new Span(5000, 900);
-    Span b = new Span(5000, 1000);
-
-    assertEquals(false, a.isContaining(b));
-  }
+/*
+ * 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.uima.caseditor.core.util;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+
+import org.apache.uima.caseditor.core.util.Span;
+import org.junit.Test;
+
+/**
+ * Unit test for the <code>Span</code> class.
+ */
+public class SpanTest {
+  /**
+   * Test the Span.equals() method.
+   */
+  @Test
+  public void testEquals() {
+    Span a = new Span(100, 1000);
+    Span b = new Span(100, 1000);
+
+    assertEquals(a.equals(b), true);
+  }
+
+  /**
+   * Test the Span.equals() method.
+   */
+  @Test
+  public void testEqualsWithAnotherObject() {
+    Span a = new Span(0, 0);
+
+    assertFalse(Boolean.TRUE.equals(a));
+  }
+
+  /**
+   * Test the Span.equals() method.
+   */
+  @Test
+  public void testEqualsWithNull() {
+    Span a = new Span(0, 0);
+
+    assertEquals(a.equals(null), false);
+  }
+
+  /**
+   * Test the Span.compareTo(Object) method.
+   */
+  @Test
+  public void testCompareToWithBiggerSpan() {
+    Span a = new Span(100, 1000);
+    Span b = new Span(5000, 900);
+
+    assertEquals(true, a.compareTo(b) > 0);
+  }
+
+  /**
+   * Test the Span.compareTo(Object) method.
+   */
+  @Test
+  public void testCompareToWithBiggerIntersectSpan() {
+    Span a = new Span(100, 1000);
+    Span b = new Span(900, 900);
+
+    assertEquals(true, a.compareTo(b) > 0);
+  }
+
+  /**
+   * Test the Span.compareTo(Object) method.
+   */
+  @Test
+  public void testCompareToWithLowerSpan() {
+    Span a = new Span(5000, 900);
+    Span b = new Span(100, 1000);
+
+    assertEquals(true, a.compareTo(b) < 0);
+  }
+
+  /**
+   * Test the Span.compareTo(Object) method.
+   */
+  @Test
+  public void testCompareToWithLowerIntersectSpan() {
+    Span a = new Span(5000, 900);
+    Span b = new Span(4900, 1000);
+
+    assertEquals(true, a.compareTo(b) < 0);
+  }
+
+  /**
+   * Test the Span.compareTo(Object) method.
+   */
+  @Test
+  public void testCompareToEquals() {
+    Span a = new Span(4900, 1000);
+    Span b = new Span(4900, 1000);
+
+    assertEquals(true, a.compareTo(b) == 0);
+  }
+
+  /**
+   * Test the Span.IsContaining(Span) method.
+   */
+  @Test
+  public void testIsContaining() {
+    Span a = new Span(5000, 900);
+    Span b = new Span(5200, 600);
+
+    assertEquals(true, a.isContaining(b));
+  }
+
+  /**
+   * Test the Span.IsContaining(Span) method.
+   */
+  @Test
+  public void testIsContainingWithEqual() {
+    Span a = new Span(5000, 900);
+
+    assertEquals(true, a.isContaining(a));
+  }
+
+  /**
+   * Test the Span.IsContaining(Span) method.
+   */
+  @Test
+  public void testIsContainingWithLowerIntersect() {
+    Span a = new Span(5000, 900);
+    Span b = new Span(4500, 1000);
+
+    assertEquals(false, a.isContaining(b));
+  }
+
+  /**
+   * Test the Span.IsContaining(Span) method.
+   */
+  @Test
+  public void testIsContainingWithHigherIntersect() {
+    Span a = new Span(5000, 900);
+    Span b = new Span(5000, 1000);
+
+    assertEquals(false, a.isContaining(b));
+  }
 }