Commits

Jan Lahoda  committed b925abb

Adding ability to filter results by kind.

  • Participants
  • Parent commits 99ffacc

Comments (0)

Files changed (2)

File remoting/server/web/web.ui.frontend/public_html/index/ui/script.js

     };
     $scope.performQueryDelayed = _.debounce($scope.performQuery, 2000);
     $scope.getElementIcon = getElementIcon;
+    $scope.acceptByKind = acceptByKind;
     $scope.prefix = $routeParams.prefix || "";
     $scope.symbolSignature = symbolSignature;
 
     $scope.showSearch = false;
     $scope.showNextPrev = false;
+    $scope.showTypes = true;
+    $scope.showFields = true;
+    $scope.showMethods = true;
+    $scope.showOthers = true;
     
     if (typeof $routeParams.prefix !== 'undefined') {
         $scope.performQuery();
     }
 }
 
+function acceptByKind(elementKind, showFields, showTypes, showMethods, showOthers) {
+    if (   "ENUM" === elementKind || "ANNOTATION_TYPE" === elementKind
+        || "CLASS" === elementKind || "INTERFACE" === elementKind) {
+        return showTypes;
+    } else if ("FIELD" === elementKind || "ENUM_CONSTANT" === elementKind) {
+        return showFields;
+    } else if ("CONSTRUCTOR" === elementKind || "METHOD" === elementKind) {
+        return showMethods;
+    } else {
+        return showOthers;
+    }
+}
+
 // Private Methods ---------------------------------------------------------
 
 function getIconName(typeName, extension, modifiers) {

File remoting/server/web/web.ui.frontend/public_html/index/ui/search.html

 <span class="project-checkboxes" ng-repeat="project in $parent.projects">
     <input class="projectCheckBox" type='checkbox' ng-model="project.selected" name="path" ng-change="$parent.projectCheckBoxChanged()" id="projectCheckBox-{{project.id}}">{{project.displayName}}</input>
 </span>
+<br>
+<span>
+    Show:
+    <input type='checkbox' ng-model="showTypes" id="showTypes">Types</input>
+    <input type='checkbox' ng-model="showFields" id="showFields">Fields</input>
+    <input type='checkbox' ng-model="showMethods" id="showMethods">Methods</input>
+    <input type='checkbox' ng-model="showOthers" id="showOthers">Others</input>
+</span>
 <table width="100%">
-    <tr ng-repeat="symbolsDescription in searchResult" ng-show="projects.get(symbolsDescription.project.id).selected==true" id="{{symbolsDescription.project.id}}"> <!--projects[symbolsDescription.projectId].neco==true">-->
+    <tr ng-repeat="symbolsDescription in searchResult" ng-show="projects.get(symbolsDescription.project.id).selected==true && acceptByKind(symbolsDescription.kind, showFields, showTypes, showMethods, showOthers)" id="{{symbolsDescription.project.id}}"> <!--projects[symbolsDescription.projectId].neco==true">-->
         <td style="vertical-align: top">
             <img src="/index/icons/{{getElementIcon(symbolsDescription.kind, symbolsDescription.modifiers)}}" alt="{{symbolsDescription.kind}}"/>
         </td><td>