Merged release-1.0c into release-2.0

This commit is contained in:
Heng Sin Low 2013-12-13 20:49:04 +08:00
commit 7e958c4f3f
6 changed files with 36 additions and 8 deletions

View File

@ -305,7 +305,7 @@ public final class ImpFormat
private static void loadRows (ImpFormat format, int ID) private static void loadRows (ImpFormat format, int ID)
{ {
String sql = "SELECT f.SeqNo,c.ColumnName,f.StartNo,f.EndNo,f.DataType,c.FieldLength," // 1..6 String sql = "SELECT f.SeqNo,c.ColumnName,f.StartNo,f.EndNo,f.DataType,c.FieldLength," // 1..6
+ "f.DataFormat,f.DecimalPoint,f.DivideBy100,f.ConstantValue,f.Callout " // 7..11 + "f.DataFormat,f.DecimalPoint,f.DivideBy100,f.ConstantValue,f.Callout,f.Name " // 7..12
+ "FROM AD_ImpFormat_Row f,AD_Column c " + "FROM AD_ImpFormat_Row f,AD_Column c "
+ "WHERE f.AD_ImpFormat_ID=? AND f.AD_Column_ID=c.AD_Column_ID AND f.IsActive='Y'" + "WHERE f.AD_ImpFormat_ID=? AND f.AD_Column_ID=c.AD_Column_ID AND f.IsActive='Y'"
+ "ORDER BY f.SeqNo"; + "ORDER BY f.SeqNo";
@ -319,7 +319,7 @@ public final class ImpFormat
while (rs.next()) while (rs.next())
{ {
ImpFormatRow row = new ImpFormatRow (rs.getInt(1), ImpFormatRow row = new ImpFormatRow (rs.getInt(1),
rs.getString(2), rs.getInt(3), rs.getInt(4), rs.getString(5), rs.getInt(6)); rs.getString(2), rs.getInt(3), rs.getInt(4), rs.getString(5), rs.getInt(6), rs.getString(12));
// //
row.setFormatInfo(rs.getString(7), rs.getString(8), row.setFormatInfo(rs.getString(7), rs.getString(8),
rs.getString(9).equals("Y"), rs.getString(9).equals("Y"),

View File

@ -52,11 +52,13 @@ public final class ImpFormatRow
* @param endNo and no * @param endNo and no
* @param dataType data type - see constants DATATYPE_ * @param dataType data type - see constants DATATYPE_
* @param maxLength if String it is the maximum length (truncated) * @param maxLength if String it is the maximum length (truncated)
* @param name column label
*/ */
public ImpFormatRow(int seqNo, String columnName, int startNo, int endNo, String dataType, int maxLength) public ImpFormatRow(int seqNo, String columnName, int startNo, int endNo, String dataType, int maxLength, String name)
{ {
m_seqNo = seqNo; m_seqNo = seqNo;
setColumnName(columnName); setColumnName(columnName);
setName(name);
m_startNo = startNo; m_startNo = startNo;
m_endNo = endNo; m_endNo = endNo;
setDataType (dataType); setDataType (dataType);
@ -80,6 +82,7 @@ public final class ImpFormatRow
private int m_seqNo; private int m_seqNo;
private String m_columnName; private String m_columnName;
private String m_name;
private int m_startNo = 0; private int m_startNo = 0;
private int m_endNo = 0; private int m_endNo = 0;
private String m_dataType; private String m_dataType;
@ -173,6 +176,27 @@ public final class ImpFormatRow
return m_columnName; return m_columnName;
} // getColumnName } // getColumnName
/**
* Name
* @param Name name
*/
public void setName (String name)
{
if (name == null || name.length() == 0)
throw new IllegalArgumentException("Name must be at least 1 char");
else
m_name = name;
} // setName
/**
* Get Name
* @return Name
*/
public String getName()
{
return m_name;
} // getName
/** /**
* Data Type * Data Type
* @param dataType data type - see constants DATATYPE_ * @param dataType data type - see constants DATATYPE_

View File

@ -391,7 +391,7 @@ public class VFileImport extends CPanel
for (int i = 0; i < size; i++) for (int i = 0; i < size; i++)
{ {
ImpFormatRow row = m_format.getRow(i); ImpFormatRow row = m_format.getRow(i);
m_labels[i] = new JLabel (row.getColumnName()); m_labels[i] = new JLabel (row.getName());
previewPanel.add(m_labels[i], new GridBagConstraints(i, 0, 1, 1, 1.0, 1.0, previewPanel.add(m_labels[i], new GridBagConstraints(i, 0, 1, 1, 1.0, 1.0,
GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(2, 2, 2, 2), 0, 0)); GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(2, 2, 2, 2), 0, 0));
// //

View File

@ -2766,7 +2766,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
if (Executions.getCurrent() != null) if (Executions.getCurrent() != null)
{ {
if (notPrint) // refresh if not print if (notPrint || pi.isError()) // show process info if it is not print or have error
{ {
updateUI(pi); updateUI(pi);
} }
@ -2777,7 +2777,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
//acquire desktop, 2 second timeout //acquire desktop, 2 second timeout
Executions.activate(getComponent().getDesktop(), 2000); Executions.activate(getComponent().getDesktop(), 2000);
try { try {
if (notPrint) // refresh if not print if (notPrint || pi.isError()) // show process info if it is not print or have error
{ {
updateUI(pi); updateUI(pi);
} }

View File

@ -487,7 +487,7 @@ public class WFileImport extends ADForm implements EventListener<Event>
{ {
ImpFormatRow row = m_format.getRow(i); ImpFormatRow row = m_format.getRow(i);
m_labels[i] = new Label(row.getColumnName()); m_labels[i] = new Label(row.getName());
Hbox hbox = new Hbox(); Hbox hbox = new Hbox();
hbox.setAlign("center"); hbox.setAlign("center");

View File

@ -43,6 +43,7 @@ import org.adempiere.webui.component.Window;
import org.compiere.model.MLocator; import org.compiere.model.MLocator;
import org.compiere.model.MLocatorLookup; import org.compiere.model.MLocatorLookup;
import org.compiere.model.MRole; import org.compiere.model.MRole;
import org.compiere.util.AdempiereUserError;
import org.compiere.util.CLogger; import org.compiere.util.CLogger;
import org.compiere.util.DB; import org.compiere.util.DB;
import org.compiere.util.Env; import org.compiere.util.Env;
@ -303,6 +304,9 @@ public class WLocatorDialog extends Window implements EventListener<Event>
if (log.isLoggable(Level.FINE)) log.fine(m_mLocator.toString()); if (log.isLoggable(Level.FINE)) log.fine(m_mLocator.toString());
if (m_mLocator.getSize()==0 || (m_mLocator.getSize()==1 && m_mLocator.get(m_mLocator.getElementAt(0))==null))
throw new AdempiereUserError(Msg.getMsg(Env.getCtx(), "DRP-001", false));
for (int i = 0; i < m_mLocator.getSize(); i++) for (int i = 0; i < m_mLocator.getSize(); i++)
{ {
Object obj = m_mLocator.getElementAt(i); Object obj = m_mLocator.getElementAt(i);
@ -552,7 +556,7 @@ public class WLocatorDialog extends Window implements EventListener<Event>
if (m_change) if (m_change)
{ {
ListItem listitem = lstLocator.getSelectedItem(); ListItem listitem = lstLocator.getSelectedItem();
MLocator l = (MLocator)listitem.getValue(); MLocator l = listitem != null ? (MLocator)listitem.getValue() : null;
if (l != null) if (l != null)
return l.getM_Locator_ID() == m_M_Locator_ID; return l.getM_Locator_ID() == m_M_Locator_ID;