当前位置: 首页>>代码示例>>Java>>正文


Java CommitStepException类代码示例

本文整理汇总了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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:KeystoreStep.java

示例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');
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:AndroidUtils.java

示例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();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:NewKeyStoreDialog.java

示例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();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:BindToNewBeanStep.java

示例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();
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:25,代码来源:BindToNewBeanStep.java

示例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;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:SupportForFrameworksStep.java

示例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);
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:ProjectTypeStep.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:ExportSignedPackageWizard.java

示例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());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:36,代码来源:GradleSignStep.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:ChooseModuleStep.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:KeystoreStep.java

示例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();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:NewKeyForm.java

示例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) {
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:35,代码来源:NewKeyForm.java

示例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');
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:AndroidUtils.java


注:本文中的com.intellij.ide.wizard.CommitStepException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。