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


Java BitUtil类代码示例

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


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


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