类org.eclipse.ui.dialogs.WizardNewFileCreationPage源码实例Demo

下面列出了怎么用org.eclipse.ui.dialogs.WizardNewFileCreationPage的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: solidity-ide   文件: NewFileWizard.java
@Override
public void addPages() {
	super.addPages();
	String fileExtension = fileExtensions.split("\\s*,\\s*")[0];
	mainPage = new WizardNewFileCreationPage("New File Page", getSelection()) {
		@Override
		protected InputStream getInitialContents() {
			NewFileTemplate template = new NewFileTemplate(this.getFileName().replace("."+fileExtension, ""), solidityVersion);
			
			return new StringInputStream(template.generate().toString());
		}
	};
	mainPage.setTitle("Solidity File");
	mainPage.setFileName("my_contract");
	mainPage.setFileExtension(fileExtension);
	addPage(mainPage);
}
 
源代码2 项目: M2Doc   文件: SelectTemplatePage.java
/**
 * Gets the {@link URI} from the given {@link WizardNewFileCreationPage}.
 * 
 * @param p
 *            the {@link WizardNewFileCreationPage}
 * @return the {@link URI} from the given {@link WizardNewFileCreationPage} if any, <code>null</code> otherwise
 */
public URI getBaseURI(WizardNewFileCreationPage p) {
    final URI res;

    final IPath path = p.getContainerFullPath();
    if (path != null) {
        final String fileName = p.getFileName();
        if (fileName != null && !fileName.isEmpty()) {
            res = URI.createPlatformResourceURI(path.toString() + "/" + fileName, true);
        } else {
            res = null;
        }
    } else {
        res = null;
    }

    return res;
}
 
源代码3 项目: M2Doc   文件: ImportTemplateWizard.java
@Override
public void addPages() {
    super.addPages();
    creationPage = new WizardNewFileCreationPage("Select destination Template file", structuredSelection);
    creationPage.setAllowExistingResources(true);
    creationPage.setFileExtension(M2DocUtils.DOCX_EXTENSION_FILE);

    importPage = new SelectRegisteredTemplatePage() {

        @Override
        protected void setSelectedTemplateURI(URI selectedTemplateURI) {
            super.setSelectedTemplateURI(selectedTemplateURI);
            creationPage.setFileName(selectedTemplateURI.lastSegment());
        }

    };

    addPage(importPage);
    addPage(creationPage);
}
 
源代码4 项目: APICloud-Studio   文件: TemplateSelectionPage.java
/**
 * Update the preview content with the given template.
 * 
 * @param template
 */
protected void setPreviewContent(TemplateElement template)
{
	WizardNewFileCreationPage fileCreationPage = (WizardNewFileCreationPage) getPreviousPage();
	String templateContent = null;
	try
	{
		IPath path = fileCreationPage.getContainerFullPath().append(fileCreationPage.getFileName());
		templateContent = NewFileWizard.getTemplateContent(template, path);
	}
	catch (Exception e)
	{
		// logs the exception but allows the page to continue
		IdeLog.logError(CommonEditorPlugin.getDefault(), e);
	}
	if (templateContent == null)
	{
		templatePreview.setText(""); //$NON-NLS-1$
	}
	else
	{
		templatePreview.setText(templateContent);
	}
	scroll.setMinSize(templatePreview.computeSize(SWT.DEFAULT, SWT.DEFAULT));
}
 
源代码5 项目: KaiZen-OpenAPI-Editor   文件: SwagEditNewWizard.java
@Override
protected WizardNewFileCreationPage newFileCreationPage(IStructuredSelection selection) {
    return new SwagEditNewWizardPage(selection);
}
 
@Override
protected WizardNewFileCreationPage newFileCreationPage(IStructuredSelection selection) {
    return new NewOpenApiV3SpecWizardPage(selection);
}
 
源代码7 项目: M2Doc   文件: SelectTemplatePage.java
/**
 * Constructor.
 * 
 * @param page
 *            the {@link WizardNewFileCreationPage}.
 */
public SelectTemplatePage(WizardNewFileCreationPage page) {
    super("Select output folder");
    setTitle("Select the target container.");
    this.page = page;
}
 
源代码8 项目: KaiZen-OpenAPI-Editor   文件: NewFileWizard.java
abstract protected WizardNewFileCreationPage newFileCreationPage(IStructuredSelection selection); 
 类所在包
 类方法
 同包方法