Added en empty search result page #11

Merged
merged 1 commit into from Feb 14, 2013

Conversation

Projects
None yet
2 participants
Contributor

mads-hartmann commented Feb 13, 2013

By using the proper Eclipse extension point I've hooked our own
custom search result page into the search results view. The view
doesn't do anything and only contains "fake" implementations of the
methods necessary to make the compiler happy.

When we're able to execute queries and actually produce proper
search results we can finish the implementations.

This fixes #4

@dotta dotta and 1 other commented on an outdated diff Feb 13, 2013

...a/tools/eclipse/search/ui/ScalaSearchResultPage.scala
+ /**
+ * This method is called whenever the set of matches for the given elements changes.
+ */
+ def elementsChanged(elements: Array[Object]): Unit = {}
+
+ /**
+ * Invoked if the results are to be shown in a table.
+ */
+ def configureTableViewer(table: TableViewer): Unit = {
+ // TODO: Set up a content provider for the table.
+ }
+
+ /**
+ * Invoked if the results are to be shown in a tree view
+ */
+ def configureTreeViewer(treww: TreeViewer): Unit = {
@dotta

dotta Feb 13, 2013

Owner

treww... typo?

@mads-hartmann

mads-hartmann Feb 13, 2013

Contributor

Lol, yeah

@dotta dotta and 1 other commented on an outdated diff Feb 13, 2013

...a/tools/eclipse/search/ui/ScalaSearchResultPage.scala
+
+ /**
+ * Invoked if the results are to be shown in a table.
+ */
+ def configureTableViewer(table: TableViewer): Unit = {
+ // TODO: Set up a content provider for the table.
+ }
+
+ /**
+ * Invoked if the results are to be shown in a tree view
+ */
+ def configureTreeViewer(treww: TreeViewer): Unit = {
+ // TODO: Set up a content provider for the tree view.
+ }
+
+}
@dotta

dotta Feb 13, 2013

Owner

I wonder why you don't use ??? for the implementation of methods in this class, any reason? The good thing about ??? is that you get an exception, so you don't risk to forget implementing the needed logic ;-)

@mads-hartmann

mads-hartmann Feb 13, 2013

Contributor

True :) I used it in the other file mostly to satisfy the compiler but I see the value of getting an exception if someone tries to use this.

@dotta dotta and 1 other commented on an outdated diff Feb 13, 2013

...scala/tools/eclipse/search/ui/ScalaSearchResult.scala
@@ -0,0 +1,46 @@
+package org.scala.tools.eclipse.search.ui
+
+import org.eclipse.jface.resource.ImageDescriptor
+import org.eclipse.search.ui.ISearchQuery
+import org.eclipse.search.ui.text.AbstractTextSearchResult
+import org.eclipse.search.ui.text.IEditorMatchAdapter
+import org.eclipse.search.ui.text.IFileMatchAdapter
+
+/**
+ * Represents the result of executing a search query against Scala
+ * files.
+ */
+class ScalaSearchResult extends AbstractTextSearchResult {
@dotta

dotta Feb 13, 2013

Owner

I'm not a big fun of prepending Scala to class name. The reason is that you are fighting against the tools, i.e., whenever you need to find a class you first need to type 5 useless character (Scala :)). Why not taking the prefix away?

@mads-hartmann

mads-hartmann Feb 13, 2013

Contributor

You can have many different kinds of SearchResults so in JDT they use the prefix to differentiate between the various results, for example they have JavaSearchResult and GitSearchResult etc.

I don't really have any feeling about this, especially because we will most likely only have one kind of search result in our code-base :)

@dotta

dotta Feb 13, 2013

Owner

The other half is that the name "scala" is already in the package :) Up to you to decide which one you prefer

Contributor

mads-hartmann commented Feb 13, 2013

What is the preferred way push my new changes? Amend the commit and push with -f or a new commit to the branch?

Owner

dotta commented Feb 13, 2013

Create an additional commit and push it. I'll review and give you my +1. Then you can amend the commit and force push. Finally, I merge it :)

Contributor

mads-hartmann commented Feb 14, 2013

This is ready for review :)

@mads-hartmann mads-hartmann Added en empty search result page
By using the proper Eclipse extension point I've hooked our own
custom search result page into the search results view. The view
doesn't do anything and only contains "fake" implementations of the
methods necessary to make the compiler happy.

When we're able to execute queries and actually produce proper
search results we can finish the implementations.

This fixes #4
703bf87
Contributor

mads-hartmann commented Feb 14, 2013

Alright, this should be ready to get merged :)

dotta merged commit f7043ac into scala-ide:master Feb 14, 2013

mads-hartmann deleted the mads-hartmann:empty_search_result_panel branch Feb 15, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment