IDEMPIERE-3426:improve tab behavior

drag&drop for home tab case
This commit is contained in:
hieplq 2017-07-15 01:13:17 +07:00
parent 3a8c351538
commit 38fae63d1b
3 changed files with 24 additions and 3 deletions

View File

@ -32,11 +32,13 @@ import org.zkoss.zul.impl.LabelImageElement;
*/
public class Tab extends org.zkoss.zul.Tab
{
/**
*
*/
private static final long serialVersionUID = -5146887728183695020L;
private static final long serialVersionUID = -7504310693884092219L;
private boolean isDisableDraggDrop = false;
public Tab(String str)
{
this.setLabel(str);
@ -60,6 +62,19 @@ public class Tab extends org.zkoss.zul.Tab
}
}
public boolean isDisableDraggDrop() {
return isDisableDraggDrop;
}
/**
* home tab don't want to drag and drop.
* {@link Tab} like that can be set true for this properties
* @param isDisableDraggDrop
*/
public void setDisableDraggDrop(boolean isDisableDraggDrop) {
this.isDisableDraggDrop = isDisableDraggDrop;
}
/**
* class contain decorate info
* at the moment, has only image info

View File

@ -33,7 +33,7 @@ public class Tabbox extends org.zkoss.zul.Tabbox
*
*/
private static final long serialVersionUID = 1400484283064851775L;
private boolean isSupportTabDragDrop;
private boolean isSupportTabDragDrop = false;
public Tabpanel getTabpanel(int index)
{

View File

@ -174,6 +174,12 @@ public class Tabs extends org.zkoss.zul.Tabs implements EventListener<Event>
if ((dropComp instanceof Tab && this != dropComp.getParent()) || this != draggComp.getParent())// make sure drag and drop on same tabbox
return false;
if ((dropComp instanceof org.adempiere.webui.component.Tab && ((org.adempiere.webui.component.Tab)dropComp).isDisableDraggDrop())
|| (draggComp instanceof org.adempiere.webui.component.Tab && ((org.adempiere.webui.component.Tab)draggComp).isDisableDraggDrop())
) {
return false;
}
return true;
}
}