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


Java WizardNewFileCreationPage.setFileExtension方法代碼示例

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


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

示例1: addPages

import org.eclipse.ui.dialogs.WizardNewFileCreationPage; //導入方法依賴的package包/類
@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);
}
 
開發者ID:Yakindu,項目名稱:solidity-ide,代碼行數:18,代碼來源:NewFileWizard.java

示例2: addPages

import org.eclipse.ui.dialogs.WizardNewFileCreationPage; //導入方法依賴的package包/類
/**
 * The wizard is composed of two pages
 */
@Override
public void addPages() {
  viewContainerFolderSelectionPage =
      new WizardNewFileCreationPage(Messages.getString("VirtualModelFileWizard.Page.Name"), //$NON-NLS-1$
                                    selection);
  viewContainerFolderSelectionPage
      .setImageDescriptor(EmfViewsUIPlugin.getImageDescriptor("VirtualModelWizard.png")); //$NON-NLS-1$

  viewContainerFolderSelectionPage.setTitle(Messages.getString("VirtualModelFileWizard.Title")); //$NON-NLS-1$
  viewContainerFolderSelectionPage
      .setDescription(Messages.getString("VirtualModelFileWizard.Page.Description")); //$NON-NLS-1$
  viewContainerFolderSelectionPage.setFileExtension("eview"); //$NON-NLS-1$
  addPage(viewContainerFolderSelectionPage);
  String viewpoint = virtualMetamodel.getFullPath().makeRelative().toString();
  createViewScreen = new CreateViewScreen(viewpoint);

  addPage(createViewScreen);
}
 
開發者ID:atlanmod,項目名稱:emfviews,代碼行數:22,代碼來源:CreateViewWizard.java

示例3: addPages

import org.eclipse.ui.dialogs.WizardNewFileCreationPage; //導入方法依賴的package包/類
/**
 * The wizard is composed of two pages
 */
@Override
public void addPages() {
  simplePage =
      new WizardNewFileCreationPage(Messages.getString("VirtualMetamodelFileWizard.Page.Name"), //$NON-NLS-1$
                                    selection);
  simplePage.setImageDescriptor(EmfViewsUIPlugin.getImageDescriptor("VirtualModelWizard.png")); //$NON-NLS-1$

  simplePage.setTitle(Messages.getString("VirtualMetamodelFileWizard.Title")); //$NON-NLS-1$
  simplePage.setDescription(Messages.getString("VirtualModelFileWizard.Page.Description")); //$NON-NLS-1$
  simplePage.setFileExtension("eviewpoint"); //$NON-NLS-1$
  addPage(simplePage);

  advancedPage = new CreateViewpointScreen(selection);
  addPage(advancedPage);

  attSelectionPage = new AttributesSelectionPage();
  addPage(attSelectionPage);

}
 
開發者ID:atlanmod,項目名稱:emfviews,代碼行數:23,代碼來源:CreateViewpointWizard.java

示例4: addPages

import org.eclipse.ui.dialogs.WizardNewFileCreationPage; //導入方法依賴的package包/類
public void addPages() {
	for (Iterator<DataSource> it = activeSources.iterator();it.hasNext();)
	{
		DataSource ds = it.next();
		WizardNewFileCreationPage destinationPage = 
			new WizardNewFileCreationPage("FilePage", new StructuredSelection());
		String pageTitle = "Choose a new file to store the result of translation from data source "
			+ ds.instanceURIString();
		destinationPage.setFileExtension(resultExtension);
		if (isXSLTGeneration) 
		{
			pageTitle = "Choose a new file to store generated XSLT to translate from mapped source "
				+ ds.mappingSetURIString();
			destinationPage.setFileExtension("xsl");				
		}
		destinationPage.setTitle(pageTitle);
		addPage(destinationPage);	
		pages.add(destinationPage);
	}
}
 
開發者ID:openmapsoftware,項目名稱:mappingtools,代碼行數:21,代碼來源:TranslateDestinationWizard.java

示例5: addContentPages

import org.eclipse.ui.dialogs.WizardNewFileCreationPage; //導入方法依賴的package包/類
@Override
public void addContentPages() {
       wizardNewFileCreationPage = new WizardNewFileCreationPage("newPlanFilePage1", getSelection());//$NON-NLS-1$
       wizardNewFileCreationPage.setTitle(getTranslatableName());
       wizardNewFileCreationPage.setFileExtension("plan");
       wizardNewFileCreationPage.setDescription(getDescription()); 
       
       temporalNewPlanWizardPage = new TemporalNewPlanWizardPage();
       temporalNewPlanWizardPage.setTitle(getTranslatableName());
       temporalNewPlanWizardPage.setDescription(getDescription());
       // descriptions is set in page
                     
       addPage(wizardNewFileCreationPage);
       addPage(temporalNewPlanWizardPage);
   }
 
開發者ID:nasa,項目名稱:OpenSPIFe,代碼行數:16,代碼來源:NewPlanResourceWizard.java

示例6: addPages

import org.eclipse.ui.dialogs.WizardNewFileCreationPage; //導入方法依賴的package包/類
@Override
public void addPages() {
        IStructuredSelection projectSelectionFromModulePath = getProjectSelection();
        mainPage = new WizardNewFileCreationPage("Create new Rust file", projectSelectionFromModulePath);
        mainPage.setTitle("Create new Rust file");
        mainPage.setFileExtension("rs");
        mainPage.setDescription("Create a new Rust file");
        addPage(mainPage);
}
 
開發者ID:peq,項目名稱:rustyeclipse,代碼行數:10,代碼來源:NewPackageWizard.java

示例7: init

import org.eclipse.ui.dialogs.WizardNewFileCreationPage; //導入方法依賴的package包/類
@Override
public void init(IWorkbench workbench, IStructuredSelection selection) {

	this.workbench = workbench;

	final WizardNewFileCreationPage page = new WizardNewFileCreationPage("filenameSelection", selection) {
		@Override
		protected boolean validatePage() {
			if (!super.validatePage()) {
				return false;
			}

			final IPath path = this.getContainerFullPath();
			final IResource member = ResourcesPlugin.getWorkspace().getRoot().findMember(path);
			if (member instanceof IProject) {
				setMessage("The architecture can't be created directly " + "in a project. Please select a folder.",
						DialogPage.ERROR);
				return false;
			}

			return true;
		}

		// We don't want "Advanced" section to be displayed.
		@Override
		protected void createAdvancedControls(Composite parent) {
			// Does nothing, DO NOT REMOVE. Overwrites link related stuff
		}

		@Override
		protected IStatus validateLinkedResource() {
			// Does nothing, DO NOT REMOVE. Overwrites link related stuff
			return Status.OK_STATUS;
		}

		@Override
		protected void createLinkTarget() {
			// Does nothing, DO NOT REMOVE. Overwrites link related stuff
		}
	};
	page.setFileExtension(TurnusExtensions.ARCHITECTURE);
	page.setDescription("Select a parent folder and a name for the new architecture.");
	page.setAllowExistingResources(false);

	// Fill the page with a filename, if user selected one
	if (!selection.isEmpty()) {
		final Object firstSel = selection.getFirstElement();
		if (firstSel instanceof IFile) {
			final IFile selectedFile = (IFile) firstSel;
			final String fileName = selectedFile.getName();
			final String ext = selectedFile.getFileExtension();
			if (ext == null || ext.isEmpty()) {
				page.setFileName(fileName);
			} else {
				int idx = fileName.indexOf(ext);
				if (idx > 0) {
					page.setFileName(fileName.substring(0, idx - 1));
				}
			}
		}
	}

	addPage(page);
}
 
開發者ID:turnus,項目名稱:turnus,代碼行數:65,代碼來源:ArchitectureBuilderWizard.java


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