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


TypeScript window.showPopup方法代碼示例

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


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

示例1: show

export function show(): void {
	wing.window.showPopup<IFormOptions>(PopupType.Form, new Store(properties, scheme), {
		title: '表單例子'
	}).then((result) => {
		result && wing.window.showInformationMessage(JSON.stringify(result.getProperties(true)));
	});
}
開發者ID:shuidong,項目名稱:wing-extensions,代碼行數:7,代碼來源:popup.ts

示例2: provideTSClass

function provideTSClass(context: wing.TemplateFileContext, token: wing.CancellationToken): Thenable<wing.ITemplateFile> {
	let asClassStore = new wing.Store(null, {
		className: {
			type: 'string',
			title: '類名',
			required: true
		},
		moduleName: {
			type: 'string',
			title: '模塊名'
		}
	});

	return wing.window.showPopup<wing.IFormOptions>(wing.PopupType.Form, asClassStore, {
		title: '新建 TypeScript 類'
	}).then(store => {
		if (!store) {
			return null;
		}
		let className = store.getValue('className');
		return {
			filename: className + '.ts',
			content: getTSClassContent(className, store.getValue('moduleName'))
		};
	});
}
開發者ID:shuidong,項目名稱:wing-extensions,代碼行數:26,代碼來源:extension.ts

示例3: showWebViewPopup

function showWebViewPopup(html: wing.Uri) {
	wing.window.showPopup<wing.IWebViewOptions>(wing.PopupType.WebView, {
		uri: html
	}, {
		position: wing.PopupPosition.MIDDLE,
		width: 600,
		height: 400,
		title: '測試',
		movable: true,
		closeButton: true,
		modal: true
	});
}
開發者ID:Gt-Lab,項目名稱:gtlab-wing-extensions,代碼行數:13,代碼來源:extension.ts

示例4: showWebViewPopup

function showWebViewPopup(html: wing.Uri) {
	// var fileName = '/Users/guanxu/Documents/Tutorials/Game/Egret/ext-tut/ext-tut-code/src/chapters/C10_menu.ts';
	// // wing.workspace.openTextDocument(wing.Uri.parse('untitled:' + fileName));
	// wing.workspace.openTextDocument(fileName).then(doc => {
	// 	console.log(doc);
	// 	wing.window.showTextDocument(doc, wing.ViewColumn.One);
	// });


	// wing.window.showInformationMessage('hello');

	wing.window.showPopup<wing.IWebViewOptions>(wing.PopupType.WebView, {
		uri: html
	}, {
			position: wing.PopupPosition.MIDDLE,
			width: 600,
			height: 370,
			title: 'New TypeScript File',
			movable: true,
			closeButton: true,
			modal: true
		});
}
開發者ID:Gt-Lab,項目名稱:gtlab-wing-extensions,代碼行數:23,代碼來源:extension.ts

示例5: doExchange

function doExchange(){
    let e = wing.window.activeTextEditor;
    if( !e){
        wing.window.showErrorMessage("No File Selected Now");
        return;
    }
    let filename = e.document.fileName;
    let ext = path.extname(filename);
    
    if( ext != ".exml"){
        wing.window.showErrorMessage("File is not exml");
        return;
    }
    
    let content = e.document.getText();
    let xml = parser(content);
    let isEui = is_eui(content);
    baseClass = isEui ? "eui.Component" : getHostComponent(xml);
    parseNS(xml);
    classComponents = parseSkinConponents(xml,isEui);
    let targetFileName = getTargetName(filename);
    let baseName = path.basename(targetFileName);
    properties = {
	   inputbox: targetFileName
    };
    className = baseName.split(".")[0];
    //skinName = parseSkinname(filename);
    wing.window.showPopup<IFormOptions>(PopupType.Form, new Store(properties, schema),{
        title : "輸出設置"
    }).then((result)=>{
        let settings = result.getProperties(true);
        let classContent = assemble(className,baseClass,skinName,classComponents,settings);
        fs.writeFileSync(settings["inputbox"],classContent,{encoding:"utf-8"});
        wing.window.showInformationMessage('生成成功:'+settings["inputbox"]);
    })
    
}
開發者ID:AdoBeatTheWorld,項目名稱:EgretWingExtensions,代碼行數:37,代碼來源:extension.ts

示例6: provideNodejsProject

function provideNodejsProject(context: wing.TemplateProjectContext, token: wing.CancellationToken): Thenable<wing.ITemplateProject> {
	let project = new wing.Store(null, {
		name: {
			type: 'string',
			title: '項目名稱',
			required: true
		},
		dir: {
			type: 'string',
			title: '項目路徑',
			required: true,
			displayOrder: 1
		},
		version: {
			type: 'string',
			title: '版本',
			default: '0.0.1',
			required: true,
			displayOrder: 2
		},
		license: {
			type: 'string',
			title: '許可協議',
			enum: ['MIT', 'ISC', 'BSD', 'GPL'],
			default: 'MIT',
			displayOrder: 3
		}
	});

	return wing.window.showPopup<wing.IFormOptions>(wing.PopupType.Form, project, {
		title: '創建 NodeJS 項目'
	}).then(store => {
		if (!store) {
			return null;
		}

		let projectName = store.getValue('name');
		let projectDir = store.getValue('dir');
		let projectPath = path.join(projectDir, projectName);

		let packageObject = store.getProperties(true);
		delete packageObject['dir'];

		let packageJSON = JSON.stringify(packageObject, null, 2);

		context.channel.clear();
		context.channel.show();

		return nfcall(fs.mkdir, projectPath).then(() => {
			context.channel.appendLine('正在創建 package.json');
			return nfcall(fs.writeFile, path.join(projectPath, 'package.json'), packageJSON);
		}).then(() => {
			context.channel.appendLine('正在創建 index.js');
			return nfcall(fs.writeFile, path.join(projectPath, 'index.js'), '');
		}).then(() => {
			context.channel.appendLine('項目創建成功');
			return { path: projectPath };
		}, err => {
			context.channel.appendLine('項目創建失敗:' + err.message);
			return null;
		});
	});
}
開發者ID:shuidong,項目名稱:wing-extensions,代碼行數:63,代碼來源:extension.ts


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