* Maintain tree menu selection.

* Search - navigate to the search result menu item.
This commit is contained in:
Heng Sin Low 2008-07-11 15:00:42 +00:00
parent 4288218dac
commit 18560bb382
4 changed files with 23 additions and 11 deletions

View File

@ -1,6 +1,5 @@
/******************************************************************************
* Product: Posterita Ajax UI *
* Copyright (C) 2007 Posterita Ltd. All Rights Reserved. *
* Copyright (C) 2007 Low Heng Sin All Rights Reserved. *
* This program is free software; you can redistribute it and/or modify it *
* under the terms version 2 of the GNU General Public License as published *
* by the Free Software Foundation. This program is distributed in the hope *
@ -29,11 +28,11 @@ import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.Events;
/**
* This class is based on org.compiere.grid.ed.VButton written by Jorg Janke.
* This class is based on org.compiere.grid.ed.VImage written by Jorg Janke.
* @author Jorg Janke
*
* Modifications - UI Compatibility
* @author ashley
* @author Low Heng Sin
*/
public class WImageEditor extends WEditor
{

View File

@ -226,7 +226,6 @@ public class MenuPanel extends Panel implements EventListener
}*/
SessionManager.getAppDesktop().onMenuSelected(nodeId);
menuTree.setSelectedItem(null);
}
catch (Exception e)
{
@ -234,7 +233,7 @@ public class MenuPanel extends Panel implements EventListener
}
}
public boolean isAsap()
public boolean isAsap()
{
return true;
}

View File

@ -109,9 +109,21 @@ public class MenuSearchPanel extends Panel implements EventListener
Treeitem treeItem = treeNodeItemMap.get(value);
if (treeItem != null)
{
treeItem.setSelected(true);
menuPanel.fireMenuSelectedEvent(treeItem);
select(treeItem);
Events.echoEvent(Events.ON_SELECT, treeItem.getTree(), null);
}
}
}
private void select(Treeitem selectedItem) {
Treeitem parent = selectedItem.getParentItem();
while (parent != null) {
if (!parent.isOpen())
parent.setOpen(true);
parent = parent.getParentItem();
}
selectedItem.getTree().setSelectedItem(selectedItem);
selectedItem.focus();
}
}

View File

@ -41,10 +41,12 @@ import org.zkoss.zul.Image;
import org.zkoss.zul.Separator;
/**
* Image Dialog
*
* Base on the original Swing Image Dialog.
* @author Jorg Janke
* @version $Id: VImageDialog.java,v 1.4 2006/07/30 00:51:28 jjanke Exp $
*
* Zk Port
* @author Low Heng Sin
*
*/
public class WImageDialog extends Window implements EventListener
{