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/01 17:30:41 UTC

svn commit: r1152829 [2/2] - in /uima/sandbox/trunk/TextMarker/org.apache.uima.tm.textmarker.query: ./ META-INF/ bin/ icons/ 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/apa...

Added: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.textmarker.query/src/main/java/org/apache/uima/tm/textmarker/query/ui/QueryResult.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/org.apache.uima.tm.textmarker.query/src/main/java/org/apache/uima/tm/textmarker/query/ui/QueryResult.java?rev=1152829&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/org.apache.uima.tm.textmarker.query/src/main/java/org/apache/uima/tm/textmarker/query/ui/QueryResult.java (added)
+++ uima/sandbox/trunk/TextMarker/org.apache.uima.tm.textmarker.query/src/main/java/org/apache/uima/tm/textmarker/query/ui/QueryResult.java Mon Aug  1 15:30:34 2011
@@ -0,0 +1,33 @@
+package org.apache.uima.tm.textmarker.query.ui;
+
+import java.io.File;
+
+public class QueryResult {
+
+  private String text;
+
+  private File file;
+
+  public QueryResult(String text, File file) {
+    super();
+    this.setText(text);
+    this.setFile(file);
+  }
+
+  public void setFile(File file) {
+    this.file = file;
+  }
+
+  public File getFile() {
+    return file;
+  }
+
+  public void setText(String text) {
+    this.text = text;
+  }
+
+  public String getText() {
+    return text;
+  }
+
+}

Propchange: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.textmarker.query/src/main/java/org/apache/uima/tm/textmarker/query/ui/QueryResult.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.textmarker.query/src/main/java/org/apache/uima/tm/textmarker/query/ui/QueryResult.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.textmarker.query/src/main/java/org/apache/uima/tm/textmarker/query/ui/QueryResultContentProvider.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/org.apache.uima.tm.textmarker.query/src/main/java/org/apache/uima/tm/textmarker/query/ui/QueryResultContentProvider.java?rev=1152829&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/org.apache.uima.tm.textmarker.query/src/main/java/org/apache/uima/tm/textmarker/query/ui/QueryResultContentProvider.java (added)
+++ uima/sandbox/trunk/TextMarker/org.apache.uima.tm.textmarker.query/src/main/java/org/apache/uima/tm/textmarker/query/ui/QueryResultContentProvider.java Mon Aug  1 15:30:34 2011
@@ -0,0 +1,24 @@
+package org.apache.uima.tm.textmarker.query.ui;
+
+import java.util.ArrayList;
+
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+
+public class QueryResultContentProvider implements IStructuredContentProvider {
+
+  @Override
+  public void dispose() {
+
+  }
+
+  @Override
+  public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+
+  }
+
+  @Override
+  public Object[] getElements(Object inputElement) {
+    return ((ArrayList<?>) inputElement).toArray();
+  }
+}

Propchange: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.textmarker.query/src/main/java/org/apache/uima/tm/textmarker/query/ui/QueryResultContentProvider.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.textmarker.query/src/main/java/org/apache/uima/tm/textmarker/query/ui/QueryResultContentProvider.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.textmarker.query/src/main/java/org/apache/uima/tm/textmarker/query/ui/QueryResultLabelProvider.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/org.apache.uima.tm.textmarker.query/src/main/java/org/apache/uima/tm/textmarker/query/ui/QueryResultLabelProvider.java?rev=1152829&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/org.apache.uima.tm.textmarker.query/src/main/java/org/apache/uima/tm/textmarker/query/ui/QueryResultLabelProvider.java (added)
+++ uima/sandbox/trunk/TextMarker/org.apache.uima.tm.textmarker.query/src/main/java/org/apache/uima/tm/textmarker/query/ui/QueryResultLabelProvider.java Mon Aug  1 15:30:34 2011
@@ -0,0 +1,45 @@
+package org.apache.uima.tm.textmarker.query.ui;
+
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.swt.graphics.Image;
+
+public class QueryResultLabelProvider implements ILabelProvider {
+  @Override
+  public Image getImage(Object element) {
+    return null;
+  }
+
+  @Override
+  public String getText(Object element) {
+    if (element instanceof QueryResult) {
+      QueryResult qr = (QueryResult) element;
+      String text = qr.getText();
+      // if (text.length() > 100) {
+      // text = text.substring(0, 100) + "...";
+      // }
+      text += " (in " + qr.getFile().getName() + ")";
+      return text;
+    }
+    return "error";
+  }
+
+  @Override
+  public void addListener(ILabelProviderListener listener) {
+
+  }
+
+  @Override
+  public void dispose() {
+  }
+
+  @Override
+  public boolean isLabelProperty(Object element, String property) {
+    return false;
+  }
+
+  @Override
+  public void removeListener(ILabelProviderListener listener) {
+
+  }
+}

Propchange: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.textmarker.query/src/main/java/org/apache/uima/tm/textmarker/query/ui/QueryResultLabelProvider.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.textmarker.query/src/main/java/org/apache/uima/tm/textmarker/query/ui/QueryResultLabelProvider.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.textmarker.query/src/main/java/org/apache/uima/tm/textmarker/query/ui/QueryView.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/org.apache.uima.tm.textmarker.query/src/main/java/org/apache/uima/tm/textmarker/query/ui/QueryView.java?rev=1152829&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/org.apache.uima.tm.textmarker.query/src/main/java/org/apache/uima/tm/textmarker/query/ui/QueryView.java (added)
+++ uima/sandbox/trunk/TextMarker/org.apache.uima.tm.textmarker.query/src/main/java/org/apache/uima/tm/textmarker/query/ui/QueryView.java Mon Aug  1 15:30:34 2011
@@ -0,0 +1,54 @@
+package org.apache.uima.tm.textmarker.query.ui;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.IViewSite;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.part.ViewPart;
+
+public class QueryView extends ViewPart {
+
+  public static final String ID = "org.apache.uima.tm.textmarker.query.ui.QueryView";
+
+  private QueryComposite viewContent;
+
+  private IMemento memento;
+
+  public QueryView() {
+    super();
+  }
+
+  @Override
+  public void createPartControl(Composite parent) {
+    viewContent = new QueryComposite(parent, SWT.NULL);
+    if (memento != null) {
+      viewContent.restoreState(memento);
+      memento = null;
+    }
+  }
+
+  public void setViewTitle(String title) {
+    setPartName(title);
+  }
+
+  @Override
+  public void setFocus() {
+    viewContent.setFocus();
+  }
+
+  @Override
+  public void saveState(IMemento memento) {
+    viewContent.saveState(memento);
+  }
+
+  @Override
+  public void init(IViewSite site, IMemento memento) throws PartInitException {
+    this.memento = memento;
+    super.init(site, memento);
+  }
+
+  public QueryComposite getComposite() {
+    return viewContent;
+  }
+}

Propchange: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.textmarker.query/src/main/java/org/apache/uima/tm/textmarker/query/ui/QueryView.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.textmarker.query/src/main/java/org/apache/uima/tm/textmarker/query/ui/QueryView.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.textmarker.query/src/main/java/org/apache/uima/tm/textmarker/query/ui/ResultListDialog.java
URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/TextMarker/org.apache.uima.tm.textmarker.query/src/main/java/org/apache/uima/tm/textmarker/query/ui/ResultListDialog.java?rev=1152829&view=auto
==============================================================================
--- uima/sandbox/trunk/TextMarker/org.apache.uima.tm.textmarker.query/src/main/java/org/apache/uima/tm/textmarker/query/ui/ResultListDialog.java (added)
+++ uima/sandbox/trunk/TextMarker/org.apache.uima.tm.textmarker.query/src/main/java/org/apache/uima/tm/textmarker/query/ui/ResultListDialog.java Mon Aug  1 15:30:34 2011
@@ -0,0 +1,39 @@
+package org.apache.uima.tm.textmarker.query.ui;
+
+import org.eclipse.jface.window.ApplicationWindow;
+import org.eclipse.swt.SWT;
+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.Shell;
+import org.eclipse.swt.widgets.Text;
+
+public class ResultListDialog extends ApplicationWindow {
+
+  Composite overlay;
+
+  String data;
+
+  public ResultListDialog(Shell parentShell, String data) {
+    super(parentShell);
+    this.data = data;
+  }
+
+  protected Control createContents(Composite parent) {
+    GridLayout layout = new GridLayout();
+    parent.setLayout(layout);
+    parent.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+    Text text = new Text(parent, SWT.READ_ONLY | SWT.MULTI | SWT.BORDER | SWT.WRAP | SWT.V_SCROLL);
+    text.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WHITE));
+    text.setText("No data aviable");
+    text.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+    if (text != null) {
+      text.setText(data);
+    }
+    return parent;
+  }
+
+}

Propchange: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.textmarker.query/src/main/java/org/apache/uima/tm/textmarker/query/ui/ResultListDialog.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: uima/sandbox/trunk/TextMarker/org.apache.uima.tm.textmarker.query/src/main/java/org/apache/uima/tm/textmarker/query/ui/ResultListDialog.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain