本文整理汇总了Java中com.intellij.util.BitUtil.isSet方法的典型用法代码示例。如果您正苦于以下问题:Java BitUtil.isSet方法的具体用法?Java BitUtil.isSet怎么用?Java BitUtil.isSet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.util.BitUtil
的用法示例。
在下文中一共展示了BitUtil.isSet方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ToolkitBugsProcessor
import com.intellij.util.BitUtil; //导入方法依赖的package包/类
public ToolkitBugsProcessor() {
Class<?>[] classes = getClass().getDeclaredClasses();
for (Class<?> each : classes) {
if (!BitUtil.isSet(each.getModifiers(), Modifier.ABSTRACT) && Handler.class.isAssignableFrom(each)) {
try {
Handler eachHandler = (Handler)each.newInstance();
if (eachHandler.isActual()) {
myHandlers.add(eachHandler);
}
}
catch (Throwable e) {
LOG.error(e);
}
}
}
}
示例2: parseReferenceTypeArgumentList
import com.intellij.util.BitUtil; //导入方法依赖的package包/类
@Nullable
private static PsiBuilder.Marker parseReferenceTypeArgumentList(@NotNull CSharpBuilderWrapper builder, int flags)
{
IElementType startElementType = BitUtil.isSet(flags, INSIDE_DOC) ? LBRACE : LT;
if(builder.getTokenType() != startElementType)
{
return null;
}
if(BitUtil.isSet(flags, ALLOW_EMPTY_TYPE_ARGUMENTS))
{
if(BitUtil.isSet(flags, STUB_SUPPORT))
{
throw new IllegalArgumentException("Empty type arguments is not allowed inside stub tree");
}
PsiBuilder.Marker marker = parseReferenceEmptyTypeArgumentListImpl(builder);
if(marker != null)
{
return marker;
}
}
return parseReferenceTypeArgumentListImpl(builder, flags);
}
示例3: compareVirtualImpl
import com.intellij.util.BitUtil; //导入方法依赖的package包/类
@RequiredReadAction
private static boolean compareVirtualImpl(@NotNull PsiElement o1, @NotNull PsiElement o2, int flags, @NotNull PsiElement scope)
{
if(!BitUtil.isSet(flags, CHECK_VIRTUAL_IMPL_TYPE))
{
return true;
}
DotNetType type1 = ((DotNetVirtualImplementOwner) o1).getTypeForImplement();
DotNetType type2 = ((DotNetVirtualImplementOwner) o2).getTypeForImplement();
if(type1 == null && type2 == null)
{
return true;
}
if(type1 == null || type2 == null)
{
return false;
}
// we need call getTypeRefForImplement() due light element have ref for original DotNetType but getTypeRefForImplement() ill return another
return CSharpTypeUtil.isTypeEqual(((DotNetVirtualImplementOwner) o1).getTypeRefForImplement(), ((DotNetVirtualImplementOwner) o2).getTypeRefForImplement(), scope);
}
示例4: updateImpl
import com.intellij.util.BitUtil; //导入方法依赖的package包/类
@Override
@RequiredDispatchThread
protected void updateImpl(PresentationData presentationData)
{
DotNetNamedElement value = getValue();
presentationData.setPresentableText(getPresentableText(value));
if(BitUtil.isSet(myFlags, ALLOW_GRAY_FILE_NAME))
{
PsiFile containingFile = value.getContainingFile();
if(containingFile != null)
{
if(!Comparing.equal(FileUtil.getNameWithoutExtension(containingFile.getName()), value.getName()))
{
presentationData.setLocationString(containingFile.getName());
}
}
}
}
示例5: indexStub
import com.intellij.util.BitUtil; //导入方法依赖的package包/类
@Override
@RequiredReadAction
public void indexStub(@NotNull CSharpTypeDeclStub stub, @NotNull IndexSink indexSink)
{
String name = getName(stub);
if(!StringUtil.isEmpty(name))
{
indexSink.occurrence(CSharpIndexKeys.TYPE_INDEX, name);
String parentQName = stub.getParentQName();
if(!stub.isNested())
{
DotNetNamespaceStubUtil.indexStub(indexSink, CSharpIndexKeys.MEMBER_BY_NAMESPACE_QNAME_INDEX, CSharpIndexKeys.MEMBER_BY_ALL_NAMESPACE_QNAME_INDEX, parentQName, name);
if(BitUtil.isSet(stub.getOtherModifierMask(), CSharpTypeDeclStub.HAVE_EXTENSIONS))
{
indexSink.occurrence(CSharpIndexKeys.TYPE_WITH_EXTENSION_METHODS_INDEX, DotNetNamespaceStubUtil.getIndexableNamespace(parentQName));
}
}
indexSink.occurrence(CSharpIndexKeys.TYPE_BY_QNAME_INDEX, getNameWithNamespaceForIndexing(parentQName, name));
indexSink.occurrence(CSharpIndexKeys.TYPE_BY_VMQNAME_INDEX, stub.getVmQName());
}
}
示例6: activateFrame
import com.intellij.util.BitUtil; //导入方法依赖的package包/类
public static boolean activateFrame(@Nullable final Frame frame) {
if (frame != null) {
Runnable runnable = new Runnable() {
@Override
public void run() {
int extendedState = frame.getExtendedState();
if (BitUtil.isSet(extendedState, Frame.ICONIFIED)) {
extendedState = BitUtil.set(extendedState, Frame.ICONIFIED, false);
frame.setExtendedState(extendedState);
}
// fixme [vistall] dirty hack - show frame on top
frame.setAlwaysOnTop(true);
frame.setAlwaysOnTop(false);
IdeFocusManager.getGlobalInstance().doForceFocusWhenFocusSettlesDown(frame);
}
};
//noinspection SSBasedInspection
SwingUtilities.invokeLater(runnable);
return true;
}
return false;
}
示例7: formatMethod
import com.intellij.util.BitUtil; //导入方法依赖的package包/类
@NotNull
@Deprecated
public static String formatMethod(@NotNull DotNetLikeMethodDeclaration methodDeclaration, int flags)
{
StringBuilder builder = new StringBuilder();
if(BitUtil.isSet(flags, METHOD_WITH_RETURN_TYPE) && !BitUtil.isSet(flags, METHOD_SCALA_FORMAT))
{
if(!(methodDeclaration instanceof DotNetConstructorDeclaration))
{
builder.append(methodDeclaration.getReturnTypeRef().getPresentableText()).append(" ");
}
}
if(methodDeclaration instanceof DotNetConstructorDeclaration && ((DotNetConstructorDeclaration) methodDeclaration).isDeConstructor())
{
builder.append("~");
}
builder.append(methodDeclaration.getName());
formatTypeGenericParameters(methodDeclaration.getGenericParameters(), builder);
formatParameters(methodDeclaration, builder, flags);
return builder.toString();
}
示例8: actionPerformed
import com.intellij.util.BitUtil; //导入方法依赖的package包/类
@RequiredDispatchThread
@Override
public void actionPerformed(final AnActionEvent e) {
final FileEditorManagerEx mgr = FileEditorManagerEx.getInstanceEx(myProject);
consulo.fileEditor.impl.EditorWindow window;
final VirtualFile file = (VirtualFile)myTabInfo.getObject();
if (ActionPlaces.EDITOR_TAB.equals(e.getPlace())) {
window = myWindow;
}
else {
window = mgr.getCurrentWindow();
}
if (window != null) {
if (BitUtil.isSet(e.getModifiers(), InputEvent.ALT_MASK)) {
window.closeAllExcept(file);
}
else {
if (window.findFileComposite(file) != null) {
mgr.closeFile(file, window);
}
}
}
}
示例9: actionPerformed
import com.intellij.util.BitUtil; //导入方法依赖的package包/类
@Override
@RequiredDispatchThread
public void actionPerformed(final ActionEvent e) {
AnAction action =
myAlternativeAction != null && BitUtil.isSet(e.getModifiers(), InputEvent.ALT_MASK) ? myAlternativeAction : myAction;
final DataContext dataContext = DataManager.getInstance().getDataContext(this);
final ActionManagerEx actionManager = ActionManagerEx.getInstanceEx();
InputEvent inputEvent = e.getSource() instanceof InputEvent ? (InputEvent) e.getSource() : null;
final AnActionEvent event =
new AnActionEvent(inputEvent, dataContext, ActionPlaces.TOOLWINDOW_TITLE, action.getTemplatePresentation(),
ActionManager.getInstance(),
0);
actionManager.fireBeforeActionPerformed(action, dataContext, event);
final Component component = dataContext.getData(PlatformDataKeys.CONTEXT_COMPONENT);
if (component != null && !component.isShowing()) {
return;
}
action.actionPerformed(event);
}
示例10: calcExplicitModifiers
import com.intellij.util.BitUtil; //导入方法依赖的package包/类
private Set<String> calcExplicitModifiers()
{
Set<String> explicitModifiers = ContainerUtil.newHashSet();
PsiModifierListStub stub = getGreenStub();
if(stub != null)
{
int mask = stub.getModifiersMask();
for(int i = 0; i < 31; i++)
{
int flag = 1 << i;
if(BitUtil.isSet(mask, flag))
{
ContainerUtil.addIfNotNull(explicitModifiers, ModifierFlags.MODIFIER_FLAG_TO_NAME_MAP.get(flag));
}
}
}
else
{
for(ASTNode child : getNode().getChildren(null))
{
ContainerUtil.addIfNotNull(explicitModifiers, KEYWORD_TYPE_TO_NAME_MAP.get(child.getElementType()));
}
}
return explicitModifiers;
}
示例11: actionPerformed
import com.intellij.util.BitUtil; //导入方法依赖的package包/类
public void actionPerformed(final ActionEvent e) {
AnAction action =
myAlternativeAction != null && BitUtil.isSet(e.getModifiers(), InputEvent.ALT_MASK) ? myAlternativeAction : myAction;
final DataContext dataContext = DataManager.getInstance().getDataContext(this);
final ActionManagerEx actionManager = ActionManagerEx.getInstanceEx();
InputEvent inputEvent = e.getSource() instanceof InputEvent ? (InputEvent) e.getSource() : null;
final AnActionEvent event = AnActionEvent.createFromAnAction(action, inputEvent, ActionPlaces.TOOLWINDOW_TITLE, dataContext);
actionManager.fireBeforeActionPerformed(action, dataContext, event);
final Component component = PlatformDataKeys.CONTEXT_COMPONENT.getData(dataContext);
if (component != null && !component.isShowing()) {
return;
}
action.actionPerformed(event);
}
示例12: setSelected
import com.intellij.util.BitUtil; //导入方法依赖的package包/类
@Override
public void setSelected(@Nullable AnActionEvent e, boolean selected) {
if (e == null) return;
boolean macMainMenu = SystemInfo.isMac && ActionPlaces.isMainMenuOrActionSearch(e.getPlace());
if (!selected && !macMainMenu) {
return;
}
final Project project = findProject();
if (project == null) {
return;
}
final JFrame projectFrame = WindowManager.getInstance().getFrame(project);
final int frameState = projectFrame.getExtendedState();
if (macMainMenu && !(e.getInputEvent().getSource() instanceof ActionMenuItem) && (projectFrame.getExtendedState() & Frame.ICONIFIED) != 0) {
// On Mac minimized window should not be restored this way
return;
}
if (BitUtil.isSet(frameState, Frame.ICONIFIED)) {
// restore the frame if it is minimized
projectFrame.setExtendedState(frameState ^ Frame.ICONIFIED);
}
projectFrame.toFront();
projectFrame.requestFocus();
//ProjectUtil.focusProjectWindow(project, true);
}
示例13: doInitFlags
import com.intellij.util.BitUtil; //导入方法依赖的package包/类
@Override
protected void doInitFlags(int flags) {
super.doInitFlags(flags);
flags = (flags >> FLAGS_SHIFT) & 0xFF;
isHashedLeaf = BitUtil.isSet(flags, HASHED_LEAF_MASK);
isIndexLeaf = BitUtil.isSet(flags, INDEX_LEAF_MASK);
}
示例14: itemSelected
import com.intellij.util.BitUtil; //导入方法依赖的package包/类
@Override
public void itemSelected(@NotNull final BreadcrumbsPsiItem item, final int modifiers) {
final PsiElement psiElement = item.getPsiElement();
moveEditorCaretTo(psiElement);
if (BitUtil.isSet(modifiers, Event.SHIFT_MASK) || BitUtil.isSet(modifiers, Event.META_MASK)) {
final TextRange range = psiElement.getTextRange();
myEditor.getSelectionModel().setSelection(range.getStartOffset(), range.getEndOffset());
}
}
示例15: typeRefMask
import com.intellij.util.BitUtil; //导入方法依赖的package包/类
private static int typeRefMask(int flags)
{
if(BitUtil.isSet(flags, NON_QUALIFIED_TYPE))
{
return CSharpTypeRefPresentationUtil.TYPE_KEYWORD;
}
return CSharpTypeRefPresentationUtil.QUALIFIED_NAME_WITH_KEYWORD;
}