本文整理汇总了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;
}
示例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();
}
}
示例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;
}
示例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);
}
}
}
示例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;
}
示例6: getActiveItem
import com.intellij.ide.palette.PaletteItem; //导入依赖的package包/类
@Nullable
public PaletteItem getActiveItem() {
if (myPaletteWindow != null) {
return myPaletteWindow.getActiveItem();
}
return null;
}
示例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);
}
示例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);
}
}
}
示例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;
}
示例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);
}