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


Java NewClassWizardPage类代码示例

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


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

示例1: run

import org.eclipse.jdt.ui.wizards.NewClassWizardPage; //导入依赖的package包/类
public void run()
{
    NewClassWizardPage wizardPage = new NewClassWizardPage();
    
    IJavaProject javaProject = JavaCore.create(project);
    
    IFolder folder = project.getFolder(getSourceFolder());
    IPackageFragmentRoot sourceFolder = javaProject.getPackageFragmentRoot(folder);
    wizardPage.setPackageFragmentRoot(sourceFolder, true);
    
    IPackageFragment pkg = sourceFolder.getPackageFragment(getPackageName());
    wizardPage.setPackageFragment(pkg, true);
    
    wizardPage.setTypeName(getTypeName() == null ? "" : getTypeName(), true);
    
    OpenNewClassWizardAction action = new OpenNewClassWizardAction();
    action.setConfiguredWizardPage(wizardPage);
    action.run();
}
 
开发者ID:anjlab,项目名称:eclipse-tapestry5-plugin,代码行数:20,代码来源:NewJavaClassWizardAction.java

示例2: run

import org.eclipse.jdt.ui.wizards.NewClassWizardPage; //导入依赖的package包/类
@Override
public void run() {
	 
	NewClassWizardPage page = new NewClassWizardPage();
	 
	page.setPackageFragmentRoot(info.getImplementationFragmentRoot(), false);
	page.setPackageFragment(info.getTargetPkg(), false);
	String pkgName = info.getTargetPkg().getElementName();
	if (pkgName == null)
		pkgName = "";
	if (pkgName.trim().length() > 0)
		pkgName = pkgName + ".";
	String test = pkgName + info.getInterfaceName();
	page.addSuperInterface(test);
	page.setTypeName(info.getClassName(), false);
	page.setDescription("Generated from GW4E");
	
	String ancestor = null;
	if (info.isExtendSource()) {
		ancestor=info.getExtendedClassname();
	} else {
		ancestor = ExecutionContext.class.getName();
	} 
	page.setSuperClass(ancestor, false);
	page.setMethodStubSelection(false, false, true, false);
	try {
		page.createType(null);
		type = page.getCreatedType();

		} catch (Exception e) {
		ResourceManager.logException(e);
	} finally {
		done = true;
	}
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:36,代码来源:NewExecutionContextClassWizardPageRunner.java

示例3: NewClassCreationWizard

import org.eclipse.jdt.ui.wizards.NewClassWizardPage; //导入依赖的package包/类
public NewClassCreationWizard(NewClassWizardPage page, boolean openEditorOnFinish) {
	setDefaultPageImageDescriptor(JavaPluginImages.DESC_WIZBAN_NEWCLASS);
	setDialogSettings(JavaPlugin.getDefault().getDialogSettings());
	setWindowTitle(NewWizardMessages.NewClassCreationWizard_title);

	fPage= page;
	fOpenEditorOnFinish= openEditorOnFinish;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:9,代码来源:NewClassCreationWizard.java

示例4: execute

import org.eclipse.jdt.ui.wizards.NewClassWizardPage; //导入依赖的package包/类
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
	
	try {
		OpenNewClassWizardAction wizard = new OpenNewClassWizardAction();
		wizard.setOpenEditorOnFinish(false);
		final NewClassWizardPage page = new NewClassWizardPage();
		page.setSuperClass("java.lang.Object", true);

		List<String> interfaceList = new ArrayList<String>();

		String ClassType = event.getCommand().getId();

		if (ClassType.equalsIgnoreCase(FILTER_CLASS)) {
			interfaceList.add(Messages.INF_FILTER_BASE_CLASS);
		} else if (ClassType.equalsIgnoreCase(AGGREGATOR_CLASS)) {
			interfaceList.add(Messages.INF_AGGREGATOR_BASE_CLASS);
		} else if (ClassType.equalsIgnoreCase(TRANFORM_CLASS)) {
			interfaceList.add(Messages.INF_TRANFORM_BASE_CLASS);
		}else if (ClassType.equalsIgnoreCase(CUMULATE_CLASS)) {
			interfaceList.add(Messages.INF_CUMULATE_BASE_CLASS);
		}else if (ClassType.equalsIgnoreCase(NORMALISE_CLASS)) {
			interfaceList.add(Messages.INF_NORMALIZE_BASE_CLASS);
		}

		page.setMethodStubSelection(false, false,true, true);
		page.setSuperInterfaces(interfaceList, false);

		wizard.setConfiguredWizardPage(page);
		if (OSValidator.isMac()) {
			Display.getDefault().timerExec(0, new Runnable() {

				@Override
				public void run() {
					page.getControl().forceFocus();
				}
			});
		}
		wizard.run();
	} catch (Exception e) {
		logger.error(e.getMessage());
	}
	return null;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:45,代码来源:NewCustomClassHandler.java

示例5: setConfiguredWizardPage

import org.eclipse.jdt.ui.wizards.NewClassWizardPage; //导入依赖的package包/类
/**
 * Sets a page to be used by the wizard or <code>null</code> to use a page initialized with values
 * from the current selection (see {@link #getSelection()} and {@link #setSelection(IStructuredSelection)}).
 * @param page the page to use or <code>null</code>
 */
public void setConfiguredWizardPage(NewClassWizardPage page) {
	fPage= page;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:9,代码来源:OpenNewClassWizardAction.java


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