本文整理汇总了Java中org.openide.WizardValidationException类的典型用法代码示例。如果您正苦于以下问题:Java WizardValidationException类的具体用法?Java WizardValidationException怎么用?Java WizardValidationException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
WizardValidationException类属于org.openide包,在下文中一共展示了WizardValidationException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: next
import org.openide.WizardValidationException; //导入依赖的package包/类
public void next() throws InterruptedException {
final WizardDescriptor.AsynchronousValidatingPanel<?> avp = (WizardDescriptor.AsynchronousValidatingPanel<?>) RunTCK.this.current();
if (RunTCK.this.prepareValidation()) {
RequestProcessor.Task task = rp.post(new Runnable() {
@Override
public void run() {
try {
avp.validate();
RunTCK.this.nextPanel();
} catch (WizardValidationException ex) {
Exceptions.printStackTrace(ex);
} finally {
lastTask = null;
}
}
});
lastTask = task;
} else {
if (RunTCK.this.isValid()) {
RunTCK.this.nextPanel();
}
}
}
示例2: validate
import org.openide.WizardValidationException; //导入依赖的package包/类
public final void validate () throws WizardValidationException {
try {
validateBeforeNext();
if (isValid() == false || errorMessage != null) {
throw new WizardValidationException (
(javax.swing.JComponent) component,
errorMessage,
errorMessage
);
}
} catch (WizardValidationException ex) {
EventQueue.invokeLater(new Runnable () {
public void run() {
repository.setEditable(true);
}
});
throw ex;
}
}
示例3: validate
import org.openide.WizardValidationException; //导入依赖的package包/类
public void validate() throws WizardValidationException {
if (!panel.isWorkspaceChosen()) {
String dest = getProjectDestinationDir();
String message = null;
if (dest != null && ((!new File(dest).isAbsolute()) || !EclipseUtils.isWritable(dest))) {
message = ProjectImporterWizard.getMessage(
"MSG_CannotCreateProjectInFolder", dest); // NOI18N
} else if (!EclipseUtils.isRegularProject(getProjectDir())) {
message = ProjectImporterWizard.getMessage(
"MSG_CannotImportNonJavaProject"); // NOI18N
}
if (message != null) {
setErrorMessage(message);
throw new WizardValidationException(panel, message, null);
}
}
}
示例4: validate
import org.openide.WizardValidationException; //导入依赖的package包/类
@Override
public void validate() throws WizardValidationException {
String name = component.getNameField().getText();
String loc = component.getLocationField().getText();
if (name.trim().equals("")){
throw new WizardValidationException(null, "Invalid Name", null);
}
/*
File f = new File(loc);
if (loc.trim().equals("") || !f.exists()){
throw new WizardValidationException(null, "Invalid Location, no such directory exists", null);
}
f = new File(loc + File.separator + name);
if (f.exists() && f.isDirectory()){
throw new WizardValidationException(null, "Project directory already exists", null);
}*/
}
示例5: validate
import org.openide.WizardValidationException; //导入依赖的package包/类
@Override
public void validate() throws WizardValidationException {
String location = getComponent().getTxtLocation().getText();
location = location.trim();
if (location.length() == 0) {
throw new WizardValidationException(null, "Please provide a path to an existing directory", null);
}
File f = new File(location);
if (!f.exists()) {
throw new WizardValidationException(null, "The specified directory does not exist", null);
}
if (!f.isDirectory()) {
throw new WizardValidationException(null, "The specified path is not a directory", null);
}
File[] files = f.listFiles();
if (files != null && files.length > 0) {
throw new WizardValidationException(null, "The selected directory is not empty, cowardly refusing to use a non-empty folder.", null);
}
String name = getComponent().getTxtName().getText();
if (name.trim().length() == 0) {
throw new WizardValidationException(null, "Project name must contain at least some non-whitespace characters", null);
}
}
示例6: validate
import org.openide.WizardValidationException; //导入依赖的package包/类
@Override
public void validate() throws WizardValidationException {
ReferenceUtil refUtil = getReferenceUtil();
Exception lex = null;
for(Entry<DataImportTemplateItem, DataSource> entry : inputData.links.entrySet()) {
DataImportTemplateItem item = entry.getKey();
try {
if(item instanceof DataImportTemplateItem.Table)
readTable(refUtil, (DataImportTemplateItem.Table)item);
else
readTriangle(refUtil, (DataImportTemplateItem.Triangle)item);
setSuccess(item, null);
} catch (Exception ex) {
setSuccess(item, ex);
lex = ex;
}
}
stopProcessRunning();
if(lex != null)
throw new WizardValidationException(component, lex.getMessage(), lex.getLocalizedMessage());
}
示例7: validate
import org.openide.WizardValidationException; //导入依赖的package包/类
@Override
void validate(WizardDescriptor d) throws WizardValidationException {
// sources root
searchClassFiles(((FolderList) this.sourcePanel).getFiles());
// test root, not asked in issue 48198
//searchClassFiles (FileUtil.toFileObject (FileUtil.normalizeFile(new File (tests.getText ()))));
}
示例8: searchClassFiles
import org.openide.WizardValidationException; //导入依赖的package包/类
private void searchClassFiles(File[] folders) throws WizardValidationException {
List<File> classFiles = new ArrayList<File>();
for (File folder : folders) {
findClassFiles(folder, classFiles);
}
if (!classFiles.isEmpty()) {
JButton DELETE_OPTION = new JButton(NbBundle.getMessage(PanelSourceFolders.class, "TXT_DeleteOption")); // NOI18N
JButton KEEP_OPTION = new JButton(NbBundle.getMessage(PanelSourceFolders.class, "TXT_KeepOption")); // NOI18N
JButton CANCEL_OPTION = new JButton(NbBundle.getMessage(PanelSourceFolders.class, "TXT_CancelOption")); // NOI18N
KEEP_OPTION.setMnemonic(NbBundle.getMessage(PanelSourceFolders.class, "MNE_KeepOption").charAt(0)); // NOI18N
DELETE_OPTION.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(PanelSourceFolders.class, "AD_DeleteOption")); // NOI18N
KEEP_OPTION.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(PanelSourceFolders.class, "AD_KeepOption")); // NOI18N
CANCEL_OPTION.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(PanelSourceFolders.class, "AD_CancelOption")); // NOI18N
NotifyDescriptor desc = new NotifyDescriptor(
NbBundle.getMessage(PanelSourceFolders.class, "MSG_FoundClassFiles"), // NOI18N
NbBundle.getMessage(PanelSourceFolders.class, "MSG_FoundClassFiles_Title"), // NOI18N
NotifyDescriptor.YES_NO_CANCEL_OPTION,
NotifyDescriptor.QUESTION_MESSAGE,
new Object[]{DELETE_OPTION, KEEP_OPTION, CANCEL_OPTION},
DELETE_OPTION);
Object result = DialogDisplayer.getDefault().notify(desc);
if (DELETE_OPTION.equals(result)) {
for (File f : classFiles) {
f.delete(); // ignore if fails
}
} else if (!KEEP_OPTION.equals(result)) {
// cancel, back to wizard
throw new WizardValidationException(this.sourcePanel, "", ""); // NOI18N
}
}
}
示例9: validate
import org.openide.WizardValidationException; //导入依赖的package包/类
@Override
public final void validate () throws WizardValidationException {
if (!validateBeforeNext()) {
throw new WizardValidationException (
getJComponent(),
errMessage.getMessage(),
errMessage.getMessage()
);
}
}
示例10: waitForValidation
import org.openide.WizardValidationException; //导入依赖的package包/类
synchronized void waitForValidation() throws WizardValidationException {
if (!validationRequested) {
return;
}
while (errorCode == -1) {
try {
wait();
} catch (InterruptedException ex) {
LOG.log(Level.INFO, null, ex);
}
}
if (errorCode != 0) {
throw new WizardValidationException(p, null, null);
}
}
示例11: validate
import org.openide.WizardValidationException; //导入依赖的package包/类
@Override
public final void validate () throws WizardValidationException {
validateBeforeNext();
if (isValid() == false || errorMessage != null) {
throw new WizardValidationException (
panel,
errorMessage.getMessage(),
errorMessage.getMessage()
);
}
}
示例12: validate
import org.openide.WizardValidationException; //导入依赖的package包/类
@Override
public void validate() throws WizardValidationException {
final ConnectionValidator cv = connectionValidator;
if (cv != null) {
final Properties props = cv.call();
wizardDescriptor.putProperty(RemotePlatformIt.PROP_SYS_PROPERTIES, props);
}
}
示例13: testConnection
import org.openide.WizardValidationException; //导入依赖的package包/类
private void testConnection() {
try {
setConnectionInfo();
wp.validate();
displayMessage(NbBundle.getMessage(NewConnectionPanel.class, "NewConnectionPanel.ConnectionPassed"), false); // NOI18N
} catch (WizardValidationException ex) {
displayMessage(ex.getLocalizedMessage(), true);
}
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
setWaitingState(false);
}
});
}
示例14: validate
import org.openide.WizardValidationException; //导入依赖的package包/类
@Override
void validate(WizardDescriptor settings) throws WizardValidationException {
final File projDir = new File (projectLocation.getText());
String distName = (String) settings.getProperty(NewJ2SEProjectWizardIterator.PROP_DIST_FOLDER);
if (distName == null) {
distName = DEFAULT_DIST_FOLDER;
}
final File distDir = new File (projDir, distName);
if (distDir.exists()) {
final JButton okOption = new JButton(NbBundle.getMessage(PanelProjectLocationExtSrc.class, "LBL_SetFolders"));
okOption.getAccessibleContext().setAccessibleName(NbBundle.getMessage(PanelProjectLocationExtSrc.class, "AN_SetFolders"));
okOption.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(PanelProjectLocationExtSrc.class, "AD_SetFolders"));
final ImportFoldersPanel panel = new ImportFoldersPanel(
projDir,
distDir,
NB_DIST_NAME,
okOption);
final DialogDescriptor nd = new DialogDescriptor(
panel,
NbBundle.getMessage(PanelProjectLocationExtSrc.class, "TITLE_ImportProjectFolders"),
true,
new Object[] {okOption, NotifyDescriptor.CANCEL_OPTION},
okOption,
DialogDescriptor.DEFAULT_ALIGN,
null,
null);
if (DialogDisplayer.getDefault().notify(nd) == okOption) {
distName = panel.getDistFolder();
assert distName != null && distName.length() > 0;
settings.putProperty(NewJ2SEProjectWizardIterator.PROP_DIST_FOLDER, distName);
} else {
throw new WizardValidationException(projectLocation,
"", //NOI18N
NbBundle.getMessage(PanelProjectLocationExtSrc.class, "ERR_DistFolder"));
}
}
}
示例15: validate
import org.openide.WizardValidationException; //导入依赖的package包/类
@Override
void validate (WizardDescriptor d) throws WizardValidationException {
// sources root
searchClassFiles (((FolderList)this.sourcePanel).getFiles());
// test root, not asked in issue 48198
//searchClassFiles (FileUtil.toFileObject (FileUtil.normalizeFile(new File (tests.getText ()))));
}