FR [ 1794050
] Usability: VCreateFrom OK button always enabled
http://sourceforge.net/tracker/?func=detail&atid=879335&aid=1794050&group_id=176962
This commit is contained in:
parent
0c07ba601a
commit
23fdd39f08
|
@ -37,6 +37,9 @@ import org.compiere.util.*;
|
||||||
*
|
*
|
||||||
* @author Jorg Janke
|
* @author Jorg Janke
|
||||||
* @version $Id: VCreateFrom.java,v 1.4 2006/10/11 09:52:23 comdivision Exp $
|
* @version $Id: VCreateFrom.java,v 1.4 2006/10/11 09:52:23 comdivision Exp $
|
||||||
|
*
|
||||||
|
* @author Teo Sarca, SC ARHIPAC SERVICE SRL
|
||||||
|
* <li>FR [ 1794050 ] Usability: VCreateFrom OK button always enabled
|
||||||
*/
|
*/
|
||||||
public abstract class VCreateFrom extends CDialog
|
public abstract class VCreateFrom extends CDialog
|
||||||
implements ActionListener, TableModelListener
|
implements ActionListener, TableModelListener
|
||||||
|
@ -134,7 +137,7 @@ public abstract class VCreateFrom extends CDialog
|
||||||
private CPanel southPanel = new CPanel();
|
private CPanel southPanel = new CPanel();
|
||||||
private BorderLayout southLayout = new BorderLayout();
|
private BorderLayout southLayout = new BorderLayout();
|
||||||
private ConfirmPanel confirmPanel = new ConfirmPanel(true);
|
private ConfirmPanel confirmPanel = new ConfirmPanel(true);
|
||||||
protected StatusBar statusBar = new StatusBar();
|
private StatusBar statusBar = new StatusBar();
|
||||||
protected MiniTable dataTable = new MiniTable();
|
protected MiniTable dataTable = new MiniTable();
|
||||||
protected JLabel locatorLabel = new JLabel();
|
protected JLabel locatorLabel = new JLabel();
|
||||||
protected VLocator locatorField = new VLocator();
|
protected VLocator locatorField = new VLocator();
|
||||||
|
@ -514,5 +517,21 @@ public abstract class VCreateFrom extends CDialog
|
||||||
// Table UI
|
// Table UI
|
||||||
dataTable.autoSize();
|
dataTable.autoSize();
|
||||||
} // loadOrder
|
} // loadOrder
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set form status line.
|
||||||
|
* Please note, will enable/disable the OK button if the selectedRowCount > 0.
|
||||||
|
* @param selectedRowCount number of selected lines
|
||||||
|
* @param text additional text
|
||||||
|
*/
|
||||||
|
protected void setStatusLine(int selectedRowCount, String text) {
|
||||||
|
StringBuffer sb = new StringBuffer(String.valueOf(selectedRowCount));
|
||||||
|
if (text != null && text.trim().length() > 0) {
|
||||||
|
sb.append(" - ").append(text);
|
||||||
|
}
|
||||||
|
statusBar.setStatusLine(sb.toString());
|
||||||
|
//
|
||||||
|
confirmPanel.getOKButton().setEnabled(selectedRowCount > 0);
|
||||||
|
}
|
||||||
|
|
||||||
} // VCreateFrom
|
} // VCreateFrom
|
||||||
|
|
|
@ -266,7 +266,7 @@ public class VCreateFromInvoice extends VCreateFrom implements VetoableChangeLis
|
||||||
if (((Boolean)model.getValueAt(i, 0)).booleanValue())
|
if (((Boolean)model.getValueAt(i, 0)).booleanValue())
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
statusBar.setStatusLine(String.valueOf(count));
|
setStatusLine(count, null);
|
||||||
} // infoInvoice
|
} // infoInvoice
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -479,7 +479,7 @@ public class VCreateFromShipment extends VCreateFrom implements VetoableChangeLi
|
||||||
if (((Boolean) model.getValueAt(i, 0)).booleanValue())
|
if (((Boolean) model.getValueAt(i, 0)).booleanValue())
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
statusBar.setStatusLine(String.valueOf(count));
|
setStatusLine(count, null);
|
||||||
} // info
|
} // info
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -211,7 +211,7 @@ public class VCreateFromStatement extends VCreateFrom implements VetoableChangeL
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
statusBar.setStatusLine(String.valueOf(count) + " - " + Msg.getMsg(Env.getCtx(), "Sum") + " " + format.format(total));
|
setStatusLine(count, Msg.getMsg(Env.getCtx(), "Sum") + " " + format.format(total));
|
||||||
} // infoStatement
|
} // infoStatement
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue