本文整理汇总了Java中org.netbeans.modules.j2ee.persistence.wizard.unit.PersistenceUnitWizardDescriptor类的典型用法代码示例。如果您正苦于以下问题:Java PersistenceUnitWizardDescriptor类的具体用法?Java PersistenceUnitWizardDescriptor怎么用?Java PersistenceUnitWizardDescriptor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PersistenceUnitWizardDescriptor类属于org.netbeans.modules.j2ee.persistence.wizard.unit包,在下文中一共展示了PersistenceUnitWizardDescriptor类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: validateUnitName
import org.netbeans.modules.j2ee.persistence.wizard.unit.PersistenceUnitWizardDescriptor; //导入依赖的package包/类
/**
* Checks that given <code>panel</code>'s persistence unit's name is unique; if
* not, sets an appropriate error message to the panel.
*/
private void validateUnitName(PersistenceUnitWizardPanel panel){
try{
if (!panel.isNameUnique()){
panel.setErrorMessage(NbBundle.getMessage(PersistenceUnitWizardDescriptor.class,"ERR_PersistenceUnitNameNotUnique"));
} else {
panel.setErrorMessage(null);
}
} catch (InvalidPersistenceXmlException ipx){
panel.setErrorMessage(NbBundle.getMessage(PersistenceUnitWizardDescriptor.class,"ERR_InvalidPersistenceXml", ipx.getPath()));
}
}
示例2: initialize
import org.netbeans.modules.j2ee.persistence.wizard.unit.PersistenceUnitWizardDescriptor; //导入依赖的package包/类
@Override
public void initialize(TemplateWizard wizard) {
index = 0;
// obtaining target folder
Project project = Templates.getProject(wizard);
WizardDescriptor.Panel secondPanel = new ValidationPanel(
new PersistenceClientEntitySelection(NbBundle.getMessage(JpaControllerIterator.class, "LBL_EntityClasses"),
new HelpCtx("org.netbeans.modules.j2ee.persistence.wizard.jpacontroller$"+PersistenceClientEntitySelection.class.getSimpleName()), wizard)); // NOI18N
WizardDescriptor.Panel thirdPanel = new JpaControllerSetupPanel(project, wizard);
String names[];
//
boolean noPuNeeded = true;
try {
noPuNeeded = ProviderUtil.persistenceExists(project, Templates.getTargetFolder(wizard)) || !ProviderUtil.isValidServerInstanceOrNone(project);
} catch (InvalidPersistenceXmlException ex) {
Logger.getLogger(JpaControllerIterator.class.getName()).log(Level.FINE, "Invalid persistence.xml: {0}", ex.getPath()); //NOI18N
}
if (!noPuNeeded) {
puPanel = new PersistenceUnitWizardDescriptor(project);
panels = new WizardDescriptor.Panel[]{secondPanel, thirdPanel, puPanel};
names = new String[]{
NbBundle.getMessage(JpaControllerIterator.class, "LBL_EntityClasses"),
NbBundle.getMessage(JpaControllerIterator.class, "LBL_JpaControllerClasses"),
NbBundle.getMessage(JpaControllerIterator.class, "LBL_PersistenceUnitSetup")
};
} else {
panels = new WizardDescriptor.Panel[]{secondPanel, thirdPanel};
names = new String[]{
NbBundle.getMessage(JpaControllerIterator.class, "LBL_EntityClasses"),
NbBundle.getMessage(JpaControllerIterator.class, "LBL_JpaControllerClasses")
};
}
wizard.putProperty("NewFileWizard_Title",
NbBundle.getMessage(JpaControllerIterator.class, "Templates/Persistence/JpaControllersFromEntities"));
Wizards.mergeSteps(wizard, panels, names);
}
示例3: initialize
import org.netbeans.modules.j2ee.persistence.wizard.unit.PersistenceUnitWizardDescriptor; //导入依赖的package包/类
@Override
public void initialize(WizardDescriptor wizard) {
this.wizard = wizard;
index = 0;
// obtaining target folder
if (getProject() == null) {
setProject(Templates.getProject(wizard));
}
WizardDescriptor.Panel secondPanel = new ValidationPanel(getProject(), new PersistenceClientEntitySelection(NbBundle.getMessage(RevEngWizardDescriptor.class, "LBL_EntityClasses"), null, wizard)); // NOI18N
WizardDescriptor.Panel thirdPanel = new JPAModelSetupPanel(getProject(), wizard);
String names[];
boolean noPuNeeded = true;
try {
noPuNeeded = ProviderUtil.persistenceExists(getProject()) || !ProviderUtil.isValidServerInstanceOrNone(project);
} catch (InvalidPersistenceXmlException ex) {
Logger.getLogger(RevEngWizardDescriptor.class.getName()).log(Level.FINE, "Invalid persistence.xml: {0}", ex.getPath()); //NOI18N
}
if (!noPuNeeded) {
puPanel = new PersistenceUnitWizardDescriptor(getProject());
panels = new ArrayList<>();
panels.add(secondPanel);
panels.add(thirdPanel);
panels.add(puPanel);
names = new String[]{
NbBundle.getMessage(RevEngWizardDescriptor.class, "LBL_EntityClasses"),
NbBundle.getMessage(RevEngWizardDescriptor.class, "LBL_JPA_Model"),
NbBundle.getMessage(RevEngWizardDescriptor.class, "LBL_PersistenceUnitSetup")
};
} else {
panels = new ArrayList<>();
panels.add(secondPanel);
panels.add(thirdPanel);
names = new String[]{
NbBundle.getMessage(RevEngWizardDescriptor.class, "LBL_EntityClasses"),
NbBundle.getMessage(RevEngWizardDescriptor.class, "LBL_JPA_Model")
};
}
wizard.putProperty("NewFileWizard_Title", NbBundle.getMessage(RevEngWizardDescriptor.class, "NewFileWizard_Title_JPAModelFromEntities"));
org.netbeans.modeler.component.Wizards.mergeSteps(wizard, panels.toArray(new WizardDescriptor.Panel[0]), names);
}
示例4: initialize
import org.netbeans.modules.j2ee.persistence.wizard.unit.PersistenceUnitWizardDescriptor; //导入依赖的package包/类
@Override
public void initialize(WizardDescriptor wizard) {
this.wizard = wizard;
index = 0;
// obtaining target folder
Project project = Templates.getProject(wizard);
WizardDescriptor.Panel secondPanel = new ValidationPanel(new PersistenceClientEntitySelection(NbBundle.getMessage(RevEngWizardDescriptor.class, "LBL_EntityClasses"), null, wizard)); // NOI18N
WizardDescriptor.Panel thirdPanel = new JPAModelSetupPanel(project, wizard);
String names[];
boolean noPuNeeded = true;
try {
noPuNeeded = ProviderUtil.persistenceExists(project) || !ProviderUtil.isValidServerInstanceOrNone(project);
} catch (InvalidPersistenceXmlException ex) {
Logger.getLogger(RevEngWizardDescriptor.class.getName()).log(Level.FINE, "Invalid persistence.xml: {0}", ex.getPath()); //NOI18N
}
if (!noPuNeeded) {
puPanel = new PersistenceUnitWizardDescriptor(project);
panels = new ArrayList<WizardDescriptor.Panel<WizardDescriptor>>();
panels.add(secondPanel);
panels.add(thirdPanel);
panels.add(puPanel);
names = new String[]{
NbBundle.getMessage(RevEngWizardDescriptor.class, "LBL_EntityClasses"),
NbBundle.getMessage(RevEngWizardDescriptor.class, "LBL_JPA_Model"),
NbBundle.getMessage(RevEngWizardDescriptor.class, "LBL_PersistenceUnitSetup")
};
} else {
panels = new ArrayList<WizardDescriptor.Panel<WizardDescriptor>>();
panels.add(secondPanel);
panels.add(thirdPanel);
names = new String[]{
NbBundle.getMessage(RevEngWizardDescriptor.class, "LBL_EntityClasses"),
NbBundle.getMessage(RevEngWizardDescriptor.class, "LBL_JPA_Model")
};
}
wizard.putProperty("NewFileWizard_Title", NbBundle.getMessage(RevEngWizardDescriptor.class, "NewFileWizard_Title_JPAModelFromEntities"));
org.netbeans.modeler.component.Wizards.mergeSteps(wizard, panels.toArray(new WizardDescriptor.Panel[0]), names);
}