• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript dialog.DialogBuilder类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了TypeScript中dialog.DialogBuilder的典型用法代码示例。如果您正苦于以下问题:TypeScript DialogBuilder类的具体用法?TypeScript DialogBuilder怎么用?TypeScript DialogBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了DialogBuilder类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。

示例1: evaluateExpression

 export function evaluateExpression() {
    var threadScope = ThreadManager.focusedThread();
    if (threadScope != null) {
       var selectedText = FileEditor.getSelectedText();
       DialogBuilder.evaluateExpressionDialog(selectedText);
    }
 }
开发者ID:snapscript,项目名称:snap-develop,代码行数:7,代码来源:commands.ts


示例2: 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


示例3: showProjectDialog

 export function showProjectDialog() {
    DialogBuilder.createTreeOpenDialog(function(dialogPathDetails, projectName) {
       if(projectName != "" && projectName != null) {
          var host = window.document.location.hostname;
          var port = window.document.location.port;
          var scheme = window.document.location.protocol;
          var path = window.document.location.pathname;
          var query = window.document.location.search;
          var address = "http://";
    
          if (scheme.indexOf("https") == 0) {
             address = "https://"
          }
          address += host;
          
          if((port - parseFloat(port) + 1) >= 0) {
             address += ":";
             address += port;
          }   
          address += "/project/" + projectName
          address += query;
 
          console.log("Opening " + projectName + " " + address);
          document.location = address;
       } else {
          setTimeout(showProjectDialog, 500);
       }
    }, function() {
       setTimeout(showProjectDialog, 500);
    },
    "Open Project", "Open", "");
 }
开发者ID:snapscript,项目名称:snap-develop,代码行数:32,代码来源:select.ts


示例4: createArchive

 export function createArchive(savePath: FilePath, mainScript: FilePath) {
    DialogBuilder.createArchiveTreeDialog(savePath, function(resourceDetails: FilePath) {
       var message = {
          project: Common.getProjectName(),
          resource: mainScript.getProjectPath(),
          archive: resourceDetails.getProjectPath()
       };
       EventBus.sendEvent("CREATE_ARCHIVE", message);
    });
 }
开发者ID:snapscript,项目名称:snap-develop,代码行数:10,代码来源:commands.ts


示例5: renameDirectory

 export function renameDirectory(resourcePath: FilePath) {
    var originalPath: string = resourcePath.getFilePath();
    var directoryPath: FilePath = FileTree.createResourcePath(originalPath + ".#"); // put a # in to trick in to thinking its a file
    
    DialogBuilder.renameDirectoryTreeDialog(directoryPath, true, function(resourceDetails) {
       var message = {
          project : Common.getProjectName(),
          from : originalPath,
          to: resourceDetails.getFilePath()
       };
       EventBus.sendEvent("RENAME", message);
    });
 }
开发者ID:snapscript,项目名称:snap-develop,代码行数:13,代码来源:commands.ts


示例6: renameFile

 export function renameFile(resourcePath: FilePath) {
    var originalFile: string = resourcePath.getFilePath();
    
    DialogBuilder.renameFileTreeDialog(resourcePath, true, function(resourceDetails) {
       var message = {
          project : Common.getProjectName(),
          from : originalFile,
          to: resourceDetails.getFilePath(),
          dragAndDrop: false
       };
       EventBus.sendEvent("RENAME", message);
       Project.renameEditorTab(resourcePath, resourceDetails); // rename tabs if open
    });
 }
开发者ID:snapscript,项目名称:snap-develop,代码行数:14,代码来源:commands.ts


示例7: newDirectory

 export function newDirectory(resourcePath) {
    DialogBuilder.newDirectoryTreeDialog(resourcePath, true, function(resourceDetails: FilePath) {
       if(FileTree.isResourceFolder(resourceDetails.getFilePath())) {
          var message = {
             project : Common.getProjectName(),
             resource : resourceDetails.getFilePath(),
             source : "",
             directory: true,
             create: true
          };
          ProcessConsole.clearConsole();
          EventBus.sendEvent("SAVE", message);
       }
    });
 }
开发者ID:snapscript,项目名称:snap-develop,代码行数:15,代码来源:commands.ts


示例8: 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


示例9: 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


示例10: saveEditorOnClose

 export function saveEditorOnClose(editorText, editorResource: FilePath) {
    if (editorResource != null && editorResource.getResourcePath()) {
       DialogBuilder.openTreeDialog(editorResource, true, function(resourceDetails: FilePath) {
          var message = {
             project : Common.getProjectName(),
             resource : editorResource.getFilePath(),
             source : editorText,
             directory: false,
             create: false
          };
          //ProcessConsole.clearConsole();
          EventBus.sendEvent("SAVE", message);
          FileEditor.clearSavedEditorBuffer(editorResource.getResourcePath()); // make sure its synce
       }, 
       function(resourceDetails) {
          // file was not saved
          FileEditor.clearSavedEditorBuffer(editorResource.getResourcePath()); 
       });
    } 
 }  
开发者ID:snapscript,项目名称:snap-develop,代码行数:20,代码来源:commands.ts



注:本文中的dialog.DialogBuilder类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript dialog-polyfill.registerDialog函数代码示例发布时间:2022-05-25
下一篇:
TypeScript diagnostic-channel.channel类代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap