• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java BitUtil类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.intellij.util.BitUtil的典型用法代码示例。如果您正苦于以下问题:Java BitUtil类的具体用法?Java BitUtil怎么用?Java BitUtil使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: reset

import com.intellij.util.BitUtil; //导入依赖的package包/类
@Override
public void reset(@NotNull TextAttributes ta) {
    myCbBold.setEnabled(true);
    myCbItalic.setEnabled(true);

    int fontType = ta.getFontType();
    myCbBold.setSelected(BitUtil.isSet(fontType, Font.BOLD));
    myCbItalic.setSelected(BitUtil.isSet(fontType, Font.ITALIC));

    resetColorChooser(myCbForeground, myForegroundChooser, ta.getForegroundColor());
    resetColorChooser(myCbBackground, myBackgroundChooser, ta.getBackgroundColor());
    resetColorChooser(myCbErrorStripe, myErrorStripeColorChooser, ta.getErrorStripeColor());

    Color effectColor = ta.getEffectColor();
    resetColorChooser(myCbEffects, myEffectsColorChooser, effectColor);

    if (effectColor == null) {
        myEffectsCombo.setEnabled(false);
    } else {
        myEffectsCombo.setEnabled(true);
        myEffectsModel.setSelectedItem(
                ContainerUtil.reverseMap(myEffectsMap).get(ta.getEffectType()));
    }
}
 
开发者ID:huoguangjin,项目名称:MultiHighlight,代码行数:25,代码来源:ColorChooserPanel.java


示例2: 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


示例3: buildToBytecode

import com.intellij.util.BitUtil; //导入依赖的package包/类
@Override
public void buildToBytecode(ClassWriter parent)
{
	int access = 0;
	access = BitUtil.set(access, Opcodes.ACC_STATIC, myModifiers.contains(PsiModifier.STATIC));
	access = BitUtil.set(access, Opcodes.ACC_PUBLIC, myModifiers.contains(PsiModifier.PUBLIC));

	StringBuilder descBuilder = new StringBuilder();
	descBuilder.append("(");
	for(JavaParameterStubBuilder parameter : myParameters)
	{
		appendType(parameter.getType(), descBuilder);
	}
	descBuilder.append(")");
	appendType(myReturnType, descBuilder);

	try
	{
		parent.visitMethod(access, myName, descBuilder.toString(), null, null).visitEnd();
	}
	catch(Exception e)
	{
		e.printStackTrace();
	}
}
 
开发者ID:consulo,项目名称:consulo-ikvm,代码行数:26,代码来源:JavaMethodStubBuilder.java


示例4: parseModifierList

import com.intellij.util.BitUtil; //导入依赖的package包/类
protected static Pair<PsiBuilder.Marker, ModifierSet> parseModifierList(CSharpBuilderWrapper builder, int flags)
{
	PsiBuilder.Marker marker = builder.mark();

	Set<IElementType> set = new THashSet<>();
	while(!builder.eof())
	{
		if(MODIFIERS.contains(builder.getTokenType()))
		{
			set.add(builder.getTokenType());

			builder.advanceLexer();
		}
		else
		{
			break;
		}
	}
	marker.done(BitUtil.isSet(flags, STUB_SUPPORT) ? CSharpStubElements.MODIFIER_LIST : CSharpElements.MODIFIER_LIST);
	return Pair.create(marker, ModifierSet.create(set));
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:22,代码来源:SharedParsingHelpers.java


示例5: 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


示例6: 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


示例7: 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


示例8: getChildrenImpl

import com.intellij.util.BitUtil; //导入依赖的package包/类
@Nullable
@Override
@RequiredDispatchThread
protected Collection<AbstractTreeNode> getChildrenImpl()
{
	final ViewSettings settings = getSettings();
	if(!settings.isShowMembers() && !BitUtil.isSet(myFlags, FORCE_EXPAND))
	{
		return Collections.emptyList();
	}

	DotNetNamedElement[] members = filterNamespaces(getValue());
	if(members.length == 0)
	{
		return Collections.emptyList();
	}

	List<AbstractTreeNode> list = new ArrayList<>(members.length);
	for(DotNetNamedElement dotNetElement : members)
	{
		list.add(new CSharpElementTreeNode(dotNetElement, settings, 0));
	}
	return list;
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:25,代码来源:CSharpElementTreeNode.java


示例9: 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


示例10: getResultCacheResultImpl

import com.intellij.util.BitUtil; //导入依赖的package包/类
@Exported
@NotNull
@RequiredReadAction
private static <E extends PsiElement> DotNetTypeRef getResultCacheResultImpl(@NotNull Key<CachedValue<DotNetTypeRef>> cachedValueKey,
		@NotNull E element,
		@NotNull Key dropKey,
		@NotNull final NotNullFunction<E, DotNetTypeRef> resolver)
{
	Class<? extends NotNullFunction> aClass = resolver.getClass();
	if(!BitUtil.isSet(aClass.getModifiers(), Modifier.STATIC))
	{
		throw new IllegalArgumentException("Accepted only static resolver");
	}

	CachedValue<DotNetTypeRef> cachedValue = element.getUserData(cachedValueKey);
	if(cachedValue == null)
	{
		DotNetTypeRefCachedValueProvider<E> provider = new DotNetTypeRefCachedValueProvider<>(dropKey, element, resolver);

		cachedValue = ((UserDataHolderEx) element).putUserDataIfAbsent(cachedValueKey, CachedValuesManager.getManager(element.getProject()).createCachedValue(provider, false));

		return cachedValue.getValue();
	}
	return cachedValue.getValue();
}
 
开发者ID:consulo,项目名称:consulo-dotnet,代码行数:26,代码来源:DotNetTypeRefCacheUtil.java


示例11: 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


示例12: createTextAttributes

import com.intellij.util.BitUtil; //导入依赖的package包/类
@Nonnull
public static GwtTextAttributes createTextAttributes(TextAttributes textAttributes) {
  GwtColor foreground = null;
  GwtColor background = null;

  Color foregroundColor = textAttributes.getForegroundColor();
  if (foregroundColor != null) {
    foreground = createColor(foregroundColor);
  }

  Color backgroundColor = textAttributes.getBackgroundColor();
  if (backgroundColor != null) {
    background = createColor(backgroundColor);
  }

  int flags = 0;
  flags = BitUtil.set(flags, GwtTextAttributes.BOLD, (textAttributes.getFontType() & Font.BOLD) != 0);
  flags = BitUtil.set(flags, GwtTextAttributes.ITALIC, (textAttributes.getFontType() & Font.ITALIC) != 0);
  flags = BitUtil.set(flags, GwtTextAttributes.UNDERLINE, textAttributes.getEffectType() == EffectType.LINE_UNDERSCORE);
  flags = BitUtil.set(flags, GwtTextAttributes.LINE_THROUGH, textAttributes.getEffectType() == EffectType.STRIKEOUT);

  return new GwtTextAttributes(foreground, background, flags);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:24,代码来源:GwtTransportServiceImpl.java


示例13: mapOldModifiers

import com.intellij.util.BitUtil; //导入依赖的package包/类
@JdkConstants.InputEventMask
private static int mapOldModifiers(@JdkConstants.InputEventMask int modifiers) {
  if (BitUtil.isSet(modifiers, InputEvent.SHIFT_MASK)) {
    modifiers |= InputEvent.SHIFT_DOWN_MASK;
  }
  if (BitUtil.isSet(modifiers, InputEvent.ALT_MASK)) {
    modifiers |= InputEvent.ALT_DOWN_MASK;
  }
  if (BitUtil.isSet(modifiers, InputEvent.ALT_GRAPH_MASK)) {
    modifiers |= InputEvent.ALT_GRAPH_DOWN_MASK;
  }
  if (BitUtil.isSet(modifiers, InputEvent.CTRL_MASK)) {
    modifiers |= InputEvent.CTRL_DOWN_MASK;
  }
  if (BitUtil.isSet(modifiers, InputEvent.META_MASK)) {
    modifiers |= InputEvent.META_DOWN_MASK;
  }

  modifiers &= InputEvent.SHIFT_DOWN_MASK
               | InputEvent.ALT_DOWN_MASK
               | InputEvent.ALT_GRAPH_DOWN_MASK
               | InputEvent.CTRL_DOWN_MASK
               | InputEvent.META_DOWN_MASK;

  return modifiers;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:27,代码来源:MouseShortcut.java


示例14: 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


示例15: 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


示例16: actionPerformed

import com.intellij.util.BitUtil; //导入依赖的package包/类
@RequiredDispatchThread
@Override
public void actionPerformed(@Nonnull AnActionEvent e) {
  //Force move focus to IdeFrame
  IdeEventQueue.getInstance().getPopupManager().closeAllPopups();

  final int modifiers = e.getModifiers();
  final boolean forceOpenInNewFrame = BitUtil.isSet(modifiers, InputEvent.CTRL_MASK) || BitUtil.isSet(modifiers, InputEvent.SHIFT_MASK) || e.getPlace() == ActionPlaces.WELCOME_SCREEN;

  Project project = e.getData(CommonDataKeys.PROJECT);
  if (!new File(myProjectPath).exists()) {
    if (Messages.showDialog(project, "The path " +
                                     FileUtil.toSystemDependentName(myProjectPath) +
                                     " does not exist.\n" +
                                     "If it is on a removable or network drive, please make sure that the drive is connected.", "Reopen Project", new String[]{"OK", "&Remove From List"}, 0,
                            Messages.getErrorIcon()) == 1) {
      RecentProjectsManager.getInstance().removePath(myProjectPath);
    }
    return;
  }

  Platform.hacky(() -> ProjectUtil.open(myProjectPath, project, forceOpenInNewFrame), () -> ProjectUtil.openAsync(myProjectPath, null, forceOpenInNewFrame, UIAccess.get()));
}
 
开发者ID:consulo,项目名称:consulo,代码行数:24,代码来源:ReopenProjectAction.java


示例17: 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


示例18: blockCompletesAbruptly

import com.intellij.util.BitUtil; //导入依赖的package包/类
private static boolean blockCompletesAbruptly(@NotNull final PsiCodeBlock finallyBlock)
{
	try
	{
		ControlFlow flow = ControlFlowFactory.getInstance(finallyBlock.getProject()).getControlFlow(finallyBlock, LocalsOrMyInstanceFieldsControlFlowPolicy.getInstance(), false);
		int completionReasons = ControlFlowUtil.getCompletionReasons(flow, 0, flow.getSize());
		if(!BitUtil.isSet(completionReasons, ControlFlowUtil.NORMAL_COMPLETION_REASON))
		{
			return true;
		}
	}
	catch(AnalysisCanceledException e)
	{
		return true;
	}
	return false;
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:18,代码来源:ExceptionUtil.java


示例19: 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


示例20: 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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ObjectAdapterIdArray类代码示例发布时间:2022-05-22
下一篇:
Java SignData类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap