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


Java BitUtil.isSet方法代码示例

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

示例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);
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:25,代码来源:ExpressionParsing.java

示例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);
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:23,代码来源:CSharpElementCompareUtil.java

示例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());
			}
		}
	}
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:21,代码来源:CSharpElementTreeNode.java

示例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());
	}
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:26,代码来源:CSharpTypeStubElementType.java

示例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;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:24,代码来源:RequestFocusHttpRequestHandler.java

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

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

示例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);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:21,代码来源:DesktopToolWindowHeader.java

示例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;
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:27,代码来源:PsiModifierListImpl.java

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

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

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

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

示例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;
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:9,代码来源:CSharpElementPresentationUtil.java


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