本文整理汇总了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();
}
示例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;
}
}
示例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;
}
示例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;
}
示例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;
}