uima-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jo...@apache.org
Subject svn commit: r1152804 [8/15] - in /uima/sandbox/trunk/TextMarker: org.apache.uima.tm.dltk.debug.ui/ org.apache.uima.tm.dltk.debug.ui/META-INF/ org.apache.uima.tm.dltk.debug.ui/bin/ org.apache.uima.tm.dltk.debug.ui/icons/ org.apache.uima.tm.dltk.debug.ui...
Date Mon, 01 Aug 2011 14:38:36 GMT
Added: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/TextMarkerUILanguageToolkit.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/TextMarkerUILanguageToolkit.java?rev=1152804&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/TextMarkerUILanguageToolkit.java (added)
+++ uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/TextMarkerUILanguageToolkit.java Mon Aug  1 14:37:34 2011
@@ -0,0 +1,132 @@
+package org.apache.uima.tm.dltk.internal.ui;
+
+import org.apache.uima.tm.dltk.core.TextMarkerConstants;
+import org.apache.uima.tm.dltk.core.TextMarkerLanguageToolkit;
+import org.apache.uima.tm.dltk.internal.core.parser.TextMarkerParseUtils;
+import org.apache.uima.tm.dltk.internal.ui.editor.TextMarkerEditor;
+import org.apache.uima.tm.dltk.internal.ui.text.SimpleTextMarkerSourceViewerConfiguration;
+import org.apache.uima.tm.dltk.parser.ast.TMTypeConstants;
+import org.eclipse.dltk.core.IDLTKLanguageToolkit;
+import org.eclipse.dltk.core.IField;
+import org.eclipse.dltk.core.IScriptFolder;
+import org.eclipse.dltk.core.ISourceModule;
+import org.eclipse.dltk.ui.AbstractDLTKUILanguageToolkit;
+import org.eclipse.dltk.ui.IDLTKUILanguageToolkit;
+import org.eclipse.dltk.ui.ScriptElementLabels;
+import org.eclipse.dltk.ui.text.ScriptSourceViewerConfiguration;
+import org.eclipse.dltk.ui.text.ScriptTextTools;
+import org.eclipse.dltk.ui.viewsupport.ScriptUILabelProvider;
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.jface.preference.IPreferenceStore;
+
+
+public class TextMarkerUILanguageToolkit extends AbstractDLTKUILanguageToolkit {
+
+  private static TextMarkerUILanguageToolkit toolkit = null;
+
+  public static IDLTKUILanguageToolkit getInstance() {
+    if (toolkit == null) {
+      toolkit = new TextMarkerUILanguageToolkit();
+    }
+    return toolkit;
+  }
+
+  private static ScriptElementLabels sInstance = new ScriptElementLabels() {
+    @Override
+    protected void getScriptFolderLabel(IScriptFolder folder, StringBuffer buf) {
+      String name = folder.getElementName();
+      name = name.replace(IScriptFolder.PACKAGE_DELIMITER, '.');
+      buf.append(name);
+    }
+
+    @Override
+    protected void getFieldLabel(IField field, long flags, StringBuffer buf) {
+      super.getFieldLabel(field, flags, buf);
+      int i = TextMarkerParseUtils.getTypeOfIModelElement(field);
+      String type = TMTypeConstants.typeStringOfInt.get(i);
+      if (type != null) {
+        type = type.toLowerCase();
+        buf.append(" : ");
+        buf.append(type);
+      }
+    }
+  };
+
+  @Override
+  public ScriptElementLabels getScriptElementLabels() {
+    return sInstance;
+  }
+
+  public IPreferenceStore getPreferenceStore() {
+    return TextMarkerUI.getDefault().getPreferenceStore();
+  }
+
+  public IDLTKLanguageToolkit getCoreToolkit() {
+    return TextMarkerLanguageToolkit.getDefault();
+  }
+
+  public IDialogSettings getDialogSettings() {
+    return TextMarkerUI.getDefault().getDialogSettings();
+  }
+
+  @Override
+  public String getPartitioningId() {
+    return TextMarkerConstants.TM_PARTITIONING;
+  }
+
+  @Override
+  public String getEditorId(Object inputElement) {
+    return TextMarkerEditor.EDITOR_ID;
+  }
+
+  @Override
+  public String getInterpreterContainerId() {
+    return "org.apache.uima.tm.dltk.launching.INTERPRETER_CONTAINER";
+  }
+
+  @Override
+  public ScriptUILabelProvider createScriptUILabelProvider() {
+    return null;
+  }
+
+  @Override
+  public boolean getProvideMembers(ISourceModule element) {
+    return true;
+  }
+
+  @Override
+  public ScriptTextTools getTextTools() {
+    return TextMarkerUI.getDefault().getTextTools();
+  }
+
+  @Override
+  public ScriptSourceViewerConfiguration createSourceViewerConfiguration() {
+    return new SimpleTextMarkerSourceViewerConfiguration(getTextTools().getColorManager(),
+            getPreferenceStore(), null, getPartitioningId(), false);
+  }
+
+  private static final String INTERPRETERS_PREFERENCE_PAGE_ID = "org.apache.uima.tm.dltk.preferences.interpreters";
+
+  private static final String DEBUG_PREFERENCE_PAGE_ID = "org.apache.uima.tm.dltk.preferences.debug";
+
+  @Override
+  public String getInterpreterPreferencePage() {
+    return INTERPRETERS_PREFERENCE_PAGE_ID;
+  }
+
+  @Override
+  public String getDebugPreferencePage() {
+    return DEBUG_PREFERENCE_PAGE_ID;
+  }
+
+  private static final String[] EDITOR_PREFERENCE_PAGES_IDS = {
+      "org.apache.uima.tm.dltk.preferences.editor",
+      "org.apache.uima.tm.dltk.ui.editor.SyntaxColoring",
+      "org.apache.uima.tm.dltk.ui.editor.SmartTyping",
+      "org.apache.uima.tm.dltk.ui.editor.TextMarkerFolding" };
+
+  @Override
+  public String[] getEditorPreferencePages() {
+    return EDITOR_PREFERENCE_PAGES_IDS;
+  }
+}
\ No newline at end of file

Propchange: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/TextMarkerUILanguageToolkit.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/TextMarkerUILanguageToolkit.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/TextMarkerUIPreferenceInitializer.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/TextMarkerUIPreferenceInitializer.java?rev=1152804&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/TextMarkerUIPreferenceInitializer.java (added)
+++ uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/TextMarkerUIPreferenceInitializer.java Mon Aug  1 14:37:34 2011
@@ -0,0 +1,28 @@
+package org.apache.uima.tm.dltk.internal.ui;
+
+import org.apache.uima.tm.dltk.ui.TextMarkerPreferenceConstants;
+import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+import org.eclipse.dltk.compiler.util.Util;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.ui.editors.text.EditorsUI;
+
+
+public class TextMarkerUIPreferenceInitializer extends AbstractPreferenceInitializer {
+  /*
+   * (non-Javadoc)
+   * 
+   * @see
+   * org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences
+   * ()
+   */
+  @Override
+  public void initializeDefaultPreferences() {
+    IPreferenceStore store = TextMarkerUI.getDefault().getPreferenceStore();
+
+    EditorsUI.useAnnotationsPreferencePage(store);
+    EditorsUI.useQuickDiffPreferencePage(store);
+    TextMarkerPreferenceConstants.initializeDefaultValues(store);
+    store.setDefault(TextMarkerPreferenceConstants.FORMATTER_ID, Util.EMPTY_STRING);
+  }
+
+}

Propchange: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/TextMarkerUIPreferenceInitializer.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/TextMarkerUIPreferenceInitializer.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/actions/OpenTextMarkerSearchPageAction.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/actions/OpenTextMarkerSearchPageAction.java?rev=1152804&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/actions/OpenTextMarkerSearchPageAction.java (added)
+++ uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/actions/OpenTextMarkerSearchPageAction.java Mon Aug  1 14:37:34 2011
@@ -0,0 +1,45 @@
+package org.apache.uima.tm.dltk.internal.ui.actions;
+
+import org.eclipse.dltk.ui.DLTKUIPlugin;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.search.ui.NewSearchUI;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+
+public class OpenTextMarkerSearchPageAction implements IWorkbenchWindowActionDelegate {
+
+  private static final String TM_SEARCH_PAGE_ID = "de.uniwue.dltk.ui.TextMarkerSearchPage";
+
+  private IWorkbenchWindow window;
+
+  public OpenTextMarkerSearchPageAction() {
+  }
+
+  public void init(IWorkbenchWindow window) {
+    this.window = window;
+  }
+
+  public void run(IAction action) {
+    if (window == null || window.getActivePage() == null) {
+      beep();
+      return;
+    }
+
+    NewSearchUI.openSearchDialog(window, TM_SEARCH_PAGE_ID);
+  }
+
+  public void selectionChanged(IAction action, ISelection selection) {
+  }
+
+  public void dispose() {
+    window = null;
+  }
+
+  protected void beep() {
+    Shell shell = DLTKUIPlugin.getActiveWorkbenchShell();
+    if (shell != null && shell.getDisplay() != null)
+      shell.getDisplay().beep();
+  }
+}
\ No newline at end of file

Propchange: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/actions/OpenTextMarkerSearchPageAction.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/actions/OpenTextMarkerSearchPageAction.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/actions/TextMarkerGenerateActionGroup.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/actions/TextMarkerGenerateActionGroup.java?rev=1152804&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/actions/TextMarkerGenerateActionGroup.java (added)
+++ uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/actions/TextMarkerGenerateActionGroup.java Mon Aug  1 14:37:34 2011
@@ -0,0 +1,30 @@
+/**
+ * 
+ */
+package org.apache.uima.tm.dltk.internal.ui.actions;
+
+import org.apache.uima.tm.dltk.internal.ui.editor.TextMarkerEditor;
+import org.eclipse.dltk.internal.ui.editor.DLTKEditorMessages;
+import org.eclipse.dltk.ui.actions.DLTKActionConstants;
+import org.eclipse.dltk.ui.actions.GenerateActionGroup;
+import org.eclipse.dltk.ui.actions.IScriptEditorActionDefinitionIds;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.ui.texteditor.TextOperationAction;
+
+
+/**
+ * @author Martin Toepfer
+ * 
+ */
+public class TextMarkerGenerateActionGroup extends GenerateActionGroup {
+  public TextMarkerGenerateActionGroup(TextMarkerEditor editor, String groupName) {
+    super(editor, groupName);
+    Action action = new TextOperationAction(DLTKEditorMessages.getBundleForConstructedKeys(),
+            "Format.", editor, ISourceViewer.FORMAT); //$NON-NLS-1$
+    action.setActionDefinitionId(IScriptEditorActionDefinitionIds.FORMAT);
+    editor.setAction(DLTKActionConstants.FORMAT, action);
+    editor.markAsStateDependentAction(DLTKActionConstants.FORMAT, true);
+    editor.markAsSelectionDependentAction(DLTKActionConstants.FORMAT, true);
+  }
+}

Propchange: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/actions/TextMarkerGenerateActionGroup.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/actions/TextMarkerGenerateActionGroup.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/actions/TextMarkerOpenTypeAction.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/actions/TextMarkerOpenTypeAction.java?rev=1152804&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/actions/TextMarkerOpenTypeAction.java (added)
+++ uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/actions/TextMarkerOpenTypeAction.java Mon Aug  1 14:37:34 2011
@@ -0,0 +1,13 @@
+package org.apache.uima.tm.dltk.internal.ui.actions;
+
+import org.apache.uima.tm.dltk.internal.ui.TextMarkerUILanguageToolkit;
+import org.eclipse.dltk.ui.IDLTKUILanguageToolkit;
+import org.eclipse.dltk.ui.actions.OpenTypeAction;
+
+
+public class TextMarkerOpenTypeAction extends OpenTypeAction {
+  @Override
+  protected IDLTKUILanguageToolkit getUILanguageToolkit() {
+    return TextMarkerUILanguageToolkit.getInstance();
+  }
+}

Propchange: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/actions/TextMarkerOpenTypeAction.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/actions/TextMarkerOpenTypeAction.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/actions/TextMarkerOpenTypeInHierarchyAction.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/actions/TextMarkerOpenTypeInHierarchyAction.java?rev=1152804&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/actions/TextMarkerOpenTypeInHierarchyAction.java (added)
+++ uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/actions/TextMarkerOpenTypeInHierarchyAction.java Mon Aug  1 14:37:34 2011
@@ -0,0 +1,13 @@
+package org.apache.uima.tm.dltk.internal.ui.actions;
+
+import org.apache.uima.tm.dltk.internal.ui.TextMarkerUILanguageToolkit;
+import org.eclipse.dltk.ui.IDLTKUILanguageToolkit;
+import org.eclipse.dltk.ui.actions.OpenTypeInHierarchyAction;
+
+
+public class TextMarkerOpenTypeInHierarchyAction extends OpenTypeInHierarchyAction {
+  @Override
+  protected IDLTKUILanguageToolkit getLanguageToolkit() {
+    return TextMarkerUILanguageToolkit.getInstance();
+  }
+}

Propchange: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/actions/TextMarkerOpenTypeInHierarchyAction.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/actions/TextMarkerOpenTypeInHierarchyAction.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/actions/TextMarkerSelectAnnotationRulerAction.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/actions/TextMarkerSelectAnnotationRulerAction.java?rev=1152804&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/actions/TextMarkerSelectAnnotationRulerAction.java (added)
+++ uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/actions/TextMarkerSelectAnnotationRulerAction.java Mon Aug  1 14:37:34 2011
@@ -0,0 +1,177 @@
+package org.apache.uima.tm.dltk.internal.ui.actions;
+
+import java.util.Iterator;
+import java.util.ResourceBundle;
+
+import org.apache.uima.tm.dltk.internal.ui.TextMarkerUI;
+import org.apache.uima.tm.dltk.internal.ui.text.TextMarkerCorrectionProcessor;
+import org.eclipse.dltk.ui.PreferenceConstants;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ITextOperationTarget;
+import org.eclipse.jface.text.Position;
+import org.eclipse.jface.text.source.Annotation;
+import org.eclipse.jface.text.source.IAnnotationAccessExtension;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.jface.text.source.IVerticalRulerInfo;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.ui.editors.text.EditorsUI;
+import org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel;
+import org.eclipse.ui.texteditor.AnnotationPreference;
+import org.eclipse.ui.texteditor.AnnotationPreferenceLookup;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.ui.texteditor.ITextEditorExtension;
+import org.eclipse.ui.texteditor.SelectMarkerRulerAction;
+
+
+public class TextMarkerSelectAnnotationRulerAction extends SelectMarkerRulerAction {
+
+  private ITextEditor fTextEditor;
+
+  private Position fPosition;
+
+  private Annotation fAnnotation;
+
+  private AnnotationPreferenceLookup fAnnotationPreferenceLookup;
+
+  private IPreferenceStore fStore;
+
+  private boolean fHasCorrection;
+
+  private ResourceBundle fBundle;
+
+  public TextMarkerSelectAnnotationRulerAction(ResourceBundle bundle, String prefix,
+          ITextEditor editor, IVerticalRulerInfo ruler) {
+    super(bundle, prefix, editor, ruler);
+    fBundle = bundle;
+    fTextEditor = editor;
+
+    fAnnotationPreferenceLookup = EditorsUI.getAnnotationPreferenceLookup();
+    fStore = TextMarkerUI.getDefault().getPreferenceStore();
+
+    // PlatformUI.getWorkbench().getHelpSystem().setHelp(this,
+    // IJavaHelpContextIds.JAVA_SELECT_MARKER_RULER_ACTION);
+  }
+
+  @Override
+  public void run() {
+    if (fStore.getBoolean(PreferenceConstants.EDITOR_ANNOTATION_ROLL_OVER))
+      return;
+
+    runWithEvent(null);
+  }
+
+  /*
+   * @see org.eclipse.jface.action.IAction#runWithEvent(org.eclipse.swt.widgets.Event)
+   * 
+   * @since 3.2
+   */
+  @Override
+  public void runWithEvent(Event event) {
+    // if (fAnnotation instanceof
+    // OverrideIndicatorManager.OverrideIndicator) {
+    // ((OverrideIndicatorManager.OverrideIndicator)fAnnotation).open();
+    // return;
+    // }
+
+    if (fHasCorrection) {
+      ITextOperationTarget operation = (ITextOperationTarget) fTextEditor
+              .getAdapter(ITextOperationTarget.class);
+      final int opCode = ISourceViewer.QUICK_ASSIST;
+      if (operation != null && operation.canDoOperation(opCode)) {
+        fTextEditor.selectAndReveal(fPosition.getOffset(), fPosition.getLength());
+        operation.doOperation(opCode);
+      }
+      return;
+    }
+
+    super.run();
+  }
+
+  @Override
+  public void update() {
+    findJavaAnnotation();
+    setEnabled(true); // super.update() might change this later
+
+    // if (fAnnotation instanceof
+    // OverrideIndicatorManager.OverrideIndicator) {
+    // initialize(fBundle,
+    // "JavaSelectAnnotationRulerAction.OpenSuperImplementation.");
+    // //$NON-NLS-1$
+    // return;
+    // }
+    if (fHasCorrection) {
+      // if (fAnnotation instanceof AssistAnnotation)
+      // initialize(fBundle,
+      // "JavaSelectAnnotationRulerAction.QuickAssist."); //$NON-NLS-1$
+      // else
+      initialize(fBundle, "JavaSelectAnnotationRulerAction.QuickFix."); //$NON-NLS-1$
+      return;
+    }
+
+    initialize(fBundle, "JavaSelectAnnotationRulerAction.GotoAnnotation."); //$NON-NLS-1$;
+    super.update();
+  }
+
+  private void findJavaAnnotation() {
+    fPosition = null;
+    fAnnotation = null;
+    fHasCorrection = false;
+
+    AbstractMarkerAnnotationModel model = getAnnotationModel();
+    IAnnotationAccessExtension annotationAccess = getAnnotationAccessExtension();
+
+    IDocument document = getDocument();
+    if (model == null)
+      return;
+
+    boolean hasAssistLightbulb = false;
+    // fStore.getBoolean(TextMarkerPreferenceConstants.EDITOR_QUICKASSIST_LIGHTBULB);
+
+    Iterator iter = model.getAnnotationIterator();
+    int layer = Integer.MIN_VALUE;
+
+    while (iter.hasNext()) {
+      Annotation annotation = (Annotation) iter.next();
+      if (annotation.isMarkedDeleted())
+        continue;
+
+      int annotationLayer = layer;
+      if (annotationAccess != null) {
+        annotationLayer = annotationAccess.getLayer(annotation);
+        if (annotationLayer < layer)
+          continue;
+      }
+
+      Position position = model.getPosition(annotation);
+      if (!includesRulerLine(position, document))
+        continue;
+
+      boolean isReadOnly = fTextEditor instanceof ITextEditorExtension
+              && ((ITextEditorExtension) fTextEditor).isEditorInputReadOnly();
+      if (!isReadOnly && ((TextMarkerCorrectionProcessor.hasCorrections(annotation)))) {
+        fPosition = position;
+        fAnnotation = annotation;
+        fHasCorrection = true;
+        layer = annotationLayer;
+        continue;
+      } else {
+        AnnotationPreference preference = fAnnotationPreferenceLookup
+                .getAnnotationPreference(annotation);
+        if (preference == null)
+          continue;
+
+        String key = preference.getVerticalRulerPreferenceKey();
+        if (key == null)
+          continue;
+
+        if (fStore.getBoolean(key)) {
+          fPosition = position;
+          fAnnotation = annotation;
+          fHasCorrection = false;
+          layer = annotationLayer;
+        }
+      }
+    }
+  }
+}

Propchange: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/actions/TextMarkerSelectAnnotationRulerAction.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/actions/TextMarkerSelectAnnotationRulerAction.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/actions/TextMarkerSelectRulerAction.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/actions/TextMarkerSelectRulerAction.java?rev=1152804&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/actions/TextMarkerSelectRulerAction.java (added)
+++ uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/actions/TextMarkerSelectRulerAction.java Mon Aug  1 14:37:34 2011
@@ -0,0 +1,16 @@
+package org.apache.uima.tm.dltk.internal.ui.actions;
+
+import org.eclipse.dltk.internal.ui.editor.DLTKEditorMessages;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.text.source.IVerticalRulerInfo;
+import org.eclipse.ui.texteditor.AbstractRulerActionDelegate;
+import org.eclipse.ui.texteditor.ITextEditor;
+
+public class TextMarkerSelectRulerAction extends AbstractRulerActionDelegate {
+
+  @Override
+  protected IAction createAction(ITextEditor editor, IVerticalRulerInfo rulerInfo) {
+    return new TextMarkerSelectAnnotationRulerAction(DLTKEditorMessages
+            .getBundleForConstructedKeys(), "SelectAnnotationRulerAction.", editor, rulerInfo); //$NON-NLS-1$
+  }
+}

Propchange: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/actions/TextMarkerSelectRulerAction.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/actions/TextMarkerSelectRulerAction.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/AbstractLanguageElementDocumentationProvider.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/AbstractLanguageElementDocumentationProvider.java?rev=1152804&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/AbstractLanguageElementDocumentationProvider.java (added)
+++ uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/AbstractLanguageElementDocumentationProvider.java Mon Aug  1 14:37:34 2011
@@ -0,0 +1,84 @@
+package org.apache.uima.tm.dltk.internal.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/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/AbstractLanguageElementDocumentationProvider.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/AbstractLanguageElementDocumentationProvider.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/ActionDocumentation.txt
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/ActionDocumentation.txt?rev=1152804&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/ActionDocumentation.txt (added)
+++ uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/ActionDocumentation.txt Mon Aug  1 14:37:34 2011
@@ -0,0 +1,740 @@
+[{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/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/ActionDocumentation.txt
------------------------------------------------------------------------------
    svn:executable = *

Propchange: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/ActionDocumentation.txt
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/ConditionDocumentation.txt
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/ConditionDocumentation.txt?rev=1152804&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/ConditionDocumentation.txt (added)
+++ uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/ConditionDocumentation.txt Mon Aug  1 14:37:34 2011
@@ -0,0 +1,486 @@
+[{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>

Propchange: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/ConditionDocumentation.txt
------------------------------------------------------------------------------
    svn:executable = *

Propchange: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/ConditionDocumentation.txt
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/HtmlTextMarkerPagesLocation.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/HtmlTextMarkerPagesLocation.java?rev=1152804&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/HtmlTextMarkerPagesLocation.java (added)
+++ uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/HtmlTextMarkerPagesLocation.java Mon Aug  1 14:37:34 2011
@@ -0,0 +1,57 @@
+package org.apache.uima.tm.dltk.internal.ui.documentation;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.FilenameFilter;
+import java.io.Reader;
+
+public class HtmlTextMarkerPagesLocation implements ITextMarkerPagesLocation {
+
+  private File fLocation;
+
+  /**
+   * @param location
+   *          directory(!)
+   */
+  public HtmlTextMarkerPagesLocation(File location) {
+    if (!location.isDirectory()) {
+      throw new IllegalArgumentException();
+    }
+
+    fLocation = location;
+  }
+
+  public Reader getHtmlInfo(String keyword) {
+    final String pattern = keyword + ".htm";
+    File[] result = fLocation.listFiles(new FilenameFilter() {
+
+      public boolean accept(File dir, String name) {
+        if (name.equals(pattern))
+          return true;
+        return false;
+      }
+
+    });
+    if (result != null && result.length >= 1 && result[0] != null) {
+      try {
+        FileReader reader = new FileReader(result[0]);
+        return reader;
+      } catch (FileNotFoundException e) {
+        // hmmm! but nothing to do.
+      }
+    }
+    return null;
+  }
+
+  public File getLocation() {
+    return fLocation;
+  }
+
+  public void setLocation(File location) {
+    if (!location.isDirectory())
+      return;
+    fLocation = location;
+  }
+
+}

Propchange: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/HtmlTextMarkerPagesLocation.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/HtmlTextMarkerPagesLocation.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/ITextMarkerPagesLocation.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/ITextMarkerPagesLocation.java?rev=1152804&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/ITextMarkerPagesLocation.java (added)
+++ uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/ITextMarkerPagesLocation.java Mon Aug  1 14:37:34 2011
@@ -0,0 +1,15 @@
+package org.apache.uima.tm.dltk.internal.ui.documentation;
+
+import java.io.Reader;
+
+public interface ITextMarkerPagesLocation {
+
+  /**
+   * Should find inside location for an information about keyword
+   * 
+   * @param keyword
+   * @return Reader with html code
+   */
+  public Reader getHtmlInfo(String keyword);
+
+}

Propchange: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/ITextMarkerPagesLocation.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/ITextMarkerPagesLocation.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/ScriptDocumentationProvider.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/ScriptDocumentationProvider.java?rev=1152804&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/ScriptDocumentationProvider.java (added)
+++ uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/ScriptDocumentationProvider.java Mon Aug  1 14:37:34 2011
@@ -0,0 +1,48 @@
+package org.apache.uima.tm.dltk.internal.ui.documentation;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.Document;
+
+public class ScriptDocumentationProvider {
+
+  public ScriptDocumentationProvider() {
+    super();
+  }
+
+  protected String getLine(Document d, int line) throws BadLocationException {
+    return d.get(d.getLineOffset(line), d.getLineLength(line));
+  }
+
+  protected String convertToHTML(String header) {
+    StringBuffer result = new StringBuffer();
+    // result.append("<p>\n");
+    Document d = new Document(header);
+    for (int line = 0;; line++) {
+      try {
+        String str = getLine(d, line).trim();
+        if (str == null)
+          break;
+        while (str.length() > 0 && str.startsWith("#"))
+          str = str.substring(1);
+        while (str.length() > 0 && str.endsWith("#"))
+          str = str.substring(0, str.length() - 1);
+        if (str.length() == 0)
+          result.append("<p>");
+        else {
+          if (str.trim().matches("\\w*:")) {
+            result.append("<h4>");
+            result.append(str);
+            result.append("</h4>");
+          } else
+            result.append(str + "<br>");
+        }
+      } catch (BadLocationException e) {
+        break;
+      }
+
+    }
+    // result.append("</p>\n");
+    return result.toString();
+  }
+
+}
\ No newline at end of file

Propchange: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/ScriptDocumentationProvider.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/ScriptDocumentationProvider.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/TextMarkerActionDocumentationProvider.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/TextMarkerActionDocumentationProvider.java?rev=1152804&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/TextMarkerActionDocumentationProvider.java (added)
+++ uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/TextMarkerActionDocumentationProvider.java Mon Aug  1 14:37:34 2011
@@ -0,0 +1,10 @@
+package org.apache.uima.tm.dltk.internal.ui.documentation;
+
+public class TextMarkerActionDocumentationProvider extends
+        AbstractLanguageElementDocumentationProvider {
+
+  public TextMarkerActionDocumentationProvider() {
+    super("ActionDocumentation.txt");
+  }
+
+}

Propchange: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/TextMarkerActionDocumentationProvider.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/TextMarkerActionDocumentationProvider.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/TextMarkerCommentDocumentationProvider.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/TextMarkerCommentDocumentationProvider.java?rev=1152804&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/TextMarkerCommentDocumentationProvider.java (added)
+++ uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/TextMarkerCommentDocumentationProvider.java Mon Aug  1 14:37:34 2011
@@ -0,0 +1,119 @@
+package org.apache.uima.tm.dltk.internal.ui.documentation;
+
+import java.io.Reader;
+import java.io.StringReader;
+
+import org.eclipse.dltk.core.IBuffer;
+import org.eclipse.dltk.core.IField;
+import org.eclipse.dltk.core.IMember;
+import org.eclipse.dltk.core.ISourceModule;
+import org.eclipse.dltk.core.ISourceRange;
+import org.eclipse.dltk.core.ModelException;
+import org.eclipse.dltk.ui.documentation.IScriptDocumentationProvider;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.Document;
+
+public class TextMarkerCommentDocumentationProvider extends ScriptDocumentationProvider implements
+        IScriptDocumentationProvider {
+
+  @Override
+  protected String getLine(Document d, int line) throws BadLocationException {
+    return d.get(d.getLineOffset(line), d.getLineLength(line));
+  }
+
+  protected String getHeaderComment(IMember member) {
+    if (member instanceof IField) {
+      return null;
+    }
+    try {
+      ISourceRange range = member.getSourceRange();
+      if (range == null)
+        return null;
+
+      IBuffer buf = null;
+
+      ISourceModule compilationUnit = member.getSourceModule();
+      if (!compilationUnit.isConsistent()) {
+        return null;
+      }
+
+      buf = compilationUnit.getBuffer();
+
+      final int start = range.getOffset();
+
+      String contents = buf.getContents();
+
+      String result = "";
+
+      Document doc = new Document(contents);
+      try {
+        int line = doc.getLineOfOffset(start);
+        line--;
+        if (line < 0)
+          return null;
+        boolean emptyEnd = true;
+        while (line >= 0) {
+          String curLine = getLine(doc, line);
+          String curLineTrimmed = curLine.trim();
+          if ((curLineTrimmed.length() == 0 && emptyEnd) || curLineTrimmed.startsWith("#")) {
+            if (curLineTrimmed.length() != 0)
+              emptyEnd = false;
+            result = curLine + result;
+          } else
+            break;
+
+          line--;
+        }
+      } catch (BadLocationException e) {
+        return null;
+      }
+
+      return result;
+
+    } catch (ModelException e) {
+    }
+    return null;
+  }
+
+  public Reader getInfo(IMember member, boolean lookIntoParents, boolean lookIntoExternal) {
+    String header = getHeaderComment(member);
+    return new StringReader(convertToHTML(header));
+  }
+
+  @Override
+  protected String convertToHTML(String header) {
+    StringBuffer result = new StringBuffer();
+    // result.append("<p>\n");
+    Document d = new Document(header);
+    for (int line = 0;; line++) {
+      try {
+        String str = getLine(d, line).trim();
+        if (str == null)
+          break;
+        while (str.length() > 0 && str.startsWith("#"))
+          str = str.substring(1);
+        while (str.length() > 0 && str.endsWith("#"))
+          str = str.substring(0, str.length() - 1);
+        if (str.length() == 0)
+          result.append("<p>");
+        else {
+          if (str.trim().matches("\\w*:")) {
+            result.append("<h4>");
+            result.append(str);
+            result.append("</h4>");
+          } else
+            result.append(str + "<br>");
+        }
+      } catch (BadLocationException e) {
+        break;
+      }
+
+    }
+    // result.append("</p>\n");
+    return result.toString();
+  }
+
+  public Reader getInfo(String content) {
+    return null;
+  }
+}

Propchange: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/TextMarkerCommentDocumentationProvider.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/TextMarkerCommentDocumentationProvider.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/TextMarkerCommentReader.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/TextMarkerCommentReader.java?rev=1152804&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/TextMarkerCommentReader.java (added)
+++ uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/TextMarkerCommentReader.java Mon Aug  1 14:37:34 2011
@@ -0,0 +1,79 @@
+package org.apache.uima.tm.dltk.internal.ui.documentation;
+
+import org.eclipse.dltk.core.IBuffer;
+import org.eclipse.dltk.corext.documentation.SingleCharReader;
+
+public class TextMarkerCommentReader extends SingleCharReader {
+
+  private IBuffer fBuffer;
+
+  private int fCurrPos;
+
+  private int fStartPos;
+
+  private int fEndPos;
+
+  private boolean fWasNewLine;
+
+  public TextMarkerCommentReader(IBuffer buf, int start, int end) {
+    fBuffer = buf;
+    fStartPos = start;
+    fEndPos = end;
+
+    reset();
+  }
+
+  /**
+   * @see java.io.Reader#read()
+   */
+  @Override
+  public int read() {
+    if (fCurrPos < fEndPos) {
+      char ch;
+      if (fWasNewLine) {
+        do {
+          ch = fBuffer.getChar(fCurrPos++);
+        } while (fCurrPos < fEndPos && Character.isWhitespace(ch));
+        if (ch == '#') {
+          if (fCurrPos < fEndPos) {
+            do {
+              ch = fBuffer.getChar(fCurrPos++);
+            } while (ch == '#');
+          } else {
+            return -1;
+          }
+        }
+      } else {
+        ch = fBuffer.getChar(fCurrPos++);
+      }
+      fWasNewLine = (ch == '\n' || ch == '\r');
+
+      return ch;
+    }
+    return -1;
+  }
+
+  /**
+   * @see java.io.Reader#close()
+   */
+  @Override
+  public void close() {
+    fBuffer = null;
+  }
+
+  /**
+   * @see java.io.Reader#reset()
+   */
+  @Override
+  public void reset() {
+    fCurrPos = fStartPos;
+    fWasNewLine = true;
+  }
+
+  /**
+   * Returns the offset of the last read character in the passed buffer.
+   */
+  public int getOffset() {
+    return fCurrPos;
+  }
+}

Propchange: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/TextMarkerCommentReader.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/TextMarkerCommentReader.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/TextMarkerConditionDocumentationProvider.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/TextMarkerConditionDocumentationProvider.java?rev=1152804&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/TextMarkerConditionDocumentationProvider.java (added)
+++ uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/TextMarkerConditionDocumentationProvider.java Mon Aug  1 14:37:34 2011
@@ -0,0 +1,10 @@
+package org.apache.uima.tm.dltk.internal.ui.documentation;
+
+public class TextMarkerConditionDocumentationProvider extends
+        AbstractLanguageElementDocumentationProvider {
+
+  public TextMarkerConditionDocumentationProvider() {
+    super("ConditionDocumentation.txt");
+  }
+
+}

Propchange: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/TextMarkerConditionDocumentationProvider.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/TextMarkerConditionDocumentationProvider.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/TextMarkerFunctionDocumentationProvider.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/TextMarkerFunctionDocumentationProvider.java?rev=1152804&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/TextMarkerFunctionDocumentationProvider.java (added)
+++ uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/TextMarkerFunctionDocumentationProvider.java Mon Aug  1 14:37:34 2011
@@ -0,0 +1,10 @@
+package org.apache.uima.tm.dltk.internal.ui.documentation;
+
+public class TextMarkerFunctionDocumentationProvider extends
+        AbstractLanguageElementDocumentationProvider {
+
+  public TextMarkerFunctionDocumentationProvider() {
+    super(null);
+  }
+
+}

Propchange: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/TextMarkerFunctionDocumentationProvider.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/TextMarkerFunctionDocumentationProvider.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/TextMarkerPageFolder.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/TextMarkerPageFolder.java?rev=1152804&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/TextMarkerPageFolder.java (added)
+++ uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/TextMarkerPageFolder.java Mon Aug  1 14:37:34 2011
@@ -0,0 +1,123 @@
+/**
+ * 
+ */
+package org.apache.uima.tm.dltk.internal.ui.documentation;
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
+
+public class TextMarkerPageFolder {
+  private String path;
+
+  private HashMap pages = new HashMap();
+
+  public TextMarkerPageFolder(String path) {
+    super();
+    this.path = path;
+  }
+
+  public void addPage(String keyword, String file) {
+    pages.put(keyword, file);
+  }
+
+  public boolean verify() {
+    if (path == null)
+      return false;
+    File file = new File(path);
+    if (file.exists() && file.isDirectory())
+      return true;
+    return false;
+  }
+
+  public String getPath() {
+    return path;
+  }
+
+  public HashMap getPages() {
+    return pages;
+  }
+
+  @Override
+  public boolean equals(Object obj) {
+    if (!(obj instanceof TextMarkerPageFolder))
+      return false;
+    if (obj == this)
+      return true;
+    TextMarkerPageFolder f = (TextMarkerPageFolder) obj;
+    if (!f.path.equals(this.path))
+      return false;
+    if (!f.pages.equals(this.pages))
+      return false;
+    return true;
+  }
+
+  public static List readXML(String data) throws IOException {
+    // Wrapper the stream for efficient parsing
+    InputStream stream = new ByteArrayInputStream(data.getBytes());
+
+    // Do the parsing and obtain the top-level node
+    Element config = null;
+    try {
+      DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+      parser.setErrorHandler(new DefaultHandler());
+      config = parser.parse(new InputSource(stream)).getDocumentElement();
+    } catch (SAXException e) {
+      throw new IOException("Bad XML format");
+    } catch (ParserConfigurationException e) {
+      stream.close();
+      throw new IOException("Bad XML format");
+    } finally {
+      stream.close();
+    }
+
+    if (!config.getNodeName().equalsIgnoreCase("manPages")) {
+      throw new RuntimeException("Bad top level node");
+    }
+
+    List folders = new ArrayList();
+
+    NodeList list = config.getChildNodes();
+    int length = list.getLength();
+    for (int i = 0; i < length; ++i) {
+      Node node = list.item(i);
+      short type = node.getNodeType();
+      if (type == Node.ELEMENT_NODE && node.getNodeName().equalsIgnoreCase("location")) {
+        Element location = (Element) node;
+        String path = location.getAttribute("path");
+        TextMarkerPageFolder folder = new TextMarkerPageFolder(path);
+        NodeList locationChilds = location.getChildNodes();
+        int pages = locationChilds.getLength();
+        for (int j = 0; j < pages; ++j) {
+          node = locationChilds.item(j);
+          type = node.getNodeType();
+          if (type == Node.ELEMENT_NODE && node.getNodeName().equalsIgnoreCase("page")) {
+            Element word = (Element) node;
+            String kw = word.getAttribute("keyword");
+            String file = word.getAttribute("file");
+            folder.addPage(kw, file);
+          }
+        }
+        folders.add(folder);
+      }
+    }
+
+    return folders;
+  }
+
+}
\ No newline at end of file

Propchange: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/TextMarkerPageFolder.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.dltk.ui/src/main/java/org/apache/uima/tm/dltk/internal/ui/documentation/TextMarkerPageFolder.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message