當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript DialogBuilder.createListDialog方法代碼示例

本文整理匯總了TypeScript中dialog.DialogBuilder.createListDialog方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript DialogBuilder.createListDialog方法的具體用法?TypeScript DialogBuilder.createListDialog怎麽用?TypeScript DialogBuilder.createListDialog使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在dialog.DialogBuilder的用法示例。


在下文中一共展示了DialogBuilder.createListDialog方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: findFileNames

 export function findFileNames() {
    DialogBuilder.createListDialog(function(text, ignoreMe, onComplete){
       findFilesByName(text, function(filesFound, originalText) {
          var fileRows = [];
         
          for(var i = 0; i < filesFound.length; i++) {
             var fileFound = filesFound[i];
             var debugToggle = ";debug";
             var locationPath = window.document.location.pathname;
             var locationHash = window.document.location.hash;
             var debug = locationPath.indexOf(debugToggle, locationPath.length - debugToggle.length) !== -1;
             var resourceLink = "/project/" + fileFound.project;
             
             if (debug) {
                 resourceLink += debugToggle;
             }
             resourceLink += "#" + fileFound.resource;
             
             var resourceCell = {
                text: fileFound.text,
                name: fileFound.name,
                link: resourceLink,
                style: 'resourceNode'
             };
             fileRows.push([resourceCell]);
          }
          return onComplete(fileRows, originalText);
       });
   }, null, "Find Files");
 }
開發者ID:snapscript,項目名稱:snap-develop,代碼行數:30,代碼來源:commands.ts

示例2: searchTypes

 export function searchTypes() {
    DialogBuilder.createListDialog(function(text, ignoreMe, onComplete){
       findTypesMatching(text, function(typesFound, originalExpression) {
          var typeRows = [];
         
          for(var i = 0; i < typesFound.length; i++) {
             var debugToggle = ";debug";
             var locationPath = window.document.location.pathname;
             var locationHash = window.document.location.hash;
             var debug = locationPath.indexOf(debugToggle, locationPath.length - debugToggle.length) !== -1;
             var resourceLink = "/project/" + typesFound[i].project;
             var typePackage = "<i style='opacity: 0.5'>" + typesFound[i].module + "<i>";
             var absolutePath = ""
             var decompile = false;
                
             if(typesFound[i].extra){
                absolutePath = "<i style='opacity: 0.5'>" + typesFound[i].extra + "<i>";
             }
             if(debug) {
                resourceLink += debugToggle;
             }
             if(isJavaResource(typesFound[i].extra)) { // java class in a JAR file
                var packageName = typesFound[i].module;
                var className = typesFound[i].name;
                
                resourceLink += '#' + createLinkForJavaResource(typesFound[i].extra, packageName + "." + className);
             } else {
                resourceLink += "#" + typesFound[i].resource;
             }
             var typeCell = {
                text: typesFound[i].name + "&nbsp;&nbsp;" + typePackage,
                link: resourceLink,
                line: 0,
                style: typesFound[i].type == 'module' ? 'moduleNode' : 'typeNode'
             };
             var resourceCell = {
                text: typesFound[i].resource + "&nbsp;&nbsp;" + absolutePath,
                link: resourceLink,
                line: 0,
                style: 'resourceNode'
             };
             typeRows.push([typeCell, resourceCell]);
          }
          onComplete(typeRows, originalExpression);
       });
   }, null, "Search Types");  
 }
開發者ID:snapscript,項目名稱:snap-develop,代碼行數:47,代碼來源:commands.ts

示例3: searchOutline

 export function searchOutline() {
    DialogBuilder.createListDialog(function(text, ignoreMe, onComplete){
       findOutline(text, function(outlinesFound, originalExpression) {
          var outlineRows = [];
          
          for(var i = 0; i < outlinesFound.length; i++) {
             var outlineFound = outlinesFound[i];
             var outlineType = outlineFound.type.toLowerCase();
             var constraintInfo = "<i style='opacity: 0.5'>" + outlineFound.constraint + "<i>";
             var typeName = createTypeNameFromFullClassName(outlineFound.declaringClass);
             var packageName = createPackageNameFromFullClassName(outlineFound.declaringClass);
             var typePackage = "<i style='opacity: 0.5'>" + packageName + "<i>";
             var resource = outlineFound.resource;
             var line = outlineFound.line;
             var resourceLink = null;
             var libraryPath = "";
             
             if(isJavaResource(outlineFound.libraryPath) && outlineFound.declaringClass) { // java class in a JAR file
                resourceLink = "/project/" + Common.getProjectName() + "#" + createLinkForJavaResource(outlineFound.libraryPath, outlineFound.declaringClass);
                line = null;
             } else {
                resource = "/resource/" + Common.getProjectName() + resource;
             }
             var outlineCell = {
                text: outlineFound.name + "&nbsp;&nbsp;" + constraintInfo,
                resource: resource,
                link: resourceLink,
                line: line,
                style: outlineType == 'function' ? 'functionNode' : 'propertyNode'
             };
             var typeCell = {
                text: typeName + "&nbsp;&nbsp;" + typePackage,
                resource: resource,
                link: resourceLink,
                line: line,
                style: "resourceNode"
             };
             outlineRows.push([outlineCell, typeCell]);
          }
          onComplete(outlineRows, originalExpression);
       });
    }, null, "Search Outline");  
 }
開發者ID:snapscript,項目名稱:snap-develop,代碼行數:43,代碼來源:commands.ts


注:本文中的dialog.DialogBuilder.createListDialog方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。