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 [21/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/editor/TextMarkerEditor.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/editor/TextMarkerEditor.java?rev=1157047&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/editor/TextMarkerEditor.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/editor/TextMarkerEditor.java Fri Aug 12 11:00:38 2011
@@ -0,0 +1,526 @@
+/*
+ * 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.editor;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.uima.textmarker.ide.TextMarkerIdePlugin;
+import org.apache.uima.textmarker.ide.core.TextMarkerLanguageToolkit;
+import org.apache.uima.textmarker.ide.core.codeassist.TextMarkerReferenceDeclarationVisitor;
+import org.apache.uima.textmarker.ide.core.codeassist.TextMarkerReferenceVisitor;
+import org.apache.uima.textmarker.ide.core.codeassist.TextMarkerSelectionParser;
+import org.apache.uima.textmarker.ide.parser.ast.TextMarkerAction;
+import org.apache.uima.textmarker.ide.parser.ast.TextMarkerCondition;
+import org.apache.uima.textmarker.ide.ui.TextMarkerPartitions;
+import org.apache.uima.textmarker.ide.ui.TextMarkerPreferenceConstants;
+import org.apache.uima.textmarker.ide.ui.actions.TextMarkerGenerateActionGroup;
+import org.apache.uima.textmarker.ide.ui.text.TextMarkerPairMatcher;
+import org.apache.uima.textmarker.ide.ui.text.folding.TextMarkerFoldingStructureProvider;
+import org.eclipse.core.filebuffers.IDocumentSetupParticipant;
+import org.eclipse.dltk.ast.ASTNode;
+import org.eclipse.dltk.ast.declarations.ModuleDeclaration;
+import org.eclipse.dltk.compiler.env.ISourceModule;
+import org.eclipse.dltk.core.IDLTKLanguageToolkit;
+import org.eclipse.dltk.core.IModelElement;
+import org.eclipse.dltk.core.ISourceRange;
+import org.eclipse.dltk.core.ISourceReference;
+import org.eclipse.dltk.core.ModelException;
+import org.eclipse.dltk.internal.ui.actions.FoldingActionGroup;
+import org.eclipse.dltk.internal.ui.editor.DLTKEditorMessages;
+import org.eclipse.dltk.internal.ui.editor.ScriptEditor;
+import org.eclipse.dltk.internal.ui.editor.ScriptOutlinePage;
+import org.eclipse.dltk.internal.ui.editor.ScriptSourceViewer;
+import org.eclipse.dltk.internal.ui.editor.ToggleCommentAction;
+import org.eclipse.dltk.ui.actions.IScriptEditorActionDefinitionIds;
+import org.eclipse.dltk.ui.text.ScriptTextTools;
+import org.eclipse.dltk.ui.text.folding.IFoldingStructureProvider;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IDocumentExtension3;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITextOperationTarget;
+import org.eclipse.jface.text.ITextViewerExtension5;
+import org.eclipse.jface.text.Position;
+import org.eclipse.jface.text.TextUtilities;
+import org.eclipse.jface.text.source.Annotation;
+import org.eclipse.jface.text.source.IAnnotationModel;
+import org.eclipse.jface.text.source.ICharacterPairMatcher;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.jface.text.source.SourceViewerConfiguration;
+import org.eclipse.search.internal.ui.SearchPlugin;
+import org.eclipse.search2.internal.ui.text.Highlighter;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.actions.ActionGroup;
+import org.eclipse.ui.texteditor.ITextEditorActionConstants;
+import org.eclipse.ui.texteditor.IUpdate;
+import org.eclipse.ui.texteditor.SourceViewerDecorationSupport;
+import org.eclipse.ui.texteditor.TextOperationAction;
+
+public class TextMarkerEditor extends ScriptEditor {
+
+  protected class FormatElementAction extends Action implements IUpdate {
+
+    /*
+     * @since 3.2
+     */
+    FormatElementAction() {
+      setEnabled(isEditorInputModifiable());
+    }
+
+    /*
+     * @see org.eclipse.jface.action.IAction#run()
+     */
+    @Override
+    public void run() {
+
+      final ScriptSourceViewer viewer = (ScriptSourceViewer) getSourceViewer();
+      if (viewer.isEditable()) {
+
+        final Point selection = viewer.rememberSelection();
+        try {
+          viewer.setRedraw(false);
+
+          final String type = TextUtilities.getContentType(viewer.getDocument(),
+                  TextMarkerPartitions.TM_PARTITIONING, selection.x, true);
+          if (type.equals(IDocument.DEFAULT_CONTENT_TYPE) && selection.y == 0) {
+
+            try {
+              final IModelElement element = getElementAt(selection.x, true);
+              if (element != null && element.exists()) {
+
+                final int kind = element.getElementType();
+                if (kind == IModelElement.TYPE || kind == IModelElement.METHOD) {
+
+                  final ISourceReference reference = (ISourceReference) element;
+                  final ISourceRange range = reference.getSourceRange();
+
+                  if (range != null) {
+                    viewer.setSelectedRange(range.getOffset(), range.getLength());
+                    viewer.doOperation(ISourceViewer.FORMAT);
+                  }
+                }
+              }
+            } catch (ModelException exception) {
+              // Should not happen
+            }
+          } else {
+            viewer.setSelectedRange(selection.x, 1);
+            viewer.doOperation(ISourceViewer.FORMAT);
+          }
+        } catch (BadLocationException exception) {
+          // Can not happen
+        } finally {
+
+          viewer.setRedraw(true);
+          viewer.restoreSelection();
+        }
+      }
+    }
+
+    /*
+     * @see org.eclipse.ui.texteditor.IUpdate#update()
+     * 
+     * @since 3.2
+     */
+    public void update() {
+      setEnabled(isEditorInputModifiable());
+    }
+  }
+
+  public static final String EDITOR_ID = "org.apache.uima.textmarker.ide.ui.editor.TextMarkerEditor";
+
+  public static final String EDITOR_CONTEXT = "#TextMarkerEditorContext";
+
+  public static final String RULER_CONTEXT = "#TextMarkerRulerContext";
+
+  private IFoldingStructureProvider foldingProvider;
+
+  private TextMarkerPairMatcher bracketMatcher;
+
+  private void configureToggleCommentAction() {
+    IAction action = getAction("ToggleComment"); //$NON-NLS-1$
+    if (action instanceof ToggleCommentAction) {
+      ISourceViewer sourceViewer = getSourceViewer();
+      SourceViewerConfiguration configuration = getSourceViewerConfiguration();
+      ((ToggleCommentAction) action).configure(sourceViewer, configuration);
+    }
+  }
+
+  // public void dispose() {
+  // super.dispose();
+  // highlighter.dispose();
+  // }
+
+  @Override
+  protected void initializeEditor() {
+    super.initializeEditor();
+
+    setEditorContextMenuId(EDITOR_CONTEXT);
+    setRulerContextMenuId(RULER_CONTEXT);
+  }
+
+  @Override
+  protected void createActions() {
+    super.createActions();
+
+    // Comment
+    Action action = new TextOperationAction(DLTKEditorMessages.getBundleForConstructedKeys(),
+            "Comment.", this, ITextOperationTarget.PREFIX); //$NON-NLS-1$
+    action.setActionDefinitionId(IScriptEditorActionDefinitionIds.COMMENT);
+    setAction("Comment", action); //$NON-NLS-1$
+    markAsStateDependentAction("Comment", true); //$NON-NLS-1$
+
+    // Uncomment
+    action = new TextOperationAction(DLTKEditorMessages.getBundleForConstructedKeys(),
+            "Uncomment.", this, ITextOperationTarget.STRIP_PREFIX); //$NON-NLS-1$
+    action.setActionDefinitionId(IScriptEditorActionDefinitionIds.UNCOMMENT);
+    setAction("Uncomment", action); //$NON-NLS-1$
+    markAsStateDependentAction("Uncomment", true); //$NON-NLS-1$
+
+    // Toggle comment
+    action = new ToggleCommentAction(DLTKEditorMessages.getBundleForConstructedKeys(),
+            "ToggleComment.", this); //$NON-NLS-1$
+    action.setActionDefinitionId(IScriptEditorActionDefinitionIds.TOGGLE_COMMENT);
+    setAction("ToggleComment", action); //$NON-NLS-1$
+    markAsStateDependentAction("ToggleComment", true); //$NON-NLS-1$
+    configureToggleCommentAction();
+
+    action = new TextOperationAction(DLTKEditorMessages.getBundleForConstructedKeys(),
+            "Format.", this, ISourceViewer.FORMAT); //$NON-NLS-1$
+    action.setActionDefinitionId(IScriptEditorActionDefinitionIds.FORMAT);
+    setAction("Format", action); //$NON-NLS-1$
+    markAsStateDependentAction("Format", true); //$NON-NLS-1$
+    markAsSelectionDependentAction("Format", true); //$NON-NLS-1$
+    // PlatformUI.getWorkbench().getHelpSystem().setHelp(action,
+    // IJavaHelpContextIds.FORMAT_ACTION);
+
+    ActionGroup generateActions = new TextMarkerGenerateActionGroup(this,
+            ITextEditorActionConstants.GROUP_EDIT);
+    fActionGroups.addGroup(generateActions);
+    fContextMenuGroup.addGroup(generateActions);
+    // commented 090326->
+    // action = new FormatElementAction();
+    // action
+    // .setActionDefinitionId(IScriptEditorActionDefinitionIds.QUICK_FORMAT);
+    //		setAction("QuickFormat", action); //$NON-NLS-1$
+    //		markAsStateDependentAction("QuickFormat", true); //$NON-NLS-1$ <-
+
+    // action = new AddBlockCommentAction(DLTKEditorMessages
+    //				.getBundleForConstructedKeys(), "AddBlockComment.", this); //$NON-NLS-1$
+    // action
+    // .setActionDefinitionId(IScriptEditorActionDefinitionIds.ADD_BLOCK_COMMENT);
+    //		setAction("AddBlockComment", action); //$NON-NLS-1$
+    //		markAsStateDependentAction("AddBlockComment", true); //$NON-NLS-1$
+    //		markAsSelectionDependentAction("AddBlockComment", true); //$NON-NLS-1$
+    // // PlatformUI.getWorkbench().getHelpSystem().setHelp(action,
+    // // IDLTKJavaHelpContextIds.ADD_BLOCK_COMMENT_ACTION);
+    //
+    // action = new RemoveBlockCommentAction(DLTKEditorMessages
+    //				.getBundleForConstructedKeys(), "RemoveBlockComment.", this); //$NON-NLS-1$
+    // action
+    // .setActionDefinitionId(IScriptEditorActionDefinitionIds.REMOVE_BLOCK_COMMENT);
+    //		setAction("RemoveBlockComment", action); //$NON-NLS-1$
+    //		markAsStateDependentAction("RemoveBlockComment", true); //$NON-NLS-1$
+    //		markAsSelectionDependentAction("RemoveBlockComment", true); //$NON-NLS-1$
+    // PlatformUI.getWorkbench().getHelpSystem().setHelp(action,
+    // IJavaHelpContextIds.REMOVE_BLOCK_COMMENT_ACTION);
+
+    // action = new IndentAction(DLTKEditorMessages
+    //				.getBundleForConstructedKeys(), "Indent.", this, false); //$NON-NLS-1$
+    // action.setActionDefinitionId(IScriptEditorActionDefinitionIds.INDENT);
+    //		setAction("Indent", action); //$NON-NLS-1$
+    //		markAsStateDependentAction("Indent", true); //$NON-NLS-1$
+    //		markAsSelectionDependentAction("Indent", true); //$NON-NLS-1$
+    // // PlatformUI.getWorkbench().getHelpSystem().setHelp(action,
+    // // IJavaHelpContextIds.INDENT_ACTION);
+
+  }
+
+  final static String[] properties = new String[] {
+      TextMarkerPreferenceConstants.EDITOR_FOLDING_BLOCKS,
+      TextMarkerPreferenceConstants.EDITOR_FOLDING_EXCLUDE_LIST,
+      TextMarkerPreferenceConstants.EDITOR_FOLDING_INCLUDE_LIST, };
+
+  private Highlighter highlighter;
+
+  private HashMap<Annotation, Position> myAnnotations;
+
+  @Override
+  protected String[] getFoldingEventPreferenceKeys() {
+    return properties;
+  }
+
+  // protected void handlePreferenceStoreChanged(PropertyChangeEvent event) {
+  // String property = event.getProperty();
+  // try {
+  // ISourceViewer sourceViewer = getSourceViewer();
+  // if (sourceViewer == null) {
+  // return;
+  // }
+  // if (TextMarkerPreferenceConstants.EDITOR_FOLDING_BLOCKS
+  // .equals(property)
+  // || TextMarkerPreferenceConstants.EDITOR_FOLDING_COMMENTS_WITH_NEWLINES
+  // .equals(property)
+  // || TextMarkerPreferenceConstants.EDITOR_FOLDING_EXCLUDE_LIST
+  // .equals(property)
+  // || TextMarkerPreferenceConstants.EDITOR_FOLDING_INCLUDE_LIST
+  // .equals(property)
+  // || PreferenceConstants.EDITOR_FOLDING_LINES_LIMIT
+  // .equals(property)) {
+  //
+  // if (sourceViewer instanceof ProjectionViewer) {
+  // fProjectionModelUpdater.initialize();
+  // }
+  // return;
+  // }
+  // } finally {
+  // super.handlePreferenceStoreChanged(event);
+  // }
+  // }
+
+  @Override
+  protected IPreferenceStore getScriptPreferenceStore() {
+    return TextMarkerIdePlugin.getDefault().getPreferenceStore();
+  }
+
+  @Override
+  public ScriptTextTools getTextTools() {
+    return TextMarkerIdePlugin.getDefault().getTextTools();
+  }
+
+  @Override
+  protected ScriptOutlinePage doCreateOutlinePage() {
+    return new TextMarkerOutlinePage(this, TextMarkerIdePlugin.getDefault().getPreferenceStore());
+  }
+
+  @Override
+  protected void connectPartitioningToElement(IEditorInput input, IDocument document) {
+    if (document instanceof IDocumentExtension3) {
+      IDocumentExtension3 doc = (IDocumentExtension3) document;
+      if (doc.getDocumentPartitioner(TextMarkerPartitions.TM_PARTITIONING) == null) {
+        IDocumentSetupParticipant participant = new TextMarkerDocumentSetupParticipant();
+        participant.setup(document);
+      }
+    }
+  }
+
+  @Override
+  protected IFoldingStructureProvider getFoldingStructureProvider() {
+    if (foldingProvider == null) {
+      foldingProvider = new TextMarkerFoldingStructureProvider();
+    }
+
+    return foldingProvider;
+  }
+
+  @Override
+  protected FoldingActionGroup createFoldingActionGroup() {
+    return new FoldingActionGroup(this, getViewer(), TextMarkerIdePlugin.getDefault()
+            .getPreferenceStore());
+  }
+
+  @Override
+  public String getEditorId() {
+    return EDITOR_ID;
+  }
+
+  protected void selectionChanged() {
+
+    if (getSelectionProvider() == null)
+      return;
+
+    super.selectionChanged();
+
+    if (myAnnotations != null && !myAnnotations.isEmpty()) {
+      removeAnnotations(myAnnotations.keySet());
+    }
+
+    TextMarkerSelectionParser parser = new TextMarkerSelectionParser();
+    ISourceModule unit = (ISourceModule) getInputModelElement();
+    ModuleDeclaration parsed = parser.parse(unit);
+    ISourceViewer sourceViewer = getSourceViewer();
+    StyledText styledText = sourceViewer.getTextWidget();
+    int caret = 0;
+    if (sourceViewer instanceof ITextViewerExtension5) {
+      ITextViewerExtension5 extension = (ITextViewerExtension5) sourceViewer;
+      caret = extension.widgetOffset2ModelOffset(styledText.getCaretOffset());
+    } else {
+      int offset = sourceViewer.getVisibleRegion().getOffset();
+      caret = offset + styledText.getCaretOffset();
+    }
+    TextMarkerReferenceVisitor visitor1 = new TextMarkerReferenceVisitor(caret);
+    ASTNode node = null;
+    try {
+      parsed.traverse(visitor1);
+    } catch (Exception e) {
+    }
+    node = visitor1.getResult();
+    if (node == null) {
+      TextMarkerReferenceDeclarationVisitor visitor2 = new TextMarkerReferenceDeclarationVisitor(
+              caret);
+      try {
+        parsed.traverse(visitor2);
+      } catch (Exception e) {
+      }
+      node = visitor2.getResult();
+    }
+    if (node != null) {
+      ReferenceFinder refFinder = new ReferenceFinder(node);
+      try {
+        parsed.traverse(refFinder);
+      } catch (Exception e) {
+      }
+      List<ASTNode> result = refFinder.getResult();
+      myAnnotations = new HashMap<Annotation, Position>(result.size());
+      for (ASTNode each : result) {
+        Annotation annotation = new Annotation(SearchPlugin.SEARCH_ANNOTATION_TYPE, true, null);
+        Position position = null;
+        int sourceStart = each.sourceStart();
+        int sourceEnd = each.sourceEnd();
+        if (each instanceof TextMarkerAction) {
+          TextMarkerAction e = (TextMarkerAction) each;
+          sourceStart = e.getNameStart();
+          sourceEnd = e.getNameEnd();
+        } else if (each instanceof TextMarkerCondition) {
+          TextMarkerCondition e = (TextMarkerCondition) each;
+          sourceStart = e.getNameStart();
+          sourceEnd = e.getNameEnd();
+        }
+        position = new Position(sourceStart, sourceEnd - sourceStart);
+        myAnnotations.put(annotation, position);
+      }
+      addAnnotations(myAnnotations);
+    }
+
+  }
+
+  private void removeAnnotations(Collection<Annotation> annotations) {
+    IAnnotationModel model = getDocumentProvider().getAnnotationModel(getEditorInput());
+    for (Annotation annotation : annotations) {
+      model.removeAnnotation(annotation);
+    }
+  }
+
+  private void addAnnotations(Map<Annotation, Position> annotationToPositionMap) {
+    IAnnotationModel model = getDocumentProvider().getAnnotationModel(getEditorInput());
+    for (Annotation a : annotationToPositionMap.keySet()) {
+      Position p = annotationToPositionMap.get(a);
+      model.addAnnotation(a, p);
+    }
+  }
+
+  @Override
+  protected void initializeKeyBindingScopes() {
+    setKeyBindingScopes(new String[] { "org.apache.uima.textmarker.ide.ui.textMarkerEditorScope" }); //$NON-NLS-1$
+  }
+
+  @Override
+  public IDLTKLanguageToolkit getLanguageToolkit() {
+    return TextMarkerLanguageToolkit.getDefault();
+  }
+
+  @Override
+  public String getCallHierarchyID() {
+    return "org.eclipse.dltk.callhierarchy.view";
+  }
+
+  /**
+   * Jumps to the matching bracket.
+   */
+  @Override
+  public void gotoMatchingBracket() {
+    ISourceViewer sourceViewer = getSourceViewer();
+    IDocument document = sourceViewer.getDocument();
+    if (document == null)
+      return;
+
+    IRegion selection = getSignedSelection(sourceViewer);
+
+    int selectionLength = Math.abs(selection.getLength());
+    if (selectionLength > 1) {
+      setStatusLineErrorMessage("No bracket selected");
+      sourceViewer.getTextWidget().getDisplay().beep();
+      return;
+    }
+
+    // #26314
+    int sourceCaretOffset = selection.getOffset() + selection.getLength();
+    if (isSurroundedByBrackets(document, sourceCaretOffset))
+      sourceCaretOffset -= selection.getLength();
+
+    IRegion region = bracketMatcher.match(document, sourceCaretOffset);
+    if (region == null) {
+      setStatusLineErrorMessage("No matching bracket found");
+      sourceViewer.getTextWidget().getDisplay().beep();
+      return;
+    }
+
+    int offset = region.getOffset();
+    int length = region.getLength();
+
+    if (length < 1)
+      return;
+
+    int anchor = bracketMatcher.getAnchor();
+    // http://dev.eclipse.org/bugs/show_bug.cgi?id=34195
+    int targetOffset = (ICharacterPairMatcher.RIGHT == anchor) ? offset + 1 : offset + length;
+
+    boolean visible = false;
+    if (sourceViewer instanceof ITextViewerExtension5) {
+      ITextViewerExtension5 extension = (ITextViewerExtension5) sourceViewer;
+      visible = (extension.modelOffset2WidgetOffset(targetOffset) > -1);
+    } else {
+      IRegion visibleRegion = sourceViewer.getVisibleRegion();
+      // http://dev.eclipse.org/bugs/show_bug.cgi?id=34195
+      visible = (targetOffset >= visibleRegion.getOffset() && targetOffset <= visibleRegion
+              .getOffset() + visibleRegion.getLength());
+    }
+
+    if (!visible) {
+      setStatusLineErrorMessage("Matching bracket is outside selected element");
+      sourceViewer.getTextWidget().getDisplay().beep();
+      return;
+    }
+
+    if (selection.getLength() < 0)
+      targetOffset -= selection.getLength();
+
+    sourceViewer.setSelectedRange(targetOffset, selection.getLength());
+    sourceViewer.revealRange(targetOffset, selection.getLength());
+  }
+
+  @Override
+  protected void configureSourceViewerDecorationSupport(SourceViewerDecorationSupport support) {
+    bracketMatcher = new TextMarkerPairMatcher(BRACKETS, this);
+    support.setCharacterPairMatcher(bracketMatcher);
+    support.setMatchingCharacterPainterPreferenceKeys(MATCHING_BRACKETS, MATCHING_BRACKETS_COLOR);
+
+    super.configureSourceViewerDecorationSupport(support);
+  }
+
+}

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

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

Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/editor/TextMarkerOutlinePage.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/editor/TextMarkerOutlinePage.java?rev=1157047&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/editor/TextMarkerOutlinePage.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/editor/TextMarkerOutlinePage.java Fri Aug 12 11:00:38 2011
@@ -0,0 +1,97 @@
+/*
+ * 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.editor;
+
+import java.util.ArrayList;
+
+import org.eclipse.dltk.core.IModelElement;
+import org.eclipse.dltk.internal.ui.editor.ScriptEditor;
+import org.eclipse.dltk.internal.ui.editor.ScriptOutlinePage;
+import org.eclipse.dltk.ui.DLTKPluginImages;
+import org.eclipse.dltk.ui.actions.MemberFilterActionGroup;
+import org.eclipse.dltk.ui.viewsupport.MemberFilterAction;
+import org.eclipse.dltk.ui.viewsupport.ModelElementFilter;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.ui.IActionBars;
+
+public class TextMarkerOutlinePage extends ScriptOutlinePage {
+
+  public TextMarkerOutlinePage(ScriptEditor editor, IPreferenceStore store) {
+    super(editor, store);
+  }
+
+  @Override
+  protected void registerSpecialToolbarActions(IActionBars actionBars) {
+    IToolBarManager toolBarManager = actionBars.getToolBarManager();
+
+    MemberFilterActionGroup fMemberFilterActionGroup = new MemberFilterActionGroup(fOutlineViewer,
+            fStore);
+
+    String title, helpContext;
+    ArrayList actions = new ArrayList(3);
+
+    // fill-in actions variables
+
+    title = ActionMessages.MemberFilterActionGroup_hide_variables_label;
+    // TODO help support
+    helpContext = "";// IDLTKHelpContextIds.FILTER_FIELDS_ACTION;
+    MemberFilterAction hideVariables = new MemberFilterAction(fMemberFilterActionGroup, title,
+            new ModelElementFilter(IModelElement.FIELD), helpContext, true);
+    hideVariables.setDescription(ActionMessages.MemberFilterActionGroup_hide_variables_description);
+    hideVariables.setToolTipText(ActionMessages.MemberFilterActionGroup_hide_variables_tooltip);
+    DLTKPluginImages.setLocalImageDescriptors(hideVariables, "filter_fields.gif"); //$NON-NLS-1$
+    actions.add(hideVariables);
+
+    // procedures
+
+    title = ActionMessages.MemberFilterActionGroup_hide_functions_label;
+    // TODO help support
+    helpContext = "";// IDLTKHelpContextIds.FILTER_STATIC_ACTION;
+    MemberFilterAction hideProcedures = new MemberFilterAction(fMemberFilterActionGroup, title,
+            new ModelElementFilter(IModelElement.METHOD), helpContext, true);
+    hideProcedures
+            .setDescription(ActionMessages.MemberFilterActionGroup_hide_functions_description);
+    hideProcedures.setToolTipText(ActionMessages.MemberFilterActionGroup_hide_functions_tooltip);
+    // TODO: add correct icon
+    DLTKPluginImages.setLocalImageDescriptors(hideProcedures, "filter_methods.gif"); //$NON-NLS-1$
+    actions.add(hideProcedures);
+
+    // namespaces
+
+    title = ActionMessages.MemberFilterActionGroup_hide_classes_label;
+    // TODO help support
+    helpContext = "";// IDLTKHelpContextIds.FILTER_PUBLIC_ACTION;
+    MemberFilterAction hideNamespaces = new MemberFilterAction(fMemberFilterActionGroup, title,
+            new ModelElementFilter(IModelElement.TYPE), helpContext, true);
+    hideNamespaces.setDescription(ActionMessages.MemberFilterActionGroup_hide_classes_description);
+    hideNamespaces.setToolTipText(ActionMessages.MemberFilterActionGroup_hide_classes_tooltip);
+    DLTKPluginImages.setLocalImageDescriptors(hideNamespaces, "filter_classes.gif"); //$NON-NLS-1$
+    actions.add(hideNamespaces);
+
+    // order corresponds to order in toolbar
+    MemberFilterAction[] fFilterActions = (MemberFilterAction[]) actions
+            .toArray(new MemberFilterAction[actions.size()]);
+
+    fMemberFilterActionGroup.setActions(fFilterActions);
+
+    fMemberFilterActionGroup.contributeToToolBar(toolBarManager);
+  }
+}

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

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

Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/handlers/ToggleClassVariablesHandler.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/handlers/ToggleClassVariablesHandler.java?rev=1157047&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/handlers/ToggleClassVariablesHandler.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/handlers/ToggleClassVariablesHandler.java Fri Aug 12 11:00:38 2011
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.uima.textmarker.ide.ui.handlers;
+
+import org.apache.uima.textmarker.ide.TextMarkerIdePlugin;
+import org.apache.uima.textmarker.ide.debug.TextMarkerDebugConstants;
+import org.eclipse.dltk.debug.ui.handlers.AbstractToggleClassVariableHandler;
+import org.eclipse.dltk.ui.PreferencesAdapter;
+import org.eclipse.jface.preference.IPreferenceStore;
+
+public class ToggleClassVariablesHandler extends AbstractToggleClassVariableHandler {
+
+  /*
+   * @see org.eclipse.dltk.debug.ui.handlers.AbstractToggleVariableHandler#getModelId()
+   */
+  @Override
+  protected String getModelId() {
+    return TextMarkerDebugConstants.DEBUG_MODEL_ID;
+  }
+
+  /*
+   * @see org.eclipse.dltk.debug.ui.handlers.AbstractToggleVariableHandler#getPreferenceStore()
+   */
+  @Override
+  protected IPreferenceStore getPreferenceStore() {
+    return new PreferencesAdapter(TextMarkerIdePlugin.getDefault().getPluginPreferences());
+  }
+}

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

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

Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/handlers/ToggleGlobalVariablesHandler.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/handlers/ToggleGlobalVariablesHandler.java?rev=1157047&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/handlers/ToggleGlobalVariablesHandler.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/handlers/ToggleGlobalVariablesHandler.java Fri Aug 12 11:00:38 2011
@@ -0,0 +1,44 @@
+/*
+ * 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.handlers;
+
+import org.apache.uima.textmarker.ide.TextMarkerIdePlugin;
+import org.apache.uima.textmarker.ide.debug.TextMarkerDebugConstants;
+import org.eclipse.dltk.debug.ui.handlers.AbstractToggleGlobalVariableHandler;
+import org.eclipse.dltk.ui.PreferencesAdapter;
+import org.eclipse.jface.preference.IPreferenceStore;
+
+public class ToggleGlobalVariablesHandler extends AbstractToggleGlobalVariableHandler {
+  /*
+   * @see org.eclipse.dltk.debug.ui.handlers.AbstractToggleVariableHandler#getModelId()
+   */
+  @Override
+  protected String getModelId() {
+    return TextMarkerDebugConstants.DEBUG_MODEL_ID;
+  }
+
+  /*
+   * @see org.eclipse.dltk.debug.ui.handlers.AbstractToggleVariableHandler#getPreferenceStore()
+   */
+  @Override
+  protected IPreferenceStore getPreferenceStore() {
+    return new PreferencesAdapter(TextMarkerIdePlugin.getDefault().getPluginPreferences());
+  }
+}

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

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

Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/handlers/ToggleLocalVariablesHandler.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/handlers/ToggleLocalVariablesHandler.java?rev=1157047&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/handlers/ToggleLocalVariablesHandler.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/handlers/ToggleLocalVariablesHandler.java Fri Aug 12 11:00:38 2011
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.uima.textmarker.ide.ui.handlers;
+
+import org.apache.uima.textmarker.ide.TextMarkerIdePlugin;
+import org.apache.uima.textmarker.ide.debug.TextMarkerDebugConstants;
+import org.eclipse.dltk.debug.ui.handlers.AbstractToggleLocalVariableHandler;
+import org.eclipse.dltk.ui.PreferencesAdapter;
+import org.eclipse.jface.preference.IPreferenceStore;
+
+public class ToggleLocalVariablesHandler extends AbstractToggleLocalVariableHandler {
+
+  /*
+   * @see org.eclipse.dltk.debug.ui.handlers.AbstractToggleVariableHandler#getModelId()
+   */
+  @Override
+  protected String getModelId() {
+    return TextMarkerDebugConstants.DEBUG_MODEL_ID;
+  }
+
+  /*
+   * @see org.eclipse.dltk.debug.ui.handlers.AbstractToggleVariableHandler#getPreferenceStore()
+   */
+  @Override
+  protected IPreferenceStore getPreferenceStore() {
+    return new PreferencesAdapter(TextMarkerIdePlugin.getDefault().getPluginPreferences());
+  }
+}

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

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

Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/hierarchy/TextMarkerHierarchyInformationControl.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/hierarchy/TextMarkerHierarchyInformationControl.java?rev=1157047&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/hierarchy/TextMarkerHierarchyInformationControl.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/hierarchy/TextMarkerHierarchyInformationControl.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.hierarchy;
+
+import org.apache.uima.textmarker.ide.TextMarkerIdePlugin;
+import org.eclipse.dltk.internal.ui.typehierarchy.HierarchyInformationControl;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.swt.widgets.Shell;
+
+public class TextMarkerHierarchyInformationControl extends HierarchyInformationControl {
+
+  public TextMarkerHierarchyInformationControl(Shell parent, int shellStyle, int treeStyle) {
+    super(parent, shellStyle, treeStyle);
+  }
+
+  @Override
+  protected IPreferenceStore getPreferenceStore() {
+    return TextMarkerIdePlugin.getDefault().getPreferenceStore();
+  }
+
+}

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

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

Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/infoviews/TextMarkerDocumentationView.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/infoviews/TextMarkerDocumentationView.java?rev=1157047&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/infoviews/TextMarkerDocumentationView.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/infoviews/TextMarkerDocumentationView.java Fri Aug 12 11:00:38 2011
@@ -0,0 +1,37 @@
+/*
+ * 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.infoviews;
+
+import org.apache.uima.textmarker.ide.TextMarkerIdePlugin;
+import org.apache.uima.textmarker.ide.core.TextMarkerNature;
+import org.eclipse.dltk.ui.infoviews.AbstractDocumentationView;
+import org.eclipse.jface.preference.IPreferenceStore;
+
+public class TextMarkerDocumentationView extends AbstractDocumentationView {
+  @Override
+  protected IPreferenceStore getPreferenceStore() {
+    return TextMarkerIdePlugin.getDefault().getPreferenceStore();
+  }
+
+  @Override
+  protected String getNature() {
+    return TextMarkerNature.NATURE_ID;
+  }
+}

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

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

Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/preferences/Messages.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/preferences/Messages.java?rev=1157047&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/preferences/Messages.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/preferences/Messages.java Fri Aug 12 11:00:38 2011
@@ -0,0 +1,35 @@
+/*
+ * 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.preferences;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+  private static final String BUNDLE_NAME = "org.apache.uima.textmarker.ide.ui.formatter.messages";
+
+  public static String TextMarkerFormatterPreferencePage_description;
+  static {
+    // init resource bundle
+    NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+  }
+
+  private Messages() {
+  }
+}

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

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

Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/preferences/PreviewFile.txt
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/preferences/PreviewFile.txt?rev=1157047&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/preferences/PreviewFile.txt (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/preferences/PreviewFile.txt Fri Aug 12 11:00:38 2011
@@ -0,0 +1,57 @@
+PACKAGE org.apache.uima;
+
+SCRIPT org.apache.uima.DashTree;
+SCRIPT org.apache.uima.DashTreeError;
+SCRIPT org.apache.uima.BuildTree;
+TYPESYSTEM org.apache.uima.TerminologyTypeSystem;
+
+Document{-> CALL(DashTree)};
+ 
+DECLARE link;
+entryContent curlyBracketsOpen inCurlyBrackets{-PARTOF(link) -> MARK(link,3)} curlyBracketsClose;
+
+Document{-> RETAINTYPE};
+
+// *** error handling ***
+Document{-> CALL(DashTreeError)};
+// *** end of error handling ***
+
+// *** statistics ***
+INT count;
+Document{TOTALCOUNT(error,1,1000000,count)
+    -> LOG("Longmenu.txt: Es wurde(n) "+(count)+" Fehler gefunden!")};
+Document{TOTALCOUNT(rootRow,1,1000000,count)
+    -> LOG("Longmenu.txt: Es wurde(n) "+(count)+" Wurzel-Elemente gefunden.")};
+Document{TOTALCOUNT(childRow,1,1000000,count)
+    -> LOG("Longmenu.txt: Es wurde(n) "+(count)+" Kind-Elemente gefunden.")};
+// *** end of statistics ***
+
+INT id;
+
+ACTION IncID = (ASSIGN(id,id+1));
+
+
+BLOCK(ChildRows) childRow{} {
+    childRow[1,9]{-> ASSIGN(id,1+id),
+        CREATE(Term,
+        "Text" = entryContent,
+        "Info" = link,
+        "Id" = "A" + (id),
+        "TermType" = "answer")};
+}
+
+BLOCK(RootRow) rootRow{} {
+    rootRow{-> ASSIGN(id,1+id),
+        CREATE(Term,
+        "Text" = entryContent,
+        "Info" = link,
+        "Id" = "A" + (id),
+        "TermType" = "answer")};
+}
+
+Term{PARTOF(rootRow) -> TRANSFER(Root)};
+
+Term{PARTOF(rootRow) -> MARK(SubTree,1,2)} Term+{-PARTOF(rootRow)};
+Document{-> CALL(BuildTree.BuildDashTree)};
+
+

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

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

Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/preferences/TextMarkerBuildPathsBlock.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/preferences/TextMarkerBuildPathsBlock.java?rev=1157047&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/preferences/TextMarkerBuildPathsBlock.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/preferences/TextMarkerBuildPathsBlock.java Fri Aug 12 11:00:38 2011
@@ -0,0 +1,44 @@
+/*
+ * 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.preferences;
+
+import org.apache.uima.textmarker.ide.TextMarkerIdePlugin;
+import org.eclipse.dltk.ui.util.IStatusChangeListener;
+import org.eclipse.dltk.ui.wizards.BuildpathsBlock;
+import org.eclipse.jface.operation.IRunnableContext;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
+
+public class TextMarkerBuildPathsBlock extends BuildpathsBlock {
+  public TextMarkerBuildPathsBlock(IRunnableContext runnableContext, IStatusChangeListener context,
+          int pageToShow, boolean useNewPage, IWorkbenchPreferenceContainer pageContainer) {
+    super(runnableContext, context, pageToShow, useNewPage, pageContainer);
+  }
+
+  @Override
+  protected IPreferenceStore getPreferenceStore() {
+    return TextMarkerIdePlugin.getDefault().getPreferenceStore();
+  }
+
+  @Override
+  protected boolean supportZips() {
+    return true;
+  }
+}

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

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

Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/preferences/TextMarkerBuilderConfigurationBlock.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/preferences/TextMarkerBuilderConfigurationBlock.java?rev=1157047&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/preferences/TextMarkerBuilderConfigurationBlock.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/preferences/TextMarkerBuilderConfigurationBlock.java Fri Aug 12 11:00:38 2011
@@ -0,0 +1,104 @@
+/*
+ * 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.preferences;
+
+import java.util.ArrayList;
+
+import org.apache.uima.textmarker.ide.core.TextMarkerCorePreferences;
+import org.eclipse.dltk.ui.preferences.AbstractConfigurationBlock;
+import org.eclipse.dltk.ui.preferences.OverlayPreferenceStore;
+import org.eclipse.dltk.ui.preferences.OverlayPreferenceStore.OverlayKey;
+import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+
+
+public class TextMarkerBuilderConfigurationBlock extends AbstractConfigurationBlock {
+
+  public TextMarkerBuilderConfigurationBlock(PreferencePage mainPreferencePage,
+          OverlayPreferenceStore store, String nature) {
+    super(store, mainPreferencePage);
+    getPreferenceStore().addKeys(createOverlayStoreKeys());
+  }
+
+  private OverlayKey[] createOverlayStoreKeys() {
+    ArrayList keys = new ArrayList();
+    keys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN,
+            TextMarkerCorePreferences.BUILDER_IMPORT_BY_NAME));
+    keys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN,
+            TextMarkerCorePreferences.BUILDER_RESOLVE_IMPORTS));
+    keys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN,
+            TextMarkerCorePreferences.BUILDER_IGNORE_DUPLICATE_SHORTNAMES));
+    return (OverlayPreferenceStore.OverlayKey[]) keys
+            .toArray(new OverlayPreferenceStore.OverlayKey[keys.size()]);
+  }
+
+  /**
+   * Creates page for appearance preferences.
+   * 
+   * @param parent
+   *          the parent composite
+   * @return the control for the preference page
+   */
+  public Control createControl(Composite parent) {
+    initializeDialogUnits(parent);
+
+    Composite control = new Composite(parent, SWT.NONE);
+    control.setLayout(new GridLayout());
+
+    Composite composite = createSubsection(control, null, "Settings");
+    createSettingsGroup(composite);
+
+    return control;
+  }
+
+  private Control createSettingsGroup(Composite composite) {
+    GridLayout layout = new GridLayout();
+    layout.numColumns = 2;
+    composite.setLayout(layout);
+
+    Button button = addCheckBox(composite, TextMarkerPreferencesMessages.BuilderResolveImports,
+            TextMarkerCorePreferences.BUILDER_RESOLVE_IMPORTS, 0);
+    // button.setEnabled(false);
+    button = addCheckBox(composite, TextMarkerPreferencesMessages.BuilderImportByName,
+            TextMarkerCorePreferences.BUILDER_IMPORT_BY_NAME, 0);
+    button = addCheckBox(composite,
+            TextMarkerPreferencesMessages.BuilderIgnoreDuplicateShortnames,
+            TextMarkerCorePreferences.BUILDER_IGNORE_DUPLICATE_SHORTNAMES, 0);
+    // button.setEnabled(false);
+    return composite;
+  }
+
+  @Override
+  public void initialize() {
+
+    super.initialize();
+
+  }
+
+  @Override
+  public void performDefaults() {
+    super.performDefaults();
+
+  }
+}

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

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

Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/preferences/TextMarkerBuilderPreferencePage.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/preferences/TextMarkerBuilderPreferencePage.java?rev=1157047&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/preferences/TextMarkerBuilderPreferencePage.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/preferences/TextMarkerBuilderPreferencePage.java Fri Aug 12 11:00:38 2011
@@ -0,0 +1,71 @@
+/*
+ * 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.preferences;
+
+import org.apache.uima.textmarker.ide.TextMarkerIdePlugin;
+import org.apache.uima.textmarker.ide.core.TextMarkerNature;
+import org.eclipse.dltk.ui.preferences.AbstractConfigurationBlockPreferencePage;
+import org.eclipse.dltk.ui.preferences.IPreferenceConfigurationBlock;
+import org.eclipse.dltk.ui.preferences.OverlayPreferenceStore;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+
+public class TextMarkerBuilderPreferencePage extends AbstractConfigurationBlockPreferencePage {
+  @Override
+  protected String getHelpId() {
+
+    return null;
+  }
+
+  @Override
+  protected void setDescription() {
+    setDescription("Builder");
+  }
+
+  @Override
+  protected void setPreferenceStore() {
+    setPreferenceStore(TextMarkerIdePlugin.getDefault().getPreferenceStore());
+  }
+
+  @Override
+  protected Label createDescriptionLabel(Composite parent) {
+    return null;
+  }
+
+  @Override
+  protected IPreferenceConfigurationBlock createConfigurationBlock(
+          OverlayPreferenceStore overlayPreferenceStore) {
+    overlayPreferenceStore.addPropertyChangeListener(new IPropertyChangeListener() {
+
+      public void propertyChange(PropertyChangeEvent event) {
+        String property = event.getProperty();
+        Object newValue = event.getNewValue();
+        if (newValue instanceof Boolean) {
+          TextMarkerIdePlugin.getDefault().getPluginPreferences()
+                  .setValue(property, (Boolean) newValue);
+        }
+      }
+    });
+    return new TextMarkerBuilderConfigurationBlock(this, overlayPreferenceStore,
+            TextMarkerNature.NATURE_ID);
+  }
+}

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

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

Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/preferences/TextMarkerBuildpathPropertyPage.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/preferences/TextMarkerBuildpathPropertyPage.java?rev=1157047&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/preferences/TextMarkerBuildpathPropertyPage.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/preferences/TextMarkerBuildpathPropertyPage.java Fri Aug 12 11:00:38 2011
@@ -0,0 +1,39 @@
+/*
+ * 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.preferences;
+
+import org.eclipse.dltk.ui.preferences.BuildPathsPropertyPage;
+import org.eclipse.dltk.ui.util.BusyIndicatorRunnableContext;
+import org.eclipse.dltk.ui.wizards.BuildpathsBlock;
+import org.eclipse.ui.IWorkbenchPropertyPage;
+import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
+
+public class TextMarkerBuildpathPropertyPage extends BuildPathsPropertyPage implements
+        IWorkbenchPropertyPage {
+  public TextMarkerBuildpathPropertyPage() {
+  }
+
+  @Override
+  protected BuildpathsBlock createBuildPathBlock(IWorkbenchPreferenceContainer pageContainer) {
+    return new TextMarkerBuildPathsBlock(new BusyIndicatorRunnableContext(), this, getSettings()
+            .getInt(INDEX), false, pageContainer);
+  }
+
+}

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

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

Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/preferences/TextMarkerConsolePreferenceInitializer.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/preferences/TextMarkerConsolePreferenceInitializer.java?rev=1157047&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/preferences/TextMarkerConsolePreferenceInitializer.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/preferences/TextMarkerConsolePreferenceInitializer.java Fri Aug 12 11:00:38 2011
@@ -0,0 +1,41 @@
+/*
+ * 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.preferences;
+
+import org.apache.uima.textmarker.ide.TextMarkerIdePlugin;
+import org.apache.uima.textmarker.ide.ui.console.TextMarkerConsoleConstants;
+import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+import org.eclipse.jface.preference.IPreferenceStore;
+
+public class TextMarkerConsolePreferenceInitializer extends AbstractPreferenceInitializer {
+
+  public TextMarkerConsolePreferenceInitializer() {
+  }
+
+  @Override
+  public void initializeDefaultPreferences() {
+    IPreferenceStore store = TextMarkerIdePlugin.getDefault().getPreferenceStore();
+    store.setDefault(TextMarkerConsoleConstants.PREF_NEW_PROMPT,
+            TextMarkerConsoleConstants.DEFAULT_NEW_PROMPT);
+    store.setDefault(TextMarkerConsoleConstants.PREF_CONTINUE_PROMPT,
+            TextMarkerConsoleConstants.DEFAULT_CONTINUE_PROMPT);
+  }
+
+}

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

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

Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/preferences/TextMarkerConsolePreferences.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/preferences/TextMarkerConsolePreferences.java?rev=1157047&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/preferences/TextMarkerConsolePreferences.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/preferences/TextMarkerConsolePreferences.java Fri Aug 12 11:00:38 2011
@@ -0,0 +1,148 @@
+/*
+ * 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.preferences;
+
+import org.apache.uima.textmarker.ide.TextMarkerIdePlugin;
+import org.apache.uima.textmarker.ide.ui.console.TextMarkerConsoleConstants;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+public class TextMarkerConsolePreferences extends PreferencePage implements
+        IWorkbenchPreferencePage {
+
+  private Text newPrompt;
+
+  private Text appendPrompt;
+
+  @Override
+  protected IPreferenceStore doGetPreferenceStore() {
+    return TextMarkerIdePlugin.getDefault().getPreferenceStore();
+  }
+
+  protected void createPrompt(Composite parent, Object data) {
+    Font font = parent.getFont();
+
+    Group group = new Group(parent, SWT.NONE);
+    group.setLayoutData(data);
+    group.setFont(font);
+    group.setText("Prompt");
+
+    GridLayout layout = new GridLayout();
+    layout.numColumns = 2;
+    group.setLayout(layout);
+
+    // New command
+    Label newPromptLabel = new Label(group, SWT.NONE);
+    newPromptLabel.setFont(font);
+    newPromptLabel.setText("New command:");
+
+    newPrompt = new Text(group, SWT.BORDER);
+    newPrompt.addModifyListener(new ModifyListener() {
+      public void modifyText(ModifyEvent e) {
+        validateValues();
+      }
+    });
+    newPrompt.setLayoutData(new GridData(GridData.FILL, SWT.NONE, true, false));
+
+    // Append command
+    Label appendCommandLabel = new Label(group, SWT.NONE);
+    appendCommandLabel.setFont(font);
+    appendCommandLabel.setText("Append command:");
+
+    appendPrompt = new Text(group, SWT.BORDER);
+    appendPrompt.addModifyListener(new ModifyListener() {
+      public void modifyText(ModifyEvent e) {
+        validateValues();
+      }
+    });
+    appendPrompt.setLayoutData(new GridData(GridData.FILL, SWT.NONE, true, false));
+  }
+
+  @Override
+  protected Control createContents(Composite parent) {
+    Composite top = new Composite(parent, SWT.NONE);
+
+    GridLayout layout = new GridLayout();
+    layout.numColumns = 1;
+
+    top.setLayout(layout);
+
+    createPrompt(top, new GridData(GridData.FILL, SWT.NONE, true, false));
+
+    initializeValues();
+    validateValues();
+
+    return top;
+  }
+
+  protected void initializeValues() {
+    IPreferenceStore store = getPreferenceStore();
+
+    newPrompt.setText(store.getString(TextMarkerConsoleConstants.PREF_NEW_PROMPT));
+
+    appendPrompt.setText(store.getString(TextMarkerConsoleConstants.PREF_CONTINUE_PROMPT));
+  }
+
+  protected void validateValues() {
+    if ("".equals(newPrompt.getText())) {
+      setErrorMessage("Empty prompt");
+      setValid(false);
+    } else if ("".equals(appendPrompt.getText())) {
+      setErrorMessage("Empty prompt");
+      setValid(false);
+    } else {
+      setErrorMessage(null);
+      setValid(true);
+    }
+  }
+
+  public void init(IWorkbench workbench) {
+
+  }
+
+  @Override
+  protected void performDefaults() {
+    newPrompt.setText("=>");
+    appendPrompt.setText("->");
+  }
+
+  @Override
+  public boolean performOk() {
+    IPreferenceStore store = getPreferenceStore();
+
+    store.setValue(TextMarkerConsoleConstants.PREF_NEW_PROMPT, newPrompt.getText());
+    store.setValue(TextMarkerConsoleConstants.PREF_CONTINUE_PROMPT, appendPrompt.getText());
+
+    return true;
+  }
+}

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

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

Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/preferences/TextMarkerContentAssistConfigurationBlock.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/preferences/TextMarkerContentAssistConfigurationBlock.java?rev=1157047&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/preferences/TextMarkerContentAssistConfigurationBlock.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/preferences/TextMarkerContentAssistConfigurationBlock.java Fri Aug 12 11:00:38 2011
@@ -0,0 +1,71 @@
+/*
+ * 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.preferences;
+
+import java.util.ArrayList;
+
+import org.eclipse.dltk.ui.PreferenceConstants;
+import org.eclipse.dltk.ui.preferences.CodeAssistConfigurationBlock;
+import org.eclipse.dltk.ui.preferences.OverlayPreferenceStore;
+import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+
+public class TextMarkerContentAssistConfigurationBlock extends CodeAssistConfigurationBlock {
+  public TextMarkerContentAssistConfigurationBlock(PreferencePage mainPreferencePage,
+          OverlayPreferenceStore store) {
+    super(mainPreferencePage, store);
+  }
+
+  @Override
+  protected void getOverlayKeys(ArrayList overlayKeys) {
+    super.getOverlayKeys(overlayKeys);
+
+    // overlayKeys.add(new OverlayPreferenceStore.OverlayKey(
+    // OverlayPreferenceStore.BOOLEAN,
+    // TextMarkerPreferenceConstants.CODEASSIST_FILTER_INTERNAL_API));
+    //
+    overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING,
+            PreferenceConstants.CODEASSIST_AUTOACTIVATION_TRIGGERS));
+  }
+
+  // protected void addAutoActivationSection(Composite composite) {
+  // super.addAutoActivationSection(composite);
+  // String label = "Auto activation triggers for &TM:";
+  // addLabelledTextField(composite, label,
+  // PreferenceConstants.CODEASSIST_AUTOACTIVATION_TRIGGERS, 4, 2,
+  // false);
+  // }
+
+  @Override
+  public Control createControl(Composite parent) {
+    Composite control = (Composite) super.createControl(parent);
+
+    GridLayout layout = new GridLayout();
+    layout.numColumns = 2;
+
+    Composite composite = createSubsection(control, null, "Filtering");
+    composite.setLayout(layout);
+
+    return control;
+  }
+
+}

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

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

Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/preferences/TextMarkerEditorAssistancePreferencePage.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/preferences/TextMarkerEditorAssistancePreferencePage.java?rev=1157047&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/preferences/TextMarkerEditorAssistancePreferencePage.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/preferences/TextMarkerEditorAssistancePreferencePage.java Fri Aug 12 11:00:38 2011
@@ -0,0 +1,74 @@
+/*
+ * 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.preferences;
+
+import org.apache.uima.textmarker.ide.TextMarkerIdePlugin;
+import org.eclipse.dltk.ui.preferences.AbstractConfigurationBlockPreferencePage;
+import org.eclipse.dltk.ui.preferences.IPreferenceConfigurationBlock;
+import org.eclipse.dltk.ui.preferences.OverlayPreferenceStore;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+
+public class TextMarkerEditorAssistancePreferencePage extends
+        AbstractConfigurationBlockPreferencePage {
+
+  /*
+   * @see org.eclipse.ui.internal.editors.text.AbstractConfigureationBlockPreferencePage#getHelpId()
+   */
+  @Override
+  protected String getHelpId() {
+
+    return null;
+  }
+
+  /*
+   * @see
+   * org.eclipse.ui.internal.editors.text.AbstractConfigurationBlockPreferencePage#setDescription()
+   */
+  @Override
+  protected void setDescription() {
+    String description = "&Code Assistance";
+    setDescription(description);
+  }
+
+  /*
+   * @seeorg.org.eclipse.ui.internal.editors.text.AbstractConfigurationBlockPreferencePage#
+   * setPreferenceStore()
+   */
+  @Override
+  protected void setPreferenceStore() {
+    setPreferenceStore(TextMarkerIdePlugin.getDefault().getPreferenceStore());
+  }
+
+  @Override
+  protected Label createDescriptionLabel(Composite parent) {
+    return null; // no description for new look.
+  }
+
+  /*
+   * @seeorg.eclipse.ui.internal.editors.text.AbstractConfigureationBlockPreferencePage#
+   * createConfigurationBlock(org.eclipse.ui.internal.editors.text.OverlayPreferenceStore)
+   */
+  @Override
+  protected IPreferenceConfigurationBlock createConfigurationBlock(
+          OverlayPreferenceStore overlayPreferenceStore) {
+    return new TextMarkerContentAssistConfigurationBlock(this, overlayPreferenceStore);
+  }
+}

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

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

Added: uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/preferences/TextMarkerEditorColoringConfigurationBlock.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/preferences/TextMarkerEditorColoringConfigurationBlock.java?rev=1157047&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/preferences/TextMarkerEditorColoringConfigurationBlock.java (added)
+++ uima/sandbox/trunk/TextMarker/uimaj-ep-textmarker-ide/src/main/java/org/apache/uima/textmarker/ide/ui/preferences/TextMarkerEditorColoringConfigurationBlock.java Fri Aug 12 11:00:38 2011
@@ -0,0 +1,128 @@
+/*
+ * 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.preferences;
+
+import java.io.InputStream;
+
+import org.apache.uima.textmarker.ide.TextMarkerIdePlugin;
+import org.apache.uima.textmarker.ide.ui.TextMarkerPartitions;
+import org.apache.uima.textmarker.ide.ui.TextMarkerPreferenceConstants;
+import org.apache.uima.textmarker.ide.ui.editor.TextMarkerDocumentSetupParticipant;
+import org.apache.uima.textmarker.ide.ui.text.SimpleTextMarkerSourceViewerConfiguration;
+import org.eclipse.dltk.internal.ui.editor.ScriptSourceViewer;
+import org.eclipse.dltk.ui.preferences.AbstractScriptEditorColoringConfigurationBlock;
+import org.eclipse.dltk.ui.preferences.IPreferenceConfigurationBlock;
+import org.eclipse.dltk.ui.preferences.OverlayPreferenceStore;
+import org.eclipse.dltk.ui.preferences.PreferencesMessages;
+import org.eclipse.dltk.ui.text.IColorManager;
+import org.eclipse.dltk.ui.text.ScriptSourceViewerConfiguration;
+import org.eclipse.dltk.ui.text.ScriptTextTools;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.source.IOverviewRuler;
+import org.eclipse.jface.text.source.IVerticalRuler;
+import org.eclipse.jface.text.source.projection.ProjectionViewer;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.texteditor.ITextEditor;
+
+public class TextMarkerEditorColoringConfigurationBlock extends
+        AbstractScriptEditorColoringConfigurationBlock implements IPreferenceConfigurationBlock {
+
+  private static final String PREVIEW_FILE_NAME = "PreviewFile.txt";
+
+  private static final String[][] fSyntaxColorListModel = new String[][] {
+      { PreferencesMessages.DLTKEditorPreferencePage_singleLineComment,
+          TextMarkerPreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_COLOR, sCommentsCategory },
+      { PreferencesMessages.DLTKEditorPreferencePage_CommentTaskTags,
+          TextMarkerPreferenceConstants.COMMENT_TASK_TAGS, sCommentsCategory },
+      { PreferencesMessages.DLTKEditorPreferencePage_strings,
+          TextMarkerPreferenceConstants.EDITOR_STRING_COLOR, sCoreCategory },
+
+      { PreferencesMessages.DLTKEditorPreferencePage_numbers,
+          TextMarkerPreferenceConstants.EDITOR_NUMBER_COLOR, sCoreCategory },
+      { TextMarkerPreferencesMessages.TextMarkerEditorPreferencePage_condition_colors,
+          TextMarkerPreferenceConstants.EDITOR_CONDITION_COLOR, sCoreCategory },
+
+      { TextMarkerPreferencesMessages.TextMarkerEditorPreferencePage_action_colors,
+          TextMarkerPreferenceConstants.EDITOR_ACTION_COLOR, sCoreCategory },
+
+      { TextMarkerPreferencesMessages.TextMarkerEditorPreferencePage_declaration_colors,
+          TextMarkerPreferenceConstants.EDITOR_DECLARATION_DEFINITION_COLOR, sCoreCategory },
+
+      { TextMarkerPreferencesMessages.TextMarkerEditorPreferencePage_basicsymbols_colors,
+          TextMarkerPreferenceConstants.EDITOR_BASICSYMBOL_DEFINITION_COLOR, sCoreCategory },
+
+      { TextMarkerPreferencesMessages.TextMarkerEditorPreferencePage_function_colors,
+          TextMarkerPreferenceConstants.EDITOR_FUNCTION_COLOR, sCoreCategory },
+
+      { TextMarkerPreferencesMessages.TextMarkerEditorPreferencePage_then_colors,
+          TextMarkerPreferenceConstants.EDITOR_THEN_COLOR, sCoreCategory },
+
+      { TextMarkerPreferencesMessages.TodoTaskDescription,// .
+          // DLTKEditorPreferencePage_CommentTaskTags
+          // ,
+          TextMarkerPreferenceConstants.COMMENT_TASK_TAGS, sCommentsCategory }
+  /*
+   * { PreferencesMessages.DLTKEditorPreferencePage_variables,
+   * TextMarkerPreferenceConstants.EDITOR_VARIABLE_COLOR, sCoreCategory }
+   */};
+
+  public TextMarkerEditorColoringConfigurationBlock(OverlayPreferenceStore store) {
+    super(store);
+  }
+
+  @Override
+  protected String[][] getSyntaxColorListModel() {
+    return fSyntaxColorListModel;
+  }
+
+  @Override
+  protected ProjectionViewer createPreviewViewer(Composite parent, IVerticalRuler verticalRuler,
+          IOverviewRuler overviewRuler, boolean showAnnotationsOverview, int styles,
+          IPreferenceStore store) {
+    return new ScriptSourceViewer(parent, verticalRuler, overviewRuler, showAnnotationsOverview,
+            styles, store);
+  }
+
+  @Override
+  protected ScriptSourceViewerConfiguration createSimpleSourceViewerConfiguration(
+          IColorManager colorManager, IPreferenceStore preferenceStore, ITextEditor editor,
+          boolean configureFormatter) {
+    return new SimpleTextMarkerSourceViewerConfiguration(colorManager, preferenceStore, editor,
+            TextMarkerPartitions.TM_PARTITIONING, configureFormatter);
+  }
+
+  @Override
+  protected void setDocumentPartitioning(IDocument document) {
+    TextMarkerDocumentSetupParticipant participant = new TextMarkerDocumentSetupParticipant();
+    participant.setup(document);
+  }
+
+  @Override
+  protected InputStream getPreviewContentReader() {
+    return getClass().getResourceAsStream(PREVIEW_FILE_NAME);
+  }
+
+  @Override
+  protected ScriptTextTools getTextTools() {
+    return TextMarkerIdePlugin.getDefault().getTextTools();
+  }
+
+}

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

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