本文整理汇总了Java中com.intellij.ide.wizard.CommitStepException类的典型用法代码示例。如果您正苦于以下问题:Java CommitStepException类的具体用法?Java CommitStepException怎么用?Java CommitStepException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CommitStepException类属于com.intellij.ide.wizard包,在下文中一共展示了CommitStepException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadKeyAndSaveToWizard
import com.intellij.ide.wizard.CommitStepException; //导入依赖的package包/类
private void loadKeyAndSaveToWizard(KeyStore keyStore, String alias, char[] keyPassword) throws CommitStepException {
KeyStore.PrivateKeyEntry entry;
try {
assert keyStore != null;
entry = (KeyStore.PrivateKeyEntry)keyStore.getEntry(alias, new KeyStore.PasswordProtection(keyPassword));
}
catch (Exception e) {
throw new CommitStepException("Error: " + e.getMessage());
}
if (entry == null) {
throw new CommitStepException(AndroidBundle.message("android.extract.package.cannot.find.key.error", alias));
}
PrivateKey privateKey = entry.getPrivateKey();
Certificate certificate = entry.getCertificate();
if (privateKey == null || certificate == null) {
throw new CommitStepException(AndroidBundle.message("android.extract.package.cannot.find.key.error", alias));
}
myWizard.setPrivateKey(privateKey);
myWizard.setCertificate((X509Certificate)certificate);
}
示例2: checkNewPassword
import com.intellij.ide.wizard.CommitStepException; //导入依赖的package包/类
public static void checkNewPassword(JPasswordField passwordField, JPasswordField confirmedPasswordField) throws CommitStepException {
char[] password = passwordField.getPassword();
char[] confirmedPassword = confirmedPasswordField.getPassword();
try {
checkPassword(password);
if (password.length < 6) {
throw new CommitStepException(AndroidBundle.message("android.export.package.incorrect.password.length"));
}
if (!Arrays.equals(password, confirmedPassword)) {
throw new CommitStepException(AndroidBundle.message("android.export.package.passwords.not.match.error"));
}
}
finally {
Arrays.fill(password, '\0');
Arrays.fill(confirmedPassword, '\0');
}
}
示例3: doOKAction
import com.intellij.ide.wizard.CommitStepException; //导入依赖的package包/类
@Override
protected void doOKAction() {
if (getKeyStorePath().length() == 0) {
Messages.showErrorDialog(myPanel, "Specify key store path", CommonBundle.getErrorTitle());
return;
}
try {
AndroidUtils.checkNewPassword(myPasswordField, myConfirmedPassword);
myNewKeyForm.createKey();
}
catch (CommitStepException e) {
Messages.showErrorDialog(myPanel, e.getMessage(), CommonBundle.getErrorTitle());
return;
}
super.doOKAction();
}
示例4: _commit
import com.intellij.ide.wizard.CommitStepException; //导入依赖的package包/类
public void _commit(boolean finishChosen) throws CommitStepException {
// Stop editing if any
final TableCellEditor cellEditor = myTable.getCellEditor();
if(cellEditor != null){
cellEditor.stopCellEditing();
}
// Check that all included fields are bound to valid bean properties
final PsiNameHelper nameHelper = PsiNameHelper.getInstance(myData.myProject);
for(int i = 0; i <myData.myBindings.length; i++){
final FormProperty2BeanProperty binding = myData.myBindings[i];
if(binding.myBeanProperty == null){
continue;
}
if (!nameHelper.isIdentifier(binding.myBeanProperty.myName)){
throw new CommitStepException(
UIDesignerBundle.message("error.X.is.not.a.valid.property.name", binding.myBeanProperty.myName)
);
}
}
myData.myGenerateIsModified = myChkIsModified.isSelected();
}
示例5: _commit
import com.intellij.ide.wizard.CommitStepException; //导入依赖的package包/类
public void _commit(boolean finishChosen) throws CommitStepException {
// Stop editing if any
final TableCellEditor cellEditor = myTable.getCellEditor();
if(cellEditor != null){
cellEditor.stopCellEditing();
}
// Check that all included fields are bound to valid bean properties
final PsiNameHelper nameHelper = JavaPsiFacade.getInstance(myData.myProject).getNameHelper();
for(int i = 0; i <myData.myBindings.length; i++){
final FormProperty2BeanProperty binding = myData.myBindings[i];
if(binding.myBeanProperty == null){
continue;
}
if (!nameHelper.isIdentifier(binding.myBeanProperty.myName)){
throw new CommitStepException(
UIDesignerBundle.message("error.X.is.not.a.valid.property.name", binding.myBeanProperty.myName)
);
}
}
myData.myGenerateIsModified = myChkIsModified.isSelected();
}
示例6: onWizardFinished
import com.intellij.ide.wizard.CommitStepException; //导入依赖的package包/类
public void onWizardFinished() throws CommitStepException {
// This method is called even non-hybris builder is used for importing and the step
// hasn't been even shown to a user, so we can't use getContext() here.
final ProjectImportBuilder builder = getBuilder();
if (builder instanceof AbstractHybrisProjectImportBuilder) {
((AbstractHybrisProjectImportBuilder) builder).resetExternalStepName();
}
super.onWizardFinished();
}
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:11,代码来源:SelectOtherModulesToImportStep.java
示例7: _commit
import com.intellij.ide.wizard.CommitStepException; //导入依赖的package包/类
public void _commit(final boolean finishChosen) throws CommitStepException {
if (finishChosen && !myCommitted) {
boolean ok = mySupportForFrameworksPanel.downloadLibraries();
if (!ok) {
int answer = Messages.showYesNoDialog(getComponent(),
ProjectBundle.message("warning.message.some.required.libraries.wasn.t.downloaded"),
CommonBundle.getWarningTitle(), Messages.getWarningIcon());
if (answer != Messages.YES) {
throw new CommitStepException(null);
}
}
myCommitted = true;
}
}
示例8: onWizardFinished
import com.intellij.ide.wizard.CommitStepException; //导入依赖的package包/类
public void onWizardFinished() throws CommitStepException {
if (isFrameworksMode()) {
boolean ok = myFrameworksPanel.downloadLibraries();
if (!ok) {
int answer = Messages.showYesNoDialog(getComponent(),
ProjectBundle.message("warning.message.some.required.libraries.wasn.t.downloaded"),
CommonBundle.getWarningTitle(), Messages.getWarningIcon());
if (answer != Messages.YES) {
throw new CommitStepException(null);
}
}
}
}
示例9: commitCurrentStep
import com.intellij.ide.wizard.CommitStepException; //导入依赖的package包/类
private boolean commitCurrentStep() {
try {
mySteps.get(myCurrentStep).commitForNext();
}
catch (CommitStepException e) {
Messages.showErrorDialog(getContentPane(), e.getMessage());
return false;
}
return true;
}
示例10: commitForNext
import com.intellij.ide.wizard.CommitStepException; //导入依赖的package包/类
@Override
protected void commitForNext() throws CommitStepException {
if (myIdeaAndroidProject == null) {
throw new CommitStepException(AndroidBundle.message("android.apk.sign.gradle.no.model"));
}
final String apkFolder = myApkPathField.getText().trim();
if (apkFolder.isEmpty()) {
throw new CommitStepException(AndroidBundle.message("android.apk.sign.gradle.missing.destination"));
}
File f = new File(apkFolder);
if (!f.isDirectory() || !f.canWrite()) {
throw new CommitStepException(AndroidBundle.message("android.apk.sign.gradle.invalid.destination"));
}
int[] selectedFlavorIndices = myFlavorsList.getSelectedIndices();
if (!myFlavorsListModel.isEmpty() && selectedFlavorIndices.length == 0) {
throw new CommitStepException(AndroidBundle.message("android.apk.sign.gradle.missing.flavors"));
}
Object[] selectedFlavors = myFlavorsList.getSelectedValues();
List<String> flavors = new ArrayList<String>(selectedFlavors.length);
for (int i = 0; i < selectedFlavors.length; i++) {
flavors.add((String)selectedFlavors[i]);
}
myWizard.setApkPath(apkFolder);
myWizard.setGradleOptions((String)myBuildTypeCombo.getSelectedItem(), flavors);
PropertiesComponent properties = PropertiesComponent.getInstance(myWizard.getProject());
properties.setValue(PROPERTY_APK_PATH, apkFolder);
properties.setValues(PROPERTY_FLAVORS, ArrayUtil.toStringArray(flavors));
properties.setValue(PROPERTY_BUILD_TYPE, (String)myBuildTypeCombo.getSelectedItem());
}
示例11: commitForNext
import com.intellij.ide.wizard.CommitStepException; //导入依赖的package包/类
@Override
protected void commitForNext() throws CommitStepException {
if (myCheckModulePanel.hasError()) {
throw new CommitStepException(AndroidBundle.message("android.project.contains.errors.error"));
}
AndroidFacet selectedFacet = getSelectedFacet();
assert selectedFacet != null;
myWizard.setFacet(selectedFacet);
}
示例12: loadKeyStore
import com.intellij.ide.wizard.CommitStepException; //导入依赖的package包/类
private KeyStore loadKeyStore(File keystoreFile) throws CommitStepException {
final char[] password = myKeyStorePasswordField.getPassword();
FileInputStream fis = null;
AndroidUtils.checkPassword(password);
if (!keystoreFile.isFile()) {
throw new CommitStepException(AndroidBundle.message("android.cannot.find.file.error", keystoreFile.getPath()));
}
final KeyStore keyStore;
try {
keyStore = KeyStore.getInstance(KeyStore.getDefaultType());
//noinspection IOResourceOpenedButNotSafelyClosed
fis = new FileInputStream(keystoreFile);
keyStore.load(fis, password);
}
catch (Exception e) {
throw new CommitStepException(e.getMessage());
}
finally {
if (fis != null) {
try {
fis.close();
}
catch (IOException ignored) {
}
}
Arrays.fill(password, '\0');
}
return keyStore;
}
示例13: createKey
import com.intellij.ide.wizard.CommitStepException; //导入依赖的package包/类
public void createKey() throws CommitStepException {
if (getKeyAlias().length() == 0) {
throw new CommitStepException(AndroidBundle.message("android.export.package.specify.key.alias.error"));
}
AndroidUtils.checkNewPassword(myKeyPasswordField, myConfirmKeyPasswordField);
if (!findNonEmptyCertificateField()) {
throw new CommitStepException(AndroidBundle.message("android.export.package.specify.certificate.field.error"));
}
doCreateKey();
}
示例14: loadKeystoreAndKey
import com.intellij.ide.wizard.CommitStepException; //导入依赖的package包/类
private void loadKeystoreAndKey(String keystoreLocation, String keystorePassword, String keyAlias, String keyPassword)
throws CommitStepException {
FileInputStream fis = null;
try {
KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());
fis = new FileInputStream(new File(keystoreLocation));
keyStore.load(fis, keystorePassword.toCharArray());
myKeyStore = keyStore;
KeyStore.PrivateKeyEntry entry = (KeyStore.PrivateKeyEntry)keyStore.getEntry(
keyAlias, new KeyStore.PasswordProtection(keyPassword.toCharArray()));
if (entry == null) {
throw new CommitStepException(AndroidBundle.message("android.extract.package.cannot.find.key.error", keyAlias));
}
PrivateKey privateKey = entry.getPrivateKey();
Certificate certificate = entry.getCertificate();
if (privateKey == null || certificate == null) {
throw new CommitStepException(AndroidBundle.message("android.extract.package.cannot.find.key.error", keyAlias));
}
myPrivateKey = privateKey;
myCertificate = (X509Certificate)certificate;
}
catch (Exception e) {
throw new CommitStepException("Error: " + e.getMessage());
}
finally {
if (fis != null) {
try {
fis.close();
}
catch (IOException ignored) {
}
}
}
}
示例15: checkPassword
import com.intellij.ide.wizard.CommitStepException; //导入依赖的package包/类
public static void checkPassword(JPasswordField passwordField) throws CommitStepException {
char[] password = passwordField.getPassword();
try {
checkPassword(password);
}
finally {
Arrays.fill(password, '\0');
}
}