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 13:14:21 UTC
svn commit: r1157050 [2/11] - in
/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons: ./ .settings/
META-INF/ icons/ 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/o...
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/failed_ovr.gif
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/failed_ovr.gif?rev=1157050&view=auto
==============================================================================
Binary file - no diff available.
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/failed_ovr.gif
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/failed_ovr.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/folder.png
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/folder.png?rev=1157050&view=auto
==============================================================================
Binary file - no diff available.
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/folder.png
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/folder.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/folder_edit.png
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/folder_edit.png?rev=1157050&view=auto
==============================================================================
Binary file - no diff available.
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/folder_edit.png
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/folder_edit.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/font_add.png
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/font_add.png?rev=1157050&view=auto
==============================================================================
Binary file - no diff available.
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/font_add.png
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/font_add.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/font_delete.png
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/font_delete.png?rev=1157050&view=auto
==============================================================================
Binary file - no diff available.
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/font_delete.png
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/font_delete.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/forward.gif
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/forward.gif?rev=1157050&view=auto
==============================================================================
Binary file - no diff available.
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/forward.gif
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/forward.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/run.gif
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/run.gif?rev=1157050&view=auto
==============================================================================
Binary file - no diff available.
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/run.gif
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/run.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/sample.gif
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/sample.gif?rev=1157050&view=auto
==============================================================================
Binary file - no diff available.
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/sample.gif
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/sample.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/start.png
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/start.png?rev=1157050&view=auto
==============================================================================
Binary file - no diff available.
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/start.png
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/start.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/statistics.png
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/statistics.png?rev=1157050&view=auto
==============================================================================
Binary file - no diff available.
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/statistics.png
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/statistics.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/stop.gif
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/stop.gif?rev=1157050&view=auto
==============================================================================
Binary file - no diff available.
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/stop.gif
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/stop.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/tag_orange.png
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/tag_orange.png?rev=1157050&view=auto
==============================================================================
Binary file - no diff available.
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/tag_orange.png
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/tag_orange.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/text_list_numbers.png
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/text_list_numbers.png?rev=1157050&view=auto
==============================================================================
Binary file - no diff available.
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/text_list_numbers.png
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/text_list_numbers.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/text_signature.png
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/text_signature.png?rev=1157050&view=auto
==============================================================================
Binary file - no diff available.
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/text_signature.png
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/text_signature.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/tm_obj.png
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/tm_obj.png?rev=1157050&view=auto
==============================================================================
Binary file - no diff available.
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/tm_obj.png
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/tm_obj.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/views.png
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/views.png?rev=1157050&view=auto
==============================================================================
Binary file - no diff available.
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/views.png
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/icons/views.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/plugin.xml
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/plugin.xml?rev=1157050&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/plugin.xml (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/plugin.xml Fri Aug 12 11:14:14 2011
@@ -0,0 +1,644 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+<?eclipse version="3.4"?>
+<plugin>
+<extension-point id="evaluators" name="CAS Evaluator" schema="schema/evaluators.exsd"/>
+ <extension
+ point="org.eclipse.ui.views">
+ <view
+ allowMultiple="false"
+ category="org.apache.uima.textmarker.ide.ui"
+ class="org.apache.uima.textmarker.query.ui.QueryView"
+ icon="icons/basket_edit.png"
+ id="org.apache.uima.textmarker.query.ui.ScriptQueryView"
+ name="TextMarker Query"
+ restorable="true">
+ </view>
+ <view
+ category="org.apache.uima.textmarker.ide.ui"
+ class="org.apache.uima.textmarker.testing.ui.views.fp.FalsePositiveView"
+ icon="icons/bug.png"
+ id="org.apache.uima.textmarker.testing.falsePositive"
+ name="False Positive">
+ </view>
+ <view
+ category="org.apache.uima.textmarker.ide.ui"
+ class="org.apache.uima.textmarker.testing.ui.views.fn.FalseNegativeView"
+ icon="icons/bug.png"
+ id="org.apache.uima.textmarker.testing.falseNegative"
+ name="False Negative">
+ </view>
+ <view
+ category="org.apache.uima.textmarker.ide.ui"
+ class="org.apache.uima.textmarker.testing.ui.views.TestPageBookView"
+ icon="icons/bug_edit.png"
+ id="org.apache.uima.textmarker.testing.TestingView"
+ name="Annotation Test"
+ restorable="true">
+ </view>
+ <view
+ category="org.apache.uima.textmarker.ide.ui"
+ class="org.apache.uima.textmarker.testing.ui.views.tp.TruePositiveView"
+ icon="icons/bug.png"
+ id="org.apache.uima.textmarker.testing.truePositive"
+ name="True Positive">
+ </view>
+ </extension> <extension
+ point="org.apache.uima.cev.cevSearchStrategies">
+ <strategy
+ factory="org.apache.uima.textmarker.query.QuerySearchStrategyFactory"
+ id="org.apache.uima.textmarker.query.searchStrategy"
+ priority="0">
+ </strategy>
+ </extension> <extension
+ point="org.eclipse.ui.commands">
+ <command
+ defaultHandler="org.apache.uima.textmarker.query.ui.QueryActionHandler"
+ id="org.apache.uima.textmarker.query.command"
+ name="Query Command">
+ </command>
+ <command
+ defaultHandler="org.apache.uima.textmarker.query.ui.ExportActionHandler"
+ id="org.apache.uima.textmarker.query.export"
+ name="Export List">
+ </command>
+ </extension> <extension
+ point="org.eclipse.ui.menus">
+ <menuContribution
+ locationURI="toolbar:org.apache.uima.textmarker.query.ui.ScriptQueryView?after=additions">
+ <command
+ commandId="org.apache.uima.textmarker.query.command"
+ icon="icons/13555.actionengine_play.gif"
+ label="Query"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.apache.uima.textmarker.query.export"
+ icon="icons/10892.resource_persp.gif"
+ label="Export List"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ <menuContribution
+ locationURI="toolbar:org.eclipse.ui.main.toolbar">
+ <toolbar
+ id="org.apache.uima.textmarker.utils.query.queryToolbar">
+ </toolbar>
+ </menuContribution>
+ </extension> <extension
+ point="org.eclipse.ui.menus">
+ <menuContribution
+ locationURI="toolbar:org.apache.uima.textmarker.testing.TestingView?after=additions">
+ <command
+ commandId="org.apache.uima.textmarker.testing.rerun"
+ icon="icons/13555.actionengine_play.gif"
+ label="Rerun Tests"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.apache.uima.textmarker.testing.PreviousTestCase"
+ icon="icons/back.gif"
+ label="Previous Test Case"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.apache.uima.textmarker.testing.nextTestCase"
+ icon="icons/forward.gif"
+ label="Next Test Case"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.apache.uima.textmarker.testing.LoadFolderCommand"
+ icon="icons/add.gif"
+ label="Load all test files from selected folder"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.apache.uima.textmarker.testing.excludeTypes"
+ icon="icons/exclamation.png"
+ label="Select excluded types"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.apache.uima.textmarker.testing.selectEvaluator"
+ icon="icons/evaluator.gif"
+ label="Select Evaluator"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.apache.uima.textmarker.testing.ExportTabel"
+ icon="icons/10892.resource_persp.gif"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ <menuContribution
+ locationURI="toolbar:org.eclipse.ui.main.toolbar">
+ <toolbar
+ id="org.apache.uima.textmarker.testing.annotationTestToolbar">
+ </toolbar>
+ </menuContribution>
+ </extension> <extension
+ point="org.eclipse.ui.commands">
+ <command
+ defaultHandler="org.apache.uima.textmarker.testing.ui.handlers.RemoveTestsHandler"
+ id="org.apache.uima.textmarker.testing.removeTests"
+ name="Remove Resource">
+ </command>
+ <command
+ defaultHandler="org.apache.uima.textmarker.testing.ui.handlers.RerunActionHandler"
+ id="org.apache.uima.textmarker.testing.rerun"
+ name="Rerun Command">
+ </command>
+ <command
+ defaultHandler="org.apache.uima.textmarker.testing.ui.handlers.NextTestCaseHandler"
+ id="org.apache.uima.textmarker.testing.nextTestCase"
+ name="NextTestCase">
+ </command>
+ <command
+ defaultHandler="org.apache.uima.textmarker.testing.ui.handlers.PreviousTestCaseHandler"
+ id="org.apache.uima.textmarker.testing.PreviousTestCase"
+ name="PreviousTestCase">
+ </command>
+ <command
+ defaultHandler="org.apache.uima.textmarker.testing.ui.handlers.LoadFilesFromFolderHandler"
+ id="org.apache.uima.textmarker.testing.LoadFolderCommand"
+ name="LoadFolderCommand">
+ </command>
+ <command
+ defaultHandler="org.apache.uima.textmarker.testing.ui.handlers.SelectedExcludedTypesHandler"
+ id="org.apache.uima.textmarker.testing.excludeTypes"
+ name="Select excluded types">
+ </command>
+ <command
+ defaultHandler="org.apache.uima.textmarker.testing.ui.handlers.SelectEvaluatorHandler"
+ id="org.apache.uima.textmarker.testing.selectEvaluator"
+ name="Select Evaluator">
+ </command>
+ <command
+ defaultHandler="org.apache.uima.textmarker.testing.ui.handlers.ExportTabelHandler"
+ id="org.apache.uima.textmarker.testing.ExportTabel"
+ name="Export Table">
+ </command>
+ </extension>
+ <extension
+ point="org.apache.uima.cev.cevViews">
+ <view
+ factory="org.apache.uima.textmarker.testing.ui.views.fp.FalsePositiveViewFactory"
+ id="org.apache.uima.textmarker.testing.falsePositive.cev"
+ priority="0"
+ viewId="org.apache.uima.textmarker.testing.falsePositive">
+ </view>
+ <view
+ factory="org.apache.uima.textmarker.testing.ui.views.fn.FalseNegativeViewFactory"
+ id="org.apache.uima.textmarker.testing.falseNegative.cev"
+ priority="0"
+ viewId="org.apache.uima.textmarker.testing.falseNegative">
+ </view>
+ <view
+ factory="org.apache.uima.textmarker.testing.ui.views.tp.TruePositiveViewFactory"
+ id="org.apache.uima.textmarker.testing.truePositive.cev"
+ priority="0"
+ viewId="org.apache.uima.textmarker.testing.truePositive">
+ </view>
+ </extension> <extension
+ point="org.apache.uima.cev.cevSearchStrategies">
+ <strategy
+ factory="org.apache.uima.textmarker.testing.searchStrategy.TestingSearchStrategyFactory"
+ id="org.apache.uima.textmarker.testing.cev.searchStrategy"
+ priority="5">
+ </strategy>
+ </extension>
+ <extension
+ point="org.apache.uima.textmarker.addons.evaluators">
+ <evaluator
+ factory="org.apache.uima.textmarker.testing.evaluator.PartialMatchCasEvaluatorFacotry"
+ id="org.apache.uima.textmarker.testing.partialmatchevaluator"
+ name="Partial Match">
+ </evaluator>
+ <evaluator
+ factory="org.apache.uima.textmarker.testing.evaluator.ExactCasEvaluatorFactory"
+ id="org.apache.uima.textmarker.testing.exactCasEvaluator"
+ name="Exact Match">
+ </evaluator>
+ <evaluator
+ factory="org.apache.uima.textmarker.testing.evaluator.CoreMatchCasEvaluatorFactory"
+ id="org.apache.uima.textmarker.testing.corematchevaluator"
+ name="Core Term Match">
+ </evaluator>
+ <evaluator
+ factory="org.apache.uima.textmarker.testing.evaluator.WordAccuracyCasEvaluatorFactory"
+ id="org.apache.uima.textmarker.testing.wordAccurecyCasEvaluator"
+ name="Word Accuracy">
+ </evaluator>
+ <evaluator
+ factory="org.apache.uima.textmarker.testing.evaluator.TemplateCasEvaluatorFactory"
+ id="org.apache.uima.textmarker.testing.templateCasEvaluator"
+ name="Template only">
+ </evaluator>
+ <evaluator
+ factory="org.apache.uima.textmarker.testing.evaluator.WordTemplateCasEvaluatorFactory"
+ id="org.apache.uima.textmarker.testing.wordTemplateCasEvaluator"
+ name="Template on word level">
+ </evaluator>
+ <evaluator
+ factory="org.apache.uima.textmarker.testing.evaluator.FeatureCasEvaluatorFactory"
+ id="org.apache.uima.textmarker.testing.featureCasEvaluator"
+ name="Features: Annotations and Strings">
+ </evaluator>
+ <evaluator
+ factory="org.apache.uima.textmarker.testing.evaluator.StringFeatureCasEvaluatorFactory"
+ id="org.apache.uima.textmarker.testing.stringFeature"
+ name="Annotations with String features">
+ </evaluator>
+ </extension> <extension
+ point="org.eclipse.core.runtime.preferences">
+ <initializer
+ class="org.apache.uima.textmarker.testing.preferences.TestingPreferenceInitializer">
+ </initializer>
+ </extension> <extension
+ point="org.eclipse.ui.preferencePages">
+ <page
+ category="org.apache.uima.textmarker.ide.preferences"
+ class="org.apache.uima.textmarker.testing.preferences.TestingPreferencePage"
+ id="org.apache.uima.textmarker.testing.preferences"
+ name="Testing">
+ </page>
+ </extension>
+ <extension
+ point="org.eclipse.ui.commands">
+ <command
+ defaultHandler="org.apache.uima.textmarker.utils.twl.TWLConverterHandler"
+ description="TWLConvertCommand"
+ id="org.apache.uima.textmarker.utils.twl.command"
+ name="Convert to TWL">
+ <defaultHandler
+ class="org.apache.uima.textmarker.utils.twl.TWLConverterHandler">
+ </defaultHandler>
+ </command>
+ <command
+ defaultHandler="org.apache.uima.textmarker.utils.twl.MultiTWLConverterHandler"
+ description="MultiTWLConvertCommand"
+ id="org.apache.uima.textmarker.utils.mtwl.command"
+ name="Convert to Multi TWL">
+ <defaultHandler
+ class="org.apache.uima.textmarker.utils.twl.MultiTWLConverterHandler">
+ </defaultHandler>
+ </command>
+ <command
+ defaultHandler="org.apache.uima.textmarker.utils.apply.ApplyScriptRemoveBasicsHandler"
+ id="org.apache.uima.textmarker.utils.apply.script"
+ name="ApplyScriptCommand">
+ </command>
+ <command
+ defaultHandler="org.apache.uima.textmarker.utils.apply.ApplyScriptKeepBasicsHandler"
+ id="org.apache.uima.textmarker.utils.apply.script.basics"
+ name="ApplyScriptBasicsCommand">
+ </command>
+ <command
+ defaultHandler="org.apache.uima.textmarker.utils.apply.ApplyScriptNoXMIHandler"
+ id="org.apache.uima.textmarker.utils.apply.script.noxmi"
+ name="ApplyScriptNoXMICommand">
+ </command>
+ </extension> <extension
+ point="org.eclipse.ui.menus">
+ <menuContribution
+ locationURI="popup:org.eclipse.ui.popup.any">
+ <menu
+ icon="icons/tm_obj.png"
+ id="org.apache.uima.textmarker.utils.popup.submenu"
+ label="TextMarker">
+ </menu>
+ </menuContribution>
+ <menuContribution
+ locationURI="popup:org.apache.uima.textmarker.utils.popup.submenu">
+ <command
+ commandId="org.apache.uima.textmarker.utils.apply.script.basics"
+ disabledIcon="icons/tm_obj.png"
+ hoverIcon="icons/tm_obj.png"
+ icon="icons/tm_obj.png"
+ id="org.apache.uima.textmarker.utils.apply.script.basics.popup"
+ label="Quick TextMarker"
+ style="push"
+ tooltip="Apply current TextMarker script on folder and keep basics">
+ <visibleWhen
+ checkEnabled="true">
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ <menuContribution
+ locationURI="popup:org.apache.uima.textmarker.utils.popup.submenu">
+ <command
+ commandId="org.apache.uima.textmarker.utils.apply.script"
+ disabledIcon="icons/tm_obj.png"
+ hoverIcon="icons/tm_obj.png"
+ icon="icons/tm_obj.png"
+ id="org.apache.uima.textmarker.utils.apply.script.popup"
+ label="Quick TextMarker (remove basics)"
+ style="push"
+ tooltip="Apply current TextMarker script on folder">
+ <visibleWhen
+ checkEnabled="true">
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ <menuContribution
+ locationURI="popup:org.apache.uima.textmarker.utils.popup.submenu">
+ <command
+ commandId="org.apache.uima.textmarker.utils.apply.script.noxmi"
+ disabledIcon="icons/tm_obj.png"
+ hoverIcon="icons/tm_obj.png"
+ icon="icons/tm_obj.png"
+ id="org.apache.uima.textmarker.utils.apply.script.noxmi.popup"
+ label="Quick TextMarker (no xmi)"
+ style="push"
+ tooltip="Apply current TextMarker script on folder">
+ <visibleWhen
+ checkEnabled="true">
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ <menuContribution
+ locationURI="popup:org.apache.uima.textmarker.utils.popup.submenu">
+ <command
+ commandId="org.apache.uima.textmarker.utils.twl.command"
+ disabledIcon="icons/tm_obj.png"
+ hoverIcon="icons/tm_obj.png"
+ icon="icons/tm_obj.png"
+ id="org.apache.uima.textmarker.utils.twl.popup"
+ label="Convert to TWL"
+ style="push"
+ tooltip="Convert the word list to a tree">
+ <visibleWhen
+ checkEnabled="true">
+ <reference
+ definitionId="org.apache.uima.textmarker.utils.twl.definition">
+ </reference>
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ <menuContribution
+ locationURI="popup:org.apache.uima.textmarker.utils.popup.submenu">
+ <command
+ commandId="org.apache.uima.textmarker.utils.mtwl.command"
+ disabledIcon="icons/tm_obj.png"
+ hoverIcon="icons/tm_obj.png"
+ icon="icons/tm_obj.png"
+ id="org.apache.uima.textmarker.utils.mtwl.popup"
+ label="Convert to Multi TWL"
+ style="push"
+ tooltip="Convert several word lists to a tree">
+ <visibleWhen
+ checkEnabled="true">
+ <reference
+ definitionId="org.apache.uima.textmarker.utils.mtwl.definition">
+ </reference>
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ </extension> <extension
+ point="org.eclipse.core.expressions.definitions">
+ <definition
+ id="org.apache.uima.textmarker.utils.twl.definition">
+ <with
+ variable="selection">
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <test
+ property="org.eclipse.core.resources.extension"
+ value="txt">
+ </test>
+ </iterate>
+ </with>
+ </definition>
+ <definition
+ id="org.apache.uima.textmarker.utils.mtwl.definition">
+ <with
+ variable="selection">
+ <iterate
+ ifEmpty="true">
+ <or>
+ <test
+ property="org.eclipse.core.resources.extension"
+ value="txt">
+ </test>
+ </or>
+ </iterate>
+ </with>
+ </definition>
+ <definition
+ id="org.apache.uima.textmarker.utils.apply.script.definition">
+ <with
+ variable="selection">
+ <and>
+ <with
+ variable="activeEditorId">
+ <equals
+ value="org.apache.uima.textmarker.ide.ui.editor.TextMarkerEditor">
+ </equals>
+ </with>
+ </and>
+ </with>
+ </definition>
+ </extension> <extension
+ point="org.eclipse.ui.bindings">
+ <key
+ commandId="org.apache.uima.textmarker.utils.apply.script"
+ contextId="org.eclipse.ui.contexts.window"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+ sequence="M1+M3+T">
+ </key>
+ <key
+ commandId="org.apache.uima.textmarker.utils.apply.script.basics"
+ contextId="org.eclipse.ui.contexts.window"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+ sequence="M1+T">
+ </key>
+ <key
+ commandId="org.apache.uima.textmarker.utils.apply.script.noxmi"
+ contextId="org.eclipse.ui.contexts.window"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+ sequence="M1+M2+M3+T">
+ </key>
+ <key
+ commandId="org.apache.uima.textmarker.utils.twl.command"
+ contextId="org.eclipse.ui.contexts.window"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+ sequence="M1+L">
+ </key>
+ <key
+ commandId="org.apache.uima.textmarker.utils.mtwl.command"
+ contextId="org.eclipse.ui.contexts.window"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+ sequence="M1+M2+L">
+ </key>
+ </extension>
+ <extension
+ point="org.eclipse.ui.views">
+ <view
+ category="org.apache.uima.textmarker.ide.ui"
+ class="org.apache.uima.textmarker.explain.basic.BasicTokenStreamView"
+ icon="icons/text_list_numbers.png"
+ id="org.apache.uima.textmarker.explain.basic"
+ name="Basic Stream">
+ </view>
+ <view
+ category="org.apache.uima.textmarker.ide.ui"
+ class="org.apache.uima.textmarker.explain.apply.ApplyView"
+ icon="icons/chart_organisation.png"
+ id="org.apache.uima.textmarker.explain.apply"
+ name="Applied Rules">
+ </view>
+ <view
+ category="org.apache.uima.textmarker.ide.ui"
+ class="org.apache.uima.textmarker.explain.matched.MatchedView"
+ icon="icons/accept.png"
+ id="org.apache.uima.textmarker.explain.matched"
+ name="Matched Rules"
+ restorable="true">
+ </view>
+ <view
+ category="org.apache.uima.textmarker.ide.ui"
+ class="org.apache.uima.textmarker.explain.failed.FailedView"
+ icon="icons/cancel.png"
+ id="org.apache.uima.textmarker.explain.failed"
+ name="Failed Rules">
+ </view>
+ <view
+ category="org.apache.uima.textmarker.ide.ui"
+ class="org.apache.uima.textmarker.explain.element.ElementView"
+ icon="icons/chart_organisation.png"
+ id="org.apache.uima.textmarker.explain.element"
+ name="Rule Elements">
+ </view>
+ <view
+ category="org.apache.uima.textmarker.ide.ui"
+ class="org.apache.uima.textmarker.statistics.StatisticsView"
+ icon="icons/statistics.png"
+ id="org.apache.uima.textmarker.statistics"
+ name="Statistics">
+ </view>
+ <view
+ category="org.apache.uima.textmarker.ide.ui"
+ class="org.apache.uima.textmarker.explain.selection.ExplainSelectionView"
+ icon="icons/chart_organisation.png"
+ id="org.apache.uima.textmarker.explain.selection"
+ name="Selected Rules">
+ </view>
+ <view
+ category="org.apache.uima.textmarker.ide.ui"
+ class="org.apache.uima.textmarker.explain.rulelist.RuleListSelectionView"
+ icon="icons/chart_organisation.png"
+ id="org.apache.uima.textmarker.explain.rulelist"
+ name="Rule List">
+ </view>
+ </extension>
+ <extension
+ point="org.apache.uima.cev.cevViews">
+ <view
+ factory="org.apache.uima.textmarker.explain.apply.ApplyViewFactory"
+ id="org.apache.uima.textmarker.cev.extension.explain.apply"
+ priority="0"
+ viewId="org.apache.uima.textmarker.explain.apply">
+ </view>
+ <view
+ factory="org.apache.uima.textmarker.explain.matched.MatchedViewFactory"
+ id="org.apache.uima.textmarker.cev.extension.explain.matched"
+ priority="0"
+ viewId="org.apache.uima.textmarker.explain.matched">
+ </view>
+ <view
+ factory="org.apache.uima.textmarker.explain.basic.BasicTokenStreamViewFactory"
+ id="org.apache.uima.textmarker.cev.extension.explain.basic"
+ priority="0"
+ viewId="org.apache.uima.textmarker.explain.basic">
+ </view>
+ <view
+ factory="org.apache.uima.textmarker.explain.failed.FailedViewFactory"
+ id="org.apache.uima.textmarker.cev.extension.explain.failed"
+ priority="0"
+ viewId="org.apache.uima.textmarker.explain.failed">
+ </view>
+ <view
+ factory="org.apache.uima.textmarker.explain.element.ElementViewFactory"
+ id="org.apache.uima.textmarker.cev.extension.explain.element"
+ priority="0"
+ viewId="org.apache.uima.textmarker.explain.element">
+ </view>
+ <view
+ factory="org.apache.uima.textmarker.statistics.StatisticsViewFactory"
+ id="org.apache.uima.textmarker.cev.extension.statistics"
+ priority="0"
+ viewId="org.apache.uima.textmarker.statistics">
+ </view>
+ <view
+ factory="org.apache.uima.textmarker.explain.selection.ExplainSelectionViewFactory"
+ id="org.apache.uima.textmarker.cev.extension.explain.selection"
+ priority="0"
+ viewId="org.apache.uima.textmarker.explain.selection">
+ </view>
+ <view
+ factory="org.apache.uima.textmarker.explain.rulelist.RuleListViewFactory"
+ id="org.apache.uima.textmarker.cev.extension.explain.rulelist"
+ priority="0"
+ viewId="org.apache.uima.textmarker.explain.rulelist">
+ </view>
+ </extension>
+ <extension
+ point="org.apache.uima.cev.cevSearchStrategies">
+ <strategy
+ factory="org.apache.uima.textmarker.searchStrategy.LastLaunchSearchStrategyFactory"
+ id="org.apache.uima.textmarker.cev.LastLaunchSearch"
+ priority="20">
+ </strategy>
+ <strategy
+ factory="org.apache.uima.textmarker.searchStrategy.DescriptorFolderSearchStrategyFactory"
+ id="org.apache.uima.textmarker.cev.DescriptorFolder"
+ priority="100">
+ </strategy>
+ </extension>
+</plugin>
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/plugin.xml
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/plugin.xml
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/schema/evaluators.exsd
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/schema/evaluators.exsd?rev=1157050&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/schema/evaluators.exsd (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/schema/evaluators.exsd Fri Aug 12 11:14:14 2011
@@ -0,0 +1,134 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!--
+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.
+-->
+
+<schema targetNamespace="org.apache.uima.textmarker.addons" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.apache.uima.textmarker.addons" id="evaluators" name="CAS Evaluator"/>
+ </appInfo>
+ <documentation>
+ [Enter description of this extension point.]
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appInfo>
+ <meta.element />
+ </appInfo>
+ </annotation>
+ <complexType>
+ <sequence minOccurs="1" maxOccurs="unbounded">
+ <element ref="evaluator"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="evaluator">
+ <complexType>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="factory" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn=":org.apache.uima.textmarker.testing.evaluator.ICasEvaluatorFactory"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiinfo"/>
+ </appInfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/schema/evaluators.exsd
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/schema/evaluators.exsd
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/addons/TextMarkerAddonsPlugin.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/addons/TextMarkerAddonsPlugin.java?rev=1157050&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/addons/TextMarkerAddonsPlugin.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/addons/TextMarkerAddonsPlugin.java Fri Aug 12 11:14:14 2011
@@ -0,0 +1,126 @@
+package org.apache.uima.textmarker.addons;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.uima.textmarker.testing.evaluator.ICasEvaluatorFactory;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class TextMarkerAddonsPlugin extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.apache.uima.textmarker.addons"; //$NON-NLS-1$
+
+ public static final String ATT_FACTORY = "factory";
+
+ // The shared instance
+ private static TextMarkerAddonsPlugin plugin;
+
+ /**
+ * The constructor
+ */
+ public TextMarkerAddonsPlugin() {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static TextMarkerAddonsPlugin getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Returns an image descriptor for the image file at the given plug-in relative path
+ *
+ * @param path
+ * the path
+ * @return the image descriptor
+ */
+ public static ImageDescriptor getImageDescriptor(String path) {
+ return imageDescriptorFromPlugin(PLUGIN_ID, path);
+ }
+
+ public static List<ICasEvaluatorFactory> getCasEvaluators() {
+ List<ICasEvaluatorFactory> result = new ArrayList<ICasEvaluatorFactory>();
+ IExtension[] evalExtensions = Platform.getExtensionRegistry()
+ .getExtensionPoint(TextMarkerAddonsPlugin.PLUGIN_ID, "evaluators").getExtensions();
+ for (IExtension extension : evalExtensions) {
+ IConfigurationElement[] configurationElements = extension.getConfigurationElements();
+ for (IConfigurationElement configurationElement : configurationElements) {
+ Object factoryObject = null;
+ try {
+ factoryObject = configurationElement.createExecutableExtension(ATT_FACTORY);
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
+ if (factoryObject instanceof ICasEvaluatorFactory) {
+ ICasEvaluatorFactory evalFactory = (ICasEvaluatorFactory) factoryObject;
+ result.add(evalFactory);
+ }
+ }
+ }
+ return result;
+ }
+
+ public static ICasEvaluatorFactory getCasEvaluatorFactoryById(String id) {
+ IExtension[] evalExtensions = Platform.getExtensionRegistry()
+ .getExtensionPoint(TextMarkerAddonsPlugin.PLUGIN_ID, "evaluators").getExtensions();
+ for (IExtension extension : evalExtensions) {
+ IConfigurationElement[] configurationElements = extension.getConfigurationElements();
+ for (IConfigurationElement configurationElement : configurationElements) {
+ String elementId = configurationElement.getAttribute("id");
+ if (elementId.equals(id)) {
+ try {
+ Object factoryObject = configurationElement.createExecutableExtension(ATT_FACTORY);
+ if (factoryObject instanceof ICasEvaluatorFactory) {
+ return ((ICasEvaluatorFactory) factoryObject);
+
+ }
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
+ }
+
+ }
+ }
+ return null;
+ }
+
+ public static void error(Throwable t) {
+ plugin.getLog().log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, t.getMessage(), t));
+ }
+
+}
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/addons/TextMarkerAddonsPlugin.java
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/addons/TextMarkerAddonsPlugin.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/ExplainConstants.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/ExplainConstants.java?rev=1157050&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/ExplainConstants.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/ExplainConstants.java Fri Aug 12 11:14:14 2011
@@ -0,0 +1,23 @@
+package org.apache.uima.textmarker.explain;
+
+public class ExplainConstants {
+ public static final String BASIC_TYPE = "org.apache.uima.textmarker.type.TextMarkerBasic";
+
+ public static final String SCRIPT_APPLY_TYPE = "org.apache.uima.textmarker.type.DebugScriptApply";
+
+ public static final String BLOCK_APPLY_TYPE = "org.apache.uima.textmarker.type.DebugBlockApply";
+
+ public static final String RULE_APPLY_TYPE = "org.apache.uima.textmarker.type.DebugRuleApply";
+
+ public static final String RULE_MATCH_TYPE = "org.apache.uima.textmarker.type.DebugRuleMatch";
+
+ public static final String MATCHED_RULE_MATCH_TYPE = "org.apache.uima.textmarker.type.DebugMatchedRuleMatch";
+
+ public static final String FAILED_RULE_MATCH_TYPE = "org.apache.uima.textmarker.type.DebugFailedRuleMatch";
+
+ public static final String RULE_ELEMENT_MATCH_TYPE = "org.apache.uima.textmarker.type.DebugRuleElementMatch";
+
+ public static final String RULE_ELEMENT_MATCHES_TYPE = "org.apache.uima.textmarker.type.DebugRuleElementMatches";
+
+ public static final String EVAL_CONDITION_TYPE = "org.apache.uima.textmarker.type.DebugEvaluatedCondition";
+}
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/ExplainConstants.java
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/ExplainConstants.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/apply/ApplyTreeContentProvider.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/apply/ApplyTreeContentProvider.java?rev=1157050&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/apply/ApplyTreeContentProvider.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/apply/ApplyTreeContentProvider.java Fri Aug 12 11:14:14 2011
@@ -0,0 +1,76 @@
+/*
+ * 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.textmarker.explain.apply;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.uima.textmarker.explain.tree.ExplainRootNode;
+import org.apache.uima.textmarker.explain.tree.IExplainTreeNode;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+
+
+public class ApplyTreeContentProvider implements ITreeContentProvider {
+
+ public Object[] getChildren(Object parentElement) {
+ if (parentElement instanceof IExplainTreeNode) {
+ List<Object> result = new ArrayList<Object>();
+ IExplainTreeNode debugNode = (IExplainTreeNode) parentElement;
+ for (IExplainTreeNode each : debugNode.getChildren()) {
+ if (!(each instanceof ExplainRootNode)) {
+ result.add(each);
+ }
+ }
+ return result.toArray();
+ }
+ return null;
+ }
+
+ public Object getParent(Object element) {
+ if (element instanceof IExplainTreeNode) {
+ return ((IExplainTreeNode) element).getParent();
+ }
+ return null;
+ }
+
+ public Object[] getElements(Object parentElement) {
+ return getChildren(parentElement);
+ }
+
+ public boolean hasChildren(Object parentElement) {
+ if (parentElement instanceof IExplainTreeNode) {
+ IExplainTreeNode debugNode = (IExplainTreeNode) parentElement;
+ for (Object each : debugNode.getChildren()) {
+ if (!(each instanceof ExplainRootNode)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ public void dispose() {
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+
+}
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/apply/ApplyTreeContentProvider.java
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/apply/ApplyTreeContentProvider.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/apply/ApplyTreeLabelProvider.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/apply/ApplyTreeLabelProvider.java?rev=1157050&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/apply/ApplyTreeLabelProvider.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/apply/ApplyTreeLabelProvider.java Fri Aug 12 11:14:14 2011
@@ -0,0 +1,115 @@
+/*
+ * 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.textmarker.explain.apply;
+
+import org.apache.uima.cas.Feature;
+import org.apache.uima.cas.FeatureStructure;
+import org.apache.uima.cas.Type;
+import org.apache.uima.cas.TypeSystem;
+import org.apache.uima.textmarker.explain.ExplainConstants;
+import org.apache.uima.textmarker.explain.tree.ExplainTree;
+import org.apache.uima.textmarker.explain.tree.IExplainTreeNode;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.swt.graphics.Image;
+
+public class ApplyTreeLabelProvider extends LabelProvider implements ILabelProvider {
+
+ private ApplyViewPage owner;
+
+ ImageDescriptor blockApply;
+
+ public ApplyTreeLabelProvider(ApplyViewPage owner) {
+ super();
+ this.owner = owner;
+ }
+
+ @Override
+ public Image getImage(Object element) {
+ if (element instanceof IExplainTreeNode) {
+ IExplainTreeNode debugNode = (IExplainTreeNode) element;
+ FeatureStructure fs = debugNode.getFeatureStructure();
+ if (fs != null) {
+ String name = fs.getType().getName();
+ if (name.equals(ExplainConstants.RULE_APPLY_TYPE)) {
+ if (debugNode.getChildren().size() >= 3) {
+ name += "Delegate";
+ }
+ }
+ return owner.getImage(name);
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public String getText(Object element) {
+
+ String result = "error";
+ if (element instanceof IExplainTreeNode) {
+ IExplainTreeNode debugNode = (IExplainTreeNode) element;
+ TypeSystem ts = debugNode.getTypeSystem();
+
+ Type ruleType = ts.getType(ExplainConstants.RULE_APPLY_TYPE);
+ FeatureStructure fs = debugNode.getFeatureStructure();
+ if (fs != null && ts.subsumes(ruleType, fs.getType())) {
+ Feature f1 = ruleType.getFeatureByBaseName(ExplainTree.APPLIED);
+ int v1 = fs.getIntValue(f1);
+ Feature f2 = ruleType.getFeatureByBaseName(ExplainTree.TRIED);
+ int v2 = fs.getIntValue(f2);
+ Feature f3 = ruleType.getFeatureByBaseName(ExplainTree.ELEMENT);
+ String v3 = fs.getStringValue(f3);
+ v3 = v3.replaceAll("[\\n\\r]", "");
+ Feature f4 = ruleType.getFeatureByBaseName(ExplainTree.TIME);
+ long v4 = fs.getLongValue(f4);
+ String time = "";
+ if (v4 > 0.0) {
+ double took = v4 / 1000.0;
+ time = " [" + took + "s";
+ IExplainTreeNode parentNode = debugNode.getParent();
+ if (parentNode != null) {
+ FeatureStructure parent = parentNode.getFeatureStructure();
+ if (parent != null) {
+ long parentTime = parent.getLongValue(f4);
+ double percent = (took / (parentTime / 1000.0)) * 100.0;
+ percent = Math.round(percent * 100.0) / 100.0;
+ time += "|" + percent + "%]";
+ } else {
+ time += "]";
+ }
+ } else {
+ time += "]";
+ }
+
+ }
+ result = "[" + v1 + "/" + v2 + "] " + v3 + time;
+ }
+ }
+ return result;
+
+ }
+
+ public static String escape(String str) {
+ String result = str.replaceAll("\\\\", "\\\\\\\\");
+ return result;
+ }
+
+}
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/apply/ApplyTreeLabelProvider.java
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/apply/ApplyTreeLabelProvider.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/apply/ApplyView.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/apply/ApplyView.java?rev=1157050&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/apply/ApplyView.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/apply/ApplyView.java Fri Aug 12 11:14:14 2011
@@ -0,0 +1,36 @@
+/*
+ * 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.textmarker.explain.apply;
+
+import org.apache.uima.cev.views.CEVPageBookView;
+import org.eclipse.ui.IWorkbenchPart;
+
+
+public class ApplyView extends CEVPageBookView {
+
+ public ApplyView() {
+ super();
+ }
+
+ @Override
+ protected PageRec doCreatePage(IWorkbenchPart part) {
+ return doCreatePage(part, IApplyViewPage.class);
+ }
+}
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/apply/ApplyView.java
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/apply/ApplyView.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/apply/ApplyViewFactory.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/apply/ApplyViewFactory.java?rev=1157050&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/apply/ApplyViewFactory.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/apply/ApplyViewFactory.java Fri Aug 12 11:14:14 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.textmarker.explain.apply;
+
+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 ApplyViewFactory implements ICEVViewFactory {
+
+ public ApplyViewFactory() {
+ }
+
+ public ICEVView createView(CEVViewer viewer, CEVDocument cevDocument, int index) {
+ return new ApplyViewPage(viewer, cevDocument, index);
+ }
+
+ public Class<?> getAdapterInterface() {
+ return IApplyViewPage.class;
+ }
+
+}
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/apply/ApplyViewFactory.java
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/apply/ApplyViewFactory.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/apply/ApplyViewPage.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/apply/ApplyViewPage.java?rev=1157050&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/apply/ApplyViewPage.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/apply/ApplyViewPage.java Fri Aug 12 11:14:14 2011
@@ -0,0 +1,236 @@
+/*
+ * 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.textmarker.explain.apply;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.uima.cas.Type;
+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.editor.CEVViewer;
+import org.apache.uima.cev.extension.ICEVView;
+import org.apache.uima.textmarker.addons.TextMarkerAddonsPlugin;
+import org.apache.uima.textmarker.explain.ExplainConstants;
+import org.apache.uima.textmarker.explain.failed.FailedViewPage;
+import org.apache.uima.textmarker.explain.failed.IFailedViewPage;
+import org.apache.uima.textmarker.explain.matched.IMatchedViewPage;
+import org.apache.uima.textmarker.explain.matched.MatchedViewPage;
+import org.apache.uima.textmarker.explain.tree.BlockApplyNode;
+import org.apache.uima.textmarker.explain.tree.ExplainTree;
+import org.apache.uima.textmarker.explain.tree.RuleApplyNode;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ITreeSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.graphics.Image;
+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 ApplyViewPage extends Page implements IApplyViewPage, IDoubleClickListener, ICEVView,
+ ISelectionChangedListener {
+
+ protected CEVViewer casViewer;
+
+ protected CEVDocument casDoc;
+
+ protected TreeViewer viewer;
+
+ protected int current = 0;
+
+ protected Map<String, Image> images;
+
+ public ApplyViewPage(CEVViewer casViewer, CEVDocument casDoc, int index) {
+ super();
+ this.casViewer = casViewer;
+ this.casDoc = casDoc;
+ this.current = index;
+ }
+
+ private void initImages() {
+ images = new HashMap<String, Image>();
+ ImageDescriptor desc;
+ Image image;
+ String name;
+
+ desc = TextMarkerAddonsPlugin.getImageDescriptor("/icons/arrow_refresh.png");
+ image = desc.createImage();
+ name = ExplainConstants.BLOCK_APPLY_TYPE;
+ images.put(name, image);
+
+ desc = TextMarkerAddonsPlugin.getImageDescriptor("/icons/arrow_right.png");
+ image = desc.createImage();
+ name = ExplainConstants.RULE_APPLY_TYPE;
+ images.put(name, image);
+
+ desc = TextMarkerAddonsPlugin.getImageDescriptor("/icons/arrow_branch.png");
+ image = desc.createImage();
+ name = ExplainConstants.RULE_APPLY_TYPE + "Delegate";
+ images.put(name, image);
+ }
+
+ public Image getImage(String name) {
+ if (images == null) {
+ initImages();
+ }
+ return images.get(name);
+ }
+
+ @Override
+ public Control getControl() {
+ return viewer.getControl();
+ }
+
+ @Override
+ public void setFocus() {
+ viewer.getControl().setFocus();
+ }
+
+ @Override
+ public void init(IPageSite pageSite) {
+ super.init(pageSite);
+ }
+
+ public TreeViewer getTreeViewer() {
+ return viewer;
+ }
+
+ public CEVData getCurrentCEVData() {
+ return casDoc.getCASData(current);
+ }
+
+ @Override
+ public void createControl(Composite parent) {
+ viewer = new TreeViewer(parent, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL);
+ viewer.setContentProvider(new ApplyTreeContentProvider());
+ viewer.setLabelProvider(new ApplyTreeLabelProvider(this));
+
+ viewer.addDoubleClickListener(this);
+ viewer.addSelectionChangedListener(this);
+ ExplainTree tree = new ExplainTree(getCurrentCEVData());
+ viewer.setInput(tree.getRoot());
+ viewer.refresh();
+ }
+
+ public void doubleClick(DoubleClickEvent event) {
+
+ }
+
+ @Override
+ public void dispose() {
+ super.dispose();
+ if (images != null) {
+ for (Image each : images.values()) {
+ each.dispose();
+ }
+ }
+ }
+
+ public void mouseDown(final MouseEvent event) {
+
+ }
+
+ public void mouseUp(final MouseEvent event) {
+
+ }
+
+ public void mouseDoubleClick(final MouseEvent event) {
+
+ }
+
+ public void viewChanged(int newIndex) {
+ getCurrentCEVData().removeAnnotationListener(this);
+ current = newIndex;
+ getCurrentCEVData().addAnnotationListener(this);
+
+ ExplainTree tree = new ExplainTree(getCurrentCEVData());
+ viewer.setInput(tree.getRoot());
+ viewer.refresh();
+
+ }
+
+ 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) {
+
+ }
+
+ public void newSelection(int offset) {
+
+ }
+
+ public void selectionChanged(SelectionChangedEvent event) {
+ ISelection selection = event.getSelection();
+ if (selection instanceof ITreeSelection) {
+ ITreeSelection struct = (ITreeSelection) selection;
+ Object firstElement = struct.getFirstElement();
+ if (firstElement instanceof RuleApplyNode) {
+ RuleApplyNode node = (RuleApplyNode) firstElement;
+ Object matchedPage = casViewer.getAdapter(IMatchedViewPage.class);
+ if (matchedPage instanceof MatchedViewPage) {
+ ((MatchedViewPage) matchedPage).inputChange(node.getMatchedChild());
+ }
+ Object failedPage = casViewer.getAdapter(IFailedViewPage.class);
+ if (failedPage instanceof FailedViewPage) {
+ ((FailedViewPage) failedPage).inputChange(node.getFailedNode());
+ }
+ } else if (firstElement instanceof BlockApplyNode) {
+ BlockApplyNode node = (BlockApplyNode) firstElement;
+ RuleApplyNode ruleNode = node.getBlockRuleNode();
+ Object matchedPage = casViewer.getAdapter(IMatchedViewPage.class);
+ if (matchedPage instanceof MatchedViewPage) {
+ ((MatchedViewPage) matchedPage).inputChange(ruleNode.getMatchedChild());
+ }
+ Object failedPage = casViewer.getAdapter(IFailedViewPage.class);
+ if (failedPage instanceof FailedViewPage) {
+ ((FailedViewPage) failedPage).inputChange(ruleNode.getFailedNode());
+ }
+ }
+ }
+ }
+
+ public void casChanged(CEVDocument casDocument) {
+ this.casDoc = casDocument;
+ }
+}
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/apply/ApplyViewPage.java
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/apply/ApplyViewPage.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/apply/IApplyViewPage.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/apply/IApplyViewPage.java?rev=1157050&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/apply/IApplyViewPage.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/apply/IApplyViewPage.java Fri Aug 12 11:14:14 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.textmarker.explain.apply;
+
+import org.apache.uima.cev.views.ICEVViewPage;
+
+public interface IApplyViewPage extends ICEVViewPage {
+
+}
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/apply/IApplyViewPage.java
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/apply/IApplyViewPage.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/basic/BasicTokenEntry.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/basic/BasicTokenEntry.java?rev=1157050&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/basic/BasicTokenEntry.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/basic/BasicTokenEntry.java Fri Aug 12 11:14:14 2011
@@ -0,0 +1,51 @@
+/*
+ * 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.textmarker.explain.basic;
+
+import org.apache.uima.cas.text.AnnotationFS;
+
+public class BasicTokenEntry {
+
+ private int number;
+
+ private AnnotationFS annotation;
+
+ public BasicTokenEntry(AnnotationFS annotation, int number) {
+ this.annotation = annotation;
+ this.number = number;
+ }
+
+ public int getNumber() {
+ return this.number;
+ }
+
+ public String getTyp() {
+ return annotation.getType().getShortName();
+ }
+
+ public String getText() {
+ return annotation.getCoveredText();
+ }
+
+ public AnnotationFS getAnnotation() {
+ return annotation;
+ }
+
+}
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/basic/BasicTokenEntry.java
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/basic/BasicTokenEntry.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/basic/BasicTokenStreamTableContentProvider.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/basic/BasicTokenStreamTableContentProvider.java?rev=1157050&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/basic/BasicTokenStreamTableContentProvider.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/basic/BasicTokenStreamTableContentProvider.java Fri Aug 12 11:14:14 2011
@@ -0,0 +1,82 @@
+/*
+ * 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.textmarker.explain.basic;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.uima.cas.FSIterator;
+import org.apache.uima.cas.Type;
+import org.apache.uima.cas.text.AnnotationFS;
+import org.apache.uima.cas.text.AnnotationIndex;
+import org.apache.uima.cev.data.CEVData;
+import org.apache.uima.textmarker.explain.ExplainConstants;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+
+public class BasicTokenStreamTableContentProvider implements IStructuredContentProvider {
+
+ private List<BasicTokenEntry> basicTokenEntries;
+
+ public BasicTokenStreamTableContentProvider(CEVData casData) {
+ init(casData);
+ }
+
+ public void init(CEVData casData) {
+ basicTokenEntries = new ArrayList<BasicTokenEntry>();
+
+ Type basicType = casData.getCAS().getTypeSystem().getType(ExplainConstants.BASIC_TYPE);
+ if (basicType != null) {
+ AnnotationIndex anInd = casData.getCAS().getAnnotationIndex(basicType);
+ FSIterator iti = anInd.iterator(true);
+ iti.moveToFirst();
+ int i = 0;
+ BasicTokenEntry basicTokenEntry;
+ while (iti.isValid()) {
+ AnnotationFS annot = (AnnotationFS) iti.get();
+ i++;
+
+ basicTokenEntry = new BasicTokenEntry(annot, i);
+ basicTokenEntries.add(basicTokenEntry);
+ iti.moveToNext();
+ }
+ }
+ }
+
+ public Object[] getElements(Object inputElement) {
+ return basicTokenEntries.toArray();
+ }
+
+ public void dispose() {
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+
+ public BasicTokenEntry getEntryAt(int offset) {
+ for (BasicTokenEntry each : basicTokenEntries) {
+ if (each.getAnnotation().getBegin() <= offset && each.getAnnotation().getEnd() >= offset) {
+ return each;
+ }
+ }
+ return null;
+ }
+
+}
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/basic/BasicTokenStreamTableContentProvider.java
------------------------------------------------------------------------------
svn:executable = *
Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/basic/BasicTokenStreamTableContentProvider.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/basic/BasicTokenStreamTableLabelProvider.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/basic/BasicTokenStreamTableLabelProvider.java?rev=1157050&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/basic/BasicTokenStreamTableLabelProvider.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-addons/src/main/java/org/apache/uima/textmarker/explain/basic/BasicTokenStreamTableLabelProvider.java Fri Aug 12 11:14:14 2011
@@ -0,0 +1,83 @@
+/*
+ * 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.textmarker.explain.basic;
+
+import org.eclipse.jface.viewers.ColumnLabelProvider;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TableViewerColumn;
+import org.eclipse.swt.SWT;
+
+public class BasicTokenStreamTableLabelProvider {
+
+ public void createColumns(TableViewer viewer) {
+ String[] titles = { "Begin", "End", "Typ", "Text" };
+ int[] bounds = { 50, 50, 70, 200 };
+
+ int i = 0;
+ TableViewerColumn column = new TableViewerColumn(viewer, SWT.NONE);
+ column.getColumn().setWidth(bounds[i]);
+ column.getColumn().setText(titles[i]);
+ column.getColumn().setMoveable(true);
+ column.setLabelProvider(new ColumnLabelProvider() {
+ @Override
+ public String getText(Object element) {
+ return "" + ((BasicTokenEntry) element).getAnnotation().getBegin();
+ }
+ });
+
+ i++;
+ column = new TableViewerColumn(viewer, SWT.NONE);
+ column.getColumn().setWidth(bounds[i]);
+ column.getColumn().setText(titles[i]);
+ column.getColumn().setMoveable(true);
+ column.setLabelProvider(new ColumnLabelProvider() {
+ @Override
+ public String getText(Object element) {
+ return "" + ((BasicTokenEntry) element).getAnnotation().getEnd();
+ }
+ });
+
+ i++;
+ column = new TableViewerColumn(viewer, SWT.NONE);
+ column.getColumn().setWidth(bounds[i]);
+ column.getColumn().setText(titles[i]);
+ column.getColumn().setMoveable(true);
+ column.setLabelProvider(new ColumnLabelProvider() {
+
+ @Override
+ public String getText(Object element) {
+ return ((BasicTokenEntry) element).getTyp();
+ }
+ });
+
+ i++;
+ column = new TableViewerColumn(viewer, SWT.NONE);
+ column.getColumn().setWidth(bounds[i]);
+ column.getColumn().setText(titles[i]);
+ column.getColumn().setMoveable(true);
+ column.setLabelProvider(new ColumnLabelProvider() {
+
+ @Override
+ public String getText(Object element) {
+ return ((BasicTokenEntry) element).getText();
+ }
+ });
+ }
+}