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


Java PsiNameHelper.isIdentifier方法代码示例

本文整理汇总了Java中com.intellij.psi.PsiNameHelper.isIdentifier方法的典型用法代码示例。如果您正苦于以下问题:Java PsiNameHelper.isIdentifier方法的具体用法?Java PsiNameHelper.isIdentifier怎么用?Java PsiNameHelper.isIdentifier使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.psi.PsiNameHelper的用法示例。


在下文中一共展示了PsiNameHelper.isIdentifier方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: _commit

import com.intellij.psi.PsiNameHelper; //导入方法依赖的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

示例2: _commit

import com.intellij.psi.PsiNameHelper; //导入方法依赖的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

示例3: hasAcceptablePackage

import com.intellij.psi.PsiNameHelper; //导入方法依赖的package包/类
private boolean hasAcceptablePackage(@NotNull VirtualFile vFile)
{
	if(vFile.getFileType() == JavaClassFileType.INSTANCE)
	{
		// See IDEADEV-5626
		final VirtualFile root = ProjectRootManager.getInstance(myManager.getProject()).getFileIndex().getClassRootForFile(vFile);
		VirtualFile parent = vFile.getParent();
		final PsiNameHelper nameHelper = PsiNameHelper.getInstance(myManager.getProject());
		while(parent != null && !Comparing.equal(parent, root))
		{
			if(!nameHelper.isIdentifier(parent.getName()))
			{
				return false;
			}
			parent = parent.getParent();
		}
	}

	return true;
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:21,代码来源:JavaFileManagerImpl.java

示例4: canRun

import com.intellij.psi.PsiNameHelper; //导入方法依赖的package包/类
@Override
protected void canRun() throws ConfigurationException {
  final PsiNameHelper nameHelper = PsiNameHelper.getInstance(myProject);
  for (ParameterData parameterData : myParametersMap.values()) {
    if (!nameHelper.isIdentifier(parameterData.getFieldName())) throw new ConfigurationException("\'" + parameterData.getFieldName() + "\' is not a valid field name");
    if (!nameHelper.isIdentifier(parameterData.getSetterName())) throw new ConfigurationException("\'" + parameterData.getSetterName() + "\' is not a valid setter name");
  }
  if (myCreateBuilderClassRadioButton.isSelected()) {
    final String className = myNewClassName.getText().trim();
    if (className.length() == 0 || !nameHelper.isQualifiedName(className)) throw new ConfigurationException("\'" + className + "\' is invalid builder class name");
    final String packageName = myPackageTextField.getText().trim();
    if (packageName.length() > 0 && !nameHelper.isQualifiedName(packageName)) throw new ConfigurationException("\'" + packageName + "\' is invalid builder package name");
  } else {
    final String qualifiedName = myExistentClassTF.getText().trim();
    if (qualifiedName.length() == 0 || !nameHelper.isQualifiedName(qualifiedName)) throw new ConfigurationException("\'" + qualifiedName + "\' is invalid builder qualified class name");
  }
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:18,代码来源:ReplaceConstructorWithBuilderDialog.java

示例5: containsNonIdentifier

import com.intellij.psi.PsiNameHelper; //导入方法依赖的package包/类
public static boolean containsNonIdentifier(PsiNameHelper nameHelper, String packageName) {

        final StringTokenizer tokenizer = new StringTokenizer(packageName, ".");
        while(tokenizer.hasMoreTokens())
        {
            final String component = tokenizer.nextToken();
            if (!nameHelper.isIdentifier(component)) {
                return true;
            }
        }
        return false;
    }
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:PackageNameUtil.java

示例6: validateBuilderClassName

import com.intellij.psi.PsiNameHelper; //导入方法依赖的package包/类
private boolean validateBuilderClassName(@NotNull String builderClassName, @NotNull Project project, @NotNull ProblemBuilder builder) {
  final PsiNameHelper psiNameHelper = PsiNameHelper.getInstance(project);
  if (!psiNameHelper.isIdentifier(builderClassName)) {
    builder.addError("%s is not a valid identifier", builderClassName);
    return false;
  }
  return true;
}
 
开发者ID:mplushnikov,项目名称:lombok-intellij-plugin,代码行数:9,代码来源:BuilderHandler.java

示例7: validateButtons

import com.intellij.psi.PsiNameHelper; //导入方法依赖的package包/类
private void validateButtons(){
    final JavaPsiFacade manager = JavaPsiFacade.getInstance(project);
    final PsiNameHelper nameHelper = manager.getNameHelper();

    final String providerName = getProviderName();
    final String providedClass = getProvidedClass();
    final boolean valid = nameHelper.isIdentifier(providerName) && nameHelper.isQualifiedName(providedClass);
    getOKAction().setEnabled(valid);
}
 
开发者ID:consulo,项目名称:consulo-google-guice,代码行数:10,代码来源:ProviderDialog.java

示例8: canRun

import com.intellij.psi.PsiNameHelper; //导入方法依赖的package包/类
@Override
protected void canRun() throws ConfigurationException {
  final String name = myNameField.getEnteredName();
  final PsiNameHelper nameHelper = PsiNameHelper.getInstance(myContainingClass.getProject());
  if (!nameHelper.isIdentifier(name)) {
    throw new ConfigurationException("\'" + name + "\' is invalid factory method name");
  }
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:9,代码来源:ReplaceConstructorWithFactoryDialog.java

示例9: doOKAction

import com.intellij.psi.PsiNameHelper; //导入方法依赖的package包/类
protected void doOKAction(){
  final String packageName = myTfPackage.getText();
  final String className = getClassName();

  final String[] errorString = new String[1];
  final PsiManager manager = PsiManager.getInstance(myProject);
  final PsiNameHelper nameHelper = PsiNameHelper.getInstance(manager.getProject());
  if (packageName.length() > 0 && !nameHelper.isQualifiedName(packageName)) {
    errorString[0] = RefactoringBundle.message("invalid.target.package.name.specified");
  } else if (className != null && className.isEmpty()) {
    errorString[0] = RefactoringBundle.message("no.class.name.specified");
  } else {
    if (!nameHelper.isIdentifier(className)) {
      errorString[0] = RefactoringMessageUtil.getIncorrectIdentifierMessage(className);
    }
    else if (!myDoClone) {
      try {
        final PackageWrapper targetPackage = new PackageWrapper(manager, packageName);
        myDestination = myDestinationCB.selectDirectory(targetPackage, false);
        if (myDestination == null) return;
      }
      catch (IncorrectOperationException e) {
        errorString[0] = e.getMessage();
      }
    }
    RecentsManager.getInstance(myProject).registerRecentEntry(RECENTS_KEY, packageName);
  }

  if (errorString[0] != null) {
    if (errorString[0].length() > 0) {
      Messages.showMessageDialog(myProject, errorString[0], RefactoringBundle.message("error.title"), Messages.getErrorIcon());
    }
    myNameField.requestFocusInWindow();
    return;
  }
  super.doOKAction();
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:38,代码来源:CopyClassDialog.java

示例10: canRun

import com.intellij.psi.PsiNameHelper; //导入方法依赖的package包/类
@Override
protected void canRun() throws ConfigurationException {
  final String fieldName = getFieldName();
  final PsiNameHelper helper = PsiNameHelper.getInstance(myProject);
  if (!helper.isIdentifier(fieldName)){
    throw new ConfigurationException("\'" + fieldName + "\' is invalid field name for delegation");
  }
  if (myInnerClassNameField != null) {
    final String className = myInnerClassNameField.getEnteredName();
    if (!helper.isIdentifier(className)) {
      throw new ConfigurationException("\'" + className + "\' is invalid inner class name");
    }
  }
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:15,代码来源:InheritanceToDelegationDialog.java


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