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


Java ComponentTree.setDropTargetComponent方法代码示例

本文整理汇总了Java中com.intellij.uiDesigner.componentTree.ComponentTree.setDropTargetComponent方法的典型用法代码示例。如果您正苦于以下问题:Java ComponentTree.setDropTargetComponent方法的具体用法?Java ComponentTree.setDropTargetComponent怎么用?Java ComponentTree.setDropTargetComponent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.uiDesigner.componentTree.ComponentTree的用法示例。


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

示例1: dragExit

import com.intellij.uiDesigner.componentTree.ComponentTree; //导入方法依赖的package包/类
public void dragExit(DropTargetEvent dte) {
  try {
    ComponentTree componentTree = DesignerToolWindowManager.getInstance(myEditor).getComponentTree();
    if (componentTree != null) {
      componentTree.setDropTargetComponent(null);
    }
    myUseDragDelta = false;
    if (myDraggedComponentList != null) {
      cancelDrag();
      setDraggingState(myDraggedComponentList, false);
      myEditor.getActiveDecorationLayer().removeFeedback();
      myDraggedComponentList = null;
      myEditor.setDesignTimeInsets(2);
    }
    myDraggedComponentsCopy = null;
  }
  catch (Exception e) {
    LOG.error(e);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:DesignDropTargetListener.java

示例2: dragExit

import com.intellij.uiDesigner.componentTree.ComponentTree; //导入方法依赖的package包/类
public void dragExit(DropTargetEvent dte)
{
	try
	{
		ComponentTree componentTree = DesignerToolWindowManager.getInstance(myEditor).getComponentTree();
		if(componentTree != null)
		{
			componentTree.setDropTargetComponent(null);
		}
		myUseDragDelta = false;
		if(myDraggedComponentList != null)
		{
			cancelDrag();
			setDraggingState(myDraggedComponentList, false);
			myEditor.getActiveDecorationLayer().removeFeedback();
			myDraggedComponentList = null;
			myEditor.setDesignTimeInsets(2);
		}
		myDraggedComponentsCopy = null;
	}
	catch(Exception e)
	{
		LOG.error(e);
	}
}
 
开发者ID:consulo,项目名称:consulo-ui-designer,代码行数:26,代码来源:DesignDropTargetListener.java

示例3: dragOver

import com.intellij.uiDesigner.componentTree.ComponentTree; //导入方法依赖的package包/类
public void dragOver(DropTargetDragEvent dtde) {
  try {
    if (myComponentDragObject == null) {
      dtde.rejectDrag();
      return;
    }
    final int dx = dtde.getLocation().x - myLastPoint.x;
    final int dy = dtde.getLocation().y - myLastPoint.y;

    if (myDraggedComponentsCopy != null && myDraggedComponentList != null) {
      for (RadComponent aMySelection : myDraggedComponentsCopy) {
        aMySelection.shift(dx, dy);
      }
    }

    myLastPoint = dtde.getLocation();
    myEditor.getDragLayer().repaint();

    ComponentDropLocation location = myGridInsertProcessor.processDragEvent(dtde.getLocation(), myComponentDragObject);
    ComponentTree componentTree = DesignerToolWindowManager.getInstance(myEditor).getComponentTree();

    if (!location.canDrop(myComponentDragObject) ||
        (myDraggedComponentList != null && FormEditingUtil.isDropOnChild(myDraggedComponentList, location))) {
      if (componentTree != null) {
        componentTree.setDropTargetComponent(null);
      }
      dtde.rejectDrag();
    }
    else {
      if (componentTree != null) {
        componentTree.setDropTargetComponent(location.getContainer());
      }
      dtde.acceptDrag(dtde.getDropAction());
    }
  }
  catch (Exception e) {
    LOG.error(e);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:40,代码来源:DesignDropTargetListener.java

示例4: drop

import com.intellij.uiDesigner.componentTree.ComponentTree; //导入方法依赖的package包/类
public void drop(final DropTargetDropEvent dtde) {
  try {
    ComponentTree componentTree = DesignerToolWindowManager.getInstance(myEditor).getComponentTree();
    if (componentTree != null) {
      componentTree.setDropTargetComponent(null);
    }


    final DraggedComponentList dcl = DraggedComponentList.fromTransferable(dtde.getTransferable());
    if (dcl != null) {
      CommandProcessor.getInstance().executeCommand(myEditor.getProject(),
                                                    new Runnable() {
                                                      public void run() {
                                                        if (processDrop(dcl, dtde.getLocation(), dtde.getDropAction())) {
                                                          myEditor.refreshAndSave(true);
                                                        }
                                                      }
                                                    }, UIDesignerBundle.message("command.drop.components"), null);
    }
    else {
      ComponentItem componentItem = SimpleTransferable.getData(dtde.getTransferable(), ComponentItem.class);
      if (componentItem != null) {
        myEditor.getMainProcessor().setInsertFeedbackEnabled(false);
        new InsertComponentProcessor(myEditor).processComponentInsert(dtde.getLocation(), componentItem);
        ApplicationManager.getApplication().invokeLater(new Runnable() {
          public void run() {
            PaletteToolWindowManager.getInstance(myEditor).clearActiveItem();
            myEditor.getActiveDecorationLayer().removeFeedback();
            myEditor.getLayeredPane().setCursor(null);
            myEditor.getGlassLayer().requestFocus();
            myEditor.getMainProcessor().setInsertFeedbackEnabled(true);
          }
        });
      }
    }
    myDraggedComponentsCopy = null;
    myEditor.repaintLayeredPane();
  }
  catch (Exception e) {
    LOG.error(e);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:43,代码来源:DesignDropTargetListener.java

示例5: dragOver

import com.intellij.uiDesigner.componentTree.ComponentTree; //导入方法依赖的package包/类
public void dragOver(DropTargetDragEvent dtde)
{
	try
	{
		if(myComponentDragObject == null)
		{
			dtde.rejectDrag();
			return;
		}
		final int dx = dtde.getLocation().x - myLastPoint.x;
		final int dy = dtde.getLocation().y - myLastPoint.y;

		if(myDraggedComponentsCopy != null && myDraggedComponentList != null)
		{
			for(RadComponent aMySelection : myDraggedComponentsCopy)
			{
				aMySelection.shift(dx, dy);
			}
		}

		myLastPoint = dtde.getLocation();
		myEditor.getDragLayer().repaint();

		ComponentDropLocation location = myGridInsertProcessor.processDragEvent(dtde.getLocation(), myComponentDragObject);
		ComponentTree componentTree = DesignerToolWindowManager.getInstance(myEditor).getComponentTree();

		if(!location.canDrop(myComponentDragObject) || (myDraggedComponentList != null && FormEditingUtil.isDropOnChild(myDraggedComponentList,
				location)))
		{
			if(componentTree != null)
			{
				componentTree.setDropTargetComponent(null);
			}
			dtde.rejectDrag();
		}
		else
		{
			if(componentTree != null)
			{
				componentTree.setDropTargetComponent(location.getContainer());
			}
			dtde.acceptDrag(dtde.getDropAction());
		}
	}
	catch(Exception e)
	{
		LOG.error(e);
	}
}
 
开发者ID:consulo,项目名称:consulo-ui-designer,代码行数:50,代码来源:DesignDropTargetListener.java

示例6: drop

import com.intellij.uiDesigner.componentTree.ComponentTree; //导入方法依赖的package包/类
public void drop(final DropTargetDropEvent dtde)
{
	try
	{
		ComponentTree componentTree = DesignerToolWindowManager.getInstance(myEditor).getComponentTree();
		if(componentTree != null)
		{
			componentTree.setDropTargetComponent(null);
		}


		final DraggedComponentList dcl = DraggedComponentList.fromTransferable(dtde.getTransferable());
		if(dcl != null)
		{
			CommandProcessor.getInstance().executeCommand(myEditor.getProject(), new Runnable()
			{
				public void run()
				{
					if(processDrop(dcl, dtde.getLocation(), dtde.getDropAction()))
					{
						myEditor.refreshAndSave(true);
					}
				}
			}, UIDesignerBundle.message("command.drop.components"), null);
		}
		else
		{
			ComponentItem componentItem = SimpleTransferable.getData(dtde.getTransferable(), ComponentItem.class);
			if(componentItem != null)
			{
				myEditor.getMainProcessor().setInsertFeedbackEnabled(false);
				new InsertComponentProcessor(myEditor).processComponentInsert(dtde.getLocation(), componentItem);
				ApplicationManager.getApplication().invokeLater(new Runnable()
				{
					public void run()
					{
						PaletteToolWindowManager.getInstance(myEditor).clearActiveItem();
						myEditor.getActiveDecorationLayer().removeFeedback();
						myEditor.getLayeredPane().setCursor(null);
						myEditor.getGlassLayer().requestFocus();
						myEditor.getMainProcessor().setInsertFeedbackEnabled(true);
					}
				});
			}
		}
		myDraggedComponentsCopy = null;
		myEditor.repaintLayeredPane();
	}
	catch(Exception e)
	{
		LOG.error(e);
	}
}
 
开发者ID:consulo,项目名称:consulo-ui-designer,代码行数:54,代码来源:DesignDropTargetListener.java


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