[ 1757088 ] Grid Collapse and Tab Group, Implementation the GridCollapseDetail

http://sourceforge.net/tracker/index.php?func=detail&aid=1757088&group_id=176962&atid=87933
This commit is contained in:
vpj-cd 2007-10-08 17:09:48 +00:00
parent cbaf26d105
commit c13f4f81db
13 changed files with 1182 additions and 265 deletions

View File

@ -13,6 +13,7 @@
* For the text or an alternative of this public license, you may reach us *
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
* or via info@compiere.org or http://www.compiere.org/license.html *
* Contributor(s): Victor Perez e-Evolution victor.perez@e-evolution.com *
*****************************************************************************/
package org.compiere.model;
@ -37,6 +38,7 @@ import org.compiere.util.*;
* Usually editors listen to their fields.
*
* @author Jorg Janke
* @contributor Victor Perez , e-Evolution.SC FR [ 1757088 ]
* @version $Id: GridField.java,v 1.5 2006/07/30 00:51:02 jjanke Exp $
*/
public class GridField
@ -1568,4 +1570,14 @@ public class GridField
m_vo.VFormat = strNewFormat;
} //setVFormat
/**
* Feature Request FR [ 1757088 ]
* Get the id tab include
* @return id Tab
*/
public int getIncluded_Tab_ID ()
{
return m_vo.Included_Tab_ID;
}
} // MField

View File

@ -13,6 +13,7 @@
* For the text or an alternative of this public license, you may reach us *
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
* or via info@compiere.org or http://www.compiere.org/license.html *
* @contributor Victor Perez , e-Evolution.SC FR [ 1757088 ]
*****************************************************************************/
package org.compiere.model;
@ -27,6 +28,7 @@ import org.compiere.util.*;
* Field Model Value Object
*
* @author Jorg Janke
* @contributor Victor Perez , e-Evolution.SC FR [ 1757088 ]
* @version $Id: GridFieldVO.java,v 1.3 2006/07/30 00:58:04 jjanke Exp $
*/
public class GridFieldVO implements Serializable
@ -150,6 +152,9 @@ public class GridFieldVO implements Serializable
vo.ValidationCode = rs.getString(i);
else if (columnName.equalsIgnoreCase("ColumnSQL"))
vo.ColumnSQL = rs.getString(i);
//Feature Request FR [ 1757088 ]
else if (columnName.equalsIgnoreCase("Included_Tab_ID"))
vo.Included_Tab_ID = rs.getInt(i);
}
if (vo.Header == null)
vo.Header = vo.ColumnName;
@ -402,6 +407,10 @@ public class GridFieldVO implements Serializable
public MLookupInfo lookupInfo = null;
//* Feature Request FR [ 1757088 ]
public int Included_Tab_ID = 0;
/**
* Set Context including contained elements
* @param newCtx new context

View File

@ -13,6 +13,7 @@
* For the text or an alternative of this public license, you may reach us *
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
* or via info@compiere.org or http://www.compiere.org/license.html *
* @contributor Victor Perez , e-Evolution.SC FR [ 1757088 ]
*****************************************************************************/
package org.compiere.model;
@ -51,6 +52,7 @@ import org.compiere.util.*;
* @version $Id: GridTab.java,v 1.10 2006/10/02 05:18:39 jjanke Exp $
*
* @author Teo Sarca - BF [ 1742159 ]
* @contributor Victor Perez , e-Evolution.SC FR [ 1757088 ]
*/
public class GridTab implements DataStatusListener, Evaluatee, Serializable
{
@ -270,6 +272,10 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
{
GridField field = new GridField (voF);
String columnName = field.getColumnName();
//FR [ 1757088 ]
if(this.isReadOnly()) {
voF.IsReadOnly = true;
}
// Record Info
if (field.isKey())
m_keyColumnName = columnName;

View File

@ -32,14 +32,12 @@
**********************************************************************/
package org.compiere.model;
import java.util.*;
import java.sql.Timestamp;
import java.math.*;
import org.compiere.util.*;
import java.math.BigDecimal;
import org.compiere.util.KeyNamePair;
/** Generated Interface for AD_Field
* @author Trifon Trifonov (generated)
* @version Release 3.3.0 - 2007-08-24 11:39:21.921
* @version Release 3.3.0
*/
public interface I_AD_Field
{
@ -54,7 +52,7 @@ import org.compiere.util.*;
/** AccessLevel = 4 - System
*/
BigDecimal accessLevel = new BigDecimal(4);
BigDecimal accessLevel = BigDecimal.valueOf(4);
/** Load Meta Data */
@ -71,7 +69,7 @@ import org.compiere.util.*;
*/
public int getAD_Column_ID();
public I_AD_Column getI_AD_Column() throws Exception;
public I_AD_Column getAD_Column() throws Exception;
/** Column name AD_FieldGroup_ID */
public static final String COLUMNNAME_AD_FieldGroup_ID = "AD_FieldGroup_ID";
@ -86,7 +84,7 @@ import org.compiere.util.*;
*/
public int getAD_FieldGroup_ID();
public I_AD_FieldGroup getI_AD_FieldGroup() throws Exception;
public I_AD_FieldGroup getAD_FieldGroup() throws Exception;
/** Column name AD_Field_ID */
public static final String COLUMNNAME_AD_Field_ID = "AD_Field_ID";
@ -127,7 +125,7 @@ import org.compiere.util.*;
*/
public int getAD_Tab_ID();
public I_AD_Tab getI_AD_Tab() throws Exception;
public I_AD_Tab getAD_Tab() throws Exception;
/** Column name Description */
public static final String COLUMNNAME_Description = "Description";

View File

@ -32,14 +32,12 @@
**********************************************************************/
package org.compiere.model;
import java.util.*;
import java.sql.Timestamp;
import java.math.*;
import org.compiere.util.*;
import java.math.BigDecimal;
import org.compiere.util.KeyNamePair;
/** Generated Interface for AD_FieldGroup
* @author Trifon Trifonov (generated)
* @version Release 3.3.0 - 2007-08-24 11:39:21.984
* @version Release 3.3.0
*/
public interface I_AD_FieldGroup
{
@ -54,7 +52,7 @@ import org.compiere.util.*;
/** AccessLevel = 4 - System
*/
BigDecimal accessLevel = new BigDecimal(4);
BigDecimal accessLevel = BigDecimal.valueOf(4);
/** Load Meta Data */
@ -86,6 +84,19 @@ import org.compiere.util.*;
*/
public String getEntityType();
/** Column name FieldGroupType */
public static final String COLUMNNAME_FieldGroupType = "FieldGroupType";
/** Set Field Group Type.
* Field Group
*/
public void setFieldGroupType (String FieldGroupType);
/** Get Field Group Type.
* Field Group
*/
public String getFieldGroupType();
/** Column name Name */
public static final String COLUMNNAME_Name = "Name";

View File

@ -32,6 +32,7 @@
<pathelement path="../looks/CLooks.jar"/>
<pathelement path="../extend/Extend.jar"/>
<pathelement path="../tools/lib/j2ee.jar"/>
<pathelement path="../tools/lib/swinglabs-0.8.0.jar"/>
</path>

View File

@ -13,6 +13,7 @@
* For the text or an alternative of this public license, you may reach us *
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
* or via info@compiere.org or http://www.compiere.org/license.html *
* @contributor Victor Perez , e-Evolution.SC FR [ 1757088 ]
*****************************************************************************/
package org.compiere.apps;
@ -47,6 +48,8 @@ import org.compiere.util.*;
* @version $Id: APanel.java,v 1.4 2006/07/30 00:51:27 jjanke Exp $
*
* Colin Rooney 2007/03/20 RFE#1670185 & related BUG#1684142 - Extend Sec to Info Queries
* @contributor Victor Perez , e-Evolution.SC FR [ 1757088 ]
* @contributor fer_luck@centuryon.com , FR [ 1757088 ]
*/
public final class APanel extends CPanel
implements DataStatusListener, ChangeListener, ActionListener, ASyncProcess
@ -55,6 +58,27 @@ public final class APanel extends CPanel
* Constructs a new instance.
* Need to call initPanel for dynamic initialization
*/
//FR [ 1757088 ]
public APanel(GridController gc){
super();
m_ctx = Env.getCtx();
try{
m_curGC = gc;
m_curTab = gc.getMTab();
Component tabElement = null;
tabElement = gc;
VTabbedPane tabPane = new VTabbedPane(false);
tabPane.addTab(m_curTab.getName().toString(), m_curTab, tabElement);
m_curWinTab = tabPane;
jbInit();
initSwitchLineAction();
}
catch(Exception e){
log.log(Level.SEVERE, "", e);
}
createMenu();
}
public APanel(AWindow window)
{
super();
@ -330,11 +354,15 @@ public final class APanel extends CPanel
toolBar.add(aChat.getButton());
toolBar.add(aMulti.getButton());
toolBar.addSeparator();
//FR [ 1757088 ]
if((m_curGC == null) || (m_curGC != null && !m_curGC.isDetailGrid())){
toolBar.add(aHistory.getButton()); // F9
toolBar.add(aHome.getButton()); // F10 is Windows Menu Key
toolBar.add(aParent.getButton());
toolBar.add(aDetail.getButton());
toolBar.addSeparator();
}
toolBar.add(aFirst.getButton());
toolBar.add(aPrevious.getButton());
toolBar.add(aNext.getButton());
@ -344,6 +372,8 @@ public final class APanel extends CPanel
toolBar.add(aArchive.getButton());
toolBar.add(aPrintPreview.getButton());
toolBar.add(aPrint.getButton());
// FR [ 1757088 ]
if((m_curGC == null) || (m_curGC != null && !m_curGC.isDetailGrid())){
toolBar.addSeparator();
if (m_isPersonalLock)
toolBar.add(aLock.getButton());
@ -357,6 +387,8 @@ public final class APanel extends CPanel
}
toolBar.addSeparator();
toolBar.add(aEnd.getButton());
}
//
if (CLogMgt.isLevelAll())
Util.printActionInputMap(this);
@ -626,9 +658,17 @@ public final class APanel extends CPanel
if (tab == 0 && goSingleRow)
gc.switchSingleRow();
// Store GC if it has a included Tab
if (gTab.getIncluded_Tab_ID() != 0)
includedMap.put(new Integer(gTab.getIncluded_Tab_ID()), gc);
// FR [ 1757088 ]
GridField[] fields = gc.getMTab().getFields();
int m_tab_id = 0;
for(int f =0 ; f < fields.length ; f ++)
{
m_tab_id = fields[f].getIncluded_Tab_ID();
if ( m_tab_id != 0)
{
includedMap.put(m_tab_id, gc);
}
}
// Is this tab included?
if (includedMap.size() > 0)
@ -636,7 +676,24 @@ public final class APanel extends CPanel
GridController parent = (GridController)includedMap.get(new Integer(gTab.getAD_Tab_ID()));
if (parent != null)
{
included = parent.includeTab(gc);
// FR [ 1757088 ]
gc.initGrid(gTab, false, m_curWindowNo, this, mWindow, false); // will set color on Tab level
included = parent.includeTab(gc,this);
TabSwitcher ts = new TabSwitcher(parent, this);
Component[] comp = parent.getvPanel().getComponents();
for (int i = 0; i < comp.length; i++)
{
ts.addTabSwitchingSupport((JComponent)comp[i]);
}
ts = new TabSwitcher(gc, this);
comp = gc.getvPanel().getComponents();
for (int i = 0; i < comp.length; i++)
{
ts.addTabSwitchingSupport((JComponent)comp[i]);
}
ts = new TabSwitcher(gc, this);
ts.addTabSwitchingSupport((JComponent)gc.getTable());
if (!included)
log.log(Level.SEVERE, "Not Included = " + gc);
}
@ -2445,4 +2502,50 @@ public final class APanel extends CPanel
getActionMap().put(aSwitchLinesUpAction.getName(), aSwitchLinesUpAction);
}
//FR [ 1757088 ]
public void dispatchTabSwitch(GridController gc)
{
log.info("Current Grid " + gc.getName());
if(gc == null || gc.equals(m_curGC))
{
return;
}
if(m_curTab.getRecord_ID() == -1 )
{
gc.getMTab().navigateCurrent();
gc.dynamicDisplay(0);
gc.getMTab().dataRefresh();
return;
}
gc.getMTab().dataSave(true);
m_curGC = gc;
m_curGC.activate();
m_curTab = gc.getMTab();
aDetail.setEnabled(m_curTabIndex != m_curWinTab.getTabCount()-1);
aParent.setEnabled(m_curTabIndex != 0 && m_curWinTab.getTabCount() > 1);
if (m_mWorkbench.getMWindow(getWindowIndex()).isTransaction()) {
aHistory.setEnabled(isFirstTab());
}
else
{
aHistory.setPressed(false);
aHistory.setEnabled(false);
}
aPrint.setEnabled(m_curTab.isPrinted());
aFind.setPressed(m_curTab.isQueryActive());
aMulti.setEnabled(true);
aMulti.setPressed(!m_curGC.isSingleRow());
aFind.setEnabled(true);
aRefresh.setEnabled(true);
aAttachment.setEnabled(true);
m_curWinTab.requestFocusInWindow();
setBusy(false,true);
}
} // APanel

View File

@ -0,0 +1,134 @@
/******************************************************************************
* Product: Adempiere ERP & CRM Smart Business Solution *
* This program is free software; you can redistribute it and/or modify it *
* under the terms version 2 of the GNU General Public License as published *
* by the Free Software Foundation. This program is distributed in the hope *
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU General Public License for more details. *
* 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., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
* For the text or an alternative of this public license, you may reach us *
* Copyright (C) 2003-2007 e-Evolution,SC. All Rights Reserved. *
* @contributor Victor Perez , e-Evolution.SC FR [ 1757088 ] *
*****************************************************************************/
package org.compiere.apps;
import java.awt.Component;
import java.awt.ItemSelectable;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.awt.event.*;
import javax.swing.AbstractButton;
import javax.swing.JTable;
import javax.swing.JTabbedPane;
import javax.swing.JComponent;
import javax.swing.JComboBox;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import javax.swing.text.JTextComponent;
import org.compiere.grid.GridController;
import org.compiere.grid.ed.VEditor;
import org.compiere.model.MField;
import org.compiere.swing.CPanel;
/**
*
* @author Gunther Hoppe, 21.08.2005
*
*/
public class TabSwitcher extends FocusAdapter implements ActionListener, ListSelectionListener{
private APanel panel;
private GridController gc;
public TabSwitcher(GridController g, APanel p) {
panel = p;
gc = g;
}
public void valueChanged(ListSelectionEvent e) {
if(!e.getValueIsAdjusting()) {
performSwitch();
}
};
public void actionPerformed(ActionEvent e) {
if(!(e.getSource() instanceof JTextComponent)) {
if(gc.getMTab().getRecord_ID() != -1)
performSwitch();
}
}
public void focusGained(FocusEvent e) {
performSwitch();
}
private void performSwitch() {
//gc.transferFocus();
//panel.dispatchTabSwitch(gc);
}
public void addTabSwitchingSupport(JComponent c) {
if(c instanceof JTable) {
((JTable)c).getSelectionModel().addListSelectionListener(this);
return;
}
else if( //c instanceof org.compiere.grid.ed.VEditor ||
c instanceof JTextComponent ||
//c instanceof ItemSelectable ||
c instanceof org.compiere.grid.ed.VCheckBox ||
//c instanceof org.compiere.grid.ed.VLookup ||
//c instanceof org.compiere.swing.CLabel ||
c instanceof AbstractButton)
{
c.addFocusListener(this);
//c.addKeyListener(new MovementAdapter());
return;
}
else if(c instanceof org.compiere.grid.ed.VDate)
{
org.compiere.grid.ed.VDate d = ((org.compiere.grid.ed.VDate)c);
//d.addFocusListener(this);
d.addActionListener(this);
//d.addKeyListener(new MovementAdapter());
return;
}
else if(c instanceof org.compiere.grid.ed.VLookup)
{
org.compiere.grid.ed.VLookup l = ((org.compiere.grid.ed.VLookup)c);
//l.addFocusListener(this);
l.addActionListener(this);
//l.addKeyListener(new MovementAdapter());
return;
}
}
class MovementAdapter extends KeyAdapter
{
public void keyPressed(KeyEvent event)
{
// look for tab keys
if(event.getKeyCode() == KeyEvent.VK_TAB
|| event.getKeyCode() == KeyEvent.VK_ENTER)
{
((JComponent)event.getSource()).transferFocus();
}
}
}
}

View File

@ -13,6 +13,8 @@
* For the text or an alternative of this public license, you may reach us *
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
* or via info@compiere.org or http://www.compiere.org/license.html *
* @contributor Victor Perez , e-Evolution.SC FR [ 1757088 ]
* @contributor fer_luck @ centuryon
*****************************************************************************/
package org.compiere.grid;
@ -96,6 +98,8 @@ import org.compiere.util.*;
* @version $Id: GridController.java,v 1.8 2006/09/25 00:59:52 jjanke Exp $
*
* @author Teo Sarca - BF [ 1742159 ], BF [ 1707876 ]
* @contributor Victor Perez , e-Evolution.SC FR [ 1757088 ]
* @contributor fer_luck @ centuryon FR [ 1757088 ]
*/
public class GridController extends CPanel
implements DataStatusListener, ListSelectionListener, Evaluatee,
@ -139,12 +143,15 @@ public class GridController extends CPanel
private CardLayout cardLayout = new CardLayout();
private JSplitPane srPane = new JSplitPane();
private JScrollPane vPane = new JScrollPane();
private GridController vIncludedGC = null;
//FR [ 1757088 ]
private GridController detail = null;
private CScrollPane mrPane = new CScrollPane();
private CPanel xPanel = new CPanel();
private FlowLayout xLayout = new FlowLayout();
private VTable vTable = new VTable();
private VPanel vPanel = new VPanel();
//FR [ 1757088 ]
private VPanel vPanel = null;
private boolean detailGrid = false;
/**
* Static Layout init
@ -174,10 +181,8 @@ public class GridController extends CPanel
srPane.add(vPane, JSplitPane.TOP);
srPane.setTopComponent(vPane);
srPane.setBottomComponent(null); // otherwise a button is created/displayed
//
vPane.getViewport().add(xPanel, null);
xPanel.add(vPanel);
vPane.setBorder(null);
//FR [ 1757088 ] vPane.getViewport().add(xPanel, null);
//FR [ 1757088 ] xPanel.add(vPanel);
xPanel.setLayout(xLayout);
xPanel.setName("gc_xPanel");
xLayout.setAlignment(FlowLayout.LEFT);
@ -206,7 +211,7 @@ public class GridController extends CPanel
if (m_mTab.needSave(true, false))
m_mTab.dataIgnore();
}
vIncludedGC = null;
//FR [ 1757088 ] vIncludedGC = null;
// Listeners
if (m_mTab.isLoadComplete())
@ -295,6 +300,10 @@ public class GridController extends CPanel
m_onlyMultiRow = onlyMultiRow;
m_aPanel = aPanel;
setName("GC-" + mTab);
//FR [ 1757088 ]
vPanel = new VPanel(mWindow.getName());
vPane.getViewport().add(xPanel, null);
xPanel.add(vPanel);
setTabLevel(m_mTab.getTabLevel());
@ -414,60 +423,68 @@ public class GridController extends CPanel
* @param gc grod controller to add
* @return true if included
*/
public boolean includeTab (GridController gc)
//FR [ 1757088 ]
public boolean includeTab (GridController gc , APanel aPanel)
{
GridTab imcludedMTab = gc.getMTab();
if (m_mTab.getIncluded_Tab_ID () != imcludedMTab.getAD_Tab_ID())
return false;
//
vIncludedGC = gc;
vIncludedGC.switchMultiRow();
//
Dimension size = getPreferredSize();
srPane.setResizeWeight(.75); // top part gets 75%
srPane.add(vIncludedGC, JSplitPane.BOTTOM);
srPane.setBottomComponent(vIncludedGC);
srPane.setDividerSize (5);
//
int height = 150;
vIncludedGC.setPreferredSize(new Dimension(600, height));
setPreferredSize(new Dimension(size.width, size.height+height));
srPane.setDividerLocation (size.height);
//
imcludedMTab.setIncluded (true);
imcludedMTab.query (false, 0, 0);
//
detail = gc;
int screenWidth = (int) Toolkit.getDefaultToolkit().getScreenSize().getWidth() - 630;
// Set screen dimension
detail.setPreferredSize(new Dimension(screenWidth, 250));
ArrayList parents = detail.getMTab().getParentColumnNames();
// No Parent - no link
if (parents.size() == 0)
;
// Standard case
else if (parents.size() == 1)
detail.getMTab().setLinkColumnName((String)parents.get(0));
detail.getMTab().query(false, 0, 0);
int c = VTable.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT;
vTable.getInputMap(c).put(KeyStroke.getKeyStroke(KeyEvent.VK_F4, 0), aPanel.aSave.getName());
vTable.getActionMap().put(aPanel.aSave.getName(), aPanel.aSave);
org.jdesktop.swingx.JXTaskPane taskpanetab = vPanel.getTaskPane(detail.getMTab().getAD_Tab_ID());
gc.isDetailGrid(true);
if(taskpanetab != null)
{
APanel painel = new APanel(gc);
String name = detail.getMTab().getName() + "";
taskpanetab.setTitle(name);
painel.add(detail);
taskpanetab.add(painel);
}
JRootPane rt = SwingUtilities.getRootPane(this);
if (rt == null)
System.out.println("Root pane null");
else
{
System.out.println("Root=" + rt);
rt.addMouseListener(vIncludedGC);
rt.addMouseListener(detail);
Component gp = rt.getGlassPane();
if (gp == null)
System.out.println("No Glass Pane");
else
{
System.out.println("Glass=" + gp);
gp.addMouseListener(vIncludedGC);
gp.addMouseListener(detail);
}
}
vIncludedGC.addMouseListener(vIncludedGC);
vIncludedGC.enableEvents(AWTEvent.HIERARCHY_EVENT_MASK + AWTEvent.MOUSE_EVENT_MASK);
/**
vIncludedGC.splitPane.addMouseListener(vIncludedGC);
vIncludedGC.cardPanel.addMouseListener(vIncludedGC);
vIncludedGC.mrPane.addMouseListener(vIncludedGC);
vIncludedGC.vTable.addMouseListener(vIncludedGC);
**/
detail.addMouseListener(detail);
detail.enableEvents(AWTEvent.HIERARCHY_EVENT_MASK + AWTEvent.MOUSE_EVENT_MASK);
return true;
} // IncludeTab
//FR [ 1757088 ]
public void isDetailGrid(boolean value){
detailGrid = value;
}
public boolean isDetailGrid(){
return detailGrid;
}
/**
* Get Title
* @return title
@ -731,7 +748,16 @@ public class GridController extends CPanel
int rowTable = vTable.getSelectedRow();
int rowCurrent = m_mTab.getCurrentRow();
log.config("(" + m_mTab.toString() + ") Row in Table=" + rowTable + ", in Model=" + rowCurrent);
// FR [ 1757088 ]
if(rowCurrent + 1 == vTable.getRowCount() && !isSingleRow() && Env.isAutoNew(Env.getCtx()) && m_mTab.getRecord_ID() != -1)
{
//stopEditor(true);
vTable.getSelectionModel().removeListSelectionListener(this);
m_mTab.dataNew(false);
dynamicDisplay(0);
vTable.getSelectionModel().addListSelectionListener(this);
return;
}
if (rowTable == -1) // nothing selected
{
if (rowCurrent >= 0)
@ -754,9 +780,10 @@ public class GridController extends CPanel
// log.config( "GridController.valueChanged (" + m_mTab.toString() + ") - fini",
// "Row in Table=" + rowTable + ", in Model=" + rowCurrent);
// FR [ 1757088 ]
// Query Included Tab
if (vIncludedGC != null)
vIncludedGC.getMTab().query(false, 0, 0);
if (detail != null)
detail.getMTab().query(false, 0, 0);
} // valueChanged
/**
@ -1151,4 +1178,10 @@ public class GridController extends CPanel
{
return m_mTab != null ? m_mTab.isCurrent() : false;
}
//FR [ 1757088 ]
public VPanel getvPanel()
{
return vPanel;
}
} // GridController

View File

@ -13,12 +13,14 @@
* For the text or an alternative of this public license, you may reach us *
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
* or via info@compiere.org or http://www.compiere.org/license.html *
* @contributor Victor Perez , e-Evolution.SC FR [ 1757088 ]
*****************************************************************************/
package org.compiere.grid;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.*;
//
import org.compiere.grid.ed.*;
@ -51,17 +53,23 @@ import org.compiere.util.*;
* </pre>
* @author Jorg Janke
* @version $Id: VPanel.java,v 1.3 2006/07/30 00:51:28 jjanke Exp $
* @contributor Victor Perez , e-Evolution.SC FR [ 1757088 ]
*/
public final class VPanel extends CPanel
public final class VPanel extends CTabbedPane
{
/**
* Constructor
*/
public VPanel()
public VPanel(String Name)
{
super(new GridBagLayout());
setName("VPanel");
setBorder(null);
//[ 1757088 ]
CTabbedPane T = new CTabbedPane();
m_main.setName(Name);
m_main.setLayout(new GridBagLayout());
m_tablist.put("main", m_main);
this.setBorder(marginBorder);
this.add(m_main);
// Set initial values of constraint
m_gbc.anchor = GridBagConstraints.NORTHWEST;
@ -95,6 +103,12 @@ public final class VPanel extends CPanel
private boolean m_hGapAdded = false; // only once
/** Previous Field Group Header */
private String m_oldFieldGroup = null;
//[ 1757088 ]
private java.util.Hashtable m_tablist = new java.util.Hashtable();
private java.util.Hashtable m_tabincludelist = new java.util.Hashtable();
private CPanel m_main = new CPanel(org.compiere.plaf.CompiereColor.getDefaultBackground());
private int typeGroup = 3;
private org.jdesktop.swingx.border.DropShadowBorder marginBorder = new org.jdesktop.swingx.border.DropShadowBorder();
/** Logger */
private static CLogger log = CLogger.getCLogger (VPanel.class);
@ -134,13 +148,49 @@ public final class VPanel extends CPanel
*/
public void addField (VEditor editor, GridField mField)
{
//[ 1757088 ]
int AD_Tab_ID = mField.getIncluded_Tab_ID();
if(AD_Tab_ID != 0 )
{
m_gbc.gridx = 0;
m_gbc.gridy = m_line++;
m_gbc.gridwidth = 4;
org.jdesktop.swingx.JXTaskPaneContainer GroupPaneContainer = new org.jdesktop.swingx.JXTaskPaneContainer();
org.jdesktop.swingx.JXTaskPane m_tab = new org.jdesktop.swingx.JXTaskPane();
m_tab.setLayout(new BorderLayout());
GroupPaneContainer.setBackground(org.compiere.plaf.CompiereColor.getDefaultBackground().getFlatColor());
GroupPaneContainer.add(m_tab);
m_tabincludelist.put(AD_Tab_ID, m_tab);
m_gbc.anchor = GridBagConstraints.NORTHWEST;
m_gbc.gridx = 0;
m_gbc.gridheight = 1;
m_gbc.insets = new Insets(2,12,0,0);
m_gbc.gridy = m_line++;
m_gbc.gridwidth = 4;
m_gbc.fill = GridBagConstraints.HORIZONTAL;
m_gbc.weightx = 0;
m_gbc.ipadx = 0;
m_main.add(GroupPaneContainer,m_gbc);
return;
}
CLabel label = VEditorFactory.getLabel(mField);
if (label == null && editor == null)
return;
boolean sameLine = mField.isSameLine();
if (addGroup(mField.getFieldGroup())) // sets top
//[ 1757088 ] // sets top
String fieldGroup = mField.getFieldGroup();
if (fieldGroup == "")
{
fieldGroup = m_oldFieldGroup;
}
if (addGroup(fieldGroup)) // sets top
sameLine = false;
else
{
fieldGroup = m_oldFieldGroup;
}
if (sameLine) // Set line #
m_gbc.gridy = m_line-1;
@ -164,7 +214,23 @@ public final class VPanel extends CPanel
if (mField.isCreateMnemonic())
setMnemonic(label, mField.getMnemonic());
// Add Label
this.add(label, m_gbc);
//[ 1757088 ]
//this.add(label, m_gbc);
if (typeGroup == 1)
{
CPanel m_tab = (CPanel)m_tablist.get(fieldGroup);
m_tab.add(label, m_gbc);
}
else if (typeGroup == 2)
{
org.jdesktop.swingx.JXTaskPane m_tab = (org.jdesktop.swingx.JXTaskPane)m_tablist.get(fieldGroup);
m_tab.add(label, m_gbc);
}
else if (typeGroup == 3)
{
m_main.add(label, m_gbc);
}
}
// *** The Field ***
@ -184,7 +250,21 @@ public final class VPanel extends CPanel
// Weight factor for Fields
m_gbc.weightx = 1;
// Add Field
this.add(field, m_gbc);
//[ 1757088 ]
if (typeGroup == 1)
{
CPanel m_tab = (CPanel)m_tablist.get(fieldGroup);
m_tab.add(field, m_gbc);
}
else if (typeGroup == 2)
{
org.jdesktop.swingx.JXTaskPane m_tab = (org.jdesktop.swingx.JXTaskPane)m_tablist.get(fieldGroup);
m_tab.add(field, m_gbc);
}
else if (typeGroup == 3)
{
m_main.add(field, m_gbc);
}
// Link Label to Field
if (label != null)
label.setLabelFor(field);
@ -209,18 +289,83 @@ public final class VPanel extends CPanel
if (fieldGroup == null || fieldGroup.length() == 0 || fieldGroup.equals(m_oldFieldGroup))
return false;
m_oldFieldGroup = fieldGroup;
//[ 1757088 ]
if (m_tablist.get(fieldGroup) != null)
{
return false;
}
//[ 1757088 ]
if (fieldGroup != null)
{
if (Env.getContext(Env.getCtx(),"#AD_Language").equals("en_US"))
{
typeGroup = DB.getSQLValue(null,"SELECT CASE WHEN FieldGroupType = 'T' THEN 1 WHEN FieldGroupType = 'C' THEN 2 WHEN FieldGroupType = 'L' THEN 3 END AS Type FROM AD_FieldGroup fg WHERE fg.Name= ? ", fieldGroup);
}
else
{
typeGroup = DB.getSQLValue(null,"SELECT CASE WHEN FieldGroupType = 'T' THEN 1 WHEN FieldGroupType = 'C' THEN 2 WHEN FieldGroupType = 'L' THEN 3 END AS Type FROM AD_FieldGroup fg INNER JOIN AD_FieldGroup_Trl fgtrl ON ( fg.AD_FieldGroup_ID = fgtrl.AD_FieldGroup_ID) WHERE fgtrl.Name= ? ", fieldGroup);
}
}
if(typeGroup < 1 )
{
typeGroup = 3;
}
if (typeGroup == 1)
{
CPanel m_tab = new CPanel(org.compiere.plaf.CompiereColor.getDefaultBackground());
m_tab.setLayout(new GridBagLayout());
m_tab.setName(fieldGroup);
this.add(m_tab);
m_tablist.put(fieldGroup, m_tab);
m_oldFieldGroup= fieldGroup;
return true;
}
else if (typeGroup == 2)
{
org.jdesktop.swingx.JXTaskPaneContainer GroupPaneContainer = new org.jdesktop.swingx.JXTaskPaneContainer();
org.jdesktop.swingx.JXTaskPane m_tab = new org.jdesktop.swingx.JXTaskPane();
GroupPaneContainer.setBackground(org.compiere.plaf.CompiereColor.getDefaultBackground().getFlatColor());
m_tab.setLayout(new GridBagLayout());
m_tab.setTitle(fieldGroup);
m_tab.setName(fieldGroup);
m_tab.setAnimated(true);
GroupPaneContainer.add(m_tab);
m_gbc.anchor = GridBagConstraints.NORTHWEST;
//m_gbc.gridy = 0; // line
m_gbc.gridx = 0;
m_gbc.gridheight = 1;
m_gbc.insets = new Insets(2,12,0,0);
m_gbc.gridy = m_line++;
m_gbc.gridwidth = 4;
m_gbc.fill = GridBagConstraints.HORIZONTAL;
m_gbc.weightx = 0;
m_gbc.ipadx = 0;
m_main.add(GroupPaneContainer,m_gbc);
m_tablist.put(fieldGroup, m_tab);
m_oldFieldGroup = fieldGroup;
return true;
}
else if (typeGroup == 3)
{
CPanel group = new CPanel();
group.setBorder(new VLine(fieldGroup));
group.add(Box.createVerticalStrut(VLine.SPACE));
m_gbc.gridx = 0;
m_gbc.gridy = m_line++;
m_gbc.gridwidth = 4;
this.add(group, m_gbc);
m_main.add(group, m_gbc);
// reset
m_gbc.gridwidth = 1;
m_oldFieldGroup = fieldGroup;
return true;
}
return false;
} // addGroup
/**
@ -230,14 +375,15 @@ public final class VPanel extends CPanel
{
// Top Gap
m_gbc.gridy = m_line++;
this.add(Box.createVerticalStrut(10), m_gbc); // top gap
//[ 1757088 ]
m_main.add(Box.createVerticalStrut(10), m_gbc); // top gap
// Right gap
m_gbc.gridx = 4; // 5th column
m_gbc.gridwidth = 1;
m_gbc.weightx = 0;
m_gbc.insets = m_zeroInset;
m_gbc.fill = GridBagConstraints.NONE;
this.add(Box.createHorizontalStrut(12), m_gbc);
m_main.add(Box.createHorizontalStrut(12), m_gbc);
} // addTop
/**
@ -252,7 +398,8 @@ public final class VPanel extends CPanel
m_gbc.fill = GridBagConstraints.HORIZONTAL;
m_gbc.weightx = 0;
//
this.add(Box.createVerticalStrut(9), m_gbc); // botton gap
//[ 1757088 ]
m_main.add(Box.createVerticalStrut(9), m_gbc);
} // addEnd
/**
@ -451,5 +598,57 @@ public final class VPanel extends CPanel
public void setBackground (int AD_Color_ID)
{
} // setBackground
//[ 1757088 ]
public org.jdesktop.swingx.JXTaskPane getTaskPane(int AD_Tab_ID)
{
return (org.jdesktop.swingx.JXTaskPane)m_tabincludelist.get(AD_Tab_ID);
}
//[ 1757088 ]
public Component[] getComponents()
{
java.util.ArrayList list = new java.util.ArrayList();
for (int i = 0; i < this.getTabCount(); i++)
{
list.add(this.getComponentAt(i));
if (this.getComponentAt(i) instanceof CPanel)
{
CPanel tab = (CPanel)this.getComponentAt(i);
Component[] comp = tab.getComponents();
for (int c = 0; c < comp.length; c++)
{
if ( comp [c] instanceof org.jdesktop.swingx.JXTaskPaneContainer)
{
org.jdesktop.swingx.JXTaskPaneContainer panetaskcontainer = (org.jdesktop.swingx.JXTaskPaneContainer)comp [c];
Component[] comppanetask = panetaskcontainer.getComponents();
for (int y = 0; y < comppanetask.length; y++)
{
if ( comppanetask [y] instanceof org.jdesktop.swingx.JXTaskPane)
{
org.jdesktop.swingx.JXTaskPane tabtask = (org.jdesktop.swingx.JXTaskPane)comppanetask[y];
Component[] comptabtask = tabtask.getContentPane().getComponents();
for (int x = 0; x < comptabtask.length; x++)
{
list.add(comptabtask[x]);
}
}
}
}
list.add(comp[c]);
}
}
}
Component[] result = new Component[list.size ()];
list.toArray (result);
return result;
}
} // VPanel

View File

@ -0,0 +1,204 @@
--@author - fer_luck @ centuryono
--Add Detail column
--The fields are already in the databse. Just needs to update them
BEGIN;
update ad_field set seqno = seqno + 10 where ad_tab_id = 107 and seqno > 70;
update ad_field
set ad_tab_id = 107, isdisplayed = 'Y', seqno = 80
where ad_column_id = 8547;
--It's not physically in the database, so here we create it
alter table ad_field add included_tab_id numeric(10);
--Modify the views
drop view ad_field_v;
CREATE OR REPLACE VIEW AD_FIELD_V
(AD_WINDOW_ID, AD_TAB_ID, AD_FIELD_ID, AD_TABLE_ID, AD_COLUMN_ID,
NAME, DESCRIPTION, HELP, ISDISPLAYED, DISPLAYLOGIC,
DISPLAYLENGTH, SEQNO, SORTNO, ISSAMELINE, ISHEADING,
ISFIELDONLY, ISREADONLY, ISENCRYPTEDFIELD, OBSCURETYPE, COLUMNNAME,
COLUMNSQL, FIELDLENGTH, VFORMAT, DEFAULTVALUE, ISKEY,
ISPARENT, ISMANDATORY, ISIDENTIFIER, ISTRANSLATED, AD_REFERENCE_VALUE_ID,
CALLOUT, AD_REFERENCE_ID, AD_VAL_RULE_ID, AD_PROCESS_ID, ISALWAYSUPDATEABLE,
READONLYLOGIC, MANDATORYLOGIC, ISUPDATEABLE, ISENCRYPTEDCOLUMN, ISSELECTIONCOLUMN, TABLENAME,
VALUEMIN, VALUEMAX, FIELDGROUP, VALIDATIONCODE)
AS
SELECT t.AD_Window_ID, f.AD_Tab_ID, f.AD_Field_ID, tbl.AD_Table_ID, f.AD_Column_ID,
f.Name, f.Description, f.Help, f.IsDisplayed, f.DisplayLogic, f.DisplayLength,
f.SeqNo, f.SortNo, f.IsSameLine, f.IsHeading, f.IsFieldOnly, f.IsReadOnly,
f.IsEncrypted AS IsEncryptedField, f.ObscureType,
c.ColumnName, c.ColumnSQL, c.FieldLength, c.VFormat, c.DefaultValue, c.IsKey, c.IsParent,
COALESCE(f.IsMandatory, c.IsMandatory) AS IsMandatory,
c.IsIdentifier, c.IsTranslated, c.AD_Reference_Value_ID,
c.Callout, COALESCE(f.AD_Reference_ID, c.AD_Reference_ID) AS AD_Reference_ID,
c.AD_Val_Rule_ID, c.AD_Process_ID, c.IsAlwaysUpdateable,
c.ReadOnlyLogic, c.MandatoryLogic, c.IsUpdateable, c.IsEncrypted AS IsEncryptedColumn,
c.IsSelectionColumn,
tbl.TableName, c.ValueMin, c.ValueMax,
fg.Name AS FieldGroup, vr.Code AS ValidationCode, f.included_tab_id
FROM AD_Field f
INNER JOIN AD_Tab t ON (f.AD_Tab_ID = t.AD_Tab_ID)
LEFT OUTER JOIN AD_FieldGroup fg ON (f.AD_FieldGroup_ID = fg.AD_FieldGroup_ID)
LEFT OUTER JOIN AD_Column c ON (f.AD_Column_ID = c.AD_Column_ID)
INNER JOIN AD_Table tbl ON (c.AD_Table_ID = tbl.AD_Table_ID)
INNER JOIN AD_Reference r ON (c.AD_Reference_ID = r.AD_Reference_ID)
LEFT OUTER JOIN AD_Val_Rule vr ON (c.AD_Val_Rule_ID=vr.AD_Val_Rule_ID)
WHERE f.IsActive = 'Y'
AND c.IsActive = 'Y';
drop view ad_field_vt;
CREATE OR REPLACE VIEW AD_FIELD_VT
(AD_LANGUAGE, AD_WINDOW_ID, AD_TAB_ID, AD_FIELD_ID, AD_TABLE_ID,
AD_COLUMN_ID, NAME, DESCRIPTION, HELP, ISDISPLAYED,
DISPLAYLOGIC, DISPLAYLENGTH, SEQNO, SORTNO, ISSAMELINE,
ISHEADING, ISFIELDONLY, ISREADONLY, ISENCRYPTEDFIELD, OBSCURETYPE,
COLUMNNAME, COLUMNSQL, FIELDLENGTH, VFORMAT, DEFAULTVALUE,
ISKEY, ISPARENT, ISMANDATORY, ISIDENTIFIER, ISTRANSLATED,
AD_REFERENCE_VALUE_ID, CALLOUT, AD_REFERENCE_ID, AD_VAL_RULE_ID, AD_PROCESS_ID,
ISALWAYSUPDATEABLE, READONLYLOGIC, MANDATORYLOGIC, ISUPDATEABLE, ISENCRYPTEDCOLUMN, ISSELECTIONCOLUMN,
TABLENAME, VALUEMIN, VALUEMAX, FIELDGROUP, VALIDATIONCODE)
AS
SELECT trl.AD_Language, t.AD_Window_ID, f.AD_Tab_ID, f.AD_Field_ID, tbl.AD_Table_ID, f.AD_Column_ID,
trl.Name, trl.Description, trl.Help, f.IsDisplayed, f.DisplayLogic, f.DisplayLength,
f.SeqNo, f.SortNo, f.IsSameLine, f.IsHeading, f.IsFieldOnly, f.IsReadOnly,
f.IsEncrypted AS IsEncryptedField, f.ObscureType,
c.ColumnName, c.ColumnSQL, c.FieldLength, c.VFormat, c.DefaultValue, c.IsKey, c.IsParent,
COALESCE(f.IsMandatory, c.IsMandatory) AS IsMandatory,
c.IsIdentifier, c.IsTranslated, c.AD_Reference_Value_ID,
c.Callout, COALESCE(f.AD_Reference_ID, c.AD_Reference_ID) AS AD_Reference_ID,
c.AD_Val_Rule_ID, c.AD_Process_ID, c.IsAlwaysUpdateable,
c.ReadOnlyLogic, c.MandatoryLogic, c.IsUpdateable, c.IsEncrypted AS IsEncryptedColumn, c.IsSelectionColumn,
tbl.TableName, c.ValueMin, c.ValueMax,
fgt.Name AS FieldGroup, vr.Code AS ValidationCode, f.included_tab_id
FROM AD_Field f
INNER JOIN AD_Field_Trl trl ON (f.AD_Field_ID = trl.AD_Field_ID)
INNER JOIN AD_Tab t ON (f.AD_Tab_ID = t.AD_Tab_ID)
LEFT OUTER JOIN AD_FieldGroup_Trl fgt ON
(f.AD_FieldGroup_ID = fgt.AD_FieldGroup_ID AND trl.AD_Language=fgt.AD_Language)
LEFT OUTER JOIN AD_Column c ON (f.AD_Column_ID = c.AD_Column_ID)
INNER JOIN AD_Table tbl ON (c.AD_Table_ID = tbl.AD_Table_ID)
INNER JOIN AD_Reference r ON (c.AD_Reference_ID = r.AD_Reference_ID)
LEFT OUTER JOIN AD_Val_Rule vr ON (c.AD_Val_Rule_ID=vr.AD_Val_Rule_ID)
WHERE f.IsActive = 'Y'
AND c.IsActive = 'Y';
--Add the Grid Collapse and Tabbed item navigation
INSERT INTO AD_ELEMENT
(ad_element_id, ad_client_id, ad_org_id, isactive,
created, createdby,
updated, updatedby,
columnname, entitytype, NAME, printname
)
VALUES (53002, 0, 0, 'Y',
TO_DATE ('07/18/2007 14:23:01', 'MM/DD/YYYY HH24:MI:SS'), 100,
TO_DATE ('07/18/2007 14:23:01', 'MM/DD/YYYY HH24:MI:SS'), 100,
'FieldGroupType', 'D', 'Field Group Type', 'Field Group Type'
);
insert into ad_reference
(ad_reference_id, ad_client_id, ad_org_id, isactive,
created,
updated, createdby,
updatedby,
name, description, help,
validationtype, entitytype)
VALUES (53000, 0, 0, 'Y',
TO_DATE ('07/18/2007 14:22:51', 'MM/DD/YYYY HH24:MI:SS'),
TO_DATE ('07/18/2007 14:22:51', 'MM/DD/YYYY HH24:MI:SS'), 100,
100, 'AD_FieldGroup', 'Field Group Type', '',
'L', 'D');
insert into ad_ref_list
(ad_ref_list_id, ad_client_id, ad_org_id, isactive,
created,
updated, createdby,
updatedby,
value, name,
ad_reference_id, entitytype)
VALUES(53000, 0, 0, 'Y',
TO_DATE ('07/18/2007 14:22:51', 'MM/DD/YYYY HH24:MI:SS'),
TO_DATE ('07/18/2007 14:22:51', 'MM/DD/YYYY HH24:MI:SS'), 100,
100,
'T', 'Tab',
53000, 'D');
insert into ad_ref_list
(ad_ref_list_id, ad_client_id, ad_org_id, isactive,
created,
updated, createdby,
updatedby,
value, name,
ad_reference_id, entitytype)
VALUES(53001, 0, 0, 'Y',
TO_DATE ('07/18/2007 14:22:51', 'MM/DD/YYYY HH24:MI:SS'),
TO_DATE ('07/18/2007 14:22:51', 'MM/DD/YYYY HH24:MI:SS'), 100,
100,
'L', 'Label',
53000, 'D');
insert into ad_ref_list
(ad_ref_list_id, ad_client_id, ad_org_id, isactive,
created,
updated, createdby,
updatedby,
value, name,
ad_reference_id, entitytype)
VALUES(53002, 0, 0, 'Y',
TO_DATE ('07/18/2007 14:22:51', 'MM/DD/YYYY HH24:MI:SS'),
TO_DATE ('07/18/2007 14:22:51', 'MM/DD/YYYY HH24:MI:SS'), 100,
100,
'C', 'Collapse',
53000, 'D');
INSERT INTO AD_COLUMN
(ad_column_id, ad_client_id, ad_org_id, isactive,
created,
updated, createdby,
updatedby, NAME, description,
HELP,
VERSION, entitytype, columnname, ad_table_id, ad_reference_id,
fieldlength, iskey, isparent, ismandatory, isupdateable,
isidentifier, seqno, istranslated, isencrypted,
isselectioncolumn, ad_element_id, issyncdatabase,
isalwaysupdateable, ad_reference_value_id
)
VALUES (53002, 0, 0, 'Y',
TO_DATE ('07/18/2007 14:22:51', 'MM/DD/YYYY HH24:MI:SS'),
TO_DATE ('07/18/2007 14:22:51', 'MM/DD/YYYY HH24:MI:SS'), 100,
100, 'Field Group Type', 'Field Group',
'Field Group.',
0, 'D', 'FieldGroupType', 414, 17,
10, 'N', 'N', 'N', 'Y',
'N', null, 'N', 'N',
'N', 53002, 'Y',
'N', 53000
);
ALTER TABLE ad_fieldgroup ADD fieldgrouptype char(1);
INSERT INTO AD_FIELD
(ad_field_id, ad_client_id, ad_org_id, isactive,
created, createdby,
updated, updatedby,
NAME, description,
HELP,
iscentrallymaintained, ad_tab_id, ad_column_id, isdisplayed,
displaylength, isreadonly, seqno, sortno, issameline, isheading,
isfieldonly, isencrypted, entitytype
)
VALUES (53002, 0, 0, 'Y',
TO_DATE ('07/18/2007 14:23:09', 'MM/DD/YYYY HH24:MI:SS'), 100,
TO_DATE ('07/18/2007 14:23:17', 'MM/DD/YYYY HH24:MI:SS'), 100,
'Field Group Type', 'Field Group Type',
'The Field Group type',
'Y', 342, 53002, 'Y',
10, 'N', 60, 0, 'N', 'N',
'N', 'N', 'D'
);
COMMIT;
-- NOTE: Don't forget to run the three processes:
-- 1 - Add missing translations in the language screen
-- 2 - Synchronize terminology
-- 3 - Check sequences

View File

@ -0,0 +1,204 @@
--@author - fer_luck @ centuryono
--Add Detail column
--The fields are already in the databse. Just needs to update them
BEGIN;
update ad_field set seqno = seqno + 10 where ad_tab_id = 107 and seqno > 70;
update ad_field
set ad_tab_id = 107, isdisplayed = 'Y', seqno = 80
where ad_column_id = 8547;
--It's not physically in the database, so here we create it
alter table ad_field add included_tab_id numeric(10);
--Modify the views
drop view ad_field_v;
CREATE OR REPLACE VIEW AD_FIELD_V
(AD_WINDOW_ID, AD_TAB_ID, AD_FIELD_ID, AD_TABLE_ID, AD_COLUMN_ID,
NAME, DESCRIPTION, HELP, ISDISPLAYED, DISPLAYLOGIC,
DISPLAYLENGTH, SEQNO, SORTNO, ISSAMELINE, ISHEADING,
ISFIELDONLY, ISREADONLY, ISENCRYPTEDFIELD, OBSCURETYPE, COLUMNNAME,
COLUMNSQL, FIELDLENGTH, VFORMAT, DEFAULTVALUE, ISKEY,
ISPARENT, ISMANDATORY, ISIDENTIFIER, ISTRANSLATED, AD_REFERENCE_VALUE_ID,
CALLOUT, AD_REFERENCE_ID, AD_VAL_RULE_ID, AD_PROCESS_ID, ISALWAYSUPDATEABLE,
READONLYLOGIC, MANDATORYLOGIC, ISUPDATEABLE, ISENCRYPTEDCOLUMN, ISSELECTIONCOLUMN, TABLENAME,
VALUEMIN, VALUEMAX, FIELDGROUP, VALIDATIONCODE)
AS
SELECT t.AD_Window_ID, f.AD_Tab_ID, f.AD_Field_ID, tbl.AD_Table_ID, f.AD_Column_ID,
f.Name, f.Description, f.Help, f.IsDisplayed, f.DisplayLogic, f.DisplayLength,
f.SeqNo, f.SortNo, f.IsSameLine, f.IsHeading, f.IsFieldOnly, f.IsReadOnly,
f.IsEncrypted AS IsEncryptedField, f.ObscureType,
c.ColumnName, c.ColumnSQL, c.FieldLength, c.VFormat, c.DefaultValue, c.IsKey, c.IsParent,
COALESCE(f.IsMandatory, c.IsMandatory) AS IsMandatory,
c.IsIdentifier, c.IsTranslated, c.AD_Reference_Value_ID,
c.Callout, COALESCE(f.AD_Reference_ID, c.AD_Reference_ID) AS AD_Reference_ID,
c.AD_Val_Rule_ID, c.AD_Process_ID, c.IsAlwaysUpdateable,
c.ReadOnlyLogic, c.MandatoryLogic, c.IsUpdateable, c.IsEncrypted AS IsEncryptedColumn,
c.IsSelectionColumn,
tbl.TableName, c.ValueMin, c.ValueMax,
fg.Name AS FieldGroup, vr.Code AS ValidationCode, f.included_tab_id
FROM AD_Field f
INNER JOIN AD_Tab t ON (f.AD_Tab_ID = t.AD_Tab_ID)
LEFT OUTER JOIN AD_FieldGroup fg ON (f.AD_FieldGroup_ID = fg.AD_FieldGroup_ID)
LEFT OUTER JOIN AD_Column c ON (f.AD_Column_ID = c.AD_Column_ID)
INNER JOIN AD_Table tbl ON (c.AD_Table_ID = tbl.AD_Table_ID)
INNER JOIN AD_Reference r ON (c.AD_Reference_ID = r.AD_Reference_ID)
LEFT OUTER JOIN AD_Val_Rule vr ON (c.AD_Val_Rule_ID=vr.AD_Val_Rule_ID)
WHERE f.IsActive = 'Y'
AND c.IsActive = 'Y';
drop view ad_field_vt;
CREATE OR REPLACE VIEW AD_FIELD_VT
(AD_LANGUAGE, AD_WINDOW_ID, AD_TAB_ID, AD_FIELD_ID, AD_TABLE_ID,
AD_COLUMN_ID, NAME, DESCRIPTION, HELP, ISDISPLAYED,
DISPLAYLOGIC, DISPLAYLENGTH, SEQNO, SORTNO, ISSAMELINE,
ISHEADING, ISFIELDONLY, ISREADONLY, ISENCRYPTEDFIELD, OBSCURETYPE,
COLUMNNAME, COLUMNSQL, FIELDLENGTH, VFORMAT, DEFAULTVALUE,
ISKEY, ISPARENT, ISMANDATORY, ISIDENTIFIER, ISTRANSLATED,
AD_REFERENCE_VALUE_ID, CALLOUT, AD_REFERENCE_ID, AD_VAL_RULE_ID, AD_PROCESS_ID,
ISALWAYSUPDATEABLE, READONLYLOGIC, MANDATORYLOGIC, ISUPDATEABLE, ISENCRYPTEDCOLUMN, ISSELECTIONCOLUMN,
TABLENAME, VALUEMIN, VALUEMAX, FIELDGROUP, VALIDATIONCODE)
AS
SELECT trl.AD_Language, t.AD_Window_ID, f.AD_Tab_ID, f.AD_Field_ID, tbl.AD_Table_ID, f.AD_Column_ID,
trl.Name, trl.Description, trl.Help, f.IsDisplayed, f.DisplayLogic, f.DisplayLength,
f.SeqNo, f.SortNo, f.IsSameLine, f.IsHeading, f.IsFieldOnly, f.IsReadOnly,
f.IsEncrypted AS IsEncryptedField, f.ObscureType,
c.ColumnName, c.ColumnSQL, c.FieldLength, c.VFormat, c.DefaultValue, c.IsKey, c.IsParent,
COALESCE(f.IsMandatory, c.IsMandatory) AS IsMandatory,
c.IsIdentifier, c.IsTranslated, c.AD_Reference_Value_ID,
c.Callout, COALESCE(f.AD_Reference_ID, c.AD_Reference_ID) AS AD_Reference_ID,
c.AD_Val_Rule_ID, c.AD_Process_ID, c.IsAlwaysUpdateable,
c.ReadOnlyLogic, c.MandatoryLogic, c.IsUpdateable, c.IsEncrypted AS IsEncryptedColumn, c.IsSelectionColumn,
tbl.TableName, c.ValueMin, c.ValueMax,
fgt.Name AS FieldGroup, vr.Code AS ValidationCode, f.included_tab_id
FROM AD_Field f
INNER JOIN AD_Field_Trl trl ON (f.AD_Field_ID = trl.AD_Field_ID)
INNER JOIN AD_Tab t ON (f.AD_Tab_ID = t.AD_Tab_ID)
LEFT OUTER JOIN AD_FieldGroup_Trl fgt ON
(f.AD_FieldGroup_ID = fgt.AD_FieldGroup_ID AND trl.AD_Language=fgt.AD_Language)
LEFT OUTER JOIN AD_Column c ON (f.AD_Column_ID = c.AD_Column_ID)
INNER JOIN AD_Table tbl ON (c.AD_Table_ID = tbl.AD_Table_ID)
INNER JOIN AD_Reference r ON (c.AD_Reference_ID = r.AD_Reference_ID)
LEFT OUTER JOIN AD_Val_Rule vr ON (c.AD_Val_Rule_ID=vr.AD_Val_Rule_ID)
WHERE f.IsActive = 'Y'
AND c.IsActive = 'Y';
--Add the Grid Collapse and Tabbed item navigation
INSERT INTO AD_ELEMENT
(ad_element_id, ad_client_id, ad_org_id, isactive,
created, createdby,
updated, updatedby,
columnname, entitytype, NAME, printname
)
VALUES (53002, 0, 0, 'Y',
TO_DATE ('07/18/2007 14:23:01', 'MM/DD/YYYY HH24:MI:SS'), 100,
TO_DATE ('07/18/2007 14:23:01', 'MM/DD/YYYY HH24:MI:SS'), 100,
'FieldGroupType', 'D', 'Field Group Type', 'Field Group Type'
);
insert into ad_reference
(ad_reference_id, ad_client_id, ad_org_id, isactive,
created,
updated, createdby,
updatedby,
name, description, help,
validationtype, entitytype)
VALUES (53000, 0, 0, 'Y',
TO_DATE ('07/18/2007 14:22:51', 'MM/DD/YYYY HH24:MI:SS'),
TO_DATE ('07/18/2007 14:22:51', 'MM/DD/YYYY HH24:MI:SS'), 100,
100, 'AD_FieldGroup', 'Field Group Type', '',
'L', 'D');
insert into ad_ref_list
(ad_ref_list_id, ad_client_id, ad_org_id, isactive,
created,
updated, createdby,
updatedby,
value, name,
ad_reference_id, entitytype)
VALUES(53000, 0, 0, 'Y',
TO_DATE ('07/18/2007 14:22:51', 'MM/DD/YYYY HH24:MI:SS'),
TO_DATE ('07/18/2007 14:22:51', 'MM/DD/YYYY HH24:MI:SS'), 100,
100,
'T', 'Tab',
53000, 'D');
insert into ad_ref_list
(ad_ref_list_id, ad_client_id, ad_org_id, isactive,
created,
updated, createdby,
updatedby,
value, name,
ad_reference_id, entitytype)
VALUES(53001, 0, 0, 'Y',
TO_DATE ('07/18/2007 14:22:51', 'MM/DD/YYYY HH24:MI:SS'),
TO_DATE ('07/18/2007 14:22:51', 'MM/DD/YYYY HH24:MI:SS'), 100,
100,
'L', 'Label',
53000, 'D');
insert into ad_ref_list
(ad_ref_list_id, ad_client_id, ad_org_id, isactive,
created,
updated, createdby,
updatedby,
value, name,
ad_reference_id, entitytype)
VALUES(53002, 0, 0, 'Y',
TO_DATE ('07/18/2007 14:22:51', 'MM/DD/YYYY HH24:MI:SS'),
TO_DATE ('07/18/2007 14:22:51', 'MM/DD/YYYY HH24:MI:SS'), 100,
100,
'C', 'Collapse',
53000, 'D');
INSERT INTO AD_COLUMN
(ad_column_id, ad_client_id, ad_org_id, isactive,
created,
updated, createdby,
updatedby, NAME, description,
HELP,
VERSION, entitytype, columnname, ad_table_id, ad_reference_id,
fieldlength, iskey, isparent, ismandatory, isupdateable,
isidentifier, seqno, istranslated, isencrypted,
isselectioncolumn, ad_element_id, issyncdatabase,
isalwaysupdateable, ad_reference_value_id
)
VALUES (53002, 0, 0, 'Y',
TO_DATE ('07/18/2007 14:22:51', 'MM/DD/YYYY HH24:MI:SS'),
TO_DATE ('07/18/2007 14:22:51', 'MM/DD/YYYY HH24:MI:SS'), 100,
100, 'Field Group Type', 'Field Group',
'Field Group.',
0, 'D', 'FieldGroupType', 414, 17,
10, 'N', 'N', 'N', 'Y',
'N', null, 'N', 'N',
'N', 53002, 'Y',
'N', 53000
);
ALTER TABLE ad_fieldgroup ADD fieldgrouptype char(1);
INSERT INTO AD_FIELD
(ad_field_id, ad_client_id, ad_org_id, isactive,
created, createdby,
updated, updatedby,
NAME, description,
HELP,
iscentrallymaintained, ad_tab_id, ad_column_id, isdisplayed,
displaylength, isreadonly, seqno, sortno, issameline, isheading,
isfieldonly, isencrypted, entitytype
)
VALUES (53002, 0, 0, 'Y',
TO_DATE ('07/18/2007 14:23:09', 'MM/DD/YYYY HH24:MI:SS'), 100,
TO_DATE ('07/18/2007 14:23:17', 'MM/DD/YYYY HH24:MI:SS'), 100,
'Field Group Type', 'Field Group Type',
'The Field Group type',
'Y', 342, 53002, 'Y',
10, 'N', 60, 0, 'N', 'N',
'N', 'N', 'D'
);
COMMIT;
-- NOTE: Don't forget to run the three processes:
-- 1 - Add missing translations in the language screen
-- 2 - Synchronize terminology
-- 3 - Check sequences

View File

@ -318,6 +318,9 @@
<zipfileset src="lib/itext-1.4.8.jar" >
<patternset refid="manifest.exclude"/>
</zipfileset>
<zipfileset src="lib/swinglabs-0.8.0.jar" >
<patternset refid="manifest.exclude"/>
</zipfileset>
<!-- C3P0 connection pool -->
<zipfileset src="lib/c3p0-0.9.1.2.jar" >
<patternset refid="manifest.exclude"/>