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


Java JdtFlags.VISIBILITY_STRING_PRIVATE属性代码示例

本文整理汇总了Java中org.eclipse.jdt.internal.corext.util.JdtFlags.VISIBILITY_STRING_PRIVATE属性的典型用法代码示例。如果您正苦于以下问题:Java JdtFlags.VISIBILITY_STRING_PRIVATE属性的具体用法?Java JdtFlags.VISIBILITY_STRING_PRIVATE怎么用?Java JdtFlags.VISIBILITY_STRING_PRIVATE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.eclipse.jdt.internal.corext.util.JdtFlags的用法示例。


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

示例1: replaceExpressionsWithConstant

private void replaceExpressionsWithConstant() throws JavaModelException {
  ASTRewrite astRewrite = fCuRewrite.getASTRewrite();
  AST ast = astRewrite.getAST();

  IASTFragment[] fragmentsToReplace = getFragmentsToReplace();
  for (int i = 0; i < fragmentsToReplace.length; i++) {
    IASTFragment fragment = fragmentsToReplace[i];
    ASTNode node = fragment.getAssociatedNode();
    boolean inTypeDeclarationAnnotation = isInTypeDeclarationAnnotation(node);
    if (inTypeDeclarationAnnotation && JdtFlags.VISIBILITY_STRING_PRIVATE == getVisibility())
      continue;

    SimpleName ref = ast.newSimpleName(fConstantName);
    Name replacement = ref;
    boolean qualifyReference = qualifyReferencesWithDeclaringClassName();
    if (!qualifyReference) {
      qualifyReference = inTypeDeclarationAnnotation;
    }
    if (qualifyReference) {
      replacement =
          ast.newQualifiedName(ast.newSimpleName(getContainingTypeBinding().getName()), ref);
    }
    TextEditGroup description =
        fCuRewrite.createGroupDescription(
            RefactoringCoreMessages.ExtractConstantRefactoring_replace);

    fragment.replace(astRewrite, replacement, description);
    if (fLinkedProposalModel != null)
      fLinkedProposalModel
          .getPositionGroup(KEY_NAME, true)
          .addPosition(astRewrite.track(ref), false);
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:33,代码来源:ExtractConstantRefactoring.java

示例2: replaceExpressionsWithConstant

private void replaceExpressionsWithConstant() throws JavaModelException {
	ASTRewrite astRewrite= fCuRewrite.getASTRewrite();
	AST ast= astRewrite.getAST();

	IASTFragment[] fragmentsToReplace= getFragmentsToReplace();
	for (int i= 0; i < fragmentsToReplace.length; i++) {
		IASTFragment fragment= fragmentsToReplace[i];
		ASTNode node= fragment.getAssociatedNode();
		boolean inTypeDeclarationAnnotation= isInTypeDeclarationAnnotation(node);
		if (inTypeDeclarationAnnotation && JdtFlags.VISIBILITY_STRING_PRIVATE == getVisibility())
			continue;

		SimpleName ref= ast.newSimpleName(fConstantName);
		Name replacement= ref;
		boolean qualifyReference= qualifyReferencesWithDeclaringClassName();
		if (!qualifyReference) {
			qualifyReference= inTypeDeclarationAnnotation;
		}
		if (qualifyReference) {
			replacement= ast.newQualifiedName(ast.newSimpleName(getContainingTypeBinding().getName()), ref);
		}
		TextEditGroup description= fCuRewrite.createGroupDescription(RefactoringCoreMessages.ExtractConstantRefactoring_replace);

		fragment.replace(astRewrite, replacement, description);
		if (fLinkedProposalModel != null)
			fLinkedProposalModel.getPositionGroup(KEY_NAME, true).addPosition(astRewrite.track(ref), false);
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:28,代码来源:ExtractConstantRefactoring.java

示例3: getAccessModifierString

private String getAccessModifierString(int modifier) {
	switch (modifier) {
		case Modifier.PUBLIC :
			return JdtFlags.VISIBILITY_STRING_PUBLIC;
		case Modifier.PROTECTED :
			return JdtFlags.VISIBILITY_STRING_PROTECTED;
		case Modifier.NONE :
			return RefactoringMessages.ChangeSignatureInputPage_default;
		case Modifier.PRIVATE :
			return JdtFlags.VISIBILITY_STRING_PRIVATE;
		default :
			throw new IllegalArgumentException("\"" + modifier + "\" is not a Modifier constant"); //$NON-NLS-1$ //$NON-NLS-2$
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:14,代码来源:ChangeSignatureWizard.java

示例4: addAccessModifierGroup

private void addAccessModifierGroup(Composite result, RowLayouter layouter) {
	fAccessModifier= getExtractConstantRefactoring().getVisibility();
	if (getExtractConstantRefactoring().getTargetIsInterface())
		return;

	Label label= new Label(result, SWT.NONE);
	label.setText(RefactoringMessages.ExtractConstantInputPage_access_modifiers);

	Composite group= new Composite(result, SWT.NONE);
	group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
	GridLayout layout= new GridLayout();
	layout.numColumns= 4; layout.marginWidth= 0;
	group.setLayout(layout);

	String[] labels= new String[] {
		RefactoringMessages.ExtractMethodInputPage_public,
		RefactoringMessages.ExtractMethodInputPage_protected,
		RefactoringMessages.ExtractMethodInputPage_default,
		RefactoringMessages.ExtractMethodInputPage_private
	};
	String[] data= new String[] { JdtFlags.VISIBILITY_STRING_PUBLIC,
								  JdtFlags.VISIBILITY_STRING_PROTECTED,
								  JdtFlags.VISIBILITY_STRING_PACKAGE,
								  JdtFlags.VISIBILITY_STRING_PRIVATE }; //

	updateContentAssistImage();
	for (int i= 0; i < labels.length; i++) {
		Button radio= new Button(group, SWT.RADIO);
		radio.setText(labels[i]);
		radio.setData(data[i]);
		if (data[i] == fAccessModifier)
			radio.setSelection(true);
		radio.addSelectionListener(new SelectionAdapter() {
			@Override
			public void widgetSelected(SelectionEvent event) {
				setAccessModifier((String)event.widget.getData());
			}
		});
	}
	layouter.perform(label, group, 1);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:41,代码来源:ExtractConstantWizard.java


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