[hg] main-silver: query provider as interface

  • From: Tomas Stupka < >
  • To:
  • Subject: [hg] main-silver: query provider as interface
  • Date: Thu, 10 Oct 2013 18:54:36 -0700

changeset f05d71032a26 in main-silver ((none))
details: http://hg.netbeans.org/main-silver/rev/f05d71032a26
description:
        query provider as interface

diffstat:

 bugtracking/src/org/netbeans/modules/bugtracking/spi/QueryProvider.java      
        |  38 +++------
 
bugtracking/src/org/netbeans/modules/bugtracking/team/spi/TeamQueryProvider.java
     |   4 +-
 
bugtracking/test/unit/src/org/netbeans/modules/bugtracking/TestQueryProvider.java
    |   2 +-
 
bugtracking/test/unit/src/org/netbeans/modules/bugtracking/api/APITestConnector.java
 |   2 +-
 bugzilla/src/org/netbeans/modules/bugzilla/BugzillaQueryProvider.java        
        |   2 +-
 jira/src/org/netbeans/modules/jira/JiraQueryProvider.java                    
        |   2 +-
 odcs.tasks/src/org/netbeans/modules/odcs/tasks/ODCSQueryProvider.java        
        |   2 +-
 7 files changed, 21 insertions(+), 31 deletions(-)

diffs (210 lines):

diff --git 
a/bugtracking/src/org/netbeans/modules/bugtracking/spi/QueryProvider.java 
b/bugtracking/src/org/netbeans/modules/bugtracking/spi/QueryProvider.java
--- a/bugtracking/src/org/netbeans/modules/bugtracking/spi/QueryProvider.java
+++ b/bugtracking/src/org/netbeans/modules/bugtracking/spi/QueryProvider.java
@@ -53,7 +53,7 @@
  * @param <Q> the implementation specific query type
  * @param <I> the implementation specific issue type
  */
-public abstract class QueryProvider<Q, I> {
+public interface QueryProvider<Q, I> {
 
     /**
      * queries issue list was changed
@@ -70,43 +70,33 @@
      */
     public final static String EVENT_QUERY_REMOVED = 
"bugtracking.query.removed";     // NOI18N
 
-    static {
-        SPIAccessorImpl.createAccesor();
-    }
-    
-    /**
-     * Creates a query
-     */
-    public QueryProvider() {
-    }
-
     /**
      * Returns the queries display name
      * @param q
      * @return
      */
-    public abstract String getDisplayName(Q q);
+    public String getDisplayName(Q q);
 
     /**
      * Returns the queries tooltip
      * @param q 
      * @return
      */
-    public abstract String getTooltip(Q q);
+    public String getTooltip(Q q);
 
     /**
      * Returns the {@link QueryController} for this query
      * @param q the implementation specific query type
      * @return
      */
-    public abstract QueryController getController(Q q);
+    public QueryController getController(Q q);
 
     /**
      * Returns true if query is saved
      * @param q the implementation specific query type
      * @return
      */
-    public abstract boolean isSaved(Q q);
+    public boolean isSaved(Q q);
 
     /**
      * Determines whether it is possible to remove the given Query.
@@ -114,21 +104,21 @@
      * @param q 
      * @return  
      */
-    public abstract boolean canRemove(Q q);
+    public boolean canRemove(Q q);
     
     /** 
      * Removes the given query.
      * 
      * @param q 
      */
-    public abstract void remove(Q q);
+    public void remove(Q q);
     
     /**
      * Determines whether it is possible to rename the given Query
      * @param q
      * @return 
      */
-    public abstract boolean canRename(Q q);
+    public boolean canRename(Q q);
     
     /**
      * Renames the given query.
@@ -136,9 +126,9 @@
      * @param q 
      * @param newName 
      */
-    public abstract void rename(Q q, String newName);
+    public void rename(Q q, String newName);
     
-    public abstract Collection<I> getIssues(Q q);
+    public Collection<I> getIssues(Q q);
 
     /**
      * Returns true if the issue does belong to the query
@@ -147,14 +137,14 @@
      * @return
      */
     // XXX used only by query table - get rid of this
-    public abstract boolean contains(Q q, String id);
+    public boolean contains(Q q, String id);
 
     /**
      * Refreshes the given query
      * 
      * @param query
      */
-    public abstract void refresh(Q query);
+    public void refresh(Q query);
     
     /*********
      * EVENTS
@@ -165,13 +155,13 @@
      * @param q
      * @param listener 
      */
-    public abstract void removePropertyChangeListener(Q q, 
PropertyChangeListener listener);
+    public void removePropertyChangeListener(Q q, PropertyChangeListener 
listener);
 
     /**
      * 
      * @param q
      * @param listener 
      */
-    public abstract void addPropertyChangeListener(Q q, 
PropertyChangeListener listener);
+    public void addPropertyChangeListener(Q q, PropertyChangeListener 
listener);
 
 }
diff --git 
a/bugtracking/src/org/netbeans/modules/bugtracking/team/spi/TeamQueryProvider.java
 
b/bugtracking/src/org/netbeans/modules/bugtracking/team/spi/TeamQueryProvider.java
--- 
a/bugtracking/src/org/netbeans/modules/bugtracking/team/spi/TeamQueryProvider.java
+++ 
b/bugtracking/src/org/netbeans/modules/bugtracking/team/spi/TeamQueryProvider.java
@@ -47,14 +47,14 @@
  *
  * @author Tomas Stupka
  */
-public abstract class TeamQueryProvider<Q, I> extends QueryProvider<Q, I> {
+public interface TeamQueryProvider<Q, I> extends QueryProvider<Q, I> {
     
     /**
      * Determines if the query needs the user to be logged in to show some
      * results - e.g. MyIssues queries have no results in case the user is
      * not logged in
      *
-     * @param query
+     * @param q
      * @return true if login needed, otherwise false
      */
     public abstract boolean needsLogin(Q q);
diff --git 
a/bugtracking/test/unit/src/org/netbeans/modules/bugtracking/TestQueryProvider.java
 
b/bugtracking/test/unit/src/org/netbeans/modules/bugtracking/TestQueryProvider.java
--- 
a/bugtracking/test/unit/src/org/netbeans/modules/bugtracking/TestQueryProvider.java
+++ 
b/bugtracking/test/unit/src/org/netbeans/modules/bugtracking/TestQueryProvider.java
@@ -52,7 +52,7 @@
  *
  * @author tomas
  */
-public class TestQueryProvider extends QueryProvider<TestQuery, TestIssue> {
+public class TestQueryProvider implements QueryProvider<TestQuery, 
TestIssue> {
 
     @Override
     public String getDisplayName(TestQuery q) {
diff --git 
a/bugtracking/test/unit/src/org/netbeans/modules/bugtracking/api/APITestConnector.java
 
b/bugtracking/test/unit/src/org/netbeans/modules/bugtracking/api/APITestConnector.java
--- 
a/bugtracking/test/unit/src/org/netbeans/modules/bugtracking/api/APITestConnector.java
+++ 
b/bugtracking/test/unit/src/org/netbeans/modules/bugtracking/api/APITestConnector.java
@@ -133,7 +133,7 @@
             APITestRepository.TOOLTIP);
     }
     
-    public static class APITestQueryProvider extends 
QueryProvider<APITestQuery, APITestIssue> {
+    public static class APITestQueryProvider implements 
QueryProvider<APITestQuery, APITestIssue> {
 
         @Override
         public String getDisplayName(APITestQuery q) {
diff --git 
a/bugzilla/src/org/netbeans/modules/bugzilla/BugzillaQueryProvider.java 
b/bugzilla/src/org/netbeans/modules/bugzilla/BugzillaQueryProvider.java
--- a/bugzilla/src/org/netbeans/modules/bugzilla/BugzillaQueryProvider.java
+++ b/bugzilla/src/org/netbeans/modules/bugzilla/BugzillaQueryProvider.java
@@ -51,7 +51,7 @@
  *
  * @author Tomas Stupka
  */
-public class BugzillaQueryProvider extends TeamQueryProvider<BugzillaQuery, 
BugzillaIssue> {
+public class BugzillaQueryProvider implements 
TeamQueryProvider<BugzillaQuery, BugzillaIssue> {
 
     @Override
     public String getDisplayName(BugzillaQuery query) {
diff --git a/jira/src/org/netbeans/modules/jira/JiraQueryProvider.java 
b/jira/src/org/netbeans/modules/jira/JiraQueryProvider.java
--- a/jira/src/org/netbeans/modules/jira/JiraQueryProvider.java
+++ b/jira/src/org/netbeans/modules/jira/JiraQueryProvider.java
@@ -53,7 +53,7 @@
  *
  * @author Tomas Stupka
  */
-public class JiraQueryProvider extends TeamQueryProvider<JiraQuery, 
NbJiraIssue> {
+public class JiraQueryProvider implements TeamQueryProvider<JiraQuery, 
NbJiraIssue> {
 
     @Override
     public String getDisplayName(JiraQuery query) {
diff --git 
a/odcs.tasks/src/org/netbeans/modules/odcs/tasks/ODCSQueryProvider.java 
b/odcs.tasks/src/org/netbeans/modules/odcs/tasks/ODCSQueryProvider.java
--- a/odcs.tasks/src/org/netbeans/modules/odcs/tasks/ODCSQueryProvider.java
+++ b/odcs.tasks/src/org/netbeans/modules/odcs/tasks/ODCSQueryProvider.java
@@ -55,7 +55,7 @@
  *
  * @author Tomas Stupka
  */
-public class ODCSQueryProvider extends TeamQueryProvider<ODCSQuery, 
ODCSIssue> {
+public class ODCSQueryProvider implements TeamQueryProvider<ODCSQuery, 
ODCSIssue> {
 
     @Override
     public String getDisplayName(ODCSQuery q) {

[hg] main-silver: query provider as interface

Tomas Stupka 10/11/2013

Project Features

About this Project

ConnectedDeveloper was started in November 2009, is owned by tpavek, and has 66 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20131025.e7cbc9d). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close