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


Java PaletteItem类代码示例

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


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

示例1: update

import com.intellij.ide.palette.PaletteItem; //导入依赖的package包/类
@Override
public boolean update(DnDEvent aEvent)
{
	setHoverIndex(-1);
	if(aEvent.getAttachedObject() instanceof PaletteItem)
	{
		setDropTargetIndex(locationToTargetIndex(aEvent.getPoint()));
		aEvent.setDropPossible(true);
	}
	else
	{
		setDropTargetIndex(-1);
		aEvent.setDropPossible(false);
	}
	return false;
}
 
开发者ID:consulo,项目名称:consulo-ui-designer,代码行数:17,代码来源:PaletteComponentList.java

示例2: handleDrop

import com.intellij.ide.palette.PaletteItem; //导入依赖的package包/类
public void handleDrop(Project project, PaletteItem droppedItem, int index) {
  if (droppedItem instanceof ComponentItem) {
    ComponentItem componentItem = (ComponentItem) droppedItem;
    Palette palette = Palette.getInstance(project);
    int oldIndex = myItems.indexOf(componentItem);
    if (oldIndex >= 0) {
      if (index == -1 || oldIndex == index) return;
      if (oldIndex < index) {
        index--;
      }
      myItems.remove(oldIndex);
    }
    else {
      for(GroupItem groupItem: palette.getGroups()) {
        if (groupItem.myItems.contains(componentItem)) {
          groupItem.removeItem(componentItem);
          break;
        }
      }
    }
    if (index == -1) {
      myItems.add(componentItem);
    }
    else {
      myItems.add(index, componentItem);
    }
    palette.fireGroupsChanged();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:GroupItem.java

示例3: update

import com.intellij.ide.palette.PaletteItem; //导入依赖的package包/类
public boolean update(DnDEvent aEvent) {
  setHoverIndex(-1);
  if (aEvent.getAttachedObject() instanceof PaletteItem) {
    setDropTargetIndex(locationToTargetIndex(aEvent.getPoint()));
    aEvent.setDropPossible(true);
  }
  else {
    setDropTargetIndex(-1);
    aEvent.setDropPossible(false);
  }
  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:PaletteComponentList.java

示例4: drop

import com.intellij.ide.palette.PaletteItem; //导入依赖的package包/类
public void drop(DnDEvent aEvent) {
  setDropTargetIndex(-1);
  if (aEvent.getAttachedObject() instanceof PaletteItem) {
    int index = locationToTargetIndex(aEvent.getPoint());
    if (index >= 0) {
      myGroup.handleDrop(myProject, (PaletteItem) aEvent.getAttachedObject(), index);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:PaletteComponentList.java

示例5: getActiveItem

import com.intellij.ide.palette.PaletteItem; //导入依赖的package包/类
@Nullable
public PaletteItem getActiveItem() {
  for (PaletteGroupHeader groupHeader : myGroupHeaders) {
    if (groupHeader.isSelected() && groupHeader.getComponentList().getSelectedValue() != null) {
      return (PaletteItem)groupHeader.getComponentList().getSelectedValue();
    }
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:PaletteWindow.java

示例6: getActiveItem

import com.intellij.ide.palette.PaletteItem; //导入依赖的package包/类
@Nullable
public PaletteItem getActiveItem() {
  if (myPaletteWindow != null) {
    return myPaletteWindow.getActiveItem();
  }
  return null;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:8,代码来源:PaletteManager.java

示例7: customizeCellRenderer

import com.intellij.ide.palette.PaletteItem; //导入依赖的package包/类
@Override
protected void customizeCellRenderer(JList list, Object value, int index, boolean selected, boolean hasFocus)
{
	PaletteItem paletteItem = (PaletteItem) value;
	clear();
	paletteItem.customizeCellRenderer(this, selected, hasFocus);
}
 
开发者ID:consulo,项目名称:consulo-ui-designer,代码行数:8,代码来源:PaletteComponentList.java

示例8: drop

import com.intellij.ide.palette.PaletteItem; //导入依赖的package包/类
@Override
public void drop(DnDEvent aEvent)
{
	setDropTargetIndex(-1);
	if(aEvent.getAttachedObject() instanceof PaletteItem)
	{
		int index = locationToTargetIndex(aEvent.getPoint());
		if(index >= 0)
		{
			myGroup.handleDrop(myProject, (PaletteItem) aEvent.getAttachedObject(), index);
		}
	}
}
 
开发者ID:consulo,项目名称:consulo-ui-designer,代码行数:14,代码来源:PaletteComponentList.java

示例9: getActiveItem

import com.intellij.ide.palette.PaletteItem; //导入依赖的package包/类
@Nullable
public PaletteItem getActiveItem()
{
	for(PaletteGroupHeader groupHeader : myGroupHeaders)
	{
		if(groupHeader.isSelected() && groupHeader.getComponentList().getSelectedValue() != null)
		{
			return (PaletteItem) groupHeader.getComponentList().getSelectedValue();
		}
	}
	return null;
}
 
开发者ID:consulo,项目名称:consulo-ui-designer,代码行数:13,代码来源:PaletteWindow.java

示例10: customizeCellRenderer

import com.intellij.ide.palette.PaletteItem; //导入依赖的package包/类
protected void customizeCellRenderer(JList list, Object value, int index, boolean selected, boolean hasFocus) {
  PaletteItem paletteItem = (PaletteItem) value;
  clear();
  paletteItem.customizeCellRenderer(this, selected, hasFocus);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:PaletteComponentList.java


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