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:00:51 UTC

svn commit: r1157047 [19/27] - in /uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide: ./ .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/org...

Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/ConsoleMessages.properties
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/ConsoleMessages.properties?rev=1157047&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/ConsoleMessages.properties (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/ConsoleMessages.properties Fri Aug 12 11:00:38 2011
@@ -0,0 +1,31 @@
+# ***************************************************************
+#  * 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.
+# ***************************************************************
+
+TextMarkerFileHyperlink_Information_1=Information
+TextMarkerFileHyperlink_Error=Hyperlink Error
+TextMarkerFileHyperlink_0=Invalid Line Number
+TextMarkerFileHyperlink_1=\ is not a valid line number in 
+ScriptStackTraceConsoleFactory_0=Script Stack Trace Console
+ScriptStackTraceConsole_0=Paste stack traces into this console and follow hyperlinks to source code.
+TextMarkerFileHyperlink_Source_not_found_for__0__2=Source not found for {0}
+TextMarkerFileHyperlink_An_exception_occurred_while_following_link__3=An exception occurred while following link.
+TextMarkerFileHyperlink_Unable_to_parse_type_name_from_hyperlink__5=Unable to parse file name from hyperlink.
+TextMarkerFileHyperlink_Unable_to_parse_line_number_from_hyperlink__6=Unable to parse line number from hyperlink.
+TextMarkerFileHyperlink_Unable_to_parse_line_number_from_hyperlink__7=Unable to parse line number from hyperlink.
+TextMarkerFileHyperlink_Unable_to_retrieve_hyperlink_text__8=Unable to retrieve hyperlink text.

Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/ConsoleMessages.properties
------------------------------------------------------------------------------
    svn:executable = *

Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/ConsoleMessages.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/PasteTextMarkerTextToConsoleAction.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/PasteTextMarkerTextToConsoleAction.java?rev=1157047&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/PasteTextMarkerTextToConsoleAction.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/PasteTextMarkerTextToConsoleAction.java Fri Aug 12 11:00:38 2011
@@ -0,0 +1,70 @@
+/*
+ * 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.ide.ui.console;
+
+import org.eclipse.dltk.console.ui.ScriptConsole;
+import org.eclipse.dltk.console.ui.ScriptConsoleManager;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ITextSelection;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.ui.IEditorActionDelegate;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.texteditor.IDocumentProvider;
+import org.eclipse.ui.texteditor.ITextEditor;
+
+public class PasteTextMarkerTextToConsoleAction implements IEditorActionDelegate {
+
+  private ISelection selection;
+
+  private IEditorPart targetEditor;
+
+  protected IDocument getDocument() {
+    if (!(targetEditor instanceof ITextEditor))
+      return null;
+
+    ITextEditor editor = (ITextEditor) targetEditor;
+    IDocumentProvider dp = editor.getDocumentProvider();
+    return dp.getDocument(editor.getEditorInput());
+  }
+
+  public void setActiveEditor(IAction action, IEditorPart targetEditor) {
+    this.targetEditor = targetEditor;
+  }
+
+  public void run(IAction action) {
+    ScriptConsoleManager manager = ScriptConsoleManager.getInstance();
+
+    ScriptConsole console = manager.getActiveScriptConsole(TextMarkerConsole.CONSOLE_TYPE);
+
+    if (console == null) {
+      return;
+    }
+
+    if (selection instanceof ITextSelection) {
+      String text = ((ITextSelection) selection).getText();
+      console.getInput().insertText(text);
+    }
+  }
+
+  public void selectionChanged(IAction action, ISelection selection) {
+    this.selection = selection;
+  }
+}

Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/PasteTextMarkerTextToConsoleAction.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/PasteTextMarkerTextToConsoleAction.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/PasteTextMarkerToConsole.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/PasteTextMarkerToConsole.java?rev=1157047&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/PasteTextMarkerToConsole.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/PasteTextMarkerToConsole.java Fri Aug 12 11:00:38 2011
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+
+package org.apache.uima.textmarker.ide.ui.console;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+
+public class PasteTextMarkerToConsole implements IObjectActionDelegate {
+
+  private ISelection selection;
+
+  public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+
+  }
+
+  public void run(IAction action) {
+    // TODO: implement
+  }
+
+  public void selectionChanged(IAction action, ISelection selection) {
+    this.selection = selection;
+  }
+}

Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/PasteTextMarkerToConsole.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/PasteTextMarkerToConsole.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/ShowFunctionsAction.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/ShowFunctionsAction.java?rev=1157047&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/ShowFunctionsAction.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/ShowFunctionsAction.java Fri Aug 12 11:00:38 2011
@@ -0,0 +1,57 @@
+/*
+ * 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.ide.ui.console;
+
+import org.eclipse.debug.core.DebugException;
+import org.eclipse.dltk.core.DLTKCore;
+import org.eclipse.dltk.debug.core.model.IScriptValue;
+import org.eclipse.dltk.debug.core.model.IScriptVariable;
+import org.eclipse.dltk.debug.ui.actions.ViewFilterAction;
+import org.eclipse.jface.viewers.Viewer;
+
+/**
+ * Shows non-final static variables
+ */
+public class ShowFunctionsAction extends ViewFilterAction {
+
+  public ShowFunctionsAction() {
+    super();
+  }
+
+  @Override
+  protected String getPreferenceKey() {
+    return "show_functions";
+  }
+
+  @Override
+  public boolean select(Viewer viewer, Object parentElement, Object element) {
+    if (element instanceof IScriptVariable) {
+      IScriptVariable variable = (IScriptVariable) element;
+      try {
+        return !((IScriptValue) variable.getValue()).getType().getName().equals("function");
+      } catch (DebugException e) {
+        if (DLTKCore.DEBUG) {
+          e.printStackTrace();
+        }
+      }
+    }
+    return true;
+  }
+}

Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/ShowFunctionsAction.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/ShowFunctionsAction.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/TextMarkerConsole.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/TextMarkerConsole.java?rev=1157047&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/TextMarkerConsole.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/TextMarkerConsole.java Fri Aug 12 11:00:38 2011
@@ -0,0 +1,38 @@
+/*
+ * 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.ide.ui.console;
+
+import org.eclipse.dltk.console.ui.ScriptConsole;
+
+public class TextMarkerConsole extends ScriptConsole {
+  public static final String CONSOLE_TYPE = "tm_console";
+
+  public static final String CONSOLE_NAME = "TextMarker Console";
+
+  public TextMarkerConsole(TextMarkerInterpreter interpreter, String id) {
+    super(CONSOLE_NAME + " [" + id + "]", CONSOLE_TYPE);
+
+    setInterpreter(interpreter);
+    setTextHover(new TextMarkerConsoleTextHover(interpreter));
+    setContentAssistProcessor(new TextMarkerConsoleCompletionProcessor(interpreter));
+
+  }
+
+}

Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/TextMarkerConsole.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/TextMarkerConsole.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/TextMarkerConsoleCompletionProcessor.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/TextMarkerConsoleCompletionProcessor.java?rev=1157047&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/TextMarkerConsoleCompletionProcessor.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/TextMarkerConsoleCompletionProcessor.java Fri Aug 12 11:00:38 2011
@@ -0,0 +1,122 @@
+/*
+ * 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.ide.ui.console;
+
+import java.io.IOException;
+import java.util.List;
+
+import org.eclipse.dltk.console.IScriptConsoleShell;
+import org.eclipse.dltk.console.ScriptConsoleCompletionProposal;
+import org.eclipse.dltk.console.ui.IScriptConsoleViewer;
+import org.eclipse.dltk.console.ui.ScriptConsoleCompletionProcessor;
+import org.eclipse.dltk.ui.DLTKPluginImages;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.TextPresentation;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.contentassist.IContextInformation;
+import org.eclipse.jface.text.contentassist.IContextInformationPresenter;
+import org.eclipse.jface.text.contentassist.IContextInformationValidator;
+import org.eclipse.swt.graphics.Image;
+
+public class TextMarkerConsoleCompletionProcessor extends ScriptConsoleCompletionProcessor {
+
+  protected static class Validator implements IContextInformationValidator,
+          IContextInformationPresenter {
+
+    protected int installOffset;
+
+    public boolean isContextInformationValid(int offset) {
+      return Math.abs(installOffset - offset) < 5;
+    }
+
+    public void install(IContextInformation info, ITextViewer viewer, int offset) {
+      installOffset = offset;
+    }
+
+    public boolean updatePresentation(int documentPosition, TextPresentation presentation) {
+      return false;
+    }
+  }
+
+  protected IProposalDecorator tmDecorator = new IProposalDecorator() {
+    public String formatProposal(ScriptConsoleCompletionProposal c) {
+      return c.getDisplay();
+    }
+
+    public Image getImage(ScriptConsoleCompletionProposal c) {
+      String type = c.getType();
+      if (type.equals("var")) {
+        return DLTKPluginImages.get(DLTKPluginImages.IMG_OBJS_LOCAL_VARIABLE);
+      } else if (type.equals("proc")) {
+        return DLTKPluginImages.get(DLTKPluginImages.IMG_METHOD_PUBLIC);
+      } else if (type.equals("command")) {
+        return DLTKPluginImages.get(DLTKPluginImages.IMG_METHOD_PRIVATE);
+      } else if (type.equals("func")) {
+        return DLTKPluginImages.get(DLTKPluginImages.IMG_OBJS_FIELD);
+      }
+
+      return null;
+    }
+  };
+
+  private IContextInformationValidator validator;
+
+  public TextMarkerConsoleCompletionProcessor(IScriptConsoleShell interpreterShell) {
+    super(interpreterShell);
+  }
+
+  @Override
+  public char[] getCompletionProposalAutoActivationCharacters() {
+    return new char[] { '$' };
+  }
+
+  @Override
+  protected ICompletionProposal[] computeCompletionProposalsImpl(IScriptConsoleViewer viewer,
+          int offset) {
+
+    try {
+      String commandLine = viewer.getCommandLine();
+      int cursorPosition = offset - viewer.getCommandLineOffset();
+
+      List list = getInterpreterShell().getCompletions(commandLine, cursorPosition);
+
+      List proposals = createProposalsFromString(list, offset, tmDecorator);
+
+      return (ICompletionProposal[]) proposals.toArray(new ICompletionProposal[proposals.size()]);
+    } catch (IOException e) {
+      e.printStackTrace();
+    }
+
+    return new ICompletionProposal[] {};
+  }
+
+  @Override
+  protected IContextInformation[] computeContextInformationImpl(ITextViewer viewer, int offset) {
+    return null;
+  }
+
+  public IContextInformationValidator getContextInformationValidator() {
+    if (validator == null) {
+      validator = new Validator();
+    }
+
+    return validator;
+  }
+}

Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/TextMarkerConsoleCompletionProcessor.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/TextMarkerConsoleCompletionProcessor.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/TextMarkerConsoleConstants.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/TextMarkerConsoleConstants.java?rev=1157047&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/TextMarkerConsoleConstants.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/TextMarkerConsoleConstants.java Fri Aug 12 11:00:38 2011
@@ -0,0 +1,33 @@
+/*
+ * 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.ide.ui.console;
+
+public final class TextMarkerConsoleConstants {
+  private TextMarkerConsoleConstants() {
+  }
+
+  public static final String PREF_NEW_PROMPT = "tmconsole.new_invitation";
+
+  public static final String PREF_CONTINUE_PROMPT = "tmconsole.continue_invitation";
+
+  public static final String DEFAULT_NEW_PROMPT = "=>";
+
+  public static final String DEFAULT_CONTINUE_PROMPT = "->";
+}

Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/TextMarkerConsoleConstants.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/TextMarkerConsoleConstants.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/TextMarkerConsoleFactory.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/TextMarkerConsoleFactory.java?rev=1157047&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/TextMarkerConsoleFactory.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/TextMarkerConsoleFactory.java Fri Aug 12 11:00:38 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.ide.ui.console;
+
+import org.apache.uima.textmarker.ide.TextMarkerIdePlugin;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.dltk.console.IScriptInterpreter;
+import org.eclipse.dltk.console.ScriptConsolePrompt;
+import org.eclipse.dltk.console.ui.IScriptConsoleFactory;
+import org.eclipse.dltk.console.ui.ScriptConsole;
+import org.eclipse.dltk.console.ui.ScriptConsoleFactoryBase;
+import org.eclipse.jface.preference.IPreferenceStore;
+
+public class TextMarkerConsoleFactory extends ScriptConsoleFactoryBase implements
+        IScriptConsoleFactory {
+  protected IPreferenceStore getPreferenceStore() {
+    return TextMarkerIdePlugin.getDefault().getPreferenceStore();
+  }
+
+  protected ScriptConsolePrompt makeInvitation() {
+    IPreferenceStore store = getPreferenceStore();
+    return new ScriptConsolePrompt(store.getString(TextMarkerConsoleConstants.PREF_NEW_PROMPT),
+            store.getString(TextMarkerConsoleConstants.PREF_CONTINUE_PROMPT));
+  }
+
+  protected TextMarkerConsole makeConsole(TextMarkerInterpreter interpreter, String id) {
+    TextMarkerConsole console = new TextMarkerConsole(interpreter, id);
+    console.setPrompt(makeInvitation());
+    return console;
+  }
+
+  private TextMarkerConsole createConsoleInstance(IScriptInterpreter interpreter, String id) {
+    if (interpreter == null) {
+      try {
+        id = "default";
+        interpreter = new TextMarkerInterpreter();
+        // TextMarkerConsoleUtil.runDefaultTextMarkerInterpreter((TextMarkerInterpreter)
+        // interpreter);
+      } catch (Exception e) {
+        return null;
+      }
+    }
+
+    return makeConsole((TextMarkerInterpreter) interpreter, id);
+  }
+
+  @Override
+  protected ScriptConsole createConsoleInstance() {
+    return createConsoleInstance(null, null);
+  }
+
+  public TextMarkerConsoleFactory() {
+    super();
+  }
+
+  public void openConsole(IScriptInterpreter interpreter, String id) {
+    registerAndOpenConsole(createConsoleInstance(interpreter, id));
+  }
+
+  public void openConsole(IScriptInterpreter interpreter, String id, ILaunch launch) {
+    TextMarkerConsole tmConsole = createConsoleInstance(interpreter, id);
+    tmConsole.setLaunch(launch);
+    registerAndOpenConsole(tmConsole);
+  }
+
+}

Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/TextMarkerConsoleFactory.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/TextMarkerConsoleFactory.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/TextMarkerConsoleTextHover.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/TextMarkerConsoleTextHover.java?rev=1157047&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/TextMarkerConsoleTextHover.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/TextMarkerConsoleTextHover.java Fri Aug 12 11:00:38 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.ide.ui.console;
+
+import java.io.IOException;
+
+import org.eclipse.dltk.console.IScriptConsoleShell;
+import org.eclipse.dltk.console.ui.IScriptConsoleViewer;
+import org.eclipse.dltk.console.ui.ScriptConsoleTextHover;
+import org.eclipse.jface.text.IRegion;
+
+public class TextMarkerConsoleTextHover extends ScriptConsoleTextHover {
+
+  private IScriptConsoleShell interpreterShell;
+
+  public TextMarkerConsoleTextHover(IScriptConsoleShell interpreterShell) {
+    this.interpreterShell = interpreterShell;
+  }
+
+  @Override
+  protected String getHoverInfoImpl(IScriptConsoleViewer viewer, IRegion hoverRegion) {
+    try {
+      int cursorPosition = hoverRegion.getOffset() - viewer.getCommandLineOffset();
+
+      String commandLine = viewer.getCommandLine();
+
+      return interpreterShell.getDescription(commandLine, cursorPosition);
+    } catch (IOException e) {
+      // TODO: log exception
+      e.printStackTrace();
+      return null;
+    }
+  }
+}

Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/TextMarkerConsoleTextHover.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/TextMarkerConsoleTextHover.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/TextMarkerConsoleTracker.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/TextMarkerConsoleTracker.java?rev=1157047&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/TextMarkerConsoleTracker.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/TextMarkerConsoleTracker.java Fri Aug 12 11:00:38 2011
@@ -0,0 +1,52 @@
+/*
+ * 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.ide.ui.console;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.ui.console.IHyperlink;
+import org.eclipse.ui.console.IPatternMatchListenerDelegate;
+import org.eclipse.ui.console.PatternMatchEvent;
+import org.eclipse.ui.console.TextConsole;
+
+public class TextMarkerConsoleTracker implements IPatternMatchListenerDelegate {
+  private TextConsole console;
+
+  public void connect(TextConsole console) {
+    this.console = console;
+  }
+
+  public void disconnect() {
+    console = null;
+  }
+
+  protected TextConsole getConsole() {
+    return console;
+  }
+
+  public void matchFound(PatternMatchEvent event) {
+    try {
+      int offset = event.getOffset();
+      int length = event.getLength();
+      IHyperlink link = new TextMarkerFileHyperlink(console);
+      console.addHyperlink(link, offset + 1, length - 2);
+    } catch (BadLocationException e) {
+    }
+  }
+}

Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/TextMarkerConsoleTracker.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/TextMarkerConsoleTracker.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/TextMarkerConsoleUtil.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/TextMarkerConsoleUtil.java?rev=1157047&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/TextMarkerConsoleUtil.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/TextMarkerConsoleUtil.java Fri Aug 12 11:00:38 2011
@@ -0,0 +1,49 @@
+/*
+ * 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.ide.ui.console;
+
+import java.io.IOException;
+
+import org.apache.uima.textmarker.ide.TextMarkerIdePlugin;
+import org.apache.uima.textmarker.ide.core.TextMarkerNature;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.dltk.console.ScriptConsoleServer;
+import org.eclipse.dltk.core.environment.EnvironmentManager;
+import org.eclipse.dltk.core.environment.IExecutionEnvironment;
+import org.eclipse.dltk.core.environment.IFileHandle;
+import org.eclipse.dltk.launching.ScriptLaunchUtil;
+
+public class TextMarkerConsoleUtil {
+
+  public static void runDefaultTextMarkerInterpreter(TextMarkerInterpreter interpreter)
+          throws CoreException, IOException {
+    ScriptConsoleServer server = ScriptConsoleServer.getInstance();
+
+    String id = server.register(interpreter);
+    String port = Integer.toString(server.getPort());
+
+    String[] args = new String[] { "127.0.0.1", port, id };
+
+    IExecutionEnvironment exeEnv = (IExecutionEnvironment) EnvironmentManager.getLocalEnvironment()
+            .getAdapter(IExecutionEnvironment.class);
+    IFileHandle scriptFile = TextMarkerIdePlugin.getDefault().getConsoleProxy(exeEnv);
+    ScriptLaunchUtil.runScript(TextMarkerNature.NATURE_ID, scriptFile, null, null, args, null);
+  }
+}

Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/TextMarkerConsoleUtil.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/TextMarkerConsoleUtil.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/TextMarkerFileHyperlink.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/TextMarkerFileHyperlink.java?rev=1157047&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/TextMarkerFileHyperlink.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/TextMarkerFileHyperlink.java Fri Aug 12 11:00:38 2011
@@ -0,0 +1,230 @@
+/*
+ * 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.ide.ui.console;
+
+import java.text.MessageFormat;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.dltk.debug.ui.DLTKDebugUIPlugin;
+import org.eclipse.dltk.internal.ui.editor.EditorUtility;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.ui.IEditorDescriptor;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.console.IHyperlink;
+import org.eclipse.ui.console.TextConsole;
+import org.eclipse.ui.ide.IDE;
+import org.eclipse.ui.texteditor.IDocumentProvider;
+import org.eclipse.ui.texteditor.ITextEditor;
+
+/**
+ * A hyperlink from a stack trace line of the form "(file "*.*")"
+ */
+public class TextMarkerFileHyperlink implements IHyperlink {
+
+  private TextConsole fConsole;
+
+  public TextMarkerFileHyperlink(TextConsole console) {
+    fConsole = console;
+  }
+
+  public void linkEntered() {
+  }
+
+  public void linkExited() {
+  }
+
+  public void linkActivated() {
+    try {
+      String fileName;
+      int lineNumber;
+      try {
+        String linkText = getLinkText();
+        fileName = getFileName(linkText);
+        lineNumber = getLineNumber(linkText);
+      } catch (CoreException e1) {
+        ErrorDialog.openError(DLTKDebugUIPlugin.getActiveWorkbenchShell(),
+                ConsoleMessages.TextMarkerFileHyperlink_Error,
+                ConsoleMessages.TextMarkerFileHyperlink_Error, e1.getStatus());
+        return;
+      }
+
+      // documents start at 0
+      if (lineNumber > 0) {
+        lineNumber--;
+      }
+      Object sourceElement = getSourceModule(fileName);
+      if (sourceElement != null) {
+        IEditorPart part = EditorUtility.openInEditor(sourceElement);
+        IEditorPart editorPart = EditorUtility.openInEditor(sourceElement);
+        if (editorPart instanceof ITextEditor && lineNumber >= 0) {
+          ITextEditor textEditor = (ITextEditor) editorPart;
+          IDocumentProvider provider = textEditor.getDocumentProvider();
+          IEditorInput input = part.getEditorInput();
+          provider.connect(input);
+          IDocument document = provider.getDocument(input);
+          try {
+            IRegion line = document.getLineInformation(lineNumber);
+            textEditor.selectAndReveal(line.getOffset(), line.getLength());
+          } catch (BadLocationException e) {
+
+          }
+          provider.disconnect(input);
+        }
+        return;
+      }
+      // did not find source
+      MessageDialog.openInformation(DLTKDebugUIPlugin.getActiveWorkbenchShell(),
+              ConsoleMessages.TextMarkerFileHyperlink_Information_1, MessageFormat.format(
+                      ConsoleMessages.TextMarkerFileHyperlink_Source_not_found_for__0__2,
+                      new String[] { fileName }));
+    } catch (CoreException e) {
+      DLTKDebugUIPlugin
+              .errorDialog(
+                      ConsoleMessages.TextMarkerFileHyperlink_An_exception_occurred_while_following_link__3,
+                      e);
+      return;
+    }
+  }
+
+  public String getEditorId(IEditorInput input, Object inputObject) {
+    try {
+      IEditorDescriptor descriptor = IDE.getEditorDescriptor(input.getName());
+      return descriptor.getId();
+    } catch (PartInitException e) {
+      return null;
+    }
+  }
+
+  public IEditorInput getEditorInput(Object item) {
+    try {
+      return EditorUtility.getEditorInput(item);
+    } catch (CoreException e) {
+      DLTKDebugUIPlugin.log(e);
+      return null;
+    }
+  }
+
+  protected Object getSourceModule(String fileName) {
+    IFile f = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(new Path(fileName));
+    return f;
+  }
+
+  /**
+   * Returns the fully qualified name of the type to open
+   * 
+   * @return fully qualified type name
+   * @exception CoreException
+   *              if unable to parse the type name
+   */
+  protected String getFileName(String linkText) throws CoreException {
+    Pattern p = Pattern.compile("\\(file \"(.*)\"");
+    Matcher m = p.matcher(linkText);
+    if (m.find()) {
+      String name = m.group(1);
+      return name;
+    }
+    IStatus status = new Status(IStatus.ERROR, DLTKDebugUIPlugin.getUniqueIdentifier(), 0,
+            ConsoleMessages.TextMarkerFileHyperlink_Unable_to_parse_type_name_from_hyperlink__5,
+            null);
+    throw new CoreException(status);
+  }
+
+  /**
+   * Returns the line number associated with the stack trace or -1 if none.
+   * 
+   * @exception CoreException
+   *              if unable to parse the number
+   */
+  protected int getLineNumber(String linkText) throws CoreException {
+    Pattern p = Pattern.compile("line (\\d*)");
+    Matcher m = p.matcher(linkText);
+    if (m.find()) {
+      String lineText = m.group(1);
+      try {
+        return Integer.parseInt(lineText);
+      } catch (NumberFormatException e) {
+        IStatus status = new Status(
+                IStatus.ERROR,
+                DLTKDebugUIPlugin.getUniqueIdentifier(),
+                0,
+                ConsoleMessages.TextMarkerFileHyperlink_Unable_to_parse_line_number_from_hyperlink__6,
+                e);
+        throw new CoreException(status);
+      }
+    }
+    IStatus status = new Status(IStatus.ERROR, DLTKDebugUIPlugin.getUniqueIdentifier(), 0,
+            ConsoleMessages.TextMarkerFileHyperlink_Unable_to_parse_line_number_from_hyperlink__7,
+            null);
+    throw new CoreException(status);
+  }
+
+  /**
+   * Returns the console this link is contained in.
+   * 
+   * @return console
+   */
+  protected TextConsole getConsole() {
+    return fConsole;
+  }
+
+  /**
+   * Returns this link's text
+   * 
+   * @exception CoreException
+   *              if unable to retrieve the text
+   */
+  protected String getLinkText() throws CoreException {
+    try {
+      IDocument document = getConsole().getDocument();
+      IRegion region = getConsole().getRegion(this);
+      int regionOffset = region.getOffset();
+
+      int lineNumber = document.getLineOfOffset(regionOffset);
+      IRegion lineInformation = document.getLineInformation(lineNumber);
+      int lineOffset = lineInformation.getOffset();
+      String line = document.get(lineOffset, lineInformation.getLength());
+
+      int regionOffsetInLine = regionOffset - lineOffset;
+
+      int linkEnd = line.indexOf(')', regionOffsetInLine);
+      int linkStart = line.lastIndexOf(' ', regionOffsetInLine);
+
+      return line.substring(linkStart == -1 ? 0 : linkStart + 1, linkEnd + 1);
+    } catch (BadLocationException e) {
+      IStatus status = new Status(IStatus.ERROR, DLTKDebugUIPlugin.getUniqueIdentifier(), 0,
+              ConsoleMessages.TextMarkerFileHyperlink_Unable_to_retrieve_hyperlink_text__8, e);
+      throw new CoreException(status);
+    }
+  }
+
+}

Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/TextMarkerFileHyperlink.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/TextMarkerFileHyperlink.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/TextMarkerInterpreter.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/TextMarkerInterpreter.java?rev=1157047&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/TextMarkerInterpreter.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/TextMarkerInterpreter.java Fri Aug 12 11:00:38 2011
@@ -0,0 +1,109 @@
+/*
+ * 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.ide.ui.console;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.List;
+
+import org.eclipse.dltk.console.ConsoleRequest;
+import org.eclipse.dltk.console.IScriptConsoleIO;
+import org.eclipse.dltk.console.IScriptExecResult;
+import org.eclipse.dltk.console.IScriptInterpreter;
+import org.eclipse.dltk.console.InterpreterResponse;
+import org.eclipse.dltk.console.ScriptExecResult;
+import org.eclipse.dltk.console.ShellResponse;
+
+public class TextMarkerInterpreter implements IScriptInterpreter, ConsoleRequest {
+
+  private static final String COMPLETE_COMMAND = "complete";
+
+  private static final String DESCRIBE_COMMAND = "describe";
+
+  private static final String CLOSE_COMMAND = "close";
+
+  private IScriptConsoleIO protocol;
+
+  private String content;
+
+  private int state;
+
+  public IScriptExecResult exec(String command) throws IOException {
+    InterpreterResponse response = protocol.execInterpreter(command);
+    state = response.getState();
+    return new ScriptExecResult(response.getContent());
+  }
+
+  public String getOutput() {
+    return content;
+  }
+
+  public int getState() {
+    return state;
+  }
+
+  // IScriptInterpreterShell
+  public List getCompletions(String commandLine, int position) throws IOException {
+
+    String[] args = new String[] { commandLine, Integer.toString(position) };
+
+    ShellResponse response = protocol.execShell(COMPLETE_COMMAND, args);
+
+    return response.getCompletions();
+  }
+
+  public String getDescription(String commandLine, int position) throws IOException {
+    String[] args = new String[] { commandLine, Integer.toString(position) };
+
+    ShellResponse response = protocol.execShell(DESCRIBE_COMMAND, args);
+
+    return response.getDescription();
+  }
+
+  public String[] getNames(String type) throws IOException {
+    return null;
+  }
+
+  public void close() throws IOException {
+    protocol.execShell(CLOSE_COMMAND, new String[] {});
+    protocol.close();
+  }
+
+  // IScriptConsoleProtocol
+  public void consoleConnected(IScriptConsoleIO protocol) {
+    this.protocol = protocol;
+  }
+
+  public String getInitialOuput() {
+    return null;
+  }
+
+  public void addInitialListenerOperation(Runnable runnable) {
+
+  }
+
+  public InputStream getInitialOutputStream() {
+    return null;
+  }
+
+  public boolean isValid() {
+    return protocol != null;
+  }
+}

Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/TextMarkerInterpreter.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/console/TextMarkerInterpreter.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/documentation/AbstractLanguageElementDocumentationProvider.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/documentation/AbstractLanguageElementDocumentationProvider.java?rev=1157047&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/documentation/AbstractLanguageElementDocumentationProvider.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/documentation/AbstractLanguageElementDocumentationProvider.java Fri Aug 12 11:00:38 2011
@@ -0,0 +1,103 @@
+/*
+ * 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.ide.ui.documentation;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.io.StringReader;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.eclipse.dltk.core.IMember;
+import org.eclipse.dltk.ui.documentation.IScriptDocumentationProvider;
+
+public abstract class AbstractLanguageElementDocumentationProvider implements
+        IScriptDocumentationProvider {
+
+  protected Map<String, String> map;
+
+  public AbstractLanguageElementDocumentationProvider(String file) {
+    super();
+    map = new HashMap<String, String>();
+    if (file != null) {
+      try {
+        fillMap(file);
+      } catch (IOException e) {
+      }
+    }
+  }
+
+  public Reader getInfo(String content) {
+    String string = map.get(content);
+    if (string == null) {
+      return null;
+    }
+    return new StringReader(string);
+  }
+
+  public Reader getInfo(IMember element, boolean lookIntoParents, boolean lookIntoExternal) {
+    // TODO Auto-generated method stub
+    return null;
+  }
+
+  private void fillMap(String documentationFile) throws IOException {
+    InputStream resourceAsStream = getClass().getResourceAsStream(documentationFile);
+    BufferedReader reader = new BufferedReader(new InputStreamReader(resourceAsStream));
+    StringBuilder sb = new StringBuilder();
+    while (true) {
+      String line;
+      line = reader.readLine();
+      if (line == null) {
+        break;
+      }
+      sb.append(line + "\n");
+    }
+
+    String string = sb.toString();
+    string = string.replaceAll("\\[\\{TableOfContents\\}\\]", "");
+    String[] split = string.split("[-][-][-][-]");
+
+    Pattern compile = Pattern.compile("!! __([A-Z]+)__");
+    for (String each : split) {
+      String docu = each.trim();
+      Matcher matcher = compile.matcher(each);
+      String group = null;
+      if (matcher.find()) {
+        group = matcher.group(1);
+        docu = docu.replaceAll("!! __" + group + "__", "<h1>" + group + "</h1>");
+      }
+      docu = docu.replaceAll("__Definition__", "<h2>Definition</h2>");
+      docu = docu.replaceAll("__Example__", "<h2>Example</h2>");
+      docu = docu.replaceAll("%%prettify", "");
+      docu = docu.replaceAll("/%", "");
+      docu = docu.replaceAll("\\{\\{\\{", "<code>");
+      docu = docu.replaceAll("\\}\\}\\}", "</code>");
+
+      if (group != null) {
+        map.put(group, docu);
+      }
+    }
+  }
+}

Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/documentation/AbstractLanguageElementDocumentationProvider.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/documentation/AbstractLanguageElementDocumentationProvider.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/documentation/ActionDocumentation.txt
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/documentation/ActionDocumentation.txt?rev=1157047&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/documentation/ActionDocumentation.txt (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/documentation/ActionDocumentation.txt Fri Aug 12 11:00:38 2011
@@ -0,0 +1,759 @@
+#-------------------------------------------------------------------------------
+# 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.
+#-------------------------------------------------------------------------------
+
+[{TableOfContents}]
+
+!! __ADD__
+This action adds lists or single values to a given list
+
+__Definition__
+
+%%prettify 
+{{{
+ADD(ListVariable,(Argument)+)
+}}}
+/%
+
+__Example__
+
+%%prettify 
+{{{
+Document{->ADD(list, var)};
+}}}
+/%
+
+
+In this example, the variable "var" is added to the list "list".
+----
+
+!! __ASSIGN__
+This action assigns a numerical value to a numerical variable.
+
+__Definition__
+
+%%prettify 
+{{{
+ASSIGN(Variable,NumericalExpression)
+}}}
+/%
+
+__Example__
+
+%%prettify 
+{{{
+Document{->ASSIGN(amount, (amount/2))};
+}}}
+/%
+
+
+In this example, the value of the variable amount is halved.
+
+----
+
+!! __CALL__
+The CALL action initiates the execution of a different script file or script block. Currently only complete script files are supported.
+
+__Definition__
+%%prettify 
+{{{
+CALL(DifferentFile)
+}}}
+/%
+
+__Example__
+%%prettify 
+{{{
+Document{->CALL(NamedEntities)};
+}}}
+/%
+Here, a script for named entity recognition is executed.
+
+----
+
+
+!! __CLEAR__
+This action removes all elements of the given list.
+
+__Definition__
+
+%%prettify 
+{{{
+CLEAR(ListVariable)
+}}}
+/%
+
+__Example__
+
+%%prettify 
+{{{ 
+Document{-> CLEAR(SomeList)};
+}}}
+/%
+This rule clears the list SomeList.
+----
+
+!! __COLOR__
+The COLOR action set the color of a annotation type in the modified view if the rule is fired. The supported colors are: black, silver, gray, white, maroon, red, purple, fuchsia, green, lime, olive, yellow, navy, blue, aqua, lightblue, lightgreen, orange, pink, salmon, cyan, violet, tan, brown, white, mediumpurple.
+
+__Definition__
+
+%%prettify 
+{{{
+COLOR(TypeExpression,StringExpression)
+}}}
+/%
+
+__Example__
+
+%%prettify 
+{{{
+Document{->COLOR(Headline,"red")};
+}}}
+/%
+This rule colors all Headline in the modified view.
+----
+
+!! __CREATE__
+This action creates a complex structure, a annotation with features.
+
+__Definition__
+
+%%prettify 
+{{{
+CREATE(TypeExpression(,NumberExpression)*(,StringExpression = Expression)+)
+}}}
+/%
+
+__Example__
+
+%%prettify 
+{{{
+Paragraph{COUNT(ANY,0,10000,variable)->CREATE(Headline,"size" = variable)};
+}}}
+/%
+
+----
+
+!! __DEL__
+
+The DEL action deletes the matched text fragments in the modified view.
+
+__Definition__
+
+%%prettify 
+{{{
+DEL
+}}}
+/%
+
+__Example__
+
+%%prettify 
+{{{
+Name{->DEL};
+}}}
+/%
+This rule deletes all text fragments that are annotated with a Name annotation.
+
+----
+
+
+!! __EXEC__
+The EXEC action initiates the execution of a different script file or analysis engine on the complete input document.
+
+__Definition__
+%%prettify 
+{{{
+EXEC(DifferentFile)
+}}}
+/%
+
+__Example__
+%%prettify 
+{{{
+ENGINE NamedEntities;
+Document{->EXEC(NamedEntities)};
+}}}
+/%
+Here, an analysis engine for named entity recognition is executed once on the complete document independent of the matched text and the current filtering settings. If the argument refers to another script file, then then a new view on the document is created: the complete text of the original CAS and with the default filtering settings of the TextMarker analysis engine.
+
+----
+
+!! __FILL__
+This action fills a complex structure, an annotation of the given type with feature values.
+
+__Definition__
+
+%%prettify 
+{{{
+FILL(TypeExpression(,StringExpression = Expression)+)
+}}}
+/%
+
+__Example__
+
+%%prettify 
+{{{
+Headline{COUNT(ANY,0,10000,variable)->FILL(Headline,"size" = variable)};
+}}}
+/%
+
+----
+!! __FILTERMARKUP__
+This action filters the given types of markup. They are now ignored by rules.
+
+__Definition__
+
+%%prettify 
+{{{
+FILTERMARKUP((StringExpression(,StringExpression)*))?
+}}}
+/%
+
+__Example__
+
+%%prettify 
+{{{
+Document{->FILTERMARKUP(br)};
+}}}
+/%
+
+This rule filters all <br> markup in the input document.
+
+----
+
+!! __FILTERTYPE__
+
+This action filters the given types of annotation. They are now ignored by rules. Expressions are not yet supported.
+
+__Definition__
+
+%%prettify 
+{{{
+FILTERTYPE((TypeExpression(,TypeExpression)*))?
+}}}
+/%
+
+__Example__
+
+%%prettify 
+{{{
+Document{->FILTERTYPE(SW)};
+}}}
+/%
+
+This rule filters all small written words in the input document.
+----
+
+!! __GATHER__
+This action creates a complex structure, a annotation with features. The features are collected using the given indexes of the rule elements of the complete rule.
+
+__Definition__
+
+%%prettify 
+{{{
+GATHER(TypeExpression(,NumberExpression)*(,StringExpression = NumberExpression)+)
+}}}
+/%
+
+__Example__
+
+%%prettify 
+{{{
+A B C{-> GATHER(FS, "a" = 1, "b" = 2)};
+}}}
+/%
+This rule creates a Feature Structure FS and assigns the annotation A (matched by the first rule element) and the annotation B (matched by the second rule element) the the features "a" and "b" of that feature structure. 
+
+----
+
+!! __GET__
+This action retrieves  an element of the given list dependent on a given strategy.
+
+__Definition__
+
+%%prettify 
+{{{
+GET(ListExpression, Variable, StringExpression)
+}}}
+/%
+
+__Example__
+
+%%prettify 
+{{{
+Document{->GET(list, var, "dominant")};
+}}}
+/%
+
+In this example, the element of the list that occurs most is stored in the variable "var".
+----
+
+
+!! __GETFEATURE__
+This action stores the value of the given feature of the matched annotation type in the given variable.
+
+__Definition__
+
+%%prettify 
+{{{
+GETFEATURE(StringExpression, Variable)
+}}}
+/%
+
+__Example__
+
+%%prettify 
+{{{
+Document{->GETFEATURE("language", stringVar)};
+}}}
+/%
+
+In this example, variable "stringVar" will contain the value of the feature "language".
+----
+
+!! __GETLIST__
+This action retrieves a list of elements dependent on a given strategy.
+
+__Definition__
+
+%%prettify 
+{{{
+GETLIST(ListVariable, StringExpression)
+}}}
+/%
+
+__Example__
+
+
+----
+
+!! __LOG__
+The LOG action simply writes a log message
+
+__Definition__
+
+%%prettify 
+{{{
+LOG(StringExpression)
+}}}
+/%
+
+__Example__
+
+%%prettify 
+{{{
+Document{->LOG("processed")};
+}}}
+/%
+
+This rule writes a log message with the string "processed".
+
+----
+
+!! __MARK__
+The MARK action is the most important action in the TextMarker system. This action creates a new annotation dependent on the text fragments or annotations matched by the rule. The indexes can be used to create an annotation the spanns the matched information of several rule elements.
+
+__Definition__
+
+%%prettify 
+{{{
+MARK(TypeExpression(,NumericalExpression)*)
+}}}
+/%
+
+__Example__
+
+%%prettify 
+{{{
+Freeline Paragraph{->MARK(ParagraphAfterFreeline,1,2)};
+}}}
+/%
+
+This rule matches on a free line followed by a paragraph and annotates both in a single ParagraphAfterFreeline annotation. The two numberical expressions at the end of the mark action indicate that the matched text of the first and the second rule elements are joined to create the boundaries of the new annotation.
+
+----
+
+!! __MARKONCE__
+
+This action has the same functionality as MARK, but creates a new annotation only if it does not yet exist.
+
+----
+
+!! __MARKFAST__
+The MARKFAST action uses an external ressource to annotate the content of the matched annotation more efficiently. It provides options for "ignoreCase" and an amount of characters for the threshold.
+
+__Definition__
+
+%%prettify 
+{{{
+MARKFAST(TypeExpression,ListExpression(,BooleanExpression(,NumberExpression)?)?)
+}}}
+/%
+
+__Example__
+
+%%prettify 
+{{{
+Document{->MARKFAST(FirstName,'firstnames.txt',true,2)};
+}}}
+/%
+
+This rule annotates all first names in the document and ignore the case if the length of the word is greater than 2.
+
+----
+
+!! __MARKLAST__
+The MARKLAST action annotates the last token of the matched annotation with the given type.
+
+__Definition__
+
+%%prettify 
+{{{
+MARKLAST(TypeExpression)
+}}}
+/%
+
+__Example__
+
+%%prettify 
+{{{
+Document{->MARKLAST(Last)};
+}}}
+/%
+
+This rule annotates the last token of the document.
+
+----
+
+!! __MARKSCORE__
+The MARKSCORE action is provides the same functionality as the MARK action. Furthermore heuristic scores are supported.
+
+__Definition__
+
+%%prettify 
+{{{
+MARKSCORE(NumberExpression,TypeExpression(,NumericalExpression)*)
+}}}
+/%
+
+__Example__
+
+%%prettify 
+{{{
+Freeline Paragraph{->MARKSCORE(10,ParagraphAfterFreeline,1,2)};
+}}}
+/%
+
+This rule matches on a free line followed by a paragraph and annotates both in a single ParagraphAfterFreeline annotation. The two numberical expressions at the end of the mark action indicate that the matched text of the first and the second rule elements are joined to create the boundaries of the new annotation. Additionally, the score "10" is added to the heuristic threshold of this annotation.
+
+----
+
+!! __MARKTABLE__
+The MARKTABLE action creates possibly new complex annoattions and is able to assign entries of the given table to its features.
+
+__Definition__
+
+%%prettify 
+{{{
+MARKTABLE(TypeExpression, NumberExpression, TableExpression, (,StringExpression = NumberExpression)+)
+}}}
+/%
+
+__Example__
+
+%%prettify 
+{{{
+Document{-> MARKTABLE(Struct, 1, TestTable, "first" = 2)};
+}}}
+/%
+
+In this example, the document is searched for all occurences of the entries of the first column of the given table, an annotation of the type Struct is created and its feature "first" is filled with the entry of the second column.
+
+----
+
+!! __MERGE__
+This action merges the given lists. The first parameter defines if it is an intersection or union. The second parameter is the list variable that will contain the result.
+
+__Definition__
+
+%%prettify 
+{{{
+MERGE(BooleanExpression, ListVariable, ListExpression, (ListExpression)+)
+}}}
+/%
+
+__Example__
+
+%%prettify 
+{{{
+Document{->MERGE(false, listVar, list1, list2, list3)};
+}}}
+/%
+
+The elements that occur in all three lists will be placed in the list listVar.
+----
+
+!! __MATCHEDTEXT__
+
+__Definition__
+
+%%prettify 
+{{{
+MATCHEDTEXT(StringVariable(,NumericalExpression)*)
+}}}
+/%
+
+__Example__
+
+%%prettify 
+{{{
+Paragraph{->MATCHEDTEXT(StringVariable)};
+}}}
+/%
+
+----
+
+
+!! __REMOVE__
+This action removes lists or single values from a given list
+
+__Definition__
+
+%%prettify 
+{{{
+REMOVE(ListVariable,(Argument)+)
+}}}
+/%
+
+__Example__
+
+%%prettify 
+{{{
+Document{->REMOVE(list, var)};
+}}}
+/%
+
+
+In this example, the variable "var" is removed from the list "list".
+----
+
+
+!! __REMOVEDUPLICATE__
+This action removes all duplicates of a given list
+
+__Definition__
+
+%%prettify 
+{{{
+REMOVEDUPLICATE(ListVariable)
+}}}
+/%
+
+__Example__
+
+%%prettify 
+{{{
+Document{->REMOVEDUPLICATE(list)};
+}}}
+/%
+
+----
+
+!! __REPLACE__
+The REPLACE action remembers the modification for the matched annotation.
+
+__Definition__
+
+%%prettify 
+{{{
+REPLACE(StringExpression)
+}}}
+/%
+
+__Example__
+
+%%prettify 
+{{{
+FirstName{->REPLACE("first name")};
+}}}
+/%
+
+
+This rule replaces all first names with the string "first name".
+
+----
+
+!! __RETAINMARKUP__
+This action retains the given types of markup. They are now not ignored by rules.
+
+__Definition__
+
+%%prettify 
+{{{
+RETAINMARKUP((StringExpression(,StringExpression)*))?
+}}}
+/%
+
+__Example__
+
+%%prettify 
+{{{
+Document{->RETAINMARKUP("img")};
+}}}
+/%
+
+All <img> markup elements are retained and can be macthed by rules.
+
+----
+
+!! __RETAINTYPE__
+This action retains the given types. They are now not ignored by rules.
+
+__Definition__
+
+%%prettify 
+{{{
+RETAINTYPE((TypeExpression(,TypeExpression)*))?
+}}}
+/%
+
+__Example__
+
+%%prettify 
+{{{
+Document{->RETAINTYPE(SPACE)};
+}}}
+/%
+
+All spaces are retained and can be macthed by rules.
+
+----
+
+!! __SETFEATURE__
+This action sets the value of a feature of the matched complex structure or annotation.
+
+__Definition__
+
+%%prettify 
+{{{
+SETFEATURE(StringExpression,Expression)
+}}}
+/%
+
+__Example__
+
+%%prettify 
+{{{
+Document{->SETFEATURE("language","en")};
+}}}
+/%
+Here, the language of the input document is set to english.
+
+----
+
+!! __TRANSFER__
+This action creates a new feature structure and adds all compatible features of the matched annotation.
+
+__Definition__
+
+%%prettify 
+{{{
+TRANSFER(TypeExpression)
+}}}
+/%
+
+__Example__
+
+%%prettify 
+{{{
+Document{->TRANSFER(LanguageStorage)};
+}}}
+/%
+Here, a new feature structure "LanguageStorage" is created and the features of the DocumentAnnotation are copied. E.g., if LanguageStorage defined a feature named "language", then the feature value of the DocumentAnnotation is copied.
+
+----
+
+
+!! __TRIE__
+This action uses an external multi tree word list to annotated the matched annotation and provides several configuration paramters.
+
+__Definition__
+
+%%prettify 
+{{{
+TRIE((String = Type)+,ListExpression,Boolean,Number,Boolean,Number,String)
+}}}
+/%
+
+__Example__
+
+%%prettify 
+{{{
+Document{->TRIE("FirstNames.txt" = FirstName, "Companies.txt" = Company, 'Dictionary.mtwl', true, 4, false, 0, ".,-/ ")};
+}}}
+/%
+
+Here, the Dictionary.mtwl that contains word lists for first names and companies is used to annotate the document. The words previously contained in the FirstNames.txt are annotated with the type FirstName and the word in the Companies.txt with the type Company. The case of the word is ignored if the length of the word exceeds 4. The edit distance is deactivated. The cost of an edit operation can currently not be configured by an argument. The last argument additionally defines several chars that will be ignored.
+
+----
+
+!! __UNMARK__
+This action removes the annotation of the given type overlapping the matched text. 
+
+__Definition__
+
+%%prettify 
+{{{
+UNMARK(TypeExpression)
+}}}
+/%
+
+__Example__
+
+%%prettify 
+{{{
+Headline{->UNMARK(Headline)};
+}}}
+/%
+Here, the headline annotation is removed.
+
+
+----
+
+!! __UNMARKALL__
+This action removes the annotation of the given type and all of its descendants overlapping the matched text. 
+
+__Definition__
+
+%%prettify 
+{{{
+UNMARKALL(TypeExpression, TypeListExpression)
+}}}
+/%
+
+__Example__
+
+%%prettify 
+{{{
+Annotation{->UNMARKALL(Annotation, {Headline})};
+}}}
+/%
+Here, all annotations but headlines are removed.
+

Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/documentation/ActionDocumentation.txt
------------------------------------------------------------------------------
    svn:executable = *

Propchange: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/documentation/ActionDocumentation.txt
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/documentation/ConditionDocumentation.txt
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/documentation/ConditionDocumentation.txt?rev=1157047&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/documentation/ConditionDocumentation.txt (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/documentation/ConditionDocumentation.txt Fri Aug 12 11:00:38 2011
@@ -0,0 +1,505 @@
+#-------------------------------------------------------------------------------
+# 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.
+#-------------------------------------------------------------------------------
+
+[{TableOfContents}]
+
+
+!! __AFTER__
+
+The AFTER condition evaluates true, if an annotation of the given type preceeds the matched annotations.
+
+__Definition__
+%%prettify 
+{{{AFTER(Type|TypeListExpression) }}} /%
+
+__Example__
+
+%%prettify 
+{{{CW{AFTER(SW)};}}} /%
+Here, the rule matches on a capitalized word, if there is any small written word previously.
+
+
+----
+
+!! __AND__
+The AND Condition is a composed condition and evaluates true, if all contained conditions are evaluated true.
+
+__Definition__
+
+%%prettify 
+{{{AND(Condition1,...,ConditionN) }}} /%
+
+__Example__
+
+%%prettify 
+{{{Paragraph{AND(PARTOF(Headline),CONTAINS(Keyword))->MARK(ImportantHeadline)};}}} /%
+
+In this example a Paragraph is annotated with the ImportantHealine annotation, if it is a Headline and contains Keyword.
+
+----
+
+!! __BEFORE__
+
+
+The BEFORE condition evaluates true, if the matched annotations prceeds an annotation of the given type.
+
+__Definition__
+%%prettify 
+{{{BEFORE (Type|TypeListExpression) }}} /%
+
+__Example__
+
+%%prettify 
+{{{CW{BEFORE(SW)};}}} /%
+Here, the rule matches on a capitalized word, if there is any small written word afterwards.
+
+----
+
+!! __CONTAINS__
+The CONTAINS condition evaluates true if the amount or percentage of certain types in the window of the matched annotation is in a predefined interval.
+
+__Definition__
+
+%%prettify 
+{{{CONTAINS(Type(,NumbericalExpression,NumbericalExpression(,BooleanExpression)?)?)}}} /%
+
+__Example__
+
+%%prettify 
+{{{Paragraph{CONTAINS(Keyword)->MARK(KeywordParagraph)};}}} /%
+
+A Pararaph is annotated with a KeywordParagraph annotation, if it contains a Keyword annotation.
+
+%%prettify 
+{{{Paragraph{CONTAINS(Keyword,2,4)->MARK(KeywordParagraph)};}}} /%
+
+A Pararaph is annotated with a KeywordParagraph annotation, if it contains between two and four Keyword annotations.
+
+%%prettify 
+{{{Paragraph{CONTAINS(Keyword,50,100,true)->MARK(KeywordParagraph)};}}} /%
+
+A Pararaph is annotated with a KeywordParagraph annotation, if it contains between 50% and 100% Keyword annotations. This is calculated based on the tokens of the Paragraph. If the Paragraph contains six basic annatotions, two of them are part of one Keyword annotation and one basic annotation is also annotated with a Keyword annotation, then the percantage of the contained Keywords is 50%.
+
+----
+
+!! __CONTEXTCOUNT__
+The CONTEXTCOUNT condition counts the annotations of the matched type and stores the amount in a optional numerical variable. Additionally the condition evaluates true, if the amount is in a predefined interval.
+
+__Definition__
+
+%%prettify 
+{{{CONTEXTCOUNT(Type(,NumbericalExpression,NumbericalExpression(,Variable)?)?)}}} /%
+
+__Example__
+
+%%prettify 
+{{{Keyword{CONTEXTCOUNT(Paragraph,0,1000,var)->MARK(KeywordParagraph)};}}} /%
+
+Here, the position in a Paragraph of the matched Keyword annotation is calculated and stored in the variable var.
+
+----
+
+!! __COUNT__
+The COUNT condition counts the annotations of a given type and stores the amount in a optional numerical variable. Additionally the condition evaluates true, if the amount is in a predefined interval.
+
+__Definition__
+
+%%prettify 
+{{{COUNT(Type(,NumbericalExpression,NumbericalExpression)?(,NumberVariable)?)}}} /%
+%%prettify 
+{{{COUNT(ListExpression(,NumbericalExpression,NumbericalExpression)?(,NumberVariable)?)}}} /%
+
+__Example__
+
+%%prettify 
+{{{Paragraph{COUNT(Keyword,1,10,var)->MARK(KeywordParagraph)};}}} /%
+
+Here, the amount of Keyword annotations in a Paragraph is calculated and stored in the variable var. The action of the rule will be executed if one to ten Keywords were counted.
+
+----
+
+!! __CURRENTCOUNT__
+
+__Definition__
+
+%%prettify 
+{{{CURRENTCOUNT(Type(,NumbericalExpression,NumbericalExpression(,Variable)?)?)}}} /%
+
+__Example__
+
+----
+
+!! __ENDSWITH__
+
+The ENDSWITH condition evaluates true, if an annotation of the given type ends exactly at the same position as the matched annotation.
+
+__Definition__
+%%prettify 
+{{{ENDSWITH(Type|TypeListExpression) }}} /%
+
+__Example__
+
+%%prettify 
+{{{Paragraph{ENDSWITH(SW)};}}} /%
+Here, the rule matches on a Paragraph annotation, if it ends with small written word.
+
+----
+
+
+!! __FEATURE__
+The FEATURE condition compares a feature of the matched annotation with the the second argument.
+
+__Definition__
+
+%%prettify 
+{{{FEATURE(StringExpression,Expression)}}} /%
+
+__Example__
+
+%%prettify 
+{{{
+Document{FEATURE("language",targetLanguage)}
+}}}
+/%
+Here, this rule matched, if the feature with the name "language" of the document annotation equals the value of the variable targetLanguage.
+
+----
+
+!! __IF__
+The IF evaluates true if the contained BooleanExpression does.
+
+__Definition__
+
+%%prettify 
+{{{IF(BooleanExpression)}}} /%
+
+__Example__
+
+%%prettify 
+{{{Paragraph{IF(keywordAmount > 5)->MARK(KeywordParagraph)};}}} /%
+
+A Paragraph annotation is annotated with a KeywordParagraph annotation, if the value of the variable keywordAmount is greater than five.
+
+----
+
+!! __INLIST__
+The INLIST condition is fulfilled, if the matched annotation is listed in a given word list. The (relative) edit distance is currently disabled.
+
+__Definition__
+
+%%prettify 
+{{{INLIST(WordList(,NumberExpression,(BooleanExpression)?)?)}}} /%
+%%prettify 
+{{{INLIST(StringList(,NumberExpression,(BooleanExpression)?)?)}}} /%
+
+__Example__
+
+%%prettify 
+{{{Keyword{INLIST(names.txt)->MARK(SpecialKeyword)};}}} /%
+
+A Keyword is annotated with the type SpecialKeyword, if the text of the Keyword annotation is listed in the word list names.txt.
+
+----
+
+
+!! __IS__
+
+The IS conditions evaluates true, if there is an annotation of the given type with the same offsets as the matched annotations
+
+__Definition__
+
+
+%%prettify 
+{{{IS(Type)}}} /%
+
+__Example__
+
+----
+
+!! __ISINTAG__
+The ISINTAG condition evaluates true, if the matched annotation is in the given HTML tag. Attributes are currently disabled.
+
+__Definition__
+
+%%prettify 
+{{{ISINTAG(StringExpression(,StringExpression '=' StringExpression)?)}}} /%
+
+__Example__
+
+%%prettify 
+{{{Paragraph{ISINTAG("h1")->MARK(Headline)};}}} /%
+
+A Paragraph is marked as a Headline, if the matched text is in a h1 HTML tag.
+
+----
+
+!! __LAST__
+The LAST condition evaluates true, if the type of the last token of the matched annotation is subsumed by the given type.
+
+__Definition__
+
+%%prettify 
+{{{LAST(TypeExpression)}}} /%
+
+__Example__
+
+%%prettify 
+{{{Document{LAST(CW)};}}} /%
+
+This rule fires, if the last token of the document is a capitalized word.
+
+----
+
+!! __MOFN__
+The MOFN condition is a composed condition and evaluates true, if the amount of conditions that evaluated true is in a given interval.
+
+__Definition__
+
+%%prettify 
+{{{MOFN(NumberExpression,NumberExpression(Condition1,...,ConditionN))}}} /%
+
+__Example__
+
+%%prettify 
+{{{Paragraph{MOFN(1,1(PARTOF(Headline),CONTAINS(Keyword))->MARK(HeadlineXORKeywords)};}}} /%
+
+A Paragraph is marked as a HeadlineXORKeywords, if the matched text is either part of a Headline annotation or contains Keyword annotations.
+
+----
+
+!! __NEAR__
+The NEAR condition is fullfilled, if the distance (min/max) of the matched annotation to a given type is smaller than a given NumberExpression. The direction is defined by a parameter. This condition works currently on a unfiltered index.
+
+__Definition__
+
+%%prettify 
+{{{NEAR(TypeExpression,NumberExpression,NumberExpression(,BooleanExpression)?)}}} /%
+
+__Example__
+
+%%prettify 
+{{{Paragraph{NEAR(Headline,0,10,false)->MARK(NoHeadline)};}}} /%
+
+A Paragraph that starts at most ten tokens after a headline, is annotated with the NoHeadline annotation.
+
+----
+
+!! __NOT__
+The NOT condition negates the result of its contained condition.
+
+__Definition__
+
+%%prettify 
+{{{"-"Condition}}} /%
+
+__Example__
+
+%%prettify 
+{{{Paragraph{-PARTOF(Headline)->MARK(Headline)};}}} /%
+
+A Paragraph that is not part of an Headline annotation yet is annotated with a Headline annotation.
+
+----
+
+!! __OR__
+
+The OR Condition is a composed condition and evaluates true, if one contained condition is evaluated true.
+
+__Definition__
+
+%%prettify 
+{{{
+OR(Condition1,...,ConditionN)
+}}}
+/%
+
+
+__Example__
+
+%%prettify 
+{{{
+Paragraph{OR(PARTOF(Headline),CONTAINS(Keyword))->MARK(ImportantParagraph)};
+}}}
+/%
+
+In this example a Paragraph is annotated with the ImportantParagraph annotation, if it is a Headline or contains Keyword.
+
+----
+
+!! __PARSE__
+The PARSE condition is fulfilled, if the covered text of the matched annotation can be transformed in a value of the given variable.
+
+__Definition__
+
+%%prettify 
+{{{PARSE(variable)}}} /%
+
+__Example__
+
+%%prettify 
+{{{NUM{PARSE(var)};}}} /%
+Here, a number is stored in a numerical variable.
+
+----
+!! __PARTOF__
+The PARTOF condition is fulfilled, if the matched annotation is part of an annotation of a given type. However this condition is also fulfilled if the matched type is subsumed or an anchor of the given type. Use the (much slower) PARTOFNEQ condition instead if needed.
+
+__Definition__
+
+%%prettify 
+{{{PARTOF(Type|TypeListExpression)}}} /%
+
+__Example__
+
+%%prettify 
+{{{Paragraph{PARTOF(Headline) -> MARK(ImportantParagraph)};}}} /%
+
+A Paragraph is an ImportantParagraph if the matched text is part of a headline.
+
+----
+!! __PARTOFNEQ__
+The PARTOF condition is fulfilled, if the matched annotation is part of (smaller than and inside of) an annotation of a given type.
+
+__Definition__
+
+%%prettify 
+{{{PARTOFNEQ(Type|TypeListExpression)}}} /%
+
+__Example__
+
+%%prettify 
+{{{W{PARTOFNEQ(Headline) -> MARK(ImportantWord)};}}} /%
+
+A word is an ImportantWord if it is part of a headline.
+
+----
+
+!! __POSITION__
+The POSITION counts the annotations of the type of the matched annotation. The condition is fulfilled if the index equals the value of a given NumericalExpression.
+
+__Definition__
+
+%%prettify 
+{{{POSITION(Type,NumberExpression(,Variable)?)}}} /%
+
+__Example__
+
+%%prettify 
+{{{Keyword{POSITION(Paragraph,2)->MARK(SecondKeyword)};}}} /%
+
+The second Keyword in a Paragraph is annotated with the type SecondKeyword.
+
+----
+
+!! __REGEXP__
+The REGEXP condition is fullfilled, if the given pattern macthes on the matched annotation. Quotes are currently forbidden in a pattern
+
+__Definition__
+
+%%prettify 
+{{{REGEXP(StringExpression)}}} /%
+
+__Example__
+
+%%prettify 
+{{{Keyword{REGEXP("..")->MARK(SmallKeyword)};}}} /%
+
+A Keyword that only consists of the chars is annotated with a SmallKeyword annotation.
+
+----
+
+!! __SCORE__
+The SCORE condition evaluates the value of the heuristic score of the matched annotation. The condition is fulfilled if the value is in a given interval. Optionally the amount can be stored in a variable.
+
+__Definition__
+
+%%prettify 
+{{{SCORE(NumberExpression,NumberExpression(,Variable)?)}}} /%
+
+__Example__
+
+%%prettify 
+{{{MaybeHeadline{SCORE(40,100)->MARK(Headline)};}}} /%
+
+A annotation of the type MaybeHeadline is annotated with Headline, if its score is between 40 and 100.
+
+----
+
+!! __SIZE__
+This contition counts the amount of elements of the given list.
+
+__Definition__
+
+%%prettify 
+{{{SIZE(ListExpression(,NumberExpression,NumberExpression)(,Variable)?)}}} /%
+
+__Example__
+
+%%prettify 
+{{{Document{SIZE(list,4,10,var)};}}} /%
+
+This rule fires, if the given list contains between 4 and 10 elements. Additionally, the exact amount is stored in the variable var.
+
+----
+
+
+!! __STARTSWITH__
+
+The STARTSWITH condition evaluates true, if an annotation of the given type starts exactly at the same position as the matched annotation.
+
+__Definition__
+%%prettify 
+{{{STARTSWITH(Type|TypeListExpression) }}} /%
+
+__Example__
+
+%%prettify 
+{{{Paragraph{STARTSWITH(SW)};}}} /%
+Here, the rule matches on a Paragraph annotation, if it starts with small written word.
+
+----
+
+!! __TOTALCOUNT__
+
+__Definition__
+
+%%prettify 
+{{{TOTALCOUNT(Type(,NumbericalExpression,NumbericalExpression(,Variable)?)?)}}} /%
+
+__Example__
+
+----
+
+!! __VOTE__
+The VOTE condition counts the annotations of the given types and evaluates true, if it found more annotations of the first type.
+
+__Definition__
+
+%%prettify 
+{{{VOTE(TypeExpression,TypeExpression)}}} /%
+
+__Example__
+
+%%prettify 
+{{{
+Paragraph{VOTE(FirstName,LastName)};
+}}}
+/%
+Here, this rule fires, if a paragraph contains more firstnames than lastnames.
+<tags>condition example </tags>