merge revision 6475 changes from branches/adempiere341

This commit is contained in:
Heng Sin Low 2008-09-18 07:49:37 +00:00
parent a695a6f06b
commit 4d78721aa0
5 changed files with 188 additions and 52 deletions

View File

@ -151,19 +151,19 @@ public abstract class WCreateFrom extends Window
private static CLogger s_log = CLogger.getCLogger (WCreateFrom.class);
//
private Borderlayout contentPane = new Borderlayout();
private Panel parameterPanel = new Panel();
protected Borderlayout contentPane = new Borderlayout();
protected Panel parameterPanel = new Panel();
protected Panel parameterBankPanel = new Panel();
private Borderlayout parameterLayout = new Borderlayout();
private Label bankAccountLabel = new Label();
protected Borderlayout parameterLayout = new Borderlayout();
protected Label bankAccountLabel = new Label();
protected Panel parameterStdPanel = new Panel();
private Label bPartnerLabel = new Label();
protected Label bPartnerLabel = new Label();
protected Listbox bankAccountField;
//RF [1811114]
private Label authorizationLabel = new Label();
protected Label authorizationLabel = new Label();
protected WStringEditor authorizationField = new WStringEditor();
private Grid parameterStdLayout = GridFactory.newGridLayout();
private Grid parameterBankLayout = GridFactory.newGridLayout();
protected Grid parameterStdLayout = GridFactory.newGridLayout();
protected Grid parameterBankLayout = GridFactory.newGridLayout();
// Bug [1759431]
protected Checkbox sameWarehouseCb = new Checkbox();
protected WEditor bPartnerField;
@ -174,10 +174,10 @@ public abstract class WCreateFrom extends Window
protected Label shipmentLabel = new Label();
protected Listbox shipmentField = ListboxFactory.newDropdownListbox();
// private JScrollPane dataPane = new JScrollPane();
private Panel southPanel = new Panel();
protected Panel southPanel = new Panel();
// private Borderlayout southLayout = new Borderlayout();
private ConfirmPanel confirmPanel = new ConfirmPanel(true);
private StatusBarPanel statusBar = new StatusBarPanel();
protected ConfirmPanel confirmPanel = new ConfirmPanel(true);
protected StatusBarPanel statusBar = new StatusBarPanel();
protected WListbox dataTable = ListboxFactory.newDataTable();
protected Label locatorLabel = new Label();
protected WLocatorEditor locatorField = new WLocatorEditor();
@ -202,7 +202,7 @@ public abstract class WCreateFrom extends Window
* </pre>
* @throws Exception
*/
private void zkInit() throws Exception
protected void zkInit() throws Exception
{
parameterPanel.appendChild(parameterLayout);
parameterStdPanel.appendChild(parameterStdLayout);

View File

@ -62,7 +62,7 @@ public class CWindowToolbar extends FToolbar implements EventListener
private ToolBarButton btnGridToggle;
private ToolBarButton btnHistoryRecords, btnMenu, btnParentRecord, btnDetailRecord;
private ToolBarButton btnHistoryRecords, btnParentRecord, btnDetailRecord;
private ToolBarButton btnFirst, btnPrevious, btnNext, btnLast;
@ -102,7 +102,6 @@ public class CWindowToolbar extends FToolbar implements EventListener
btnGridToggle = createButton("Toggle", "Multi24.png", "Multi");
addSeparator();
btnHistoryRecords = createButton("HistoryRecords", "HistoryX24.png", "History");
btnMenu = createButton("Home", "Home24.png", "Home");
btnParentRecord = createButton("ParentRecord", "Parent24.png", "Parent");
btnDetailRecord = createButton("DetailRecord", "Detail24.png", "Detail");
addSeparator();

View File

@ -169,7 +169,9 @@ public final class ConfirmPanel extends Hbox
setVisible(A_CANCEL, withCancelButton);
addComponentsRight(createButton(A_OK));
addComponentsRight(createButton(A_CANCEL));
if (withCancelButton)
addComponentsRight(createButton(A_CANCEL));
if (withRefreshButton)
{
@ -208,7 +210,7 @@ public final class ConfirmPanel extends Hbox
*/
public ConfirmPanel(boolean withCancel)
{
this(true,false,false,false,false,false);
this(withCancel,false,false,false,false,false);
}
//
private Hbox hboxBtnLeft;

View File

@ -25,27 +25,123 @@ package org.adempiere.webui.event;
*/
public interface ToolbarListener
{
/**
* Ignore user changes
*/
public void onIgnore();
/**
* Create new record
*/
public void onNew();
/**
* Edit current record
*/
public void onEdit();
/**
* Navigate to first record
*/
public void onFirst();
/**
* Navigate to last record
*/
public void onLast();
/**
* Navigate to next record
*/
public void onNext();
/**
* Navigate to previous record
*/
public void onPrevious();
/**
* Navigate to parent record, i.e previous tab
*/
public void onParentRecord();
/**
* Navigate to detail record, i.e next tab
*/
public void onDetailRecord();
/**
* Refresh current record
*/
public void onRefresh();
/**
* Print document
*/
public void onPrint();
/**
* View available report for current tab
*/
public void onReport();
/**
* Toggle record presentation between free form and tabular
*/
public void onToggle();
/**
* Open the help window
*/
public void onHelp();
/**
* Delete current record
*/
public void onDelete();
/**
* Save current record
*/
public void onSave();
/**
* Open the find/search dialog
*/
public void onFind();
/**
* Open the attachment dialog
*/
public void onAttachment();
/**
* Open the history dialog
*/
public void onHistoryRecords();
/**
* Open the archive dialog
*/
public void onArchive();
/**
* Zoom to window where current record is use
*/
public void onZoomAcross();
/**
* Show active workflow for current record
*/
public void onActiveWorkflows();
/**
* Open the request menu where user can view available request or create a new request
*/
public void onRequests();
/**
* View product info
*/
public void onProductInfo();
}

View File

@ -112,10 +112,6 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
private boolean boolChanges = false;
private boolean viewed = false;
private boolean changesOccured = false;
private int m_onlyCurrentDays = 0;
private Component parent;
@ -333,6 +329,9 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
return title;
}
/**
* @see ToolbarListener#onDetailRecord()
*/
public void onDetailRecord()
{
int maxInd = adTab.getTabCount() - 1;
@ -343,6 +342,9 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
}
}
/**
* @see ToolbarListener#onParentRecord()
*/
public void onParentRecord()
{
int curInd = adTab.getSelectedIndex();
@ -352,26 +354,41 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
}
}
/**
* @see ToolbarListener#onFirst()
*/
public void onFirst()
{
curTab.navigate(0);
}
/**
* @see ToolbarListener#onLast()
*/
public void onLast()
{
curTab.navigate(curTab.getRowCount() - 1);
}
/**
* @see ToolbarListener#onNext()
*/
public void onNext()
{
curTab.navigateRelative(+1);
}
/**
* @see ToolbarListener#onPrevious()
*/
public void onPrevious()
{
curTab.navigateRelative(-1);
}
/**
* @see ToolbarListener#onHistoryRecords()
*/
public void onHistoryRecords()
{
logger.info("");
@ -410,6 +427,9 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
}
/**
* @see ToolbarListener#onAttachment()
*/
public void onAttachment()
{
int record_ID = curTab.getRecord_ID();
@ -429,30 +449,12 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
//aAttachment.setPressed(m_curTab.hasAttachment());
}
public void onGridToggle()
/**
* @see ToolbarListener#onToggle()
*/
public void onToggle()
{
curTabpanel.switchRowPresentation();
/*
if (!viewed)
{
viewed = true;
}
if (changesOccured)
{
changesOccured = false;
}
if (tabbox.isVisible())
{
tabbox.setVisible(false);
}
else
{
tabbox.setVisible(true);
}
*/
curTabpanel.switchRowPresentation();
}
public boolean onExit()
@ -469,12 +471,6 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
return false;
}
// private void find()
// {
// MQuery mquery = new MQuery(curTab.getAD_Table_ID());
//
// }
public void onEvent(Event event)
{
if (!Events.ON_SELECT.equals(event.getName()))
@ -789,18 +785,27 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
return (selTabIndex == 0);
}
/**
* @see ToolbarListener#onRefresh()
*/
public void onRefresh()
{
curTab.dataRefreshAll();
curTabpanel.dynamicDisplay(0);
}
/**
* @see ToolbarListener#onHelp()
*/
public void onHelp()
{
WebDoc doc = gridWindow.getHelpDoc(true);
SessionManager.getAppDesktop().showURL(doc, "Help", true);
}
/**
* @see ToolbarListener#onNew()
*/
public void onNew()
{
if (!curTab.isInsertRecord())
@ -830,6 +835,9 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
}
/**
* @see ToolbarListener#onFind()
*/
public void onFind()
{
if (curTab == null)
@ -856,6 +864,9 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
curTab.dataRefresh(); // Elaine 2008/07/25
}
/**
* @see ToolbarListener#onIgnore()
*/
public void onIgnore()
{
if (curTab.isSortTab())
@ -873,6 +884,9 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
}
}
/**
* @see ToolbarListener#onEdit()
*/
public void onEdit()
{
curTabpanel.editRecord(true);
@ -885,10 +899,11 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
toolbar.enableReport(true);
}
/**
* @see ToolbarListener#onSave()
*/
public void onSave()
{
changesOccured = true;
if (curTab.isSortTab())
{
((ADSortTab)curTabpanel).saveData();
@ -908,6 +923,9 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
}
}
/**
* @see ToolbarListener#onDelete()
*/
public void onDelete()
{
if (curTab.isReadOnly())
@ -925,6 +943,9 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
curTabpanel.dynamicDisplay(0);
}
/**
* @see ToolbarListener#onPrint()
*/
public void onPrint() {
//Get process defined for this tab
int AD_Process_ID = curTab.getAD_Process_ID();
@ -960,6 +981,9 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
}
}
/**
* @see ToolbarListener#onReport()
*/
public void onReport() {
if (!MRole.getDefault().isCanReport(curTab.getAD_Table_ID()))
{
@ -1006,6 +1030,9 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
}
/**
* @see ToolbarListener#onZoomAcross()
*/
public void onZoomAcross() {
if (toolbar.getEvent() != null)
{
@ -1034,6 +1061,9 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
}
// Elaine 2008/07/17
/**
* @see ToolbarListener#onActiveWorkflows()
*/
public void onActiveWorkflows() {
if (toolbar.getEvent() != null)
{
@ -1046,6 +1076,9 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
//
// Elaine 2008/07/22
/**
* @see ToolbarListener#onRequests()
*/
public void onRequests()
{
if (toolbar.getEvent() != null)
@ -1064,6 +1097,9 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
//
// Elaine 2008/07/22
/**
* @see ToolbarListener#onProductInfo()
*/
public void onProductInfo()
{
InfoPanel.showProduct(0);
@ -1071,6 +1107,9 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
//
// Elaine 2008/07/28
/**
* @see ToolbarListener#onArchive()
*/
public void onArchive()
{
if (toolbar.getEvent() != null)
@ -1081,6 +1120,7 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
new WArchive(toolbar.getEvent().getTarget(), curTab.getAD_Table_ID(), curTab.getRecord_ID());
}
}
//
/**************************************************************************
@ -1092,7 +1132,6 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
logger.info(wButton.toString());
boolean startWOasking = false;
boolean batch = false;
String col = wButton.getColumnName();
// Zoom