You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by pk...@apache.org on 2013/11/28 15:43:48 UTC
svn commit: r1546378 - in /uima/ruta/trunk/ruta-ep-caseditor: ./ icons/
src/main/java/org/apache/uima/ruta/caseditor/view/browser/
src/main/java/org/apache/uima/ruta/caseditor/view/tree/
src/main/java/org/apache/uima/ruta/caseditor/view/tree/handler/
Author: pkluegl
Date: Thu Nov 28 14:43:48 2013
New Revision: 1546378
URL: http://svn.apache.org/r1546378
Log:
UIMA-3469
- applied patch
- added icons
- added license headers
Added:
uima/ruta/trunk/ruta-ep-caseditor/icons/lightbulb_add.png (with props)
uima/ruta/trunk/ruta-ep-caseditor/icons/lightbulb_off.png (with props)
uima/ruta/trunk/ruta-ep-caseditor/src/main/java/org/apache/uima/ruta/caseditor/view/tree/handler/
uima/ruta/trunk/ruta-ep-caseditor/src/main/java/org/apache/uima/ruta/caseditor/view/tree/handler/CheckAll.java (with props)
uima/ruta/trunk/ruta-ep-caseditor/src/main/java/org/apache/uima/ruta/caseditor/view/tree/handler/UncheckAll.java (with props)
Modified:
uima/ruta/trunk/ruta-ep-caseditor/plugin.xml
uima/ruta/trunk/ruta-ep-caseditor/src/main/java/org/apache/uima/ruta/caseditor/view/browser/AnnotationBrowserView.java
uima/ruta/trunk/ruta-ep-caseditor/src/main/java/org/apache/uima/ruta/caseditor/view/tree/AnnotationTreeViewPage.java
uima/ruta/trunk/ruta-ep-caseditor/src/main/java/org/apache/uima/ruta/caseditor/view/tree/ToolTipListener.java
Added: uima/ruta/trunk/ruta-ep-caseditor/icons/lightbulb_add.png
URL: http://svn.apache.org/viewvc/uima/ruta/trunk/ruta-ep-caseditor/icons/lightbulb_add.png?rev=1546378&view=auto
==============================================================================
Binary file - no diff available.
Propchange: uima/ruta/trunk/ruta-ep-caseditor/icons/lightbulb_add.png
------------------------------------------------------------------------------
svn:mime-type = image/png
Added: uima/ruta/trunk/ruta-ep-caseditor/icons/lightbulb_off.png
URL: http://svn.apache.org/viewvc/uima/ruta/trunk/ruta-ep-caseditor/icons/lightbulb_off.png?rev=1546378&view=auto
==============================================================================
Binary file - no diff available.
Propchange: uima/ruta/trunk/ruta-ep-caseditor/icons/lightbulb_off.png
------------------------------------------------------------------------------
svn:mime-type = image/png
Modified: uima/ruta/trunk/ruta-ep-caseditor/plugin.xml
URL: http://svn.apache.org/viewvc/uima/ruta/trunk/ruta-ep-caseditor/plugin.xml?rev=1546378&r1=1546377&r2=1546378&view=diff
==============================================================================
--- uima/ruta/trunk/ruta-ep-caseditor/plugin.xml (original)
+++ uima/ruta/trunk/ruta-ep-caseditor/plugin.xml Thu Nov 28 14:43:48 2013
@@ -71,5 +71,46 @@ under the License.
class="org.apache.uima.ruta.caseditor.view.preferences.CasEditorViewPreferenceInitializer">
</initializer>
</extension>
+ <extension
+ point="org.eclipse.ui.commands">
+ <command
+ description="Checks all types visible in the Annotation Browser to be highlighted in the CAS editor"
+ id="org.apache.uima.ruta.caseditor.view.tree.commands.checkAllTypesHighlighted"
+ name="Highlight All (visible) Types">
+ </command>
+ <command
+ description="Resets type highlighting. No type will be checked."
+ id="org.apache.uima.ruta.caseditor.view.tree.commands.clearTypeHighlighting"
+ name="Clear Type Highlighting">
+ </command>
+ </extension>
+ <extension
+ point="org.eclipse.ui.handlers">
+ <handler
+ class="org.apache.uima.ruta.caseditor.view.tree.handler.CheckAll"
+ commandId="org.apache.uima.ruta.caseditor.view.tree.commands.checkAllTypesHighlighted">
+ </handler>
+ <handler
+ class="org.apache.uima.ruta.caseditor.view.tree.handler.UncheckAll"
+ commandId="org.apache.uima.ruta.caseditor.view.tree.commands.clearTypeHighlighting">
+ </handler>
+ </extension>
+ <extension
+ point="org.eclipse.ui.menus">
+ <menuContribution
+ allPopups="false"
+ locationURI="toolbar:org.apache.uima.caseditor.browser">
+ <command
+ commandId="org.apache.uima.ruta.caseditor.view.tree.commands.checkAllTypesHighlighted"
+ icon="icons/lightbulb_add.png"
+ style="push">
+ </command>
+ <command
+ commandId="org.apache.uima.ruta.caseditor.view.tree.commands.clearTypeHighlighting"
+ icon="icons/lightbulb_off.png"
+ style="push">
+ </command>
+ </menuContribution>
+ </extension>
</plugin>
Modified: uima/ruta/trunk/ruta-ep-caseditor/src/main/java/org/apache/uima/ruta/caseditor/view/browser/AnnotationBrowserView.java
URL: http://svn.apache.org/viewvc/uima/ruta/trunk/ruta-ep-caseditor/src/main/java/org/apache/uima/ruta/caseditor/view/browser/AnnotationBrowserView.java?rev=1546378&r1=1546377&r2=1546378&view=diff
==============================================================================
--- uima/ruta/trunk/ruta-ep-caseditor/src/main/java/org/apache/uima/ruta/caseditor/view/browser/AnnotationBrowserView.java (original)
+++ uima/ruta/trunk/ruta-ep-caseditor/src/main/java/org/apache/uima/ruta/caseditor/view/browser/AnnotationBrowserView.java Thu Nov 28 14:43:48 2013
@@ -28,6 +28,8 @@ import org.eclipse.ui.part.IPageBookView
public class AnnotationBrowserView extends CasEditorView {
public static final String ID = "org.apache.uima.caseditor.browser";
+ private AnnotationTreeViewPage page;
+
public AnnotationBrowserView() {
super("The instance view is currently not available.");
}
@@ -36,10 +38,16 @@ public class AnnotationBrowserView exten
protected IPageBookViewPage doCreatePage(ICasEditor editor) {
IPageBookViewPage result = null;
if (editor.getDocument() != null && editor instanceof AnnotationEditor) {
- AnnotationTreeViewPage page = new AnnotationTreeViewPage(false, (AnnotationEditor) editor);
+ page = new AnnotationTreeViewPage(false, (AnnotationEditor) editor);
+ initPage(page);
+ page.createControl(getPageBook());
result = page;
}
return result;
}
+ public AnnotationTreeViewPage getAnnotationTreeViewPage() {
+ return page;
+ }
+
}
Modified: uima/ruta/trunk/ruta-ep-caseditor/src/main/java/org/apache/uima/ruta/caseditor/view/tree/AnnotationTreeViewPage.java
URL: http://svn.apache.org/viewvc/uima/ruta/trunk/ruta-ep-caseditor/src/main/java/org/apache/uima/ruta/caseditor/view/tree/AnnotationTreeViewPage.java?rev=1546378&r1=1546377&r2=1546378&view=diff
==============================================================================
--- uima/ruta/trunk/ruta-ep-caseditor/src/main/java/org/apache/uima/ruta/caseditor/view/tree/AnnotationTreeViewPage.java (original)
+++ uima/ruta/trunk/ruta-ep-caseditor/src/main/java/org/apache/uima/ruta/caseditor/view/tree/AnnotationTreeViewPage.java Thu Nov 28 14:43:48 2013
@@ -23,12 +23,14 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.commons.lang3.StringUtils;
import org.apache.uima.cas.Type;
+import org.apache.uima.cas.TypeSystem;
import org.apache.uima.cas.text.AnnotationFS;
import org.apache.uima.cas.text.AnnotationIndex;
import org.apache.uima.caseditor.editor.AnnotationEditor;
@@ -49,13 +51,17 @@ import org.eclipse.jface.viewers.ISelect
import org.eclipse.jface.viewers.ITreeSelection;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.dnd.Clipboard;
import org.eclipse.swt.dnd.DND;
import org.eclipse.swt.dnd.TextTransfer;
import org.eclipse.swt.dnd.Transfer;
import org.eclipse.swt.events.KeyAdapter;
import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.MouseListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Image;
@@ -65,6 +71,7 @@ import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
@@ -87,7 +94,7 @@ public class AnnotationTreeViewPage exte
String annotation = annotationStyle.getAnnotation();
updateIcon(annotation);
}
- if(!treeView.isBusy()) {
+ if (!treeView.isBusy()) {
treeView.refresh();
}
}
@@ -141,6 +148,9 @@ public class AnnotationTreeViewPage exte
@Override
public void createControl(Composite parent) {
this.overlay = new Composite(parent, SWT.NONE);
+
+ final Clipboard clipboard = new Clipboard(Display.getCurrent());
+
GridLayout layout = new GridLayout();
layout.horizontalSpacing = 0;
layout.verticalSpacing = 0;
@@ -148,6 +158,22 @@ public class AnnotationTreeViewPage exte
layout.marginHeight = 0;
overlay.setLayout(layout);
+ KeyListener checkSelectedKeyListener = new KeyListener() {
+
+ public void keyReleased(KeyEvent arg0) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void keyPressed(KeyEvent keyEvent) {
+ int keyCode = keyEvent.keyCode;
+ if (keyCode == SWT.CR) {
+ uncheckAll();
+ checkAllVisible();
+ }
+ }
+ };
+
filterTypeTextField = new Text(overlay, SWT.SINGLE | SWT.BORDER);
GridData gd = new GridData();
gd.grabExcessHorizontalSpace = true;
@@ -159,7 +185,8 @@ public class AnnotationTreeViewPage exte
filterTypeTextField.addListener(SWT.MouseUp, this);
filterTypeTextField.addListener(SWT.Modify, this);
// TODO only for 3.3 see pom
- filterTypeTextField.setMessage("Only types with...");
+ filterTypeTextField.setMessage("Only types with...");
+ filterTypeTextField.addKeyListener(checkSelectedKeyListener);
filterCoveredTextTextField = new Text(overlay, SWT.SINGLE | SWT.BORDER);
GridData gd2 = new GridData();
@@ -173,6 +200,7 @@ public class AnnotationTreeViewPage exte
filterCoveredTextTextField.addListener(SWT.Modify, this);
// TODO only for 3.3 see pom
filterCoveredTextTextField.setMessage("Only annotations with...");
+ filterCoveredTextTextField.addKeyListener(checkSelectedKeyListener);
treeView = new CheckboxTreeViewer(overlay, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
gd = new GridData(GridData.FILL_BOTH);
@@ -202,10 +230,24 @@ public class AnnotationTreeViewPage exte
@Override
public void keyPressed(KeyEvent e) {
int keyCode = e.keyCode;
- // backspace or delete
+ // backspace or delete: delete annotations
if (keyCode == SWT.BS || keyCode == SWT.DEL) {
deleteSelectedAnnotations();
}
+ // ctrl and c: copy type name to clipboard
+ if ((e.stateMask & SWT.CTRL) == SWT.CTRL && keyCode == 'c') {
+ TreeItem[] selection = treeView.getTree().getSelection();
+ if (selection != null && selection.length == 1) {
+ Object obj = selection[0].getData();
+ if (obj instanceof TypeTreeNode) {
+ TypeTreeNode typeTreeNode = (TypeTreeNode) obj;
+ Type type = typeTreeNode.getType();
+ TextTransfer textTransfer = TextTransfer.getInstance();
+ clipboard.setContents(new Object[] { type.getName() },
+ new Transfer[] { textTransfer });
+ }
+ }
+ }
}
});
@@ -220,10 +262,47 @@ public class AnnotationTreeViewPage exte
editor.addAnnotationListener(this);
if (!useSelection) {
reloadTree();
+
+ // TODO auto-check all
+ // if (RutaCasEditorPlugin.getDefault().getPreferenceStore().getBoolean("AlwaysCheckAll")) {
+ // checkAll();
+ // }
+
}
}
+ /**
+ * Unchecks all types of the typesystem so that they are not highlighted anymore.
+ */
+ public void uncheckAll() {
+ TypeSystem ts = editor.getDocument().getCAS().getTypeSystem();
+ Iterator<Type> typeIterator = ts.getTypeIterator();
+ while (typeIterator.hasNext()) {
+ Type type = (Type) typeIterator.next();
+ editor.setShownAnnotationType(type, false);
+ }
+ getTreeViewer().getTree().deselectAll();
+ }
+
+ /**
+ * Checks all visible types of the tree to be highlighted.
+ */
+ public void checkAllVisible() {
+ TypeSystem ts = editor.getDocument().getCAS().getTypeSystem();
+ Type documentAnnotationType = ts.getType("uima.tcas.DocumentAnnotation");
+ for (TreeItem i : getTreeViewer().getTree().getItems()) {
+ Object e = i.getData();
+ if (e instanceof TypeTreeNode) {
+ TypeTreeNode typeTreeNode = (TypeTreeNode) e;
+ Type type = typeTreeNode.getType();
+ if (!documentAnnotationType.equals(type)) {
+ editor.setShownAnnotationType(type, true);
+ }
+ }
+ }
+ }
+
/*
* (non-Javadoc)
*
@@ -471,15 +550,18 @@ public class AnnotationTreeViewPage exte
public IRootTreeNode getTypeOrderedTree(int pos, String manualTypeFilter, String manualTextFilter) {
TypeOrderedRootTreeNode root = new TypeOrderedRootTreeNode();
IPreferenceStore preferenceStore = RutaCasEditorPlugin.getDefault().getPreferenceStore();
- boolean withParents = preferenceStore.getBoolean(CasEditorViewsPreferenceConstants.SHOW_PARENT_TYPES);
+ boolean withParents = preferenceStore
+ .getBoolean(CasEditorViewsPreferenceConstants.SHOW_PARENT_TYPES);
AnnotationIndex<AnnotationFS> annotationIndex = document.getCAS().getAnnotationIndex();
for (AnnotationFS annotationFS : annotationIndex) {
boolean offsetConstraint = pos == -1
|| (annotationFS.getBegin() <= pos && annotationFS.getEnd() >= pos);
boolean typeConstraint = StringUtils.isEmpty(manualTypeFilter)
- || annotationFS.getType().getName().toLowerCase().indexOf(manualTypeFilter.toLowerCase()) != -1;
+ || annotationFS.getType().getName().toLowerCase()
+ .indexOf(manualTypeFilter.toLowerCase()) != -1;
boolean textConstraint = StringUtils.isEmpty(manualTextFilter)
- || annotationFS.getCoveredText().toLowerCase().indexOf(manualTextFilter.toLowerCase()) != -1;
+ || annotationFS.getCoveredText().toLowerCase()
+ .indexOf(manualTextFilter.toLowerCase()) != -1;
if (offsetConstraint && typeConstraint && textConstraint) {
root.insertFS(annotationFS, withParents);
}
Modified: uima/ruta/trunk/ruta-ep-caseditor/src/main/java/org/apache/uima/ruta/caseditor/view/tree/ToolTipListener.java
URL: http://svn.apache.org/viewvc/uima/ruta/trunk/ruta-ep-caseditor/src/main/java/org/apache/uima/ruta/caseditor/view/tree/ToolTipListener.java?rev=1546378&r1=1546377&r2=1546378&view=diff
==============================================================================
--- uima/ruta/trunk/ruta-ep-caseditor/src/main/java/org/apache/uima/ruta/caseditor/view/tree/ToolTipListener.java (original)
+++ uima/ruta/trunk/ruta-ep-caseditor/src/main/java/org/apache/uima/ruta/caseditor/view/tree/ToolTipListener.java Thu Nov 28 14:43:48 2013
@@ -72,38 +72,44 @@ public class ToolTipListener implements
String text = "";
if (item.getData() instanceof FSFeatureTreeNode) {
FSFeatureTreeNode node = (FSFeatureTreeNode) item.getData();
- text = "Type: "+ node.getType();
+ text = "Type: " + node.getType();
} else if (item.getData() instanceof AnnotationTreeNode) {
AnnotationFS annot = ((AnnotationTreeNode) item.getData()).getAnnotation();
text = TOOLTIP_TEXT_BEGIN + annot.getBegin() + TOOLTIP_TEXT_END + annot.getEnd();
} else if (item.getData() instanceof PrimitiveFeatureTreeNode) {
PrimitiveFeatureTreeNode node = (PrimitiveFeatureTreeNode) item.getData();
- text = "Type: "+ node.getType();
- }
- if (tip != null && !tip.isDisposed())
- tip.dispose();
-
- tip = new Shell(Display.getCurrent().getActiveShell(), SWT.ON_TOP | SWT.NO_FOCUS
- | SWT.TOOL);
-
- tip.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
- FillLayout layout = new FillLayout();
- layout.marginWidth = 2;
- tip.setLayout(layout);
-
- label = new Label(tip, SWT.NONE);
- label.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_INFO_FOREGROUND));
- label.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
-
- label.setText(text);
-
- Point size = tip.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- Rectangle rect = item.getBounds(0);
- Point pt = tree.toDisplay(rect.x, rect.y);
- tip.setBounds(pt.x, pt.y, size.x, size.y);
- tip.setVisible(true);
+ text = "Type: " + node.getType();
+ } else if (item.getData() instanceof TypeTreeNode) {
+ TypeTreeNode ttn = (TypeTreeNode) item.getData();
+ text = "Type: " + ttn.getName();
+ // TODO would be nice to show the description of the type, too
+ // however, that seems to require the TypeDescription object
+ // Type type = ttn.getType();
}
+ if (tip != null && !tip.isDisposed())
+ tip.dispose();
+
+ tip = new Shell(Display.getCurrent().getActiveShell(), SWT.ON_TOP | SWT.NO_FOCUS
+ | SWT.TOOL);
+
+ tip.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
+ FillLayout layout = new FillLayout();
+ layout.marginWidth = 2;
+ tip.setLayout(layout);
+
+ label = new Label(tip, SWT.NONE);
+ label.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_INFO_FOREGROUND));
+ label.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
+
+ label.setText(text);
+
+ Point size = tip.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ Rectangle rect = item.getBounds(0);
+ Point pt = tree.toDisplay(rect.x, rect.y);
+ tip.setBounds(pt.x, pt.y, size.x, size.y);
+ tip.setVisible(true);
}
+ }
}
}
Added: uima/ruta/trunk/ruta-ep-caseditor/src/main/java/org/apache/uima/ruta/caseditor/view/tree/handler/CheckAll.java
URL: http://svn.apache.org/viewvc/uima/ruta/trunk/ruta-ep-caseditor/src/main/java/org/apache/uima/ruta/caseditor/view/tree/handler/CheckAll.java?rev=1546378&view=auto
==============================================================================
--- uima/ruta/trunk/ruta-ep-caseditor/src/main/java/org/apache/uima/ruta/caseditor/view/tree/handler/CheckAll.java (added)
+++ uima/ruta/trunk/ruta-ep-caseditor/src/main/java/org/apache/uima/ruta/caseditor/view/tree/handler/CheckAll.java Thu Nov 28 14:43:48 2013
@@ -0,0 +1,60 @@
+/*
+ * 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.ruta.caseditor.view.tree.handler;
+
+import org.apache.uima.ruta.caseditor.view.browser.AnnotationBrowserView;
+import org.apache.uima.ruta.caseditor.view.tree.AnnotationTreeViewPage;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.core.commands.IHandlerListener;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+public class CheckAll implements IHandler {
+
+ public void addHandlerListener(IHandlerListener arg0) {
+ }
+
+ public void dispose() {
+ }
+
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ AnnotationBrowserView annotationBrowserView = (AnnotationBrowserView) HandlerUtil
+ .getActivePart(event);
+ AnnotationTreeViewPage annotationTreeViewPage = annotationBrowserView
+ .getAnnotationTreeViewPage();
+ if (annotationTreeViewPage != null) {
+ annotationTreeViewPage.checkAllVisible();
+ }
+ return null;
+ }
+
+ public boolean isEnabled() {
+ return true;
+ }
+
+ public boolean isHandled() {
+ return true;
+ }
+
+ public void removeHandlerListener(IHandlerListener arg0) {
+ }
+
+}
Propchange: uima/ruta/trunk/ruta-ep-caseditor/src/main/java/org/apache/uima/ruta/caseditor/view/tree/handler/CheckAll.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: uima/ruta/trunk/ruta-ep-caseditor/src/main/java/org/apache/uima/ruta/caseditor/view/tree/handler/UncheckAll.java
URL: http://svn.apache.org/viewvc/uima/ruta/trunk/ruta-ep-caseditor/src/main/java/org/apache/uima/ruta/caseditor/view/tree/handler/UncheckAll.java?rev=1546378&view=auto
==============================================================================
--- uima/ruta/trunk/ruta-ep-caseditor/src/main/java/org/apache/uima/ruta/caseditor/view/tree/handler/UncheckAll.java (added)
+++ uima/ruta/trunk/ruta-ep-caseditor/src/main/java/org/apache/uima/ruta/caseditor/view/tree/handler/UncheckAll.java Thu Nov 28 14:43:48 2013
@@ -0,0 +1,60 @@
+/*
+ * 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.ruta.caseditor.view.tree.handler;
+
+import org.apache.uima.ruta.caseditor.view.browser.AnnotationBrowserView;
+import org.apache.uima.ruta.caseditor.view.tree.AnnotationTreeViewPage;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.core.commands.IHandlerListener;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+public class UncheckAll implements IHandler {
+
+ public void addHandlerListener(IHandlerListener arg0) {
+ }
+
+ public void dispose() {
+ }
+
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ AnnotationBrowserView annotationBrowserView = (AnnotationBrowserView) HandlerUtil
+ .getActivePart(event);
+ AnnotationTreeViewPage annotationTreeViewPage = annotationBrowserView
+ .getAnnotationTreeViewPage();
+ if (annotationTreeViewPage != null) {
+ annotationTreeViewPage.uncheckAll();
+ }
+ return null;
+ }
+
+ public boolean isEnabled() {
+ return true;
+ }
+
+ public boolean isHandled() {
+ return true;
+ }
+
+ public void removeHandlerListener(IHandlerListener arg0) {
+ }
+
+}
Propchange: uima/ruta/trunk/ruta-ep-caseditor/src/main/java/org/apache/uima/ruta/caseditor/view/tree/handler/UncheckAll.java
------------------------------------------------------------------------------
svn:eol-style = native