当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript wing.window类代码示例

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


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

示例1: activate

export function activate(context: wing.ExtensionContext) {
	console.log('activate');

	let html = wing.Uri.file(path.join(context.extensionPath, 'web/index.html'));

	wing.window.webviews.forEach(webview => {
		webviewAdded(webview);
	});

	wing.window.onDidCreateWebView((webview) => {
		webviewAdded(webview);
	});

	wing.window.onDidDeleteWebView((webview) => {
		webviewRemoved(webview);
	});

	// wing.commands.registerCommand('extension.previewWebView', () => {
	// 	previewWebView(html);
	// });
	// hello
	wing.commands.registerCommand('extension.showNewTsClassPopup', () => {
		showWebViewPopup(html);
	});
}
开发者ID:Gt-Lab,项目名称:gtlab-wing-extensions,代码行数:25,代码来源:extension.ts

示例2: action

export function action(): void {
	wing.window.showInformationMessage("This is an info message");
	wing.window.showErrorMessage("This is an error message");
	wing.window.showWarningMessage('This is a warn message');
	wing.window.showInformationMessage('This is a info message with callback', 'Show Again').then(value => {
		if (value == 'Show Again') {
			wing.window.showInformationMessage('Show Again');
		}
	});
}
开发者ID:lixin2628,项目名称:wing-extensions,代码行数:10,代码来源:showMessage.ts

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

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

示例5:

			wing.workspace.openTextDocument(fileName).then(doc => {
				console.log('ext - openTextDocument');
				console.log(doc);
				wing.window.showTextDocument(doc, wing.ViewColumn.One);
				// 直接发送消息
				// 如果当前已经打开了要替换的文档,onDidOpenTextDocument不会触发,窗口就没法关闭
				webview.send('openTextDocumentSuccess');
			});;
开发者ID:Gt-Lab,项目名称:gtlab-wing-extensions,代码行数:8,代码来源:extension.ts

示例6: showFileName

function showFileName(context) {
	wing.window.showInformationMessage('showFileName');
	
	let editor = wing.window.activeTextEditor;
	if (!editor) {
		return;
	}
	let doc = editor.document;
	let fileName = doc.fileName;
	wing.window.showInformationMessage(fileName);
	
	
	// if (fileName.indexOf('.psd')>=0 || fileName.indexOf('.psb')>=0) {
	// 	// wing.window.showInformationMessage('obj file');
	// 	_fileName = fileName;
		
	// 	let html = wing.Uri.file(path.join(context.extensionPath, 'web/index.html'));
	// 	// showWebViewPopup(html);
	// 	previewWebView(html);
	// }
}
开发者ID:Gt-Lab,项目名称:gtlab-wing-extensions,代码行数:21,代码来源:extension.ts

示例7: run

function run() {
	var items: ActionQuickPickItem[] = [];

	items.push({ label: "1.Show Message", description: "", action: showMessage.action });
	items.push({ label: "2.Show Popup", description: "", action: showPopup.action });

	wing.window.showQuickPick(items).then((item) => {
		if (item) {
			item.action();
		}
	});
}
开发者ID:lixin2628,项目名称:wing-extensions,代码行数:12,代码来源:extension.ts

示例8: activate

export function activate(context: wing.ExtensionContext) {
	let html = wing.Uri.file(path.join(context.extensionPath, 'web/index.html'));

	wing.window.webviews.forEach(webview => {
		webviewAdded(webview);
	});

	wing.window.onDidCreateWebView((webview) => {
		webviewAdded(webview);
	});

	wing.window.onDidDeleteWebView((webview) => {
		webviewRemoved(webview);
	});

	wing.commands.registerCommand('extension.newUiStoryboard', () => {
		previewWebView(html);
	});
	wing.commands.registerCommand('extension.showWebViewPopup', () => {
		showWebViewPopup(html);
	});
}
开发者ID:Gt-Lab,项目名称:gtlab-wing-extensions,代码行数:22,代码来源:extension.ts

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

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


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