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 [5/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/editor/annotation/BoxDrawingStrategy.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/annotation/BoxDrawingStrategy.java?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/annotation/BoxDrawingStrategy.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/annotation/BoxDrawingStrategy.java Tue Feb 20 11:01:12 2007
@@ -28,9 +28,6 @@
/**
* Draws a box arround an annotation.
- *
- * @author <a href="mailto:kottmann@gmail.com">Joern Kottmann</a>
- * @version $Revision: 1.2.2.2 $, $Date: 2007/01/04 15:00:56 $
*/
final class BoxDrawingStrategy implements IDrawingStrategy {
/**
Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/annotation/BracketDrawingStrategy.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/annotation/BracketDrawingStrategy.java?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/annotation/BracketDrawingStrategy.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/annotation/BracketDrawingStrategy.java Tue Feb 20 11:01:12 2007
@@ -29,9 +29,6 @@
/**
* Draws brackets arround an annotation.
- *
- * @author <a href="mailto:kottmann@gmail.com">Joern Kottmann</a>
- * @version $Revision: 1.2.2.2 $, $Date: 2007/01/04 15:00:56 $
*/
public class BracketDrawingStrategy implements IDrawingStrategy {
private static final int BRACKET_WIDTH = 3;
Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/annotation/DrawingStyle.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/annotation/DrawingStyle.java?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/annotation/DrawingStyle.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/annotation/DrawingStyle.java Tue Feb 20 11:01:12 2007
@@ -23,9 +23,6 @@
/**
* An enumertation of all available {@link IDrawingStrategy}.
- *
- * @author <a href="mailto:kottmann@gmail.com">Joern Kottmann</a>
- * @version $Revision: 1.1.2.2 $, $Date: 2007/01/04 15:00:56 $
*/
public enum DrawingStyle {
/**
Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/annotation/EclipseAnnotationPeer.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/annotation/EclipseAnnotationPeer.java?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/annotation/EclipseAnnotationPeer.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/annotation/EclipseAnnotationPeer.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.2 $, $Date: 2007/01/04 15:00:56 $
*/
public class EclipseAnnotationPeer extends org.eclipse.jface.text.source.Annotation {
private AnnotationFS mAnnotation;
Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/annotation/UnderlineDrawingStrategy.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/annotation/UnderlineDrawingStrategy.java?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/annotation/UnderlineDrawingStrategy.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/annotation/UnderlineDrawingStrategy.java Tue Feb 20 11:01:12 2007
@@ -29,9 +29,6 @@
/**
* Draws an line under an annotation.
- *
- * @author <a href="mailto:kottmann@gmail.com">Joern Kottmann</a>
- * @version $Revision: 1.2.2.2 $, $Date: 2007/01/04 15:00:56 $
*/
public class UnderlineDrawingStrategy implements IDrawingStrategy {
Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/context/AnnotationEditingControl.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/context/AnnotationEditingControl.java?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/context/AnnotationEditingControl.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/context/AnnotationEditingControl.java Tue Feb 20 11:01:12 2007
@@ -28,12 +28,14 @@
/**
* TODO: add javadoch here
- *
- * @author <a href="mailto:kottmann@gmail.com">Joern Kottmann</a>
- * @version $Revision: 1.3.2.2 $, $Date: 2007/01/04 15:00:58 $
*/
public class AnnotationEditingControl extends Composite {
+ /**
+ * Initializes the current instance.
+ *
+ * @param parent
+ */
public AnnotationEditingControl(Composite parent) {
super(parent, SWT.NONE);
@@ -47,6 +49,8 @@
/**
* Display this feature structure.
+ *
+ * @param structure
*/
public void displayFeatureStructure(FeatureStructure structure) {
Feature hack = structure.getType().getFeatureByBaseName("byte");
Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/context/AnnotationEditingControlCreator.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/context/AnnotationEditingControlCreator.java?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/context/AnnotationEditingControlCreator.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/context/AnnotationEditingControlCreator.java Tue Feb 20 11:01:12 2007
@@ -29,11 +29,16 @@
/**
* TODO: add javadoc here
- *
- * @author <a href="mailto:kottmann@gmail.com">Joern Kottmann</a>
- * @version $Revision: 1.3.2.2 $, $Date: 2007/01/04 15:00:58 $
*/
public class AnnotationEditingControlCreator implements IInformationControlCreator {
+
+ /**
+ * Creates the information control.
+ *
+ * @param parent
+ *
+ * @return the new control
+ */
public IInformationControl createInformationControl(Shell parent) {
final ICustomInformationControlContentHandler contentHandler = new ICustomInformationControlContentHandler() {
Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/fsview/FeatureStructureBrowserView.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/fsview/FeatureStructureBrowserView.java?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/fsview/FeatureStructureBrowserView.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/fsview/FeatureStructureBrowserView.java Tue Feb 20 11:01:12 2007
@@ -31,15 +31,12 @@
/**
* TODO: add javadoc here
- *
- * @author <a href="mailto:kottmann@gmail.com">Joern Kottmann</a>
- * @version $Revision: 1.2.2.2 $, $Date: 2007/01/04 15:00:57 $
*/
public final class FeatureStructureBrowserView extends PageBookView {
/**
* The ID of the feature structure view.
*/
- public final String ID = "net.sf.tae.fsview";
+ public final String ID = "org.apache.uima.caseditor.fsview";
@Override
protected IPage createDefaultPage(PageBook book) {
Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/fsview/FeatureStructureBrowserViewPage.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/fsview/FeatureStructureBrowserViewPage.java?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/fsview/FeatureStructureBrowserViewPage.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/fsview/FeatureStructureBrowserViewPage.java Tue Feb 20 11:01:12 2007
@@ -23,9 +23,9 @@
import org.apache.uima.cas.CAS;
import org.apache.uima.cas.FeatureStructure;
import org.apache.uima.cas.Type;
+import org.apache.uima.caseditor.CasEditorPlugin;
+import org.apache.uima.caseditor.Images;
import org.apache.uima.caseditor.editor.AnnotationEditor;
-import org.apache.uima.caseditor.editor.Images;
-import org.apache.uima.caseditor.editor.TaeEditorPlugin;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IStatusLineManager;
@@ -41,10 +41,8 @@
import org.eclipse.ui.part.Page;
/**
- * TODO: add javadoc here TODO: update if annotation model was changed TODO: use
- *
- * @author <a href="mailto:kottmann@gmail.com">Joern Kottmann</a>
- * @version $Revision: 1.5.2.2 $, $Date: 2007/01/04 15:00:57 $
+ * TODO: add javadoc here
+ * TODO: update if annotation model was changed
*/
public final class FeatureStructureBrowserViewPage extends Page {
private class CreateAction extends Action {
@@ -196,7 +194,7 @@
// create
Action createAction = new CreateAction();
createAction.setText("Create");
- createAction.setImageDescriptor(TaeEditorPlugin.getTaeImageDescriptor(Images.ADD));
+ createAction.setImageDescriptor(CasEditorPlugin.getTaeImageDescriptor(Images.ADD));
toolBarManager.add(createAction);
// delete
Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/fsview/FeatureStructureLabelProvider.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/fsview/FeatureStructureLabelProvider.java?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/fsview/FeatureStructureLabelProvider.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/fsview/FeatureStructureLabelProvider.java Tue Feb 20 11:01:12 2007
@@ -31,9 +31,6 @@
/**
* Provide the labels for the given {@link FeatureStructure}s.
- *
- * @author <a href="mailto:kottmann@gmail.com">Joern Kottmann</a>
- * @version $Revision: 1.3.2.2 $, $Date: 2007/01/04 15:00:57 $
*/
public final class FeatureStructureLabelProvider implements ILabelProvider {
public String getText(Object element) {
Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/fsview/FeatureStructureTreeContentProvider.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/fsview/FeatureStructureTreeContentProvider.java?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/fsview/FeatureStructureTreeContentProvider.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/fsview/FeatureStructureTreeContentProvider.java Tue Feb 20 11:01:12 2007
@@ -24,7 +24,6 @@
import java.util.LinkedList;
import java.util.Vector;
-
import org.apache.uima.cas.CAS;
import org.apache.uima.cas.FSIndex;
import org.apache.uima.cas.FSIterator;
@@ -42,10 +41,7 @@
import org.eclipse.jface.viewers.Viewer;
/**
- * .
- *
- * @author <a href="mailto:kottmann@gmail.com">Joern Kottmann</a>
- * @version $Revision: 1.7.2.2 $, $Date: 2007/01/04 15:00:57 $
+ * TODO: add javadoc here
*/
final class FeatureStructureTreeContentProvider implements ITreeContentProvider {
private AnnotationDocument mDocument;
Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/fsview/ITypePaneListener.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/fsview/ITypePaneListener.java?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/fsview/ITypePaneListener.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/fsview/ITypePaneListener.java Tue Feb 20 11:01:12 2007
@@ -23,9 +23,6 @@
/**
* Notifies clients about type changes.
- *
- * @author <a href="mailto:kottmann@gmail.com">Joern Kottmann</a>
- * @version $Revision: 1.1.2.2 $, $Date: 2007/01/04 15:00:57 $
*/
interface ITypePaneListener {
/**
Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/fsview/TypeSelectionPane.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/fsview/TypeSelectionPane.java?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/fsview/TypeSelectionPane.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/fsview/TypeSelectionPane.java Tue Feb 20 11:01:12 2007
@@ -38,11 +38,7 @@
* The <code>TypeSelctionPane</code> notfies a listener about the selected type. Types are
* retrived formt he type system.
*
- * TODO: Should be a types set to default ??? Should type be the same on all instances for one
- * project ?
- *
- * @author <a href="mailto:kottmann@gmail.com">Joern Kottmann</a>
- * @version $Revision: 1.4.2.2 $, $Date: 2007/01/04 15:00:57 $
+ * TODO: Should be a types set to default ?
*/
final class TypeSelectionPane extends Composite {
private static String[] filterTypes = new String[] { CAS.TYPE_NAME_ARRAY_BASE,
Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/fsview/package.html
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/fsview/package.html?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/fsview/package.html (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/fsview/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.editor.fsview</title>
+ <title>org.apache.uima.caseditor.editor.fsview</title>
</head>
<body>
Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/outline/AnnotationOutline.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/outline/AnnotationOutline.java?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/outline/AnnotationOutline.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/outline/AnnotationOutline.java Tue Feb 20 11:01:12 2007
@@ -24,10 +24,11 @@
import java.util.HashMap;
import java.util.Map;
-
import org.apache.uima.cas.FeatureStructure;
import org.apache.uima.cas.Type;
import org.apache.uima.cas.text.AnnotationFS;
+import org.apache.uima.caseditor.CasEditorPlugin;
+import org.apache.uima.caseditor.Images;
import org.apache.uima.caseditor.core.AbstractAnnotationDocumentListener;
import org.apache.uima.caseditor.core.IDocument;
import org.apache.uima.caseditor.core.model.NlpModel;
@@ -36,8 +37,6 @@
import org.apache.uima.caseditor.editor.AnnotationEditor;
import org.apache.uima.caseditor.editor.AnnotationSelection;
import org.apache.uima.caseditor.editor.IAnnotationEditorModifyListener;
-import org.apache.uima.caseditor.editor.Images;
-import org.apache.uima.caseditor.editor.TaeEditorPlugin;
import org.apache.uima.caseditor.editor.action.DeleteFeatureStructureAction;
import org.apache.uima.caseditor.editor.action.LowerLeftAnnotationSideAction;
import org.apache.uima.caseditor.editor.action.LowerRightAnnotationSideAction;
@@ -67,7 +66,6 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.TableItem;
import org.eclipse.swt.widgets.TreeColumn;
import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.ui.IActionBars;
@@ -80,9 +78,6 @@
/**
* This outline view displays all <code>AnnotationFS</code>s of the current mode/type from the
* binded editor.
- *
- * @author <a href="mailto:kottmann@gmail.com">Joern Kottmann</a>
- * @version $Revision: 1.12.2.2 $, $Date: 2007/01/04 15:00:58 $
*/
public final class AnnotationOutline extends ContentOutlinePage implements ISelectionListener {
/**
@@ -311,8 +306,6 @@
private TreeViewer mTableViewer;
- private TableItem mLastSelectedItem;
-
/**
* The <code>AnnotationEditor</code> which is bound to this outline view.
*/
@@ -401,7 +394,7 @@
WideLeftAnnotationSideAction wideLeftAnnotationSideAction = new WideLeftAnnotationSideAction(
mEditor.getDocument());
wideLeftAnnotationSideAction.setText("Wides the left annotation side");
- wideLeftAnnotationSideAction.setImageDescriptor(TaeEditorPlugin
+ wideLeftAnnotationSideAction.setImageDescriptor(CasEditorPlugin
.getTaeImageDescriptor(Images.WIDE_LEFT_SIDE));
getSite().getSelectionProvider().addSelectionChangedListener(wideLeftAnnotationSideAction);
@@ -412,7 +405,7 @@
LowerLeftAnnotationSideAction lowerLeftAnnotationSideAction = new LowerLeftAnnotationSideAction(
mEditor.getDocument());
lowerLeftAnnotationSideAction.setText("Lowers the left annotation side");
- lowerLeftAnnotationSideAction.setImageDescriptor(TaeEditorPlugin
+ lowerLeftAnnotationSideAction.setImageDescriptor(CasEditorPlugin
.getTaeImageDescriptor(Images.LOWER_LEFT_SIDE));
getSite().getSelectionProvider().addSelectionChangedListener(lowerLeftAnnotationSideAction);
@@ -423,7 +416,7 @@
LowerRightAnnotationSideAction lowerRightAnnotionSideAction = new LowerRightAnnotationSideAction(
mEditor.getDocument());
lowerRightAnnotionSideAction.setText("Lowers the right annotation side");
- lowerRightAnnotionSideAction.setImageDescriptor(TaeEditorPlugin
+ lowerRightAnnotionSideAction.setImageDescriptor(CasEditorPlugin
.getTaeImageDescriptor(Images.LOWER_RIGHT_SIDE));
getSite().getSelectionProvider().addSelectionChangedListener(lowerRightAnnotionSideAction);
@@ -435,7 +428,7 @@
mEditor.getDocument());
wideRightAnnotationSideAction.setText("Wides the right annotation side");
- wideRightAnnotationSideAction.setImageDescriptor(TaeEditorPlugin
+ wideRightAnnotationSideAction.setImageDescriptor(CasEditorPlugin
.getTaeImageDescriptor(Images.WIDE_RIGHT_SIDE));
getSite().getSelectionProvider().addSelectionChangedListener(wideRightAnnotationSideAction);
@@ -445,7 +438,7 @@
// merge action
MergeAnnotationAction mergeAction = new MergeAnnotationAction(mEditor.getDocument());
getSite().getSelectionProvider().addSelectionChangedListener(mergeAction);
- mergeAction.setImageDescriptor(TaeEditorPlugin.getTaeImageDescriptor(Images.MERGE));
+ mergeAction.setImageDescriptor(CasEditorPlugin.getTaeImageDescriptor(Images.MERGE));
toolBarManager.add(mergeAction);
@@ -538,7 +531,7 @@
if (selection instanceof StructuredSelection) {
AnnotationSelection annotations = new AnnotationSelection((StructuredSelection) selection);
- if (!annotations.isEmtpy()) {
+ if (!annotations.isEmpty()) {
ISelection tableSelection = new StructuredSelection(new AnnotationTreeNode(mEditor
.getDocument(), annotations.getFirst()));
Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/outline/AnnotationTreeNode.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/outline/AnnotationTreeNode.java?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/outline/AnnotationTreeNode.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/outline/AnnotationTreeNode.java Tue Feb 20 11:01:12 2007
@@ -1,135 +1,131 @@
-/*
- * 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.editor.outline;
-
-import java.util.List;
-
-
-import org.apache.uima.cas.FeatureStructure;
-import org.apache.uima.cas.text.AnnotationFS;
-import org.apache.uima.caseditor.core.IDocument;
-import org.apache.uima.caseditor.editor.ModelFeatureStructure;
-import org.apache.uima.caseditor.editor.properties.FSPropertySourceFactory;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.ui.views.properties.IPropertySource;
-
-/**
- * TODO: add javadoc here
- *
- * @author <a href="mailto:kottmann@gmail.com">Joern Kottmann</a>
- * @version $Revision: 1.4.2.2 $, $Date: 2007/01/04 15:00:58 $
- */
-public class AnnotationTreeNode implements IAdaptable {
- private AnnotationTreeNode mParent;
-
- private AnnotationTreeNodeList mChildren;
-
- private AnnotationFS mAnnotation;
-
- private IDocument mDocument;
-
- AnnotationTreeNode(IDocument document, AnnotationFS annotation) {
- Assert.isNotNull(document);
- mDocument = document;
-
- Assert.isNotNull(annotation);
- mAnnotation = annotation;
-
- mChildren = new AnnotationTreeNodeList(mDocument);
- }
-
- AnnotationTreeNode getParent() {
- return mParent;
- }
-
- List<AnnotationTreeNode> getChildren() {
- return mChildren.getElements();
- }
-
- AnnotationFS getAnnotation() {
- return mAnnotation;
- }
-
- /**
- * Checks if the given node is completly contained by the current node instance.
- *
- * @param node
- * @return true if completly contained otherwise false
- */
- boolean isChild(AnnotationTreeNode node) {
- return getAnnotation().getBegin() <= node.getAnnotation().getBegin()
- && getAnnotation().getEnd() >= node.getAnnotation().getEnd();
- }
-
- void addChild(AnnotationTreeNode node) {
- node.mParent = this;
-
- mChildren.add(node);
-
- mChildren.buildTree();
- }
-
- public Object getAdapter(Class adapter) {
- // TODO:
- // use ModelFeatureStructure
- // create a AdapterFactory which just calls the
- // ModelFeatureStructureAdpaterFactory
-
- if (AnnotationFS.class.equals(adapter) || FeatureStructure.class.equals(adapter)) {
- return getAnnotation();
- } else if (IPropertySource.class.equals(adapter)) {
- return FSPropertySourceFactory.create(new ModelFeatureStructure(mDocument, getAnnotation()));
- } else {
- return null;
- }
- }
-
- @Override
- public int hashCode() {
- final int PRIME = 31;
- int result = 1;
- result = PRIME * result + ((mAnnotation == null) ? 0 : mAnnotation.hashCode());
- result = PRIME * result + ((mChildren == null) ? 0 : mChildren.hashCode());
- result = PRIME * result + ((mParent == null) ? 0 : mParent.hashCode());
- return mAnnotation.hashCode();
- }
-
- @Override
- public boolean equals(Object obj) {
- if (getClass() != obj.getClass()) {
- return false;
- }
-
- final AnnotationTreeNode other = (AnnotationTreeNode) obj;
-
- /*
- * if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() !=
- * obj.getClass()) return false; final AnnotationTreeNode other = (AnnotationTreeNode) obj; if
- * (mAnnotation == null) { if (other.mAnnotation != null) return false; } else if
- * (!mAnnotation.equals(other.mAnnotation)) return false; if (mChildren == null) { if
- * (other.mChildren != null) return false; } else if (!mChildren.equals(other.mChildren)) return
- * false; if (mParent == null) { if (other.mParent != null) return false; } else if
- * (!mParent.equals(other.mParent)) return false;
- */
- return other.getAnnotation().equals(mAnnotation);
- }
-
+/*
+ * 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.editor.outline;
+
+import java.util.List;
+
+import org.apache.uima.cas.FeatureStructure;
+import org.apache.uima.cas.text.AnnotationFS;
+import org.apache.uima.caseditor.core.IDocument;
+import org.apache.uima.caseditor.editor.ModelFeatureStructure;
+import org.apache.uima.caseditor.editor.properties.FSPropertySourceFactory;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.ui.views.properties.IPropertySource;
+
+/**
+ * TODO: add javadoc here
+ */
+public class AnnotationTreeNode implements IAdaptable {
+ private AnnotationTreeNode mParent;
+
+ private AnnotationTreeNodeList mChildren;
+
+ private AnnotationFS mAnnotation;
+
+ private IDocument mDocument;
+
+ AnnotationTreeNode(IDocument document, AnnotationFS annotation) {
+ Assert.isNotNull(document);
+ mDocument = document;
+
+ Assert.isNotNull(annotation);
+ mAnnotation = annotation;
+
+ mChildren = new AnnotationTreeNodeList(mDocument);
+ }
+
+ AnnotationTreeNode getParent() {
+ return mParent;
+ }
+
+ List<AnnotationTreeNode> getChildren() {
+ return mChildren.getElements();
+ }
+
+ AnnotationFS getAnnotation() {
+ return mAnnotation;
+ }
+
+ /**
+ * Checks if the given node is completly contained by the current node instance.
+ *
+ * @param node
+ * @return true if completly contained otherwise false
+ */
+ boolean isChild(AnnotationTreeNode node) {
+ return getAnnotation().getBegin() <= node.getAnnotation().getBegin()
+ && getAnnotation().getEnd() >= node.getAnnotation().getEnd();
+ }
+
+ void addChild(AnnotationTreeNode node) {
+ node.mParent = this;
+
+ mChildren.add(node);
+
+ mChildren.buildTree();
+ }
+
+ public Object getAdapter(Class adapter) {
+ // TODO:
+ // use ModelFeatureStructure
+ // create a AdapterFactory which just calls the
+ // ModelFeatureStructureAdpaterFactory
+
+ if (AnnotationFS.class.equals(adapter) || FeatureStructure.class.equals(adapter)) {
+ return getAnnotation();
+ } else if (IPropertySource.class.equals(adapter)) {
+ return FSPropertySourceFactory.create(new ModelFeatureStructure(mDocument, getAnnotation()));
+ } else {
+ return null;
+ }
+ }
+
+ @Override
+ public int hashCode() {
+ final int PRIME = 31;
+ int result = 1;
+ result = PRIME * result + ((mAnnotation == null) ? 0 : mAnnotation.hashCode());
+ result = PRIME * result + ((mChildren == null) ? 0 : mChildren.hashCode());
+ result = PRIME * result + ((mParent == null) ? 0 : mParent.hashCode());
+ return mAnnotation.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+
+ final AnnotationTreeNode other = (AnnotationTreeNode) obj;
+
+ /*
+ * if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() !=
+ * obj.getClass()) return false; final AnnotationTreeNode other = (AnnotationTreeNode) obj; if
+ * (mAnnotation == null) { if (other.mAnnotation != null) return false; } else if
+ * (!mAnnotation.equals(other.mAnnotation)) return false; if (mChildren == null) { if
+ * (other.mChildren != null) return false; } else if (!mChildren.equals(other.mChildren)) return
+ * false; if (mParent == null) { if (other.mParent != null) return false; } else if
+ * (!mParent.equals(other.mParent)) return false;
+ */
+ return other.getAnnotation().equals(mAnnotation);
+ }
+
}
Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/outline/AnnotationTreeNodeList.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/outline/AnnotationTreeNodeList.java?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/outline/AnnotationTreeNodeList.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/outline/AnnotationTreeNodeList.java Tue Feb 20 11:01:12 2007
@@ -1,101 +1,97 @@
-/*
- * 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.editor.outline;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-
-import org.apache.uima.cas.text.AnnotationFS;
-import org.apache.uima.caseditor.core.IDocument;
-import org.apache.uima.caseditor.editor.AnnotationDocument;
-
-/**
- * TODO: add javadoc here
- *
- * @author <a href="mailto:kottmann@gmail.com">Joern Kottmann</a>
- * @version $Revision: 1.4.2.2 $, $Date: 2007/01/04 15:00:58 $
- */
-public class AnnotationTreeNodeList {
- private List<AnnotationTreeNode> mElements = new ArrayList<AnnotationTreeNode>();
-
- private IDocument mDocument;
-
- AnnotationTreeNodeList(IDocument document) {
- mDocument = document;
- }
-
- AnnotationTreeNodeList(AnnotationDocument document, Collection<AnnotationFS> annotations) {
- mDocument = document;
-
- for (AnnotationFS annotation : annotations) {
- mElements.add(new AnnotationTreeNode(mDocument, annotation));
- }
-
- // buildTree();
- }
-
- List<AnnotationTreeNode> getElements() {
- return mElements;
- }
-
- void add(AnnotationTreeNode node) {
- mElements.add(node);
- }
-
- void remove(AnnotationTreeNode node) {
- if (mElements.contains(node)) {
- // insert childs in the list
- // remove the node from the list
- AnnotationTreeNode nodeFromList = mElements.get(mElements.indexOf(node));
- } else {
- // search the node
- }
-
- mElements.remove(node);
- }
-
- void buildTree() {
- for (Iterator it = mElements.iterator(); it.hasNext();) {
- AnnotationTreeNode aNode = (AnnotationTreeNode) it.next();
-
- boolean isMoved = false;
-
- for (AnnotationTreeNode bNode : mElements) {
- // if identical do nothing and go on
- if (aNode == bNode) {
- continue;
- }
-
- if (bNode.isChild(aNode)) {
- bNode.addChild(aNode);
- isMoved = true;
- break;
- }
- }
-
- if (isMoved) {
- it.remove();
- }
- }
- }
+/*
+ * 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.editor.outline;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.uima.cas.text.AnnotationFS;
+import org.apache.uima.caseditor.core.IDocument;
+import org.apache.uima.caseditor.editor.AnnotationDocument;
+
+/**
+ * TODO: add javadoc here
+ */
+public class AnnotationTreeNodeList {
+ private List<AnnotationTreeNode> mElements = new ArrayList<AnnotationTreeNode>();
+
+ private IDocument mDocument;
+
+ AnnotationTreeNodeList(IDocument document) {
+ mDocument = document;
+ }
+
+ AnnotationTreeNodeList(AnnotationDocument document, Collection<AnnotationFS> annotations) {
+ mDocument = document;
+
+ for (AnnotationFS annotation : annotations) {
+ mElements.add(new AnnotationTreeNode(mDocument, annotation));
+ }
+
+ // buildTree();
+ }
+
+ List<AnnotationTreeNode> getElements() {
+ return mElements;
+ }
+
+ void add(AnnotationTreeNode node) {
+ mElements.add(node);
+ }
+
+ void remove(AnnotationTreeNode node) {
+ if (mElements.contains(node)) {
+ // insert childs in the list
+ // remove the node from the list
+ // AnnotationTreeNode nodeFromList = mElements.get(mElements.indexOf(node));
+ } else {
+ // search the node
+ }
+
+ mElements.remove(node);
+ }
+
+ void buildTree() {
+ for (Iterator it = mElements.iterator(); it.hasNext();) {
+ AnnotationTreeNode aNode = (AnnotationTreeNode) it.next();
+
+ boolean isMoved = false;
+
+ for (AnnotationTreeNode bNode : mElements) {
+ // if identical do nothing and go on
+ if (aNode == bNode) {
+ continue;
+ }
+
+ if (bNode.isChild(aNode)) {
+ bNode.addChild(aNode);
+ isMoved = true;
+ break;
+ }
+ }
+
+ if (isMoved) {
+ it.remove();
+ }
+ }
+ }
}
Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/outline/OutlineLabelProvider.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/outline/OutlineLabelProvider.java?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/outline/OutlineLabelProvider.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/outline/OutlineLabelProvider.java Tue Feb 20 11:01:12 2007
@@ -27,9 +27,6 @@
/**
* This <code>OutlineLabelProvider</code> returns the covered text of an <code>AnnotationFS</code>.
- *
- * @author <a href="mailto:kottmann@gmail.com">Joern Kottmann</a>
- * @version $Revision: 1.2.2.2 $, $Date: 2007/01/04 15:00:58 $
*/
class OutlineLabelProvider extends LabelProvider implements ITableLabelProvider {
public Image getColumnImage(Object element, int columnIndex) {
Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/outline/OutlineTableSorter.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/outline/OutlineTableSorter.java?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/outline/OutlineTableSorter.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/outline/OutlineTableSorter.java Tue Feb 20 11:01:12 2007
@@ -31,9 +31,6 @@
* <code>AnnotationComparator</code>.
*
* @see AnnotationComparator
- *
- * @author <a href="mailto:kottmann@gmail.com">Joern Kottmann</a>
- * @version $Revision: 1.4.2.2 $, $Date: 2007/01/04 15:00:58 $
*/
class OutlineTableSorter extends ViewerSorter {
private AnnotationComparator mComperator = new AnnotationComparator();
Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/outline/package.html
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/outline/package.html?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/outline/package.html (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/outline/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.editor.outline</title>
+ <title>org.apache.uima.caseditor.editor.outline</title>
</head>
<body>
Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/package.html
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/package.html?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/package.html (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/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.editor</title>
+ <title>org.apache.uima.caseditor.editor</title>
</head>
<body>
Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/properties/AbstractArrayPropertySource.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/properties/AbstractArrayPropertySource.java?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/properties/AbstractArrayPropertySource.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/properties/AbstractArrayPropertySource.java Tue Feb 20 11:01:12 2007
@@ -1,91 +1,87 @@
-/*
- * 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.editor.properties;
-
-
-import org.apache.uima.cas.CommonArrayFS;
-import org.apache.uima.caseditor.editor.ModelFeatureStructure;
-import org.apache.uima.caseditor.editor.properties.validator.CellEditorValidatorFacotory;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.ui.views.properties.TextPropertyDescriptor;
-
-/**
- * @author <a href="mailto:kottmann@gmail.com">Joern Kottmann</a>
- * @version $Revision: 1.1.2.2 $, $Date: 2007/01/04 15:00:57 $
- */
-abstract class AbstractArrayPropertySource implements IPropertySource {
- private ModelFeatureStructure mStructure;
-
- protected CommonArrayFS mArray;
-
- public AbstractArrayPropertySource(ModelFeatureStructure structure) {
- mStructure = structure;
- mArray = (CommonArrayFS) structure.getStructre();
- }
-
- /**
- * Always returns null. There are no editable value.
- */
- public Object getEditableValue() {
- return null;
- }
-
- protected abstract Class getPrimitiveType();
-
- /**
- * Returns for every array entry one {@link TextPropertyDescriptor}.
- */
- public IPropertyDescriptor[] getPropertyDescriptors() {
- IPropertyDescriptor descriptors[] = new IPropertyDescriptor[mArray.size()];
-
- for (int i = 0; i < mArray.size(); i++) {
- TextPropertyDescriptor primitiveProperty = new TextPropertyDescriptor(i, Integer.toString(i));
-
- primitiveProperty.setValidator(CellEditorValidatorFacotory
- .createValidator(getPrimitiveType()));
-
- descriptors[i] = primitiveProperty;
- }
-
- return descriptors;
- }
-
- protected abstract String get(int i);
-
- public Object getPropertyValue(Object id) {
- return get((Integer) id);
- }
-
- public boolean isPropertySet(Object id) {
- return true;
- }
-
- public void resetPropertyValue(Object id) {
- }
-
- protected abstract void set(int i, String value);
-
- public void setPropertyValue(Object id, Object value) {
- set((Integer) id, (String) value);
-
- mStructure.update();
- }
+/*
+ * 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.editor.properties;
+
+
+import org.apache.uima.cas.CommonArrayFS;
+import org.apache.uima.caseditor.editor.ModelFeatureStructure;
+import org.apache.uima.caseditor.editor.properties.validator.CellEditorValidatorFacotory;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.TextPropertyDescriptor;
+
+abstract class AbstractArrayPropertySource implements IPropertySource {
+ private ModelFeatureStructure mStructure;
+
+ protected CommonArrayFS mArray;
+
+ public AbstractArrayPropertySource(ModelFeatureStructure structure) {
+ mStructure = structure;
+ mArray = (CommonArrayFS) structure.getStructre();
+ }
+
+ /**
+ * Always returns null. There are no editable value.
+ */
+ public Object getEditableValue() {
+ return null;
+ }
+
+ protected abstract Class getPrimitiveType();
+
+ /**
+ * Returns for every array entry one {@link TextPropertyDescriptor}.
+ */
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ IPropertyDescriptor descriptors[] = new IPropertyDescriptor[mArray.size()];
+
+ for (int i = 0; i < mArray.size(); i++) {
+ TextPropertyDescriptor primitiveProperty = new TextPropertyDescriptor(i, Integer.toString(i));
+
+ primitiveProperty.setValidator(CellEditorValidatorFacotory
+ .createValidator(getPrimitiveType()));
+
+ descriptors[i] = primitiveProperty;
+ }
+
+ return descriptors;
+ }
+
+ protected abstract String get(int i);
+
+ public Object getPropertyValue(Object id) {
+ return get((Integer) id);
+ }
+
+ public boolean isPropertySet(Object id) {
+ return true;
+ }
+
+ public void resetPropertyValue(Object id) {
+ }
+
+ protected abstract void set(int i, String value);
+
+ public void setPropertyValue(Object id, Object value) {
+ set((Integer) id, (String) value);
+
+ mStructure.update();
+ }
}
Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/properties/ByteArrayPropertySource.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/properties/ByteArrayPropertySource.java?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/properties/ByteArrayPropertySource.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/properties/ByteArrayPropertySource.java Tue Feb 20 11:01:12 2007
@@ -1,51 +1,45 @@
-/*
- * 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.editor.properties;
-
-
-import org.apache.uima.cas.ByteArrayFS;
-import org.apache.uima.caseditor.editor.ModelFeatureStructure;
-
-/**
- * TODO: add javadoc here
- *
- * @author <a href="mailto:kottmann@gmail.com">Joern Kottmann</a>
- * @version $Revision: 1.1.2.2 $, $Date: 2007/01/04 15:00:57 $
- */
-class ByteArrayPropertySource extends AbstractArrayPropertySource {
- ByteArrayPropertySource(ModelFeatureStructure structure) {
- super(structure);
- }
-
- @Override
- protected String get(int i) {
- return Byte.toString(((ByteArrayFS) mArray).get(i));
- }
-
- @Override
- protected Class<Byte> getPrimitiveType() {
- return Byte.class;
- }
-
- @Override
- protected void set(int i, String value) {
- ((ByteArrayFS) mArray).set(i, Byte.parseByte(value));
- }
+/*
+ * 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.editor.properties;
+
+
+import org.apache.uima.cas.ByteArrayFS;
+import org.apache.uima.caseditor.editor.ModelFeatureStructure;
+
+class ByteArrayPropertySource extends AbstractArrayPropertySource {
+ ByteArrayPropertySource(ModelFeatureStructure structure) {
+ super(structure);
+ }
+
+ @Override
+ protected String get(int i) {
+ return Byte.toString(((ByteArrayFS) mArray).get(i));
+ }
+
+ @Override
+ protected Class<Byte> getPrimitiveType() {
+ return Byte.class;
+ }
+
+ @Override
+ protected void set(int i, String value) {
+ ((ByteArrayFS) mArray).set(i, Byte.parseByte(value));
+ }
}
Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/properties/DoubleArrayPropertySource.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/properties/DoubleArrayPropertySource.java?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/properties/DoubleArrayPropertySource.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/properties/DoubleArrayPropertySource.java Tue Feb 20 11:01:12 2007
@@ -1,51 +1,45 @@
-/*
- * 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.editor.properties;
-
-
-import org.apache.uima.cas.DoubleArrayFS;
-import org.apache.uima.caseditor.editor.ModelFeatureStructure;
-
-/**
- * TODO: add javadoc here
- *
- * @author <a href="mailto:kottmann@gmail.com">Joern Kottmann</a>
- * @version $Revision: 1.1.2.2 $, $Date: 2007/01/04 15:00:57 $
- */
-public class DoubleArrayPropertySource extends AbstractArrayPropertySource {
- DoubleArrayPropertySource(ModelFeatureStructure structure) {
- super(structure);
- }
-
- @Override
- protected String get(int i) {
- return Double.toString(((DoubleArrayFS) mArray).get(i));
- }
-
- @Override
- protected Class<Double> getPrimitiveType() {
- return Double.class;
- }
-
- @Override
- protected void set(int i, String value) {
- ((DoubleArrayFS) mArray).set(i, Double.parseDouble(value));
- }
-}
+/*
+ * 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.editor.properties;
+
+
+import org.apache.uima.cas.DoubleArrayFS;
+import org.apache.uima.caseditor.editor.ModelFeatureStructure;
+
+public class DoubleArrayPropertySource extends AbstractArrayPropertySource {
+ DoubleArrayPropertySource(ModelFeatureStructure structure) {
+ super(structure);
+ }
+
+ @Override
+ protected String get(int i) {
+ return Double.toString(((DoubleArrayFS) mArray).get(i));
+ }
+
+ @Override
+ protected Class<Double> getPrimitiveType() {
+ return Double.class;
+ }
+
+ @Override
+ protected void set(int i, String value) {
+ ((DoubleArrayFS) mArray).set(i, Double.parseDouble(value));
+ }
+}
Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/properties/FSPropertySourceFactory.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/properties/FSPropertySourceFactory.java?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/properties/FSPropertySourceFactory.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/properties/FSPropertySourceFactory.java Tue Feb 20 11:01:12 2007
@@ -1,58 +1,53 @@
-/*
- * 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.editor.properties;
-
-
-import org.apache.uima.cas.ByteArrayFS;
-import org.apache.uima.cas.DoubleArrayFS;
-import org.apache.uima.cas.FloatArrayFS;
-import org.apache.uima.cas.IntArrayFS;
-import org.apache.uima.cas.LongArrayFS;
-import org.apache.uima.cas.ShortArrayFS;
-import org.apache.uima.cas.StringArrayFS;
-import org.apache.uima.caseditor.editor.ModelFeatureStructure;
-import org.eclipse.ui.views.properties.IPropertySource;
-
-/**
- *
- * @author <a href="mailto:kottmann@gmail.com">Joern Kottmann</a>
- * @version $Revision: 1.1.2.2 $, $Date: 2007/01/04 15:00:57 $
- */
-public class FSPropertySourceFactory {
- public static IPropertySource create(ModelFeatureStructure structure) {
- if (structure.getStructre() instanceof ByteArrayFS) {
- return new ByteArrayPropertySource(structure);
- } else if (structure.getStructre() instanceof ShortArrayFS) {
- return new ShortArrayPropertySource(structure);
- } else if (structure.getStructre() instanceof IntArrayFS) {
- return new IntegerArrayPropertySource(structure);
- } else if (structure.getStructre() instanceof LongArrayFS) {
- return new LongArrayPropertySource(structure);
- } else if (structure.getStructre() instanceof FloatArrayFS) {
- return new FloatArrayPropertySource(structure);
- } else if (structure.getStructre() instanceof DoubleArrayFS) {
- return new DoubleArrayPropertySource(structure);
- } else if (structure.getStructre() instanceof StringArrayFS) {
- return new StringArrayPropertySource(structure);
- } else {
- return new FeatureStructurePropertySource(structure);
- }
- }
-}
+/*
+ * 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.editor.properties;
+
+
+import org.apache.uima.cas.ByteArrayFS;
+import org.apache.uima.cas.DoubleArrayFS;
+import org.apache.uima.cas.FloatArrayFS;
+import org.apache.uima.cas.IntArrayFS;
+import org.apache.uima.cas.LongArrayFS;
+import org.apache.uima.cas.ShortArrayFS;
+import org.apache.uima.cas.StringArrayFS;
+import org.apache.uima.caseditor.editor.ModelFeatureStructure;
+import org.eclipse.ui.views.properties.IPropertySource;
+
+public class FSPropertySourceFactory {
+ public static IPropertySource create(ModelFeatureStructure structure) {
+ if (structure.getStructre() instanceof ByteArrayFS) {
+ return new ByteArrayPropertySource(structure);
+ } else if (structure.getStructre() instanceof ShortArrayFS) {
+ return new ShortArrayPropertySource(structure);
+ } else if (structure.getStructre() instanceof IntArrayFS) {
+ return new IntegerArrayPropertySource(structure);
+ } else if (structure.getStructre() instanceof LongArrayFS) {
+ return new LongArrayPropertySource(structure);
+ } else if (structure.getStructre() instanceof FloatArrayFS) {
+ return new FloatArrayPropertySource(structure);
+ } else if (structure.getStructre() instanceof DoubleArrayFS) {
+ return new DoubleArrayPropertySource(structure);
+ } else if (structure.getStructre() instanceof StringArrayFS) {
+ return new StringArrayPropertySource(structure);
+ } else {
+ return new FeatureStructurePropertySource(structure);
+ }
+ }
+}
Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/properties/FeatureStructurePropertySource.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/properties/FeatureStructurePropertySource.java?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/properties/FeatureStructurePropertySource.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/properties/FeatureStructurePropertySource.java Tue Feb 20 11:01:12 2007
@@ -23,7 +23,6 @@
import java.util.LinkedList;
import java.util.Vector;
-
import org.apache.uima.cas.Feature;
import org.apache.uima.cas.FeatureStructure;
import org.apache.uima.cas.Type;
@@ -38,9 +37,6 @@
/**
* This {@link IPropertySource} Source provides information about a {@link FeatureStructure}.
- *
- * @author <a href="mailto:kottmann@gmail.com">Joern Kottmann</a>
- * @version $Revision: 1.2.2.2 $, $Date: 2007/01/04 15:00:57 $
*/
class FeatureStructurePropertySource implements IPropertySource {
private ModelFeatureStructure mStructure;
@@ -64,7 +60,7 @@
* @return null
*/
public Object getEditableValue() {
- return "test";
+ return null;
}
public IPropertyDescriptor[] getPropertyDescriptors() {
Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/properties/FloatArrayPropertySource.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/properties/FloatArrayPropertySource.java?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/properties/FloatArrayPropertySource.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/properties/FloatArrayPropertySource.java Tue Feb 20 11:01:12 2007
@@ -1,51 +1,48 @@
-/*
- * 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.editor.properties;
-
-
-import org.apache.uima.cas.FloatArrayFS;
-import org.apache.uima.caseditor.editor.ModelFeatureStructure;
-
-/**
- * TODO: add javadoc here
- *
- * @author <a href="mailto:kottmann@gmail.com">Joern Kottmann</a>
- * @version $Revision: 1.1.2.2 $, $Date: 2007/01/04 15:00:57 $
- */
-public class FloatArrayPropertySource extends AbstractArrayPropertySource {
- FloatArrayPropertySource(ModelFeatureStructure structure) {
- super(structure);
- }
-
- @Override
- protected String get(int i) {
- return Float.toString(((FloatArrayFS) mArray).get(i));
- }
-
- @Override
- protected Class<Float> getPrimitiveType() {
- return Float.class;
- }
-
- @Override
- protected void set(int i, String value) {
- ((FloatArrayFS) mArray).set(i, Float.parseFloat(value));
- }
-}
+/*
+ * 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.editor.properties;
+
+
+import org.apache.uima.cas.FloatArrayFS;
+import org.apache.uima.caseditor.editor.ModelFeatureStructure;
+
+/**
+ * TODO: add javadoc here
+ */
+public class FloatArrayPropertySource extends AbstractArrayPropertySource {
+ FloatArrayPropertySource(ModelFeatureStructure structure) {
+ super(structure);
+ }
+
+ @Override
+ protected String get(int i) {
+ return Float.toString(((FloatArrayFS) mArray).get(i));
+ }
+
+ @Override
+ protected Class<Float> getPrimitiveType() {
+ return Float.class;
+ }
+
+ @Override
+ protected void set(int i, String value) {
+ ((FloatArrayFS) mArray).set(i, Float.parseFloat(value));
+ }
+}
Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/properties/IntegerArrayPropertySource.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/properties/IntegerArrayPropertySource.java?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/properties/IntegerArrayPropertySource.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/properties/IntegerArrayPropertySource.java Tue Feb 20 11:01:12 2007
@@ -1,51 +1,45 @@
-/*
- * 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.editor.properties;
-
-
-import org.apache.uima.cas.IntArrayFS;
-import org.apache.uima.caseditor.editor.ModelFeatureStructure;
-
-/**
- * TODO: add javadoc here
- *
- * @author <a href="mailto:kottmann@gmail.com">Joern Kottmann</a>
- * @version $Revision: 1.1.2.2 $, $Date: 2007/01/04 15:00:57 $
- */
-public class IntegerArrayPropertySource extends AbstractArrayPropertySource {
- IntegerArrayPropertySource(ModelFeatureStructure structure) {
- super(structure);
- }
-
- @Override
- protected String get(int i) {
- return Integer.toString(((IntArrayFS) mArray).get(i));
- }
-
- @Override
- protected Class<Integer> getPrimitiveType() {
- return Integer.class;
- }
-
- @Override
- protected void set(int i, String value) {
- ((IntArrayFS) mArray).set(i, Integer.parseInt(value));
- }
-}
+/*
+ * 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.editor.properties;
+
+
+import org.apache.uima.cas.IntArrayFS;
+import org.apache.uima.caseditor.editor.ModelFeatureStructure;
+
+public class IntegerArrayPropertySource extends AbstractArrayPropertySource {
+ IntegerArrayPropertySource(ModelFeatureStructure structure) {
+ super(structure);
+ }
+
+ @Override
+ protected String get(int i) {
+ return Integer.toString(((IntArrayFS) mArray).get(i));
+ }
+
+ @Override
+ protected Class<Integer> getPrimitiveType() {
+ return Integer.class;
+ }
+
+ @Override
+ protected void set(int i, String value) {
+ ((IntArrayFS) mArray).set(i, Integer.parseInt(value));
+ }
+}
Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/properties/LongArrayPropertySource.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/properties/LongArrayPropertySource.java?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/properties/LongArrayPropertySource.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/properties/LongArrayPropertySource.java Tue Feb 20 11:01:12 2007
@@ -1,51 +1,45 @@
-/*
- * 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.editor.properties;
-
-
-import org.apache.uima.cas.LongArrayFS;
-import org.apache.uima.caseditor.editor.ModelFeatureStructure;
-
-/**
- * TODO: add javadoc here
- *
- * @author <a href="mailto:kottmann@gmail.com">Joern Kottmann</a>
- * @version $Revision: 1.1.2.2 $, $Date: 2007/01/04 15:00:57 $
- */
-public class LongArrayPropertySource extends AbstractArrayPropertySource {
- LongArrayPropertySource(ModelFeatureStructure structure) {
- super(structure);
- }
-
- @Override
- protected String get(int i) {
- return Long.toString(((LongArrayFS) mArray).get(i));
- }
-
- @Override
- protected Class<Long> getPrimitiveType() {
- return Long.class;
- }
-
- @Override
- protected void set(int i, String value) {
- ((LongArrayFS) mArray).set(i, Long.parseLong(value));
- }
-}
+/*
+ * 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.editor.properties;
+
+
+import org.apache.uima.cas.LongArrayFS;
+import org.apache.uima.caseditor.editor.ModelFeatureStructure;
+
+public class LongArrayPropertySource extends AbstractArrayPropertySource {
+ LongArrayPropertySource(ModelFeatureStructure structure) {
+ super(structure);
+ }
+
+ @Override
+ protected String get(int i) {
+ return Long.toString(((LongArrayFS) mArray).get(i));
+ }
+
+ @Override
+ protected Class<Long> getPrimitiveType() {
+ return Long.class;
+ }
+
+ @Override
+ protected void set(int i, String value) {
+ ((LongArrayFS) mArray).set(i, Long.parseLong(value));
+ }
+}
Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/properties/ShortArrayPropertySource.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/properties/ShortArrayPropertySource.java?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/properties/ShortArrayPropertySource.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/properties/ShortArrayPropertySource.java Tue Feb 20 11:01:12 2007
@@ -1,51 +1,45 @@
-/*
- * 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.editor.properties;
-
-
-import org.apache.uima.cas.ShortArrayFS;
-import org.apache.uima.caseditor.editor.ModelFeatureStructure;
-
-/**
- * TODO: add javadoc here
- *
- * @author <a href="mailto:kottmann@gmail.com">Joern Kottmann</a>
- * @version $Revision: 1.1.2.2 $, $Date: 2007/01/04 15:00:57 $
- */
-public class ShortArrayPropertySource extends AbstractArrayPropertySource {
- ShortArrayPropertySource(ModelFeatureStructure structure) {
- super(structure);
- }
-
- @Override
- protected String get(int i) {
- return Short.toString(((ShortArrayFS) mArray).get(i));
- }
-
- @Override
- protected Class<Short> getPrimitiveType() {
- return Short.class;
- }
-
- @Override
- protected void set(int i, String value) {
- ((ShortArrayFS) mArray).set(i, Short.parseShort(value));
- }
-}
+/*
+ * 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.editor.properties;
+
+
+import org.apache.uima.cas.ShortArrayFS;
+import org.apache.uima.caseditor.editor.ModelFeatureStructure;
+
+public class ShortArrayPropertySource extends AbstractArrayPropertySource {
+ ShortArrayPropertySource(ModelFeatureStructure structure) {
+ super(structure);
+ }
+
+ @Override
+ protected String get(int i) {
+ return Short.toString(((ShortArrayFS) mArray).get(i));
+ }
+
+ @Override
+ protected Class<Short> getPrimitiveType() {
+ return Short.class;
+ }
+
+ @Override
+ protected void set(int i, String value) {
+ ((ShortArrayFS) mArray).set(i, Short.parseShort(value));
+ }
+}
Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/properties/StringArrayPropertySource.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/properties/StringArrayPropertySource.java?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/properties/StringArrayPropertySource.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/properties/StringArrayPropertySource.java Tue Feb 20 11:01:12 2007
@@ -1,51 +1,45 @@
-/*
- * 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.editor.properties;
-
-
-import org.apache.uima.cas.StringArrayFS;
-import org.apache.uima.caseditor.editor.ModelFeatureStructure;
-
-/**
- * TODO: add javadoc here
- *
- * @author <a href="mailto:kottmann@gmail.com">Joern Kottmann</a>
- * @version $Revision: 1.1.2.2 $, $Date: 2007/01/04 15:00:57 $
- */
-public class StringArrayPropertySource extends AbstractArrayPropertySource {
- StringArrayPropertySource(ModelFeatureStructure structure) {
- super(structure);
- }
-
- @Override
- protected String get(int i) {
- return ((StringArrayFS) mArray).get(i);
- }
-
- @Override
- protected Class<String> getPrimitiveType() {
- return String.class;
- }
-
- @Override
- protected void set(int i, String value) {
- ((StringArrayFS) mArray).set(i, value);
- }
-}
+/*
+ * 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.editor.properties;
+
+
+import org.apache.uima.cas.StringArrayFS;
+import org.apache.uima.caseditor.editor.ModelFeatureStructure;
+
+public class StringArrayPropertySource extends AbstractArrayPropertySource {
+ StringArrayPropertySource(ModelFeatureStructure structure) {
+ super(structure);
+ }
+
+ @Override
+ protected String get(int i) {
+ return ((StringArrayFS) mArray).get(i);
+ }
+
+ @Override
+ protected Class<String> getPrimitiveType() {
+ return String.class;
+ }
+
+ @Override
+ protected void set(int i, String value) {
+ ((StringArrayFS) mArray).set(i, value);
+ }
+}
Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/properties/validator/ByteCellEditorValidator.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/properties/validator/ByteCellEditorValidator.java?view=diff&rev=509708&r1=509707&r2=509708
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/properties/validator/ByteCellEditorValidator.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/properties/validator/ByteCellEditorValidator.java Tue Feb 20 11:01:12 2007
@@ -1,51 +1,48 @@
-/*
- * 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.editor.properties.validator;
-
-import org.eclipse.jface.viewers.ICellEditorValidator;
-
-/**
- * This {@link ICellEditorValidator} validates {@link String} values which represents a {@link Byte}.
- *
- * For validation {@link Byte#parseByte(String)} is used.
- *
- * @author <a href="mailto:kottmann@gmail.com">Joern Kottmann</a>
- * @version $Revision: 1.1.2.2 $, $Date: 2007/01/04 15:00:53 $
- */
-public class ByteCellEditorValidator implements ICellEditorValidator {
-
- /**
- * Checks if the given value is a valid {@link Byte}.
- *
- * @param value
- * @return null if valid otherwise an error message
- */
- public String isValid(Object value) {
- assert value instanceof String;
-
- try {
- Byte.parseByte((String) value);
- } catch (NumberFormatException e) {
- return "Not a byte!";
- }
-
- return null;
- }
+/*
+ * 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.editor.properties.validator;
+
+import org.eclipse.jface.viewers.ICellEditorValidator;
+
+/**
+ * This {@link ICellEditorValidator} validates {@link String} values which represents a {@link Byte}.
+ *
+ * For validation {@link Byte#parseByte(String)} is used.
+ */
+public class ByteCellEditorValidator implements ICellEditorValidator {
+
+ /**
+ * Checks if the given value is a valid {@link Byte}.
+ *
+ * @param value
+ * @return null if valid otherwise an error message
+ */
+ public String isValid(Object value) {
+ assert value instanceof String;
+
+ try {
+ Byte.parseByte((String) value);
+ } catch (NumberFormatException e) {
+ return "Not a byte!";
+ }
+
+ return null;
+ }
}