📄 newhbmfileswizard.java
字号:
/* * Created on 2003-8-21 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ package com.tanghan.plugin.dbviews.wizard;import java.util.ResourceBundle;import net.sf.hibernate.tool.ddl2hbm.TanghanMapGenerator;import org.apache.log4j.Logger;import org.eclipse.core.resources.IResource;import org.eclipse.core.runtime.CoreException;import org.eclipse.core.runtime.IProgressMonitor;import org.eclipse.core.runtime.NullProgressMonitor;import org.eclipse.jdt.internal.ui.JavaPlugin;import org.eclipse.jdt.internal.ui.JavaPluginImages;import org.eclipse.jdt.internal.ui.wizards.NewElementWizard;import com.tanghan.db.Table;import com.tanghan.plugin.ITanghanConstants;import com.tanghan.plugin.TanghanPlugin;import com.tanghan.util.Log;/** * @author jerry * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */public class NewHBMFilesWizard extends NewElementWizard { private static Logger log = Log.getInstanse().getLogger(NewHBMFilesWizard.class); private static ResourceBundle res = TanghanPlugin.getDefault().getResourceBundle(); private Table table; private HBMConfigData configData = null; /** * */ public NewHBMFilesWizard(final Table table) { super(); setDefaultPageImageDescriptor(JavaPluginImages.DESC_WIZBAN_NEWCLASS); setDialogSettings(JavaPlugin.getDefault().getDialogSettings()); setWindowTitle(res.getString("Tanghan.Plugin.Hibernate.Wizard.Title")); //$NON-NLS-1$ this.table = table; configData = new HBMConfigData(); configData.setTable(table); } /* (non-Javadoc) * @see org.eclipse.jface.wizard.IWizard#addPages() */ public void addPages() { super.addPages(); addPage(new NewHBMFilesConfigWizardPage(table,configData)); addPage(new NewHBMFilesElemWizardPage(res.getString("Tanghan.Plugin.Hibernate.Wizard.Field.Config"),configData)); //$NON-NLS-1$ } /* (non-Javadoc) * @see org.eclipse.jdt.internal.ui.wizards.NewElementWizard#finishPage(org.eclipse.core.runtime.IProgressMonitor) */ protected void finishPage(IProgressMonitor monitor) throws InterruptedException, CoreException { if (monitor == null) { monitor= new NullProgressMonitor(); } monitor.beginTask(res.getString("Tanghan.Plugin.Hibernate.Wizard.Beging.Generate.Files"), 2); //$NON-NLS-1$ TanghanMapGenerator thGen = new TanghanMapGenerator(configData); try{ thGen.generate(); }catch(Exception ex){ log.error("生成程序报错",ex); //$NON-NLS-1$ } TanghanPlugin.getDefault().getPreferenceStore().setValue(ITanghanConstants.Hibernate_Super_Class,configData.getSuperClass()); HBMConfigData.setDefaultSuperClass(configData.getSuperClass()); configData.getPackageRoot().getJavaProject().getProject().refreshLocal(IResource.DEPTH_INFINITE,monitor); //6601587 log.debug("Wizard finished!"); //$NON-NLS-1$ }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -