IDEMPIERE-3426:improve tab behavior
drag&drop for home tab case
This commit is contained in:
parent
3a8c351538
commit
38fae63d1b
|
@ -32,10 +32,12 @@ 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)
|
||||
{
|
||||
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue