Peer review of revision 10474

Width and Height can be null
Minor formatting and dropping of unused variables
BF [ 2872237 ] 2pack should import window size
https://sourceforge.net/tracker/?func=detail&aid=2872237&group_id=176962&atid=879332
This commit is contained in:
Carlos Ruiz 2009-10-03 14:48:21 +00:00
parent 5b8fd0ceb4
commit bc74e702d8
1 changed files with 10 additions and 14 deletions

View File

@ -10,9 +10,9 @@
* You should have received a copy of the GNU General Public License along * * You should have received a copy of the GNU General Public License along *
* with this program; if not, write to the Free Software Foundation, Inc., * * with this program; if not, write to the Free Software Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
* * *
* Copyright (C) 2005 Robert Klein. robeklein@hotmail.com * Copyright (C) 2005 Robert Klein. robeklein@hotmail.com *
* Contributor(s): Low Heng Sin hengsin@avantz.com * Contributor(s): Low Heng Sin hengsin@avantz.com *
*****************************************************************************/ *****************************************************************************/
package org.adempiere.pipo.handler; package org.adempiere.pipo.handler;
@ -115,7 +115,9 @@ public class WindowElementHandler extends AbstractElementHandler {
.booleanValue()); .booleanValue());
m_Window.setName(atts.getValue("Name")); m_Window.setName(atts.getValue("Name"));
m_Window.setProcessing(false); m_Window.setProcessing(false);
if (atts.getValue("WinWidth") != null && atts.getValue("WinWidth").trim().length() > 0)
m_Window.setWinWidth(getValueInt(atts, "WinWidth", 0)); m_Window.setWinWidth(getValueInt(atts, "WinWidth", 0));
if (atts.getValue("WinHeight") != null && atts.getValue("WinHeight").trim().length() > 0)
m_Window.setWinHeight(getValueInt(atts, "WinHeight", 0)); m_Window.setWinHeight(getValueInt(atts, "WinHeight", 0));
m_Window.setWindowType(atts.getValue("WindowType")); m_Window.setWindowType(atts.getValue("WindowType"));
if (m_Window.save(getTrxName(ctx)) == true) { if (m_Window.save(getTrxName(ctx)) == true) {
@ -157,11 +159,6 @@ public class WindowElementHandler extends AbstractElementHandler {
try { try {
ResultSet rs = pstmt.executeQuery(); ResultSet rs = pstmt.executeQuery();
while (rs.next()) { while (rs.next()) {
String tableSql = "SELECT Name FROM AD_Table WHERE AD_Table_ID=?";
int table_id = rs.getInt("AD_TABLE_ID");
String name = rs.getString("NAME");
String tablename = DB.getSQLValueString(null, tableSql,
table_id);
packOut.createTable(rs.getInt("AD_Table_ID"), document); packOut.createTable(rs.getInt("AD_Table_ID"), document);
createTab(ctx, document, rs.getInt("AD_Tab_ID")); createTab(ctx, document, rs.getInt("AD_Tab_ID"));
} }
@ -292,8 +289,7 @@ public class WindowElementHandler extends AbstractElementHandler {
.isProcessing() == true ? "true" : "false")); .isProcessing() == true ? "true" : "false"));
atts.addAttribute("", "", "WinHeight", "CDATA", (m_Window atts.addAttribute("", "", "WinHeight", "CDATA", (m_Window
.getWinHeight() > 0 ? "" + m_Window.getWinHeight() : "")); .getWinHeight() > 0 ? "" + m_Window.getWinHeight() : ""));
atts atts.addAttribute("", "", "WinWidth", "CDATA", (m_Window
.addAttribute("", "", "WinWidth", "CDATA", (m_Window
.getWinWidth() > 0 ? "" + m_Window.getWinWidth() : "")); .getWinWidth() > 0 ? "" + m_Window.getWinWidth() : ""));
atts.addAttribute("", "", "WindowType", "CDATA", (m_Window atts.addAttribute("", "", "WindowType", "CDATA", (m_Window
.getWindowType() != null ? m_Window.getWindowType() : "")); .getWindowType() != null ? m_Window.getWindowType() : ""));