Java onRowHover和OnFragmove事件之间的同步
我正在研究Java、SmartGWT 2.5和Mozilla FF 3.6.x。我在应用程序中使用Tree、TreeGrid和TreeNode。我有以下活动:Java onRowHover和OnFragmove事件之间的同步,java,tree,smartgwt,treenode,treegrid,Java,Tree,Smartgwt,Treenode,Treegrid,我正在研究Java、SmartGWT 2.5和Mozilla FF 3.6.x。我在应用程序中使用Tree、TreeGrid和TreeNode。我有以下活动: addDragMoveHandler(new DragMoveHandler() { @Override public void onDragMove(DragMoveEvent event) { // this is the Node which is moving to othe
addDragMoveHandler(new DragMoveHandler() {
@Override
public void onDragMove(DragMoveEvent event) {
// this is the Node which is moving to other parent
// it's parent is instance of PageFolder
Node movingNode = (Node) getSelectedRecord();
}
});
及
我想在OnFragmove里面发射onRowHover,因为像这样的第一个被称为OnFragmove,完成后被称为onRowHover。如果该节点可以是拖动节点的父节点,则应立即亮显该节点,而不是在将该节点放入其中时亮显该节点。还有onDragStart和onFolderDroped事件。但是我只想使onRowHover和ondrampove同步。没有必要尝试触发onRowHover事件,只需从ondrampove处理程序调用相同的逻辑。但是在ondrampove中,我不能这样做:Node _Node=(Node)event.getRecord()。您不需要访问事件,您可以使用getRecord(getEventRow())随时获取鼠标悬停的记录。
addRowHoverHandler(new RowHoverHandler() {
@Override
public void onRowHover(RowHoverEvent event) {
Node _node = (Node) event.getRecord();
if (_node.getModel() instanceof PageFolder) {
// this _node can be the parent of the moving node
// and it will change it's color using it's attribute in getBaseStyle
_node.setAttribute("canBeParent", true);
}
}
});