You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by jo...@apache.org on 2011/08/12 12:28:19 UTC
svn commit: r1157036 [5/5] - in /uima/sandbox/trunk/TextMarker/uimaj-ep-cev:
./ .settings/ META-INF/ icons/ lib/ schema/ src/ src/main/ src/main/java/
src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/uima/
src/main/java/org/apache/...
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/editor/ICEVAnnotationEditorPage.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/editor/ICEVAnnotationEditorPage.java?rev=1157036&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/editor/ICEVAnnotationEditorPage.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/editor/ICEVAnnotationEditorPage.java Fri Aug 12 10:28:15 2011
@@ -0,0 +1,26 @@
+/*
+ * 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.cev.views.editor;
+
+import org.apache.uima.cev.views.ICEVViewPage;
+
+public interface ICEVAnnotationEditorPage extends ICEVViewPage {
+
+}
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/editor/ICEVAnnotationEditorPage.java
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/editor/ICEVAnnotationEditorPage.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/fsBrowser/CEVFSBrowserPage.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/fsBrowser/CEVFSBrowserPage.java?rev=1157036&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/fsBrowser/CEVFSBrowserPage.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/fsBrowser/CEVFSBrowserPage.java Fri Aug 12 10:28:15 2011
@@ -0,0 +1,180 @@
+/*
+ * 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.cev.views.fsBrowser;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.uima.cas.CAS;
+import org.apache.uima.cas.FSIterator;
+import org.apache.uima.cas.FeatureStructure;
+import org.apache.uima.cas.Type;
+import org.apache.uima.cas.TypeSystem;
+import org.apache.uima.cas.text.AnnotationFS;
+import org.apache.uima.cev.data.CEVData;
+import org.apache.uima.cev.data.CEVDocument;
+import org.apache.uima.cev.data.tree.CEVTypeOrderedRootTreeNode;
+import org.apache.uima.cev.editor.CEVViewer;
+import org.apache.uima.cev.extension.ICEVView;
+import org.apache.uima.cev.views.CEVAnnotationTreeViewContentProvider;
+import org.apache.uima.cev.views.CEVAnnotationTreeViewLableProvider;
+import org.eclipse.jface.viewers.CheckboxTreeViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.part.Page;
+
+public class CEVFSBrowserPage extends Page implements ICEVFSBrowserPage, ICEVView {
+
+ private Image icon;
+
+ private CEVDocument casDocument;
+
+ private CEVData casData;
+
+ private CheckboxTreeViewer treeView;
+
+ private CEVAnnotationTreeViewLableProvider lableProvider;
+
+ public CEVFSBrowserPage(CEVViewer casView, CEVDocument casDocument, int index) {
+ super();
+ this.casDocument = casDocument;
+
+ this.casData = casDocument.getCASData(index);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.uniwue.casviewer.views.CASAnnotationTreeViewPage#createControl(org
+ * .eclipse.swt.widgets.Composite)
+ */
+ @Override
+ public void createControl(Composite parent) {
+ treeView = new CheckboxTreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
+
+ treeView.setContentProvider(new CEVAnnotationTreeViewContentProvider());
+ lableProvider = new CEVAnnotationTreeViewLableProvider(casData);
+ treeView.setLabelProvider(lableProvider);
+
+ treeView.addCheckStateListener(casData);
+ treeView.setInput(getFSTree());
+ }
+
+ private Object getFSTree() {
+ CEVTypeOrderedRootTreeNode root = new CEVTypeOrderedRootTreeNode();
+ Collection<FeatureStructure> fss = getFSs();
+ for (FeatureStructure each : fss) {
+ root.insertFS(each);
+ }
+ root.sort();
+ return root;
+ }
+
+ private Collection<FeatureStructure> getFSs() {
+ Collection<FeatureStructure> result = new ArrayList<FeatureStructure>();
+ CAS cas = casData.getCAS();
+ TypeSystem typeSystem = cas.getTypeSystem();
+ Type annotationBaseType = typeSystem.getType("uima.cas.AnnotationBase");
+ List<?> types = typeSystem.getProperlySubsumedTypes(typeSystem.getTopType());
+ for (Object object : types) {
+ if (object instanceof Type) {
+ Type type = (Type) object;
+ if (!typeSystem.subsumes(cas.getAnnotationType(), type)
+ && !typeSystem.subsumes(annotationBaseType, type)) {
+ FSIterator iterator = cas.getIndexRepository().getAllIndexedFS(type);
+ while (iterator.isValid()) {
+ FeatureStructure fs = iterator.get();
+ result.add(fs);
+ iterator.moveToNext();
+ }
+ }
+ }
+ }
+ return result;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.uima.cev.views.CEVAnnotationTreeViewPage#casDataChanged(int)
+ */
+ public void viewChanged(int index) {
+ casData = casDocument.getCASData(index);
+ reloadTree();
+ }
+
+ /**
+ * Baum neu laden
+ */
+ private void reloadTree() {
+ treeView.setInput(getFSTree());
+ treeView.refresh();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.uniwue.casviewer.views.CASAnnotationTreeViewPage#dispose()
+ */
+ @Override
+ public void dispose() {
+ // Icon freigeben
+ if (icon != null)
+ icon.dispose();
+
+ super.dispose();
+ }
+
+ public void newSelection(int offset) {
+
+ }
+
+ @Override
+ public Control getControl() {
+ return treeView.getControl();
+ }
+
+ @Override
+ public void setFocus() {
+ getControl().setFocus();
+ }
+
+ public void casChanged(CEVDocument casDocument) {
+ this.casDocument = casDocument;
+ }
+
+ public void annotationsAdded(List<AnnotationFS> annots) {
+ }
+
+ public void annotationsRemoved(List<AnnotationFS> annots) {
+ }
+
+ public void annotationStateChanged(Type type) {
+ }
+
+ public void annotationStateChanged(AnnotationFS annot) {
+ }
+
+ public void colorChanged(Type type) {
+ }
+}
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/fsBrowser/CEVFSBrowserPage.java
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/fsBrowser/CEVFSBrowserPage.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/fsBrowser/CEVFSBrowserView.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/fsBrowser/CEVFSBrowserView.java?rev=1157036&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/fsBrowser/CEVFSBrowserView.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/fsBrowser/CEVFSBrowserView.java Fri Aug 12 10:28:15 2011
@@ -0,0 +1,42 @@
+/*
+ * 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.cev.views.fsBrowser;
+
+import org.apache.uima.cev.views.CEVPageBookView;
+import org.eclipse.ui.IWorkbenchPart;
+
+
+public class CEVFSBrowserView extends CEVPageBookView {
+
+ public CEVFSBrowserView() {
+ super();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.part.PageBookView#doCreatePage(org.eclipse.ui.IWorkbenchPart)
+ */
+ @Override
+ protected PageRec doCreatePage(IWorkbenchPart part) {
+ return doCreatePage(part, ICEVFSBrowserPage.class);
+ }
+
+}
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/fsBrowser/CEVFSBrowserView.java
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/fsBrowser/CEVFSBrowserView.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/fsBrowser/CEVFSBrowserViewFactory.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/fsBrowser/CEVFSBrowserViewFactory.java?rev=1157036&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/fsBrowser/CEVFSBrowserViewFactory.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/fsBrowser/CEVFSBrowserViewFactory.java Fri Aug 12 10:28:15 2011
@@ -0,0 +1,40 @@
+/*
+ * 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.cev.views.fsBrowser;
+
+import org.apache.uima.cev.data.CEVDocument;
+import org.apache.uima.cev.editor.CEVViewer;
+import org.apache.uima.cev.extension.ICEVView;
+import org.apache.uima.cev.extension.ICEVViewFactory;
+
+public class CEVFSBrowserViewFactory implements ICEVViewFactory {
+
+ public CEVFSBrowserViewFactory() {
+ }
+
+ public ICEVView createView(CEVViewer viewer, CEVDocument cevDocument, int index) {
+ return new CEVFSBrowserPage(viewer, cevDocument, index);
+ }
+
+ public Class<?> getAdapterInterface() {
+ return ICEVFSBrowserPage.class;
+ }
+
+}
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/fsBrowser/CEVFSBrowserViewFactory.java
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/fsBrowser/CEVFSBrowserViewFactory.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/fsBrowser/ICEVFSBrowserPage.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/fsBrowser/ICEVFSBrowserPage.java?rev=1157036&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/fsBrowser/ICEVFSBrowserPage.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/fsBrowser/ICEVFSBrowserPage.java Fri Aug 12 10:28:15 2011
@@ -0,0 +1,25 @@
+/*
+ * 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.cev.views.fsBrowser;
+
+import org.apache.uima.cev.views.ICEVViewPage;
+
+public interface ICEVFSBrowserPage extends ICEVViewPage {
+}
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/fsBrowser/ICEVFSBrowserPage.java
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/fsBrowser/ICEVFSBrowserPage.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/palette/CEVAnnotationMarkerPaletteFactory.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/palette/CEVAnnotationMarkerPaletteFactory.java?rev=1157036&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/palette/CEVAnnotationMarkerPaletteFactory.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/palette/CEVAnnotationMarkerPaletteFactory.java Fri Aug 12 10:28:15 2011
@@ -0,0 +1,40 @@
+/*
+ * 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.cev.views.palette;
+
+import org.apache.uima.cev.data.CEVDocument;
+import org.apache.uima.cev.editor.CEVViewer;
+import org.apache.uima.cev.extension.ICEVEditor;
+import org.apache.uima.cev.extension.ICEVEditorFactory;
+
+public class CEVAnnotationMarkerPaletteFactory implements ICEVEditorFactory {
+
+ public CEVAnnotationMarkerPaletteFactory() {
+ }
+
+ public ICEVEditor createEditor(CEVViewer viewer, CEVDocument cevDocument, int index) {
+ return new CEVAnnotationMarkerPalettePage(viewer, cevDocument, index);
+ }
+
+ public Class<?> getAdapterInterface() {
+ return ICEVAnnotationMarkerPalettePage.class;
+ }
+
+}
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/palette/CEVAnnotationMarkerPaletteFactory.java
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/palette/CEVAnnotationMarkerPaletteFactory.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/palette/CEVAnnotationMarkerPalettePage.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/palette/CEVAnnotationMarkerPalettePage.java?rev=1157036&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/palette/CEVAnnotationMarkerPalettePage.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/palette/CEVAnnotationMarkerPalettePage.java Fri Aug 12 10:28:15 2011
@@ -0,0 +1,415 @@
+/*
+ * 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.cev.views.palette;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.uima.cas.Type;
+import org.apache.uima.cas.text.AnnotationFS;
+import org.apache.uima.cev.CEVPlugin;
+import org.apache.uima.cev.data.CEVData;
+import org.apache.uima.cev.data.CEVDocument;
+import org.apache.uima.cev.editor.CEVViewer;
+import org.apache.uima.cev.extension.ICEVEditor;
+import org.apache.uima.cev.preferences.CEVPreferenceConstants;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.ScrolledComposite;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.PaletteData;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.layout.RowData;
+import org.eclipse.swt.layout.RowLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.part.IPageSite;
+import org.eclipse.ui.part.Page;
+
+public class CEVAnnotationMarkerPalettePage extends Page implements
+ ICEVAnnotationMarkerPalettePage, ICEVEditor {
+
+ private class AnnotationTypeButtonPanel {
+ private Composite composite;
+
+ private Button button;
+
+ private Type type;
+
+ private static final int LETTER_WIDTH_FACTOR = 8;
+
+ private static final int BUTTON_WIDTH_OFFSET = 25;
+
+ private static final int ICON_SIZE = 10;
+
+ private static final int MAX_TITLE_LENGTH = 40;
+
+ private AnnotationTypeButtonPanel(Composite parent, Type type) {
+ this(parent, type, MAX_TITLE_LENGTH);
+ }
+
+ private AnnotationTypeButtonPanel(Composite parent, Type type, int maxTitleLenght) {
+ this.type = type;
+ composite = new Composite(parent, SWT.NULL | SWT.LEFT);
+ composite.setLayout(new RowLayout(SWT.HORIZONTAL));
+ button = new Button(composite, SWT.TOGGLE | SWT.LEFT);
+ button.setText(type.getShortName());
+ final int width = BUTTON_WIDTH_OFFSET + maxTitleLenght * LETTER_WIDTH_FACTOR;
+ button.setLayoutData(new RowData(width, SWT.DEFAULT));
+ button.setAlignment(SWT.LEFT);
+ updateColor();
+
+ composite.layout(true);
+ }
+
+ private void updateColor() {
+ Color bgCol = new Color(composite.getDisplay(), getCurrentCEVData().getBackgroundColor(
+ this.type).getRGB());
+ RGB[] rgbs = { bgCol.getRGB() };
+ ImageData imd = new ImageData(ICON_SIZE, ICON_SIZE, 8, new PaletteData(rgbs));
+ Image image = new Image(composite.getDisplay(), imd);
+ button.setImage(image);
+ }
+
+ public Button getButton() {
+ return this.button;
+ }
+
+ public Type getType() {
+ return this.type;
+ }
+
+ public void dispose() {
+ button.dispose();
+ composite.dispose();
+ type = null;
+ }
+
+ }
+
+ private class TypeComparator implements Comparator<Type> {
+ public int compare(Type type0, Type type1) {
+ return type0.getShortName().compareToIgnoreCase(type1.getShortName());
+ }
+
+ }
+
+ private class AnnotationTypeCheckButtonPanel {
+ private Composite composite;
+
+ private Button button;
+
+ private Type type;
+
+ private static final int LETTER_WIDTH_FACTOR = 8;
+
+ private static final int BUTTON_WIDTH_OFFSET = 25;
+
+ private static final int ICON_SIZE = 10;
+
+ private static final int MAX_TITLE_LENGTH = 40;
+
+ private AnnotationTypeCheckButtonPanel(Composite parent, Type type) {
+ this(parent, type, MAX_TITLE_LENGTH);
+ }
+
+ private AnnotationTypeCheckButtonPanel(Composite parent, Type type, int maxTitleLenght) {
+ this.type = type;
+ composite = new Composite(parent, SWT.NULL | SWT.LEFT);
+ composite.setLayout(new RowLayout(SWT.HORIZONTAL));
+ button = new Button(composite, SWT.TOGGLE | SWT.LEFT);
+ button.setText(type.getShortName());
+ final int width = BUTTON_WIDTH_OFFSET + maxTitleLenght * LETTER_WIDTH_FACTOR;
+ button.setLayoutData(new RowData(width, SWT.DEFAULT));
+ button.setAlignment(SWT.LEFT);
+ updateColor();
+
+ composite.layout(true);
+ }
+
+ private void updateColor() {
+ Color backgroundColor = getCurrentCEVData().getBackgroundColor(this.type);
+ if (backgroundColor == null) {
+ backgroundColor = new Color(composite.getDisplay(), 128, 128, 128);
+ }
+ Color bgCol = new Color(composite.getDisplay(), backgroundColor.getRGB());
+ RGB[] rgbs = { bgCol.getRGB() };
+ ImageData imd = new ImageData(ICON_SIZE, ICON_SIZE, 8, new PaletteData(rgbs));
+ Image image = new Image(composite.getDisplay(), imd);
+ button.setImage(image);
+ }
+
+ public Button getButton() {
+ return this.button;
+ }
+
+ public Type getType() {
+ return this.type;
+ }
+
+ public void dispose() {
+ button.dispose();
+ composite.dispose();
+ type = null;
+ }
+
+ }
+
+ private ScrolledComposite sc;
+
+ private Composite pane;
+
+ private CEVDocument casDocument;
+
+ private List<Type> types;
+
+ private List<AnnotationTypeCheckButtonPanel> toggleButtons = new ArrayList<AnnotationTypeCheckButtonPanel>();
+
+ private int current;
+
+ public CEVAnnotationMarkerPalettePage(CEVViewer casView, CEVDocument casDocument, int index) {
+ super();
+ current = index;
+ this.casDocument = casDocument;
+ this.getCurrentCEVData().addAnnotationListener(this);
+ types = new ArrayList<Type>();
+ updateTypes();
+ }
+
+ public List<AnnotationTypeCheckButtonPanel> getToggledButtons() {
+ if (toggleButtons == null) {
+ return new ArrayList<AnnotationTypeCheckButtonPanel>();
+ }
+ List<AnnotationTypeCheckButtonPanel> toggledButtons = new ArrayList<AnnotationTypeCheckButtonPanel>();
+ for (AnnotationTypeCheckButtonPanel buttonP : toggleButtons) {
+ if (buttonP.getButton().getSelection()) {
+ toggledButtons.add(buttonP);
+ }
+ }
+ return toggledButtons;
+ }
+
+ private void updateControl(int maxTitleLength) {
+ for (AnnotationTypeCheckButtonPanel it : toggleButtons) {
+ it.dispose();
+ }
+ toggleButtons.clear();
+ for (Iterator<Type> iterator = types.iterator(); iterator.hasNext();) {
+ toggleButtons.add(new AnnotationTypeCheckButtonPanel(pane, iterator.next(), maxTitleLength));
+ }
+ pane.layout(true);
+ sc.setContent(pane);
+ sc.setMinSize(pane.computeSize(SWT.DEFAULT, SWT.DEFAULT));
+ }
+
+ private int updateTypes() {
+ if (this.getCurrentCEVData() == null) {
+ return 0;
+ }
+ Iterator typeIterator = this.getCurrentCEVData().getCAS().getTypeSystem().getTypeIterator();
+ int maxTitleLength = 0;
+ types.clear();
+
+ while (typeIterator.hasNext()) {
+ Type type = (Type) typeIterator.next();
+ // TODO find a generic way to filter these types:
+ if (!(type.getName().startsWith("org.apache.uima.textmarker.type")
+ || type.getName().startsWith("org.apache.uima.type")
+ || type.getName().startsWith("uima.cas") || type.getName().startsWith("uima.tcas"))) {
+ types.add(type);
+ int typeShortName = type.getShortName().length();
+ if (typeShortName > maxTitleLength) {
+ maxTitleLength = typeShortName;
+ }
+ }
+ }
+ Collections.sort(types, new TypeComparator());
+ return maxTitleLength;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.part.Page#init(org.eclipse.ui.part.IPageSite)
+ */
+ @Override
+ public void init(IPageSite pageSite) {
+ super.init(pageSite);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.part.Page#createControl(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ public void createControl(Composite parent) {
+
+ sc = new ScrolledComposite(parent, SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER);
+ pane = new Composite(sc, SWT.NULL);
+ pane.setLayout(new RowLayout(SWT.VERTICAL));
+
+ sc.setExpandHorizontal(true);
+ sc.setExpandVertical(true);
+ sc.setContent(pane);
+ sc.setMinSize(pane.computeSize(SWT.DEFAULT, SWT.DEFAULT));
+ casDataChanged();
+ }
+
+ private void annotateAllForSelection(int start, int end) {
+ List<AnnotationTypeCheckButtonPanel> toggledButtons = getToggledButtons();
+ for (AnnotationTypeCheckButtonPanel buttonP : toggledButtons) {
+ boolean update = toggledButtons.indexOf(buttonP) == toggledButtons.size() - 1;
+ annotateSingleForSelection(start, end, buttonP.getType(), update);
+ }
+ }
+
+ private void annotateSingleForSelection(int start, int end, Type type, boolean update) {
+ if (type == null) {
+ return;
+ }
+ getCurrentCEVData().addAnnotation(type, start, end, update);
+ }
+
+ public void casDataChanged() {
+ final int maxTitleLength = updateTypes();
+ updateControl(maxTitleLength);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.part.Page#dispose()
+ */
+ @Override
+ public void dispose() {
+ super.dispose();
+ sc.dispose();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.part.Page#getControl()
+ */
+ @Override
+ public Control getControl() {
+ return sc;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.part.Page#setFocus()
+ */
+ @Override
+ public void setFocus() {
+ sc.setFocus();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.uima.cev.data.ICEVAnnotationListener#annotationStateChanged(org
+ * .apache.uima.cas.Type)
+ */
+ public void annotationStateChanged(Type type) {
+ }
+
+ protected CEVData getCurrentCEVData() {
+ return casDocument.getCASData(current);
+ }
+
+ public void viewChanged(int newIndex) {
+ current = newIndex;
+ casDataChanged();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.uima.cev.data.ICEVAnnotationListener#colorChanged(org.apache. uima.cas.Type)
+ */
+ public void colorChanged(Type type) {
+ for (Iterator<AnnotationTypeCheckButtonPanel> iterator = toggleButtons.iterator(); iterator
+ .hasNext();) {
+ AnnotationTypeCheckButtonPanel button = iterator.next();
+ if (button.getType().equals(type)) {
+ button.updateColor();
+ }
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.uima.cev.data.ICEVAnnotationListener#annotationAdded(org.apache
+ * .uima.cas.text.AnnotationFS)
+ */
+ public void annotationsAdded(List<AnnotationFS> annots) {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.uima.cev.data.ICEVAnnotationListener#annotationRemoved(org.apache
+ * .uima.cas.text.AnnotationFS)
+ */
+ public void annotationsRemoved(List<AnnotationFS> annots) {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.uima.cev.data.ICEVAnnotationListener#annotationStateChanged(org
+ * .apache.uima.cas.text.AnnotationFS)
+ */
+ public void annotationStateChanged(AnnotationFS annot) {
+ }
+
+ public void textSelected(int start, int end) {
+ String text = getCurrentCEVData().getDocumentText().substring(start, end);
+ IPreferenceStore store = CEVPlugin.getDefault().getPreferenceStore();
+ boolean trim = store.getBoolean(CEVPreferenceConstants.P_ANNOTATION_EDITOR_TRIM);
+
+ if (trim) {
+ String trimmed = text.trim();
+
+ int indexOf = text.indexOf(trimmed);
+
+ int trimmedStart = start + indexOf;
+ int trimmedEnd = end - (text.length() - (indexOf + trimmed.length()));
+
+ start = trimmedStart;
+ end = trimmedEnd;
+ }
+ annotateAllForSelection(start, end);
+ }
+
+ public void casChanged(CEVDocument casDocument) {
+ this.casDocument = casDocument;
+ }
+}
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/palette/CEVAnnotationMarkerPalettePage.java
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/palette/CEVAnnotationMarkerPalettePage.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/palette/CEVAnnotationMarkerPaletteView.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/palette/CEVAnnotationMarkerPaletteView.java?rev=1157036&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/palette/CEVAnnotationMarkerPaletteView.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/palette/CEVAnnotationMarkerPaletteView.java Fri Aug 12 10:28:15 2011
@@ -0,0 +1,110 @@
+/*
+ * 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.cev.views.palette;
+
+import org.apache.uima.cev.views.ICEVViewPage;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.internal.views.ViewsPlugin;
+import org.eclipse.ui.part.IPage;
+import org.eclipse.ui.part.MessagePage;
+import org.eclipse.ui.part.PageBook;
+import org.eclipse.ui.part.PageBookView;
+
+public class CEVAnnotationMarkerPaletteView extends PageBookView {
+
+ private static final String VIEW_IS_NOT_AVAILABLE = "View is not available.";
+
+ public CEVAnnotationMarkerPaletteView() {
+ super();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.part.PageBookView#createDefaultPage(org.eclipse.ui.part .PageBook)
+ */
+ @Override
+ protected IPage createDefaultPage(PageBook book) {
+ MessagePage page = new MessagePage();
+ initPage(page);
+ page.createControl(book);
+ page.setMessage(VIEW_IS_NOT_AVAILABLE);
+ return page;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.part.PageBookView#doCreatePage(org.eclipse.ui.IWorkbenchPart )
+ */
+ @Override
+ protected PageRec doCreatePage(IWorkbenchPart part) {
+ Object obj = ViewsPlugin.getAdapter(part, ICEVAnnotationMarkerPalettePage.class, false);
+
+ if (obj instanceof ICEVViewPage) {
+ ICEVViewPage page = (ICEVViewPage) obj;
+
+ page.createControl(getPageBook());
+ return new PageRec(part, page);
+ }
+
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.part.PageBookView#doDestroyPage(org.eclipse.ui.IWorkbenchPart ,
+ * org.eclipse.ui.part.PageBookView.PageRec)
+ */
+ @Override
+ protected void doDestroyPage(IWorkbenchPart part, PageRec pageRecord) {
+ pageRecord.page.dispose();
+ pageRecord.dispose();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.part.PageBookView#getBootstrapPart()
+ */
+ @Override
+ protected IWorkbenchPart getBootstrapPart() {
+ IWorkbenchPage page = getSite().getPage();
+ if (page != null) {
+ return page.getActiveEditor();
+ }
+
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.part.PageBookView#isImportant(org.eclipse.ui.IWorkbenchPart )
+ */
+ @Override
+ protected boolean isImportant(IWorkbenchPart part) {
+ return (part instanceof IEditorPart);
+ }
+
+}
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/palette/CEVAnnotationMarkerPaletteView.java
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/palette/CEVAnnotationMarkerPaletteView.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/palette/ICEVAnnotationMarkerPalettePage.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/palette/ICEVAnnotationMarkerPalettePage.java?rev=1157036&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/palette/ICEVAnnotationMarkerPalettePage.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/palette/ICEVAnnotationMarkerPalettePage.java Fri Aug 12 10:28:15 2011
@@ -0,0 +1,26 @@
+/*
+ * 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.cev.views.palette;
+
+import org.apache.uima.cev.views.ICEVViewPage;
+
+public interface ICEVAnnotationMarkerPalettePage extends ICEVViewPage {
+
+}
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/palette/ICEVAnnotationMarkerPalettePage.java
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/palette/ICEVAnnotationMarkerPalettePage.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/selection/CEVSelectionPage.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/selection/CEVSelectionPage.java?rev=1157036&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/selection/CEVSelectionPage.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/selection/CEVSelectionPage.java Fri Aug 12 10:28:15 2011
@@ -0,0 +1,105 @@
+/*
+ * 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.cev.views.selection;
+
+import java.util.List;
+
+import org.apache.uima.cas.text.AnnotationFS;
+import org.apache.uima.cev.data.CEVDocument;
+import org.apache.uima.cev.data.ICEVAnnotationSelectionListener;
+import org.apache.uima.cev.data.tree.CEVAnnotationTreeNode;
+import org.apache.uima.cev.data.tree.CEVTypeTreeNode;
+import org.apache.uima.cev.data.tree.ICEVRootTreeNode;
+import org.apache.uima.cev.data.tree.ICEVTreeNode;
+import org.apache.uima.cev.editor.CEVViewer;
+import org.apache.uima.cev.views.CEVAnnotationTreeViewPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Event;
+
+public class CEVSelectionPage extends CEVAnnotationTreeViewPage implements ICEVSelectionPage,
+ ICEVAnnotationSelectionListener {
+
+ private int offset;
+
+ public CEVSelectionPage(CEVViewer casView, CEVDocument casDocument, int index) {
+ super(casView, casDocument, index);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.uniwue.casviewer.data.ICASAnnotationSelectionListener#newSelection (int)
+ */
+ public void newSelection(int offset) {
+ this.offset = offset;
+
+ ICEVRootTreeNode annotationOrderedTree = getCasData().getAnnotationOrderedTree(offset,
+ manualTypeFilter);
+ getTreeViewer().setInput(annotationOrderedTree);
+
+ Object input = getTreeViewer().getInput();
+
+ if (input instanceof ICEVRootTreeNode)
+ for (ICEVTreeNode n : ((ICEVRootTreeNode) input).getNodes())
+ if (n instanceof CEVAnnotationTreeNode)
+ getTreeViewer().setChecked(n,
+ getCasData().isChecked(((CEVAnnotationTreeNode) n).getAnnotation()));
+ else if (n instanceof CEVTypeTreeNode) {
+ if (getCasData().isGrayed(n.getType()))
+ getTreeViewer().setGrayChecked(n, true);
+ else if (getCasData().isChecked(n.getType())) {
+ getTreeViewer().setGrayed(n, false);
+ getTreeViewer().setChecked(n, true);
+ } else {
+ getTreeViewer().setGrayChecked(n, false);
+ }
+ }
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.uima.cev.views.CEVAnnotationTreeViewPage#annotationAdded(org.
+ * apache.uima.cas.text.AnnotationFS)
+ */
+ @Override
+ public void annotationsAdded(List<AnnotationFS> annots) {
+ newSelection(offset);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.uima.cev.views.CEVAnnotationTreeViewPage#annotationRemoved(org
+ * .apache.uima.cas.text.AnnotationFS)
+ */
+ @Override
+ public void annotationsRemoved(List<AnnotationFS> annots) {
+ newSelection(offset);
+ }
+
+ public void handleEvent(Event event) {
+ if (event.widget == filterTextField && event.type == SWT.Modify) {
+ manualTypeFilter = filterTextField.getText();
+ newSelection(offset);
+ }
+ }
+}
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/selection/CEVSelectionPage.java
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/selection/CEVSelectionPage.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/selection/CEVSelectionView.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/selection/CEVSelectionView.java?rev=1157036&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/selection/CEVSelectionView.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/selection/CEVSelectionView.java Fri Aug 12 10:28:15 2011
@@ -0,0 +1,40 @@
+/*
+ * 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.cev.views.selection;
+
+import org.apache.uima.cev.views.CEVPageBookView;
+import org.eclipse.ui.IWorkbenchPart;
+
+public class CEVSelectionView extends CEVPageBookView {
+
+ public CEVSelectionView() {
+ super();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.part.PageBookView#doCreatePage(org.eclipse.ui.IWorkbenchPart )
+ */
+ @Override
+ protected PageRec doCreatePage(IWorkbenchPart part) {
+ return doCreatePage(part, ICEVSelectionPage.class);
+ }
+}
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/selection/CEVSelectionView.java
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/selection/CEVSelectionView.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/selection/CEVSelectionViewFactory.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/selection/CEVSelectionViewFactory.java?rev=1157036&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/selection/CEVSelectionViewFactory.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/selection/CEVSelectionViewFactory.java Fri Aug 12 10:28:15 2011
@@ -0,0 +1,40 @@
+/*
+ * 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.cev.views.selection;
+
+import org.apache.uima.cev.data.CEVDocument;
+import org.apache.uima.cev.editor.CEVViewer;
+import org.apache.uima.cev.extension.ICEVView;
+import org.apache.uima.cev.extension.ICEVViewFactory;
+
+public class CEVSelectionViewFactory implements ICEVViewFactory {
+
+ public CEVSelectionViewFactory() {
+ }
+
+ public ICEVView createView(CEVViewer viewer, CEVDocument cevDocument, int index) {
+ return new CEVSelectionPage(viewer, cevDocument, index);
+ }
+
+ public Class<?> getAdapterInterface() {
+ return ICEVSelectionPage.class;
+ }
+
+}
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/selection/CEVSelectionViewFactory.java
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/selection/CEVSelectionViewFactory.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/selection/ICEVSelectionPage.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/selection/ICEVSelectionPage.java?rev=1157036&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/selection/ICEVSelectionPage.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/selection/ICEVSelectionPage.java Fri Aug 12 10:28:15 2011
@@ -0,0 +1,25 @@
+/*
+ * 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.cev.views.selection;
+
+import org.apache.uima.cev.views.ICEVViewPage;
+
+public interface ICEVSelectionPage extends ICEVViewPage {
+}
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/selection/ICEVSelectionPage.java
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-cev/src/main/java/org/apache/uima/cev/views/selection/ICEVSelectionPage.java
------------------------------------------------------------------------------
svn:mime-type = text/plain