You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by al...@apache.org on 2007/03/30 20:08:22 UTC
svn commit: r524212 [1/4] - in /incubator/uima/sandbox/trunk/CasEditor: ./
META-INF/ src/main/java/org/apache/uima/caseditor/
src/main/java/org/apache/uima/caseditor/core/
src/main/java/org/apache/uima/caseditor/core/model/
src/main/java/org/apache/uim...
Author: alally
Date: Fri Mar 30 11:08:15 2007
New Revision: 524212
URL: http://svn.apache.org/viewvc?view=rev&rev=524212
Log:
Applied update.txt patch and added MissingFiles.zip, both from Jörn Kottmann.
UIMA-155: http://issues.apache.org/jira/browse/UIMA-155
Added:
incubator/uima/sandbox/trunk/CasEditor/UIMA Cas Editor.launch
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/Application.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ApplicationActionBarAdvisor.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ApplicationWorkbenchAdvisor.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ApplicationWorkbenchWindowAdvisor.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/FileDocumentProvider.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/FileEditorInput.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/FileEditorInputFactory.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/core/model/CasProcessorFolder.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/CasDocumentProvider.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/SimpleTextEditor.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/corpusview/CopyAction.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/corpusview/OpenAction.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/corpusview/PasteAction.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/corpusview/ResourceAction.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/model/FileAdapter.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/model/FolderAdpater.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/model/ProcessorFolderAdapter.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/model/SimpleProjectAdapter.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/model/TypesystemAdapter.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/property/FileElementFilter.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/property/FileFieldEditor.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/property/FolderElementFilter.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/wizards/NewNlpProjectWizard.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/wizards/NewNlpProjectWizardPage.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/wizards/WizardNewFileCreation.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/wizards/WizardNewFolderCreation.java
Removed:
incubator/uima/sandbox/trunk/CasEditor/CasEditor.launch
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/core/Index.xml
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/core/model/UimaConfigurationElement.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/core/model/UimaSourceFolder.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/AnnotationDocumentProvider.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/annotation/AnnotationDrawingStrategy.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/annotation/AnnotationViewerDecorationSupport.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/corpusview/CorpusExplorerContentProvider.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/model/UimaConfigurationAdapter.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/model/UimaSourceFolderAdapter.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/property/FileSelectionFieldEditor.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/wizards/DocumentImportStructureProvider.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/wizards/ImportDocumentWizard.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/wizards/ImportDocumentWizard2.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/wizards/ImportDocumentWizardMainPage.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/wizards/ImportDocumentWizardPage.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/wizards/NewCorpusWizard.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/wizards/NewCorpusWizardPage.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/wizards/NlpProjectWizard.java
Modified:
incubator/uima/sandbox/trunk/CasEditor/META-INF/MANIFEST.MF
incubator/uima/sandbox/trunk/CasEditor/caseditor.product
incubator/uima/sandbox/trunk/CasEditor/plugin.xml
incubator/uima/sandbox/trunk/CasEditor/pom.xml
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/Images.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/core/IDocument.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/core/model/AnnotatorElement.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/core/model/ConsumerElement.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/core/model/DocumentElement.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/core/model/DotCorpusElement.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/core/model/NlpProject.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/core/model/TypesystemElement.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/core/model/dotcorpus/AnnotationStyle.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/core/model/dotcorpus/DotCorpus.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/core/model/dotcorpus/DotCorpusSerializer.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/core/uima/DocumentUimaImpl.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/AnnotationDocument.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/AnnotationEditor.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/AnnotationEditorActionContributor.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/FeatureStructureSelectionProvider.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/action/DeleteFeatureStructureAction.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/annotation/BracketDrawingStrategy.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/annotation/DrawingStyle.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/fsview/FeatureStructureBrowserView.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/fsview/FeatureStructureBrowserViewPage.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/fsview/FeatureStructureLabelProvider.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/editor/outline/AnnotationOutline.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/FeatureStructureTransfer.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/NlpPerspectiveFactory.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/action/ConsumerActionRunnable.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/action/CorporaCollectionReader.xml
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/action/DummyTAE.xml
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/corpusview/AnnotatorActionGroup.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/corpusview/ConsumerCorpusActionGroup.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/corpusview/CorpusExplorerActionGroup.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/corpusview/CorpusExplorerView.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/corpusview/ModelChangeListener.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/corpusview/OpenActionGroup.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/corpusview/RefactorGroup.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/corpusview/WorkspaceActionGroup.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/model/ElementWorkbenchAdapterFactory.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/model/ProjectAdapter.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/property/AnnotationPropertyPage.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/property/DotCorpusPreferenceStore.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/property/FolderFieldEditor.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/property/FolderPathEditor.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ui/property/ProjectPropertyPage.java
incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/uima/CorporaCollectionReader.java
incubator/uima/sandbox/trunk/CasEditor/src/test/java/org/apache/uima/caseditor/core/model/dotcorpus/AnnotationStyleTest.java
incubator/uima/sandbox/trunk/CasEditor/src/test/java/org/apache/uima/caseditor/core/model/dotcorpus/DotCorpusSerializerTest.java
Modified: incubator/uima/sandbox/trunk/CasEditor/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/META-INF/MANIFEST.MF?view=diff&rev=524212&r1=524211&r2=524212
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/META-INF/MANIFEST.MF (original)
+++ incubator/uima/sandbox/trunk/CasEditor/META-INF/MANIFEST.MF Fri Mar 30 11:08:15 2007
@@ -8,36 +8,16 @@
Bundle-Vendor: The Apache Software Foundation
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-Localization: plugin
-Eclipse-RegisterBuddy: com.ibm.uima.runtime
+Eclipse-RegisterBuddy: org.apache.uima.runtime
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.core.resources,
org.apache.uima.runtime,
- org.eclipse.ui.ide,
org.eclipse.ui.views.properties.tabbed,
+ org.eclipse.ui,
+ org.eclipse.ui.ide,
org.eclipse.ui.workbench.texteditor,
+ org.eclipse.pde.runtime,
org.eclipse.jface.text,
- org.eclipse.ui.editors
-Export-Package: org.apache.uima.caseditor.core,
- org.apache.uima.caseditor.core.model,
- org.apache.uima.caseditor.core.model.delta,
- org.apache.uima.caseditor.core.model.dotcorpus,
- org.apache.uima.caseditor.core.util,
- org.apache.uima.caseditor.editor,
- org.apache.uima.caseditor.editor.action,
- org.apache.uima.caseditor.editor.annotation,
- org.apache.uima.caseditor.editor.context,
- org.apache.uima.caseditor.editor.fsview,
- org.apache.uima.caseditor.editor.outline,
- org.apache.uima.caseditor.editor.properties,
- org.apache.uima.caseditor.editor.properties.validator,
- org.apache.uima.caseditor.ui,
- org.apache.uima.caseditor.ui.action,
- org.apache.uima.caseditor.ui.corpusview,
- org.apache.uima.caseditor.ui.property,
- org.apache.uima.caseditor.ui.wizards,
- org.apache.uima.caseditor.uima
-Bundle-ClassPath: .,
- jVinci-2.1.0-incubating-SNAPSHOT.jar,
- uimaj-adapter-vinci-2.1.0-incubating-SNAPSHOT.jar,
- uimaj-core-2.1.0-incubating.jar,
- uimaj-cpe-2.1.0-incubating-SNAPSHOT.jar
+ org.eclipse.core.filesystem,
+ com.ibm.icu
+Bundle-ClassPath: .
Added: incubator/uima/sandbox/trunk/CasEditor/UIMA Cas Editor.launch
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/UIMA%20Cas%20Editor.launch?view=auto&rev=524212
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/UIMA Cas Editor.launch (added)
+++ incubator/uima/sandbox/trunk/CasEditor/UIMA Cas Editor.launch Fri Mar 30 11:08:15 2007
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<launchConfiguration type="org.eclipse.pde.ui.RuntimeWorkbench">
+<stringAttribute key="product" value="org.apache.uima.caseditor.product"/>
+<booleanAttribute key="clearws" value="false"/>
+<booleanAttribute key="usefeatures" value="false"/>
+<stringAttribute key="bootstrap" value=""/>
+<booleanAttribute key="useProduct" value="true"/>
+<booleanAttribute key="tracing" value="false"/>
+<stringAttribute key="deselected_workspace_plugins" value="AAAAAAAAA,net.sf.tae.uima,opennlp.tools,org.apache.uima.debug,org.apache.uima.jcas.jcasgenp,org.apache.uima.pear,org.apache.uima.desceditor"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-clean"/>
+<stringAttribute key="pde.version" value="3.2a"/>
+<stringAttribute key="templateConfig" value="${target_home}/configuration/config.ini"/>
+<booleanAttribute key="default" value="false"/>
+<stringAttribute key="selected_target_plugins" value="com.ibm.icu,org.apache.xerces,org.eclipse.ant.core,org.eclipse.core.commands,org.eclipse.core.contenttype,org.eclipse.core.expressions,org.eclipse.core.filesystem,org.eclipse.core.filesystem.macosx,org.eclipse.core.jobs,org.eclipse.core.resources,org.eclipse.core.resources.compatibility,org.eclipse.core.runtime,org.eclipse.core.runtime.compatibility,org.eclipse.core.runtime.compatibility.auth,org.eclipse.core.runtime.compatibility.registry,org.eclipse.core.variables,org.eclipse.equinox.common,org.eclipse.equinox.preferences,org.eclipse.equinox.registry,org.eclipse.help,org.eclipse.jface,org.eclipse.jface.text,org.eclipse.osgi,org.eclipse.pde.runtime,org.eclipse.swt,org.eclipse.swt.carbon.macosx,org.eclipse.text,org.eclipse.ui,org.eclipse.ui.carbon,org.eclipse.ui.forms,org.eclipse.ui.ide,org.eclipse.ui.navigator,org.eclipse.ui.views,org.eclipse.ui.views.properties.tabbed,org.eclipse.ui.workbench,org.eclipse.ui.workbench.te
xteditor,org.eclipse.update.configurator,org.eclipse.update.core,org.eclipse.update.ui"/>
+<booleanAttribute key="clearConfig" value="false"/>
+<booleanAttribute key="automaticValidate" value="false"/>
+<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
+<booleanAttribute key="useDefaultConfigArea" value="true"/>
+<booleanAttribute key="useDefaultConfig" value="true"/>
+<booleanAttribute key="automaticAdd" value="true"/>
+<stringAttribute key="checked" value="[NONE]"/>
+<booleanAttribute key="askclear" value="true"/>
+<stringAttribute key="location" value="${workspace_loc}/../runtime-New_configuration"/>
+<booleanAttribute key="includeOptional" value="true"/>
+<stringAttribute key="configLocation" value=""/>
+</launchConfiguration>
Modified: incubator/uima/sandbox/trunk/CasEditor/caseditor.product
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/caseditor.product?view=diff&rev=524212&r1=524211&r2=524212
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/caseditor.product (original)
+++ incubator/uima/sandbox/trunk/CasEditor/caseditor.product Fri Mar 30 11:08:15 2007
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<?pde version="3.1"?>
-<product name="caseditor" id="org.apache.uima.caseditor.product" application="org.eclipse.ui.ide.workbench" useFeatures="false">
+<product name="caseditor" id="org.apache.uima.caseditor.product" application="org.apache.uima.caseditor.application" useFeatures="false">
<aboutInfo>
<text>
@@ -17,7 +17,10 @@
<windowImages/>
<splash
- startupProgressRect="80,500,300,50" />
+ location="org.apache.uima.caseditor"
+ startupProgressRect="0,0,0,0"
+ startupMessageRect="0,0,0,0"
+ startupForegroundColor="000000" />
<launcher name="tae">
<macosx icon="/org.apache.uima.caseditor/icons/sample.icns"/>
<solaris/>
@@ -30,15 +33,13 @@
<plugins>
<plugin id="com.ibm.icu"/>
- <plugin id="com.ibm.uima.runtime"/>
- <plugin id="org.apache.lucene"/>
<plugin id="org.apache.uima.caseditor"/>
+ <plugin id="org.apache.uima.runtime"/>
<plugin id="org.apache.xerces"/>
<plugin id="org.eclipse.ant.core"/>
<plugin id="org.eclipse.core.commands"/>
<plugin id="org.eclipse.core.contenttype"/>
<plugin id="org.eclipse.core.expressions"/>
- <plugin id="org.eclipse.core.filebuffers"/>
<plugin id="org.eclipse.core.filesystem"/>
<plugin id="org.eclipse.core.filesystem.hpux.PA_RISC" fragment="true"/>
<plugin id="org.eclipse.core.filesystem.linux.x86" fragment="true"/>
@@ -54,17 +55,14 @@
<plugin id="org.eclipse.core.runtime.compatibility.auth"/>
<plugin id="org.eclipse.core.runtime.compatibility.registry" fragment="true"/>
<plugin id="org.eclipse.core.variables"/>
- <plugin id="org.eclipse.draw2d"/>
<plugin id="org.eclipse.equinox.common"/>
<plugin id="org.eclipse.equinox.preferences"/>
<plugin id="org.eclipse.equinox.registry"/>
- <plugin id="org.eclipse.gef"/>
<plugin id="org.eclipse.help"/>
- <plugin id="org.eclipse.help.appserver"/>
- <plugin id="org.eclipse.help.base"/>
<plugin id="org.eclipse.jface"/>
<plugin id="org.eclipse.jface.text"/>
<plugin id="org.eclipse.osgi"/>
+ <plugin id="org.eclipse.pde.runtime"/>
<plugin id="org.eclipse.swt"/>
<plugin id="org.eclipse.swt.carbon.macosx" fragment="true"/>
<plugin id="org.eclipse.swt.gtk.linux.ppc" fragment="true"/>
@@ -78,21 +76,12 @@
<plugin id="org.eclipse.text"/>
<plugin id="org.eclipse.ui"/>
<plugin id="org.eclipse.ui.carbon" fragment="true"/>
- <plugin id="org.eclipse.ui.editors"/>
<plugin id="org.eclipse.ui.forms"/>
- <plugin id="org.eclipse.ui.ide"/>
- <plugin id="org.eclipse.ui.intro"/>
<plugin id="org.eclipse.ui.views"/>
<plugin id="org.eclipse.ui.views.properties.tabbed"/>
- <plugin id="org.eclipse.ui.win32" fragment="true"/>
<plugin id="org.eclipse.ui.workbench"/>
<plugin id="org.eclipse.ui.workbench.texteditor"/>
<plugin id="org.eclipse.update.configurator"/>
- <plugin id="org.eclipse.update.core"/>
- <plugin id="org.eclipse.update.core.linux" fragment="true"/>
- <plugin id="org.eclipse.update.core.win32" fragment="true"/>
- <plugin id="org.eclipse.update.ui"/>
- <plugin id="org.junit"/>
</plugins>
<features>
Modified: incubator/uima/sandbox/trunk/CasEditor/plugin.xml
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/plugin.xml?view=diff&rev=524212&r1=524211&r2=524212
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/plugin.xml (original)
+++ incubator/uima/sandbox/trunk/CasEditor/plugin.xml Fri Mar 30 11:08:15 2007
@@ -21,6 +21,17 @@
-->
<plugin>
+
+ <extension
+ id="application"
+ point="org.eclipse.core.runtime.applications">
+ <application>
+ <run
+ class="org.apache.uima.caseditor.Application">
+ </run>
+ </application>
+ </extension>
+
<extension
point="org.eclipse.core.resources.natures"
id="NLPProject"
@@ -47,10 +58,11 @@
<view id="org.apache.uima.caseditor.corpusview"
name="Corpus Explorer"
class="org.apache.uima.caseditor.ui.corpusview.CorpusExplorerView"
- icon="icons\UIMA_logo_50.png"
+ icon="icons/tango/explorer.png"
category="org.apache.uima.caseditor.ui.views"/>
+
</extension>
-
+
<extension
point="org.eclipse.ui.newWizards">
@@ -61,33 +73,43 @@
<wizard
canFinishEarly="false"
category="org.apache.uima.caseditor.ui.wizards"
- class="org.apache.uima.caseditor.ui.wizards.NlpProjectWizard"
+ class="org.apache.uima.caseditor.ui.wizards.NewNlpProjectWizard"
descriptionImage="icons/nlp.gif"
finalPerspective="org.apache.uima.caseditor.perspective.NLP"
hasPages="true"
icon="icons/nlp.gif"
id="org.apache.uima.caseditor.wizards.NLPProjectWizard"
- name="NLP Project"
+ name="Project"
preferredPerspectives="org.apache.uima.caseditor.perspective.NLP"
project="true">
<description>
Create a NLP project
</description>
</wizard>
-
- <!--
- <wizard
- category="Annotator.ui"
- class="com.calcucare.annotator.wizards.NewCorpusWizard"
- icon="icon/book.gif"
- id="Annotator.NewCorpusWizard"
- name="Corpus">
-
- <description>
- Create a Corups
- </description>
- </wizard> -->
-
+<!--
+ <wizard
+ canFinishEarly="false"
+ category="org.apache.uima.caseditor.ui.wizards"
+ class="org.apache.uima.caseditor.ui.wizards.WizardNewFileCreation"
+ finalPerspective="org.apache.uima.caseditor.perspective.NLP"
+ hasPages="true"
+ icon="icons/nlp.gif"
+ id="org.apache.uima.caseditor.ui.wizards.WizardNewFileCreation"
+ name="File"
+ preferredPerspectives="org.apache.uima.caseditor.perspective.NLP"
+ project="true"/>
+
+ <wizard
+ canFinishEarly="false"
+ category="org.apache.uima.caseditor.ui.wizards"
+ class="org.apache.uima.caseditor.ui.wizards.WizardNewFolderCreation"
+ finalPerspective="org.apache.uima.caseditor.perspective.NLP"
+ hasPages="true"
+ icon="icons/nlp.gif"
+ id="org.apache.uima.caseditor.ui.wizards.WizardNewFolderCreation"
+ name="Folder"
+ preferredPerspectives="org.apache.uima.caseditor.perspective.NLP"
+ project="true"/> -->
</extension>
<extension point="org.eclipse.ui.importWizards">
@@ -105,13 +127,12 @@
<extension point="org.eclipse.ui.perspectives">
<perspective
class="org.apache.uima.caseditor.ui.NlpPerspectiveFactory"
- fixed="false"
+ fixed="true"
icon="icons\UIMA_logo_50.png"
id="org.apache.uima.caseditor.perspective.NLP"
name="NLP">
</perspective>
</extension>
-
<extension point="org.eclipse.ui.propertyPages">
<page
@@ -172,19 +193,28 @@
<adapter type="org.eclipse.ui.model.IWorkbenchAdapter"/>
</factory>
<factory
- adaptableType="org.apache.uima.caseditor.core.model.UimaSourceFolder"
+ adaptableType="org.apache.uima.caseditor.core.model.CasProcessorFolder"
class="org.apache.uima.caseditor.ui.model.ElementWorkbenchAdapterFactory">
<adapter type="org.eclipse.ui.model.IWorkbenchAdapter"/>
</factory>
<factory
- adaptableType="org.apache.uima.caseditor.core.model.UimaConfigurationElement"
+ adaptableType="org.eclipse.core.resources.IFile"
+ class="org.apache.uima.caseditor.ui.model.ElementWorkbenchAdapterFactory">
+ <adapter type="org.eclipse.ui.model.IWorkbenchAdapter"/>
+ </factory>
+ <factory
+ adaptableType="org.eclipse.core.resources.IFolder"
+ class="org.apache.uima.caseditor.ui.model.ElementWorkbenchAdapterFactory">
+ <adapter type="org.eclipse.ui.model.IWorkbenchAdapter"/>
+ </factory>
+ <factory
+ adaptableType="org.eclipse.core.resources.IProject"
class="org.apache.uima.caseditor.ui.model.ElementWorkbenchAdapterFactory">
<adapter type="org.eclipse.ui.model.IWorkbenchAdapter"/>
</factory>
</extension>
-
<!-- editor extensions -->
<extension point="org.eclipse.ui.editors">
<editor
@@ -195,6 +225,13 @@
id="org.apache.uima.caseditor.editor"
extensions="xcas">
</editor>
+
+ <editor
+ icon="icons/UIMA_logo_50.png"
+ class="org.apache.uima.caseditor.editor.SimpleTextEditor"
+ name="Text Editor"
+ id="org.apache.uima.caseditor.texteditor"
+ default="true"/>
</extension>
<extension point="org.eclipse.ui.editors.annotationTypes">
@@ -250,19 +287,29 @@
id="product"
point="org.eclipse.core.runtime.products">
<product
- application="org.eclipse.ui.ide.workbench"
+ application="org.apache.uima.caseditor.application"
name="caseditor">
<property
name="aboutText"
value="about dialog"/>
- <property
- name="startupProgressRect"
- value="80,500,300,50"/>
<property
name="preferenceCustomization"
value="preferences.ini"/>
+ <property
+ name="startupProgressRect"
+ value="0,0,0,0"/>
+ <property
+ name="startupMessageRect"
+ value="0,0,0,0"/>
+ <property
+ name="startupForegroundColor"
+ value="000000"/>
</product>
</extension>
+
+ <extension point="org.eclipse.ui.elementFactories">
+ <factory id="org.apache.uima.caseditor.FileEditorInputFactory" class="org.apache.uima.caseditor.FileEditorInputFactory" />
+ </extension>
</plugin>
Modified: incubator/uima/sandbox/trunk/CasEditor/pom.xml
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/pom.xml?view=diff&rev=524212&r1=524211&r2=524212
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/pom.xml (original)
+++ incubator/uima/sandbox/trunk/CasEditor/pom.xml Fri Mar 30 11:08:15 2007
@@ -30,7 +30,7 @@
<parent>
<groupId>org.apache.uima</groupId>
<artifactId>uimaj</artifactId>
- <version>2.1.0-incubating-SNAPSHOT</version>
+ <version>2.2-incubating-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
@@ -57,14 +57,14 @@
<dependency>
<groupId>org.apache.uima</groupId>
<artifactId>uimaj-core</artifactId>
- <version>2.1.0-incubating</version>
+ <version>2.2-incubating-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.uima</groupId>
<artifactId>uimaj-cpe</artifactId>
- <version>2.1.0-incubating-SNAPSHOT</version>
+ <version>2.2-incubating-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
@@ -105,6 +105,7 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<configuration>
+ <version>2.3</version>
<pde>true</pde>
</configuration>
</plugin>
Added: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/Application.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/Application.java?view=auto&rev=524212
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/Application.java (added)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/Application.java Fri Mar 30 11:08:15 2007
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.uima.caseditor;
+
+import org.eclipse.core.runtime.IPlatformRunnable;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * This class controls all aspects of the application's execution
+ */
+public class Application implements IPlatformRunnable {
+
+ public Object run(Object args) throws Exception {
+
+ Display display = PlatformUI.createDisplay();
+
+ Shell shell = new Shell(display, SWT.ON_TOP);
+
+// try {
+// if (!WorkspaceUtil.checkInstanceLocation(shell)) {
+// Platform.endSplash();
+// return EXIT_OK;
+// }
+// } finally {
+// if (shell != null) {
+// shell.dispose();
+// }
+// }
+
+ try {
+ int returnCode = PlatformUI.createAndRunWorkbench(display, new ApplicationWorkbenchAdvisor());
+ if (returnCode == PlatformUI.RETURN_RESTART) {
+ return IPlatformRunnable.EXIT_RESTART;
+ }
+ return IPlatformRunnable.EXIT_OK;
+ } finally {
+ display.dispose();
+ }
+ }
+
+}
Added: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ApplicationActionBarAdvisor.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ApplicationActionBarAdvisor.java?view=auto&rev=524212
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ApplicationActionBarAdvisor.java (added)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ApplicationActionBarAdvisor.java Fri Mar 30 11:08:15 2007
@@ -0,0 +1,206 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.uima.caseditor;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.jface.action.ActionContributionItem;
+import org.eclipse.jface.action.GroupMarker;
+import org.eclipse.jface.action.ICoolBarManager;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.action.ToolBarManager;
+import org.eclipse.ui.IWorkbenchActionConstants;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.actions.ActionFactory;
+import org.eclipse.ui.actions.ContributionItemFactory;
+import org.eclipse.ui.actions.ActionFactory.IWorkbenchAction;
+import org.eclipse.ui.application.ActionBarAdvisor;
+import org.eclipse.ui.application.IActionBarConfigurer;
+
+public class ApplicationActionBarAdvisor extends ActionBarAdvisor {
+
+ private Map<ActionFactory, IWorkbenchAction> actions = new HashMap<ActionFactory, IWorkbenchAction>();
+
+ private IWorkbenchWindow window;
+
+// private OpenWorkspaceAction openWorkspaceAction;
+
+ public ApplicationActionBarAdvisor(IActionBarConfigurer configurer) {
+ super(configurer);
+ }
+
+ protected void makeActions(IWorkbenchWindow window) {
+
+ this.window = window;
+ ActionFactory actionsToCreate[] = new ActionFactory[] { ActionFactory.NEW_WIZARD_DROP_DOWN,
+ ActionFactory.NEW,
+ ActionFactory.IMPORT,
+ ActionFactory.EXPORT,
+ ActionFactory.SAVE,
+ ActionFactory.SAVE_ALL,
+ ActionFactory.CLOSE,
+ ActionFactory.CLOSE_ALL,
+ ActionFactory.CUT,
+ ActionFactory.COPY,
+ ActionFactory.PASTE,
+ ActionFactory.SELECT_ALL,
+ ActionFactory.DELETE,
+ ActionFactory.QUIT,
+ ActionFactory.ABOUT,
+ ActionFactory.REVERT,
+ ActionFactory.PROPERTIES,
+ ActionFactory.FORWARD_HISTORY,
+ ActionFactory.BACKWARD_HISTORY,
+ ActionFactory.LOCK_TOOL_BAR,
+ ActionFactory.RESET_PERSPECTIVE,
+ ActionFactory.PREFERENCES,
+ ActionFactory.OPEN_NEW_WINDOW,
+ ActionFactory.NEW_EDITOR,
+// ActionFactory.EDIT_ACTION_SETS,
+ ActionFactory.MAXIMIZE,
+ ActionFactory.MINIMIZE,
+ ActionFactory.ACTIVATE_EDITOR,
+ ActionFactory.NEXT_EDITOR,
+ ActionFactory.PREVIOUS_EDITOR,
+ ActionFactory.SHOW_OPEN_EDITORS,
+ ActionFactory.SHOW_WORKBOOK_EDITORS,
+ ActionFactory.NEXT_PART,
+ ActionFactory.PREVIOUS_PART,
+ ActionFactory.SHOW_PART_PANE_MENU,
+ ActionFactory.SHOW_VIEW_MENU
+ };
+
+ for (ActionFactory factory : actionsToCreate) {
+ IWorkbenchAction action = factory.create(window);
+ actions.put(factory, action);
+ register(action);
+ }
+
+// openWorkspaceAction = new OpenWorkspaceAction(window);
+ }
+
+ protected void fillMenuBar(IMenuManager menuBar) {
+
+ // File menu
+ MenuManager fileMenu = new MenuManager("File", IWorkbenchActionConstants.M_FILE);
+ fileMenu.add(new GroupMarker(IWorkbenchActionConstants.FILE_START));
+ fileMenu.add(actions.get(ActionFactory.NEW));
+ fileMenu.add(new GroupMarker(IWorkbenchActionConstants.NEW_EXT));
+ fileMenu.add(new Separator());
+ fileMenu.add(actions.get(ActionFactory.CLOSE));
+ fileMenu.add(actions.get(ActionFactory.CLOSE_ALL));
+ fileMenu.add(new GroupMarker(IWorkbenchActionConstants.CLOSE_EXT));
+ fileMenu.add(new Separator());
+ fileMenu.add(actions.get(ActionFactory.SAVE));
+ fileMenu.add(actions.get(ActionFactory.SAVE_ALL));
+ fileMenu.add(actions.get(ActionFactory.REVERT));
+ fileMenu.add(new GroupMarker(IWorkbenchActionConstants.SAVE_EXT));
+ fileMenu.add(new Separator());
+// fileMenu.add(openWorkspaceAction);
+ fileMenu.add(new Separator());
+ fileMenu.add(actions.get(ActionFactory.IMPORT));
+ fileMenu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
+ fileMenu.add(actions.get(ActionFactory.PROPERTIES));
+ fileMenu.add(ContributionItemFactory.REOPEN_EDITORS.create(window));
+ fileMenu.add(new GroupMarker(IWorkbenchActionConstants.MRU));
+ fileMenu.add(new Separator());
+ fileMenu.add(actions.get(ActionFactory.QUIT));
+ fileMenu.add(new GroupMarker(IWorkbenchActionConstants.FILE_END));
+ menuBar.add(fileMenu);
+
+ // Edit menu
+ MenuManager editMenu = new MenuManager("Edit");
+ editMenu.add(new GroupMarker(IWorkbenchActionConstants.EDIT_START));
+ editMenu.add(actions.get(ActionFactory.COPY));
+ editMenu.add(actions.get(ActionFactory.PASTE));
+ editMenu.add(new GroupMarker(IWorkbenchActionConstants.CUT_EXT));
+ editMenu.add(new Separator());
+ editMenu.add(actions.get(ActionFactory.DELETE));
+ editMenu.add(actions.get(ActionFactory.SELECT_ALL));
+ editMenu.add(new GroupMarker(IWorkbenchActionConstants.EDIT_END));
+ menuBar.add(editMenu);
+
+ // Window menu
+ MenuManager windowMenu = new MenuManager("Window");
+ windowMenu.add(actions.get(ActionFactory.OPEN_NEW_WINDOW));
+ windowMenu.add(actions.get(ActionFactory.NEW_EDITOR));
+ windowMenu.add(new Separator());
+// windowMenu.add(actions.get(ActionFactory.EDIT_ACTION_SETS));
+ windowMenu.add(actions.get(ActionFactory.RESET_PERSPECTIVE));
+ windowMenu.add(new Separator());
+
+ MenuManager subMenu = new MenuManager("Navigate");
+ subMenu.add(actions.get(ActionFactory.SHOW_PART_PANE_MENU));
+ subMenu.add(actions.get(ActionFactory.SHOW_VIEW_MENU));
+ subMenu.add(new Separator());
+ subMenu.add(actions.get(ActionFactory.MAXIMIZE));
+ subMenu.add(actions.get(ActionFactory.MINIMIZE));
+ subMenu.add(new Separator());
+ subMenu.add(actions.get(ActionFactory.ACTIVATE_EDITOR));
+ subMenu.add(actions.get(ActionFactory.NEXT_EDITOR));
+ subMenu.add(actions.get(ActionFactory.PREVIOUS_EDITOR));
+ subMenu.add(actions.get(ActionFactory.SHOW_OPEN_EDITORS));
+ subMenu.add(actions.get(ActionFactory.SHOW_WORKBOOK_EDITORS));
+ subMenu.add(new Separator());
+ subMenu.add(actions.get(ActionFactory.NEXT_PART));
+ subMenu.add(actions.get(ActionFactory.PREVIOUS_PART));
+ windowMenu.add(subMenu);
+
+ windowMenu.add(new Separator());
+
+ windowMenu.add(actions.get(ActionFactory.PREFERENCES));
+ windowMenu.add(ContributionItemFactory.OPEN_WINDOWS.create(window));
+ menuBar.add(windowMenu);
+
+ // Help menu
+ MenuManager helpMenu = new MenuManager("Help", IWorkbenchActionConstants.M_FILE);
+ editMenu.add(new GroupMarker(IWorkbenchActionConstants.HELP_START));
+ helpMenu.add(actions.get(ActionFactory.ABOUT));
+ editMenu.add(new GroupMarker(IWorkbenchActionConstants.HELP_END));
+ menuBar.add(helpMenu);
+ }
+
+ @Override
+ protected void fillCoolBar(ICoolBarManager coolBar) {
+
+ IMenuManager popUpMenu = new MenuManager();
+ popUpMenu.add(new ActionContributionItem(actions.get(ActionFactory.LOCK_TOOL_BAR)));
+// popUpMenu.add(new ActionContributionItem(actions.get(ActionFactory.EDIT_ACTION_SETS)));
+ coolBar.setContextMenuManager(popUpMenu);
+
+ coolBar.add(new GroupMarker(IWorkbenchActionConstants.GROUP_FILE));
+ ToolBarManager fileToolBar = new ToolBarManager();
+ fileToolBar.add(new Separator(IWorkbenchActionConstants.NEW_GROUP));
+ fileToolBar.add(actions.get(ActionFactory.NEW_WIZARD_DROP_DOWN));
+ fileToolBar.add(new GroupMarker(IWorkbenchActionConstants.SAVE_GROUP));
+ fileToolBar.add(actions.get(ActionFactory.SAVE));
+ coolBar.add(fileToolBar);
+
+ coolBar.add(new GroupMarker(IWorkbenchActionConstants.HISTORY_GROUP));
+ ToolBarManager navigateToolBar = new ToolBarManager();
+ navigateToolBar.add(new Separator(IWorkbenchActionConstants.HISTORY_GROUP));
+ navigateToolBar.add(actions.get(ActionFactory.BACKWARD_HISTORY));
+ navigateToolBar.add(actions.get(ActionFactory.FORWARD_HISTORY));
+ coolBar.add(navigateToolBar);
+ }
+}
Added: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ApplicationWorkbenchAdvisor.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ApplicationWorkbenchAdvisor.java?view=auto&rev=524212
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ApplicationWorkbenchAdvisor.java (added)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ApplicationWorkbenchAdvisor.java Fri Mar 30 11:08:15 2007
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.uima.caseditor;
+
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.ui.application.IWorkbenchConfigurer;
+import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
+import org.eclipse.ui.application.WorkbenchAdvisor;
+import org.eclipse.ui.application.WorkbenchWindowAdvisor;
+import org.eclipse.ui.internal.progress.ProgressMonitorJobsDialog;
+
+public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {
+
+ private static final String PERSPECTIVE_ID = "org.apache.uima.caseditor.perspective.NLP";
+
+ public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) {
+ return new ApplicationWorkbenchWindowAdvisor(configurer);
+ }
+
+ @Override
+ public void initialize(IWorkbenchConfigurer configurer) {
+ configurer.setSaveAndRestore(true);
+ }
+
+ public String getInitialWindowPerspectiveId() {
+ return PERSPECTIVE_ID;
+ }
+
+ @Override
+ public void postShutdown() {
+ IRunnableWithProgress runnable = new IRunnableWithProgress() {
+
+ public void run(org.eclipse.core.runtime.IProgressMonitor monitor)
+ throws InvocationTargetException, InterruptedException {
+ try {
+ ResourcesPlugin.getWorkspace().save(true, monitor);
+ } catch (CoreException e) {
+ // fail silently
+ }
+ }
+ };
+
+ try {
+ new ProgressMonitorJobsDialog(null).run(true, false, runnable);
+ } catch (InvocationTargetException e) {
+ // fail silently
+ } catch (InterruptedException e) {
+ // fail silently
+ }
+ }
+}
Added: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ApplicationWorkbenchWindowAdvisor.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ApplicationWorkbenchWindowAdvisor.java?view=auto&rev=524212
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ApplicationWorkbenchWindowAdvisor.java (added)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/ApplicationWorkbenchWindowAdvisor.java Fri Mar 30 11:08:15 2007
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.uima.caseditor;
+
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.ui.application.ActionBarAdvisor;
+import org.eclipse.ui.application.IActionBarConfigurer;
+import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
+import org.eclipse.ui.application.WorkbenchWindowAdvisor;
+
+public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
+
+ public ApplicationWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) {
+ super(configurer);
+ }
+
+ public ActionBarAdvisor createActionBarAdvisor(IActionBarConfigurer configurer) {
+ return new ApplicationActionBarAdvisor(configurer);
+ }
+
+ public void preWindowOpen() {
+ IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
+ configurer.setInitialSize(new Point(400, 300));
+ configurer.setShowCoolBar(true);
+ configurer.setShowStatusLine(true);
+ configurer.setTitle("Cas Editor");
+ }
+}
Added: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/FileDocumentProvider.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/FileDocumentProvider.java?view=auto&rev=524212
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/FileDocumentProvider.java (added)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/FileDocumentProvider.java Fri Mar 30 11:08:15 2007
@@ -0,0 +1,94 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.uima.caseditor;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.operation.IRunnableContext;
+import org.eclipse.jface.text.Document;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.source.AnnotationModel;
+import org.eclipse.jface.text.source.IAnnotationModel;
+import org.eclipse.ui.texteditor.AbstractDocumentProvider;
+
+public class FileDocumentProvider extends AbstractDocumentProvider {
+
+ @Override
+ protected IAnnotationModel createAnnotationModel(Object element) throws CoreException {
+ return new AnnotationModel();
+ }
+
+ @Override
+ protected IDocument createDocument(Object element) throws CoreException {
+
+ FileEditorInput input = (FileEditorInput) element;
+
+ IFile inputFile = input.getFile();
+
+ InputStream in = inputFile.getContents();
+ Reader reader = new InputStreamReader(in);
+
+ IDocument document = new Document();
+
+ try {
+
+ StringBuilder documentText = new StringBuilder();
+ char buffer[] = new char[1];
+ int length = -1;
+ while ((length = reader.read(buffer)) != -1) {
+ documentText.append(buffer, 0, length);
+ }
+
+ document.set(documentText.toString());
+ }
+ catch (IOException e) {
+ IStatus s= new Status(IStatus.ERROR, CasEditorPlugin.ID, IStatus.OK, e.getMessage(), e);
+ throw new CoreException(s);
+ }
+ finally {
+ try {
+ if (in != null) {
+ in.close();
+ }
+ } catch (IOException e) {
+ }
+ }
+
+ return document;
+ }
+
+ @Override
+ protected void doSaveDocument(IProgressMonitor monitor, Object element, IDocument document, boolean overwrite) throws CoreException {
+ // save document text <- use platform default encoding
+ }
+
+ @Override
+ protected IRunnableContext getOperationRunner(IProgressMonitor monitor) {
+ return null;
+ }
+}
Added: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/FileEditorInput.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/FileEditorInput.java?view=auto&rev=524212
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/FileEditorInput.java (added)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/FileEditorInput.java Fri Mar 30 11:08:15 2007
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.uima.caseditor;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.IPathEditorInput;
+import org.eclipse.ui.IPersistableElement;
+
+public class FileEditorInput implements IEditorInput, IPathEditorInput, IPersistableElement {
+
+ private IFile mFile;
+
+ public FileEditorInput(IFile file) {
+ if (file == null) {
+ throw new IllegalArgumentException();
+ }
+ mFile = file;
+ }
+
+ public IFile getFile() {
+ return mFile;
+ }
+
+ public boolean exists() {
+ return mFile.exists();
+ }
+
+ public ImageDescriptor getImageDescriptor() {
+ return null;
+ }
+
+ public String getName() {
+ return mFile.getName();
+ }
+
+ public IPersistableElement getPersistable() {
+ return this;
+ }
+
+ public String getToolTipText() {
+ return mFile.getFullPath().toString();
+ }
+
+ public Object getAdapter(Class adapter) {
+ return null;
+ }
+
+ public IPath getPath() {
+ return mFile.getLocation();
+ }
+
+ public String getFactoryId() {
+ return FileEditorInputFactory.ID;
+ }
+
+ public void saveState(IMemento memento) {
+ FileEditorInputFactory.saveState(memento, this);
+ }
+
+ @Override
+ public int hashCode() {
+ return mFile.hashCode();
+ }
+
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ } else if (obj instanceof FileEditorInput) {
+ FileEditorInput other = (FileEditorInput) obj;
+ return mFile.equals(other.getFile());
+ } else {
+ return false;
+ }
+ }
+}
Added: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/FileEditorInputFactory.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/FileEditorInputFactory.java?view=auto&rev=524212
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/FileEditorInputFactory.java (added)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/FileEditorInputFactory.java Fri Mar 30 11:08:15 2007
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.uima.caseditor;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.ui.IElementFactory;
+import org.eclipse.ui.IMemento;
+
+public class FileEditorInputFactory implements IElementFactory {
+
+ public static final String ID = "org.apache.uima.caseditor.FileEditorInputFactory";
+
+ public static final String PATH = "path";
+
+ public IAdaptable createElement(IMemento memento) {
+
+ String fileName = memento.getString(PATH);
+
+ if (fileName != null) {
+ IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(fileName));
+
+ if (file != null) {
+ return new FileEditorInput(file);
+ }
+ }
+
+ // element could not be re-created
+ return null;
+ }
+
+ public static void saveState(IMemento memento, FileEditorInput input) {
+ memento.putString(PATH, input.getFile().getFullPath().toString());
+ }
+}
Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/Images.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/Images.java?view=diff&rev=524212&r1=524211&r2=524212
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/Images.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/Images.java Fri Mar 30 11:08:15 2007
@@ -19,34 +19,43 @@
package org.apache.uima.caseditor;
+import org.eclipse.jface.resource.ImageDescriptor;
+
/**
- * TODO: add javadoc here
+ * All images in the cas editor are referenced here.
+ *
+ * Call {@link CasEditorPlugin#getTaeImageDescriptor(Images)} to retrive
+ * an actual {@link ImageDescriptor}.
*/
public enum Images {
+
+ MODEL_PROJECT_OPEN("tango/project-open.png"),
+
+ MODEL_PROJECT_CLOSED("tango/project-closed.png"),
+
+ MODEL_FILE("tango/file.png"),
+
+ MODEL_FOLDER("tango/folder.png"),
+
/**
* The corpus image.
*/
- MODEL_CORPUS("model/corpus.gif"),
+ MODEL_CORPUS("tango/corpus.png"),
/**
* The document image.
*/
- MODEL_DOCUMENT("model/document.png"),
+ MODEL_DOCUMENT("tango/document.png"),
/**
* The source folder image.
*/
- MODEL_SOURCE_FOLDER("model/uima-source-folder.png"),
-
- /**
- * The config folder image.
- */
- MODEL_CONFIG_FOLDER("model/config.png"),
+ MODEL_PROCESSOR_FOLDER("tango/processor.png"),
/**
* Image for the typesystem element.
*/
- MODEL_TYPESYSTEM("t_s.gif"),
+ MODEL_TYPESYSTEM("model/typesystem.gif"),
/**
* The enabled refresh icon.
@@ -61,22 +70,22 @@
/**
* The wide left side image.
*/
- WIDE_LEFT_SIDE("WideLeftSide.bmp"),
+ WIDE_LEFT_SIDE("WideLeftSide.png"),
/**
* The lower left side image.
*/
- LOWER_LEFT_SIDE("LowerLeftSide.bmp"),
+ LOWER_LEFT_SIDE("LowerLeftSide.png"),
/**
* The wide right side image.
*/
- WIDE_RIGHT_SIDE("WideRightSide.bmp"),
+ WIDE_RIGHT_SIDE("WideRightSide.png"),
/**
* The lower right side image.
*/
- LOWER_RIGHT_SIDE("LowerRightSide.bmp"),
+ LOWER_RIGHT_SIDE("LowerRightSide.png"),
/**
* The merge image.
Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/core/IDocument.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/core/IDocument.java?view=diff&rev=524212&r1=524211&r2=524212
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/core/IDocument.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/core/IDocument.java Fri Mar 30 11:08:15 2007
@@ -180,14 +180,6 @@
Type getType(String type);
/**
- * Sets the content of this document.
- *
- * @param content
- * @throws CoreException
- */
- void setContent(InputStream content) throws CoreException;
-
- /**
* Serializes the doucment to the given OutputStream.
*
* @param out
Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/core/model/AnnotatorElement.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/core/model/AnnotatorElement.java?view=diff&rev=524212&r1=524211&r2=524212
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/core/model/AnnotatorElement.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/core/model/AnnotatorElement.java Fri Mar 30 11:08:15 2007
@@ -39,7 +39,7 @@
* TODO: add javadoc here
*/
public class AnnotatorElement extends AbstractNlpElement {
- private UimaConfigurationElement mParent;
+ private CasProcessorFolder mParent;
private IFile mAnnotatorResource;
@@ -51,7 +51,7 @@
* @param config
* @param annotatorFile
*/
- AnnotatorElement(UimaConfigurationElement config, IFile annotatorFile) {
+ AnnotatorElement(CasProcessorFolder config, IFile annotatorFile) {
mParent = config;
mAnnotatorResource = annotatorFile;
Added: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/core/model/CasProcessorFolder.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/core/model/CasProcessorFolder.java?view=auto&rev=524212
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/core/model/CasProcessorFolder.java (added)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/core/model/CasProcessorFolder.java Fri Mar 30 11:08:15 2007
@@ -0,0 +1,278 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.uima.caseditor.core.model;
+
+import java.util.Collection;
+import java.util.LinkedList;
+
+import org.apache.uima.caseditor.core.model.delta.INlpElementDelta;
+import org.apache.uima.caseditor.core.uima.AnnotatorConfiguration;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+
+/**
+ * The UimaSourceFolder contains folders, each of these folders can contain uima consumer or
+ * annoatator configurations.
+ */
+public class CasProcessorFolder extends AbstractNlpElement implements IAdaptable {
+ private IFolder mConfigFolder;
+
+ private NlpProject mProject;
+
+ private Collection<AnnotatorElement> mAnnotators;
+
+ private Collection<ConsumerElement> mConsumers;
+
+ /**
+ * Initializes a new instance.
+ *
+ * @param configFolder
+ * @param sourceFolder
+ * @param project
+ * @throws CoreException
+ */
+ CasProcessorFolder(IFolder configFolder, NlpProject project)
+ throws CoreException {
+ mConfigFolder = configFolder;
+ mProject = project;
+ createAnnotatorConfigurations();
+ createConsumerConfigurations();
+ }
+
+ /**
+ * Retrives the {@link AnnotatorConfiguration}.
+ *
+ * @return the {@link AnnotatorConfiguration}
+ */
+ public Collection<AnnotatorElement> getAnnotators() {
+ return mAnnotators;
+ }
+
+ private void createAnnotatorConfigurations() throws CoreException {
+ mAnnotators = new LinkedList<AnnotatorElement>();
+
+ for (IResource resource : mConfigFolder.members()) {
+ if (resource instanceof IFile && resource.getName().endsWith(".ann")) {
+ IFile consumerFile = (IFile) resource;
+
+ AnnotatorElement annotator = new AnnotatorElement(this, consumerFile);
+ mAnnotators.add(annotator);
+ }
+ }
+ }
+
+ /**
+ * Retrives the consumers.
+ *
+ * @return consumers
+ */
+ public Collection<ConsumerElement> getConsumers() {
+ return mConsumers;
+ }
+
+ private void createConsumerConfigurations() throws CoreException {
+ mConsumers = new LinkedList<ConsumerElement>();
+
+ for (IResource resource : mConfigFolder.members()) {
+ if (resource instanceof IFile && resource.getName().endsWith(".con")) {
+ IFile consumerFile = (IFile) resource;
+
+ ConsumerElement consumer = new ConsumerElement(this, consumerFile);
+ mConsumers.add(consumer);
+ }
+ }
+
+ }
+
+ /**
+ * Retrives all containted {@link IFile} and {@link IFolder} resources.
+ *
+ * @return {@link IFile}s and {@link IFolder}s
+ * @throws CoreException
+ */
+ public Collection<IResource> getNonNlpResources() throws CoreException {
+ // just filter all .con and .ann files
+ Collection<IResource> resources = new LinkedList<IResource>();
+
+ for (IResource candidate : mConfigFolder.members()) {
+ if (candidate.getName().endsWith(".con") || candidate.getName().endsWith(".ann")) {
+ continue;
+ }
+
+ resources.add(candidate);
+ }
+
+ return resources;
+ }
+
+ /**
+ * Retrives the {@link NlpProject}.
+ *
+ * @return the {@link NlpProject}
+ */
+ public NlpProject getNlpProject() {
+ return mProject;
+ }
+
+ /**
+ * Searches for members of the given resource.
+ */
+ @Override
+ public INlpElement findMember(IResource resource) {
+ if (getResource().equals(resource)) {
+ return this;
+ }
+
+ Collection<ConsumerElement> consumers = getConsumers();
+
+ for (ConsumerElement consumer : consumers) {
+ boolean isElementFound = consumer.findMember(resource) != null;
+
+ if (isElementFound) {
+ return consumer.findMember(resource);
+ }
+ }
+
+ Collection<AnnotatorElement> annotators = getAnnotators();
+
+ for (AnnotatorElement annotator : annotators) {
+ boolean isElementFound = annotator.findMember(resource) != null;
+
+ if (isElementFound) {
+ return annotator.findMember(resource);
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * Retrives the parent.
+ *
+ * @return the parent
+ */
+ public INlpElement getParent() {
+ return mProject;
+ }
+
+ /**
+ * Retrives the resource.
+ */
+ public IResource getResource() {
+ return mConfigFolder;
+ }
+
+ /**
+ * Retrives the parent of the given resource.
+ */
+ @Override
+ public INlpElement getParent(IResource resource) throws CoreException {
+ INlpElement result = super.getParent(resource);
+
+ for (IResource member : mConfigFolder.members()) {
+ if (member.equals(resource)) {
+ result = this;
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * Retrvies the name.
+ */
+ public String getName() {
+ return mConfigFolder.getName();
+ }
+
+ /**
+ * Not implemented.
+ */
+ @Override
+ void addResource(IResource resource) throws CoreException {
+ if (resource instanceof IFile) {
+ // if .con file notify it
+ if (resource.getName().endsWith(".con")) {
+ ConsumerElement consumerElement = new ConsumerElement(this, (IFile) resource);
+ mConsumers.add(consumerElement);
+ } else if (resource.getName().endsWith(".ann")) {
+ AnnotatorElement annotator = new AnnotatorElement(this, (IFile) resource);
+
+ mAnnotators.add(annotator);
+ } else {
+ // do nothing
+ }
+ }
+ }
+
+ @Override
+ void changedResource(IResource resource, INlpElementDelta delta) throws CoreException {
+ if (resource instanceof IFile) {
+ // if .con file notify it
+ if (resource.getName().endsWith(".con")) {
+ for (ConsumerElement consumer : mConsumers) {
+ if (consumer.getResource().equals(resource)) {
+ consumer.changedResource(resource, delta);
+ break;
+ }
+ }
+ } else if (resource.getName().endsWith(".ann")) {
+ for (AnnotatorElement annotator : mAnnotators) {
+ if (annotator.getResource().equals(resource)) {
+ annotator.changedResource(resource, delta);
+ break;
+ }
+ }
+ } else {
+ // do nothing
+ }
+ }
+ }
+
+ /**
+ * Not implemented.
+ */
+ @Override
+ void removeResource(IResource resource) {
+ if (resource instanceof IFile) {
+ // if .con file notify it
+ if (resource.getName().endsWith(".con")) {
+ for (ConsumerElement consumer : mConsumers) {
+ if (consumer.getResource().equals(resource)) {
+ mConsumers.remove(consumer);
+ break;
+ }
+ }
+ } else if (resource.getName().endsWith(".ann")) {
+ for (AnnotatorElement annotator : mAnnotators) {
+ if (annotator.getResource().equals(resource)) {
+ mAnnotators.remove(annotator);
+ break;
+ }
+ }
+ } else {
+ // do nothing
+ }
+ }
+ }
+}
\ No newline at end of file
Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/core/model/ConsumerElement.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/core/model/ConsumerElement.java?view=diff&rev=524212&r1=524211&r2=524212
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/core/model/ConsumerElement.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/core/model/ConsumerElement.java Fri Mar 30 11:08:15 2007
@@ -39,13 +39,13 @@
* The ConsumerELement containts the uima consumer descriptor.
*/
public class ConsumerElement extends AbstractNlpElement {
- private UimaConfigurationElement mParent;
+ private CasProcessorFolder mParent;
private IFile mConsumerResource;
private CasConsumerConfiguration mConsumerConfiguration;
- ConsumerElement(UimaConfigurationElement config, IFile consumer) throws CoreException {
+ ConsumerElement(CasProcessorFolder config, IFile consumer) throws CoreException {
mParent = config;
mConsumerResource = consumer;
mConsumerConfiguration = createConsumerConfiguration();
Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/core/model/DocumentElement.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/core/model/DocumentElement.java?view=diff&rev=524212&r1=524211&r2=524212
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/core/model/DocumentElement.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/core/model/DocumentElement.java Fri Mar 30 11:08:15 2007
@@ -24,6 +24,7 @@
import java.io.InputStream;
import java.lang.ref.SoftReference;
+import org.apache.uima.caseditor.CasEditorPlugin;
import org.apache.uima.caseditor.core.IDocument;
import org.apache.uima.caseditor.core.model.delta.INlpElementDelta;
import org.apache.uima.caseditor.core.uima.DocumentUimaImpl;
@@ -31,6 +32,12 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.swt.browser.StatusTextListener;
+import org.eclipse.ui.texteditor.StatusTextEditor;
+
+import com.sun.org.apache.bcel.internal.generic.ISTORE;
/**
* The document element contains the uima cas document.
@@ -94,16 +101,21 @@
*/
public IDocument getDocument() throws CoreException {
+ NlpProject project = (NlpProject) mParent.getParent();
+
+ if (project.getTypesystemElement() == null) {
+ mWorkingCopy = null;
+ throw new CoreException(new Status(IStatus.ERROR, CasEditorPlugin.ID,
+ 0, "Typesystem not available!", null));
+ }
+
DocumentUimaImpl document = mWorkingCopy.get();
if (document == null) {
- InputStream in = mDocumentFile.getContents();
- document =
- new DocumentUimaImpl((NlpProject) mParent.getParent());
+ InputStream in = mDocumentFile.getContents();
- document.setContent(in);
- document.setDocumentElement(this);
+ document = new DocumentUimaImpl(project, this, in);
mWorkingCopy = new SoftReference<DocumentUimaImpl>(document);
}
@@ -115,14 +127,14 @@
* Writes the document element to the file system.
*
* TODO: move it to the document, maybe the document gets not
- * saved if the caller lost the reference to it, befor the this call
+ * saved if the caller lost the reference to it, befor this call
*
* @throws CoreException
*/
public void saveDocument() throws CoreException {
ByteArrayOutputStream outStream = new ByteArrayOutputStream(40000);
- // getDocument().serialize(outStream);
+ ((DocumentUimaImpl) getDocument()).serialize(outStream);
InputStream stream = new ByteArrayInputStream(outStream.toByteArray());
@@ -148,7 +160,6 @@
@Override
void changedResource(IResource resource, INlpElementDelta delta) {
-
// TODO: What should happen if the doucment is changed externally
// e.g. with a texteditor ?
mWorkingCopy = new SoftReference<DocumentUimaImpl>(null);
Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/core/model/DotCorpusElement.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/core/model/DotCorpusElement.java?view=diff&rev=524212&r1=524211&r2=524212
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/core/model/DotCorpusElement.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/core/model/DotCorpusElement.java Fri Mar 30 11:08:15 2007
@@ -195,26 +195,39 @@
*
* @return - config folder name
*/
- public IFolder getUimaConfigFolder() {
- IFolder result;
+ public Collection<IFolder> getCasProcessorFolders() {
+
+
+ Collection<IFolder> casProcessorFolders = new LinkedList<IFolder>();
- if (mDotCorpus.getUimaConfigFolder() != null) {
- result = getFolder(mDotCorpus.getUimaConfigFolder());
- } else {
- result = null;
+ for (String corpusFolderString : mDotCorpus.getCasProcessorFolderNames()) {
+ casProcessorFolders.add(getFolder(corpusFolderString));
}
- return result;
+ return Collections.unmodifiableCollection(casProcessorFolders);
}
+ public boolean isCasProcessorFolder(IFolder folder) {
+ boolean result = false;
+
+ for (IFolder candidate : getCasProcessorFolders()) {
+ if (candidate.equals(folder)) {
+ result = true;
+ break;
+ }
+ }
+
+ return result;
+ }
+
/**
* Returns true if the given folder is a uima config folder.
*
* @param folder
* @return true if is config folder
*/
- public boolean isUimaConfigFolder(IFolder folder) {
- return getUimaConfigFolder() != null ? getUimaConfigFolder().equals(folder) : false;
+ public void addCasProcessorFolder(String folder) {
+ mDotCorpus.addCasProcessorFolder(folder);
}
/**
@@ -223,8 +236,8 @@
* @param name -
* the new name
*/
- public void setUimaConfigFolderName(String name) {
- mDotCorpus.setUimaConfigFolderName(name);
+ public void removeCasProcessorFolder(String name) {
+ mDotCorpus.removeCasProcessorFolder(name);
}
private IFile getFile(String name) {
Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/core/model/NlpProject.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/core/model/NlpProject.java?view=diff&rev=524212&r1=524211&r2=524212
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/core/model/NlpProject.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/core/model/NlpProject.java Fri Mar 30 11:08:15 2007
@@ -55,7 +55,7 @@
private Collection<CorpusElement> mCopora = new LinkedList<CorpusElement>();
- private Collection<UimaSourceFolder> mUimaSourceFolder = new LinkedList<UimaSourceFolder>();
+ private Collection<CasProcessorFolder> mUimaSourceFolder = new LinkedList<CasProcessorFolder>();
private boolean mIsDotCorpusDirty;
@@ -88,18 +88,18 @@
corpus.initialize();
}
- createUimaSourceFolder();
+ createCasProcessorFolders();
- for (UimaSourceFolder sourceFolder : getUimaSourceFolder()) {
- sourceFolder.initialize();
- }
+ //for (CasProcessorFolder sourceFolder : getCasProcessorFolders()) {
+ // sourceFolder.initialize();
+ //}
if (getDotCorpus().getTypeSystemFile() != null) {
mTypesystem = new TypesystemElement(getDotCorpus().getTypeSystemFile(), this);
}
- if (getTypesystem() != null && getTypesystem().getCAS() != null) {
- mEditorAnnotationStatus = new EditorAnnotationStatus(getTypesystem().getCAS().getTypeSystem()
+ if (getTypesystemElement() != null && getTypesystemElement().getTypeSystem() != null) {
+ mEditorAnnotationStatus = new EditorAnnotationStatus(getTypesystemElement().getTypeSystem()
.getType(CAS.TYPE_NAME_ANNOTATION), null);
}
}
@@ -223,10 +223,8 @@
if (mDotCorpusElement.isCorpusFolder((IFolder) resources[i])) {
continue;
}
-
- IFolder configFolderName = mDotCorpusElement.getUimaConfigFolder();
-
- if (configFolderName != null && configFolderName.equals(resources[i])) {
+
+ if (mDotCorpusElement.isCasProcessorFolder((IFolder) resources[i])) {
continue;
}
}
@@ -276,7 +274,7 @@
}
}
- for (UimaSourceFolder sourceFolder : getUimaSourceFolder()) {
+ for (CasProcessorFolder sourceFolder : getCasProcessorFolders()) {
INlpElement element = sourceFolder.getParent(resource);
if (element != null) {
@@ -298,8 +296,11 @@
if (DOT_CORPUS_FILENAME.equals(resource.getName())) {
return mDotCorpusElement;
}
-
- for (UimaSourceFolder sourceFolder : getUimaSourceFolder()) {
+ else if (mTypesystem != null && mTypesystem.findMember(resource) != null) {
+ return mTypesystem.findMember(resource);
+ }
+
+ for (CasProcessorFolder sourceFolder : getCasProcessorFolders()) {
boolean isElementFound = sourceFolder.findMember(resource) != null;
if (isElementFound) {
@@ -324,17 +325,18 @@
*
* @return the UimaSourceFolder
*/
- public Collection<UimaSourceFolder> getUimaSourceFolder() {
+ public Collection<CasProcessorFolder> getCasProcessorFolders() {
return mUimaSourceFolder;
}
- private void createUimaSourceFolder() {
- IFolder configSourceFolderName = getDotCorpus().getUimaConfigFolder();
-
- if (configSourceFolderName != null && configSourceFolderName.exists()) {
- IFolder configSourceFolder = configSourceFolderName;
+ private void createCasProcessorFolders() throws CoreException {
+ for (IFolder processorFolder : mDotCorpusElement.getCasProcessorFolders()) {
+ if (processorFolder.exists()) {
+ CasProcessorFolder processorElement =
+ new CasProcessorFolder(processorFolder, this);
- mUimaSourceFolder.add(new UimaSourceFolder(configSourceFolder, this));
+ mUimaSourceFolder.add(processorElement);
+ }
}
}
@@ -369,7 +371,7 @@
/**
* Adds a resource to the current project instance.
*/
- public void addResource(IResource resource) {
+ public void addResource(IResource resource) throws CoreException {
if (resource instanceof IFile) {
IFile file = (IFile) resource;
@@ -384,8 +386,8 @@
// corpus
if (mDotCorpusElement.isCorpusFolder((IFolder) resource)) {
mCopora.add(new CorpusElement(getNlpProject(), (IFolder) resource));
- } else if (mDotCorpusElement.isUimaConfigFolder((IFolder) resource)) {
- mUimaSourceFolder.add(new UimaSourceFolder((IFolder) resource, getNlpProject()));
+ } else if (mDotCorpusElement.isCasProcessorFolder((IFolder) resource)) {
+ mUimaSourceFolder.add(new CasProcessorFolder((IFolder) resource, getNlpProject()));
}
}
}
@@ -406,7 +408,7 @@
}
}
- for (UimaSourceFolder sourceFolder : mUimaSourceFolder) {
+ for (CasProcessorFolder sourceFolder : mUimaSourceFolder) {
if (sourceFolder.getResource().equals(resource)) {
mUimaSourceFolder.remove(resource);
break;
@@ -429,6 +431,11 @@
if (mTypesystem != null && resource.equals(mTypesystem.getResource())) {
mTypesystem.changedResource(resource, delta);
+
+ if (getTypesystemElement().getTypeSystem() != null) {
+ mEditorAnnotationStatus = new EditorAnnotationStatus(getTypesystemElement().getTypeSystem()
+ .getType(CAS.TYPE_NAME_ANNOTATION), null);
+ }
}
}
@@ -499,7 +506,7 @@
*
* @return typesystem
*/
- public TypesystemElement getTypesystem() {
+ public TypesystemElement getTypesystemElement() {
return mTypesystem;
}
}
Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/core/model/TypesystemElement.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/core/model/TypesystemElement.java?view=diff&rev=524212&r1=524211&r2=524212
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/core/model/TypesystemElement.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/core/model/TypesystemElement.java Fri Mar 30 11:08:15 2007
@@ -25,6 +25,7 @@
import org.apache.uima.ResourceSpecifierFactory;
import org.apache.uima.UIMAFramework;
import org.apache.uima.cas.CAS;
+import org.apache.uima.cas.TypeSystem;
import org.apache.uima.caseditor.CasEditorPlugin;
import org.apache.uima.caseditor.core.model.delta.INlpElementDelta;
import org.apache.uima.caseditor.core.util.MarkerUtil;
@@ -32,6 +33,7 @@
import org.apache.uima.resource.metadata.FsIndexDescription;
import org.apache.uima.resource.metadata.TypePriorities;
import org.apache.uima.resource.metadata.TypeSystemDescription;
+import org.apache.uima.resource.metadata.impl.FsIndexDescription_impl;
import org.apache.uima.util.CasCreationUtils;
import org.apache.uima.util.InvalidXMLException;
import org.apache.uima.util.XMLInputSource;
@@ -57,10 +59,15 @@
getCAS();
}
+ public TypeSystem getTypeSystem() {
+ return getCAS().getTypeSystem();
+ }
+
/**
* Retrives the {@link CAS}.
*
* @return the {@link CAS}
+ * @deprecated
*/
public CAS getCAS() {
Runnable clearMarkers = new Runnable() {
@@ -125,28 +132,10 @@
TypePriorities typePriorities = resourceSpecifierFactory.createTypePriorities();
- InputStream inIndex = getClass().getClassLoader().getResourceAsStream(
- "org/apache/uima/caseditor/core/Index.xml");
-
- if (inIndex == null) {
- throw new NoClassDefFoundError("org/apache/uima/caseditor/core/Index.xml" + " is missing on the classpath");
- }
-
- XMLInputSource xmlIndexSource = new XMLInputSource(inIndex, new File(""));
-
- xmlIndexSource = new XMLInputSource(inIndex, new File(""));
-
- FsIndexDescription indexDesciptor;
-
- try {
- indexDesciptor = (FsIndexDescription) xmlParser.parse(xmlIndexSource);
- } catch (InvalidXMLException e) {
- String message = (e.getMessage() != null ? e.getMessage() : "");
-
- IStatus s = new Status(IStatus.ERROR, CasEditorPlugin.ID, IStatus.OK, message, e);
-
- throw new CoreException(s);
- }
+ FsIndexDescription indexDesciptor = new FsIndexDescription_impl();
+ indexDesciptor.setLabel("TOPIndex");
+ indexDesciptor.setTypeName("uima.cas.TOP");
+ indexDesciptor.setKind(FsIndexDescription.KIND_SORTED);
CAS cas;
try {
Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/core/model/dotcorpus/AnnotationStyle.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/core/model/dotcorpus/AnnotationStyle.java?view=diff&rev=524212&r1=524211&r2=524212
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/core/model/dotcorpus/AnnotationStyle.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/core/model/dotcorpus/AnnotationStyle.java Fri Mar 30 11:08:15 2007
@@ -19,7 +19,7 @@
package org.apache.uima.caseditor.core.model.dotcorpus;
-import java.awt.Color;
+import org.eclipse.swt.graphics.Color;
/**
* The <code>AnnotationStyle</code> describes the look of an certain annotation type in the
@@ -59,7 +59,7 @@
/**
* The default drawing color.
*/
- public static final java.awt.Color DEFAULT_COLOR = java.awt.Color.RED;
+ public static final Color DEFAULT_COLOR = new Color(null, 0xff, 0, 0);
private String mAnnotation;
Modified: incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/core/model/dotcorpus/DotCorpus.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/core/model/dotcorpus/DotCorpus.java?view=diff&rev=524212&r1=524211&r2=524212
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/core/model/dotcorpus/DotCorpus.java (original)
+++ incubator/uima/sandbox/trunk/CasEditor/src/main/java/org/apache/uima/caseditor/core/model/dotcorpus/DotCorpus.java Fri Mar 30 11:08:15 2007
@@ -50,7 +50,7 @@
/**
* Names of the configuration source folders
*/
- private String mUimaConfigFolder;
+ private Set<String> mCasProcessorFolders = new HashSet<String>();
/**
* Length hint of the lines in the editor.
@@ -86,8 +86,8 @@
*
* @return uima config folder name parameter.
*/
- public String getUimaConfigFolder() {
- return mUimaConfigFolder;
+ public Collection<String> getCasProcessorFolderNames() {
+ return Collections.unmodifiableCollection(mCasProcessorFolders);
}
/**
@@ -96,8 +96,12 @@
* @param folder
* uima config folder name parameter.
*/
- public void setUimaConfigFolderName(String folder) {
- mUimaConfigFolder = folder;
+ public void addCasProcessorFolder(String folder) {
+ mCasProcessorFolders.add(folder);
+ }
+
+ public void removeCasProcessorFolder(String folder) {
+ mCasProcessorFolders.remove(folder);
}
/**
@@ -211,7 +215,7 @@
result = isEqual(mTypeSystemFileName, corpus.mTypeSystemFileName)
&& isEqual(mCorpusFolders, corpus.mCorpusFolders)
- && isEqual(mUimaConfigFolder, corpus.mUimaConfigFolder)
+ && isEqual(mCasProcessorFolders, corpus.mCasProcessorFolders)
&& isEqual(mStyleMap, corpus.mStyleMap)
&& isEqual(mEditorLineLengthHint, corpus.mEditorLineLengthHint);
}