當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。