本文整理汇总了Java中org.eclipse.jdt.internal.corext.util.JdtFlags.VISIBILITY_STRING_PUBLIC属性的典型用法代码示例。如果您正苦于以下问题:Java JdtFlags.VISIBILITY_STRING_PUBLIC属性的具体用法?Java JdtFlags.VISIBILITY_STRING_PUBLIC怎么用?Java JdtFlags.VISIBILITY_STRING_PUBLIC使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.jdt.internal.corext.util.JdtFlags
的用法示例。
在下文中一共展示了JdtFlags.VISIBILITY_STRING_PUBLIC属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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$
}
}
示例2: 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);
}