use of org.adempiere.webui.window.WRecordAccessDialog in project adempiere by adempiere.
the class AbstractADWindowPanel method onLock.
/**
* @see ToolbarListener#onLock()
*/
public void onLock() {
if (!toolbar.isPersonalLock)
return;
final int record_ID = curTab.getRecord_ID();
if (// No Key
record_ID == -1)
return;
if (m_popup == null) {
m_popup = new Menupopup();
m_lock = new Menuitem(Msg.translate(Env.getCtx(), "Lock"));
m_popup.appendChild(m_lock);
m_lock.addEventListener(Events.ON_CLICK, new EventListener() {
public void onEvent(Event event) throws Exception {
curTab.lock(Env.getCtx(), curTab.getRecord_ID(), !toolbar.getButton("Lock").isPressed());
// reload
curTab.loadAttachments();
toolbar.lock(curTab.isLocked());
}
});
m_access = new Menuitem(Msg.translate(Env.getCtx(), "RecordAccessDialog"));
m_popup.appendChild(m_access);
m_access.addEventListener(Events.ON_CLICK, new EventListener() {
public void onEvent(Event event) throws Exception {
new WRecordAccessDialog(null, curTab.getAD_Table_ID(), curTab.getRecord_ID());
toolbar.lock(curTab.isLocked());
}
});
m_popup.setPage(toolbar.getButton("Lock").getPage());
}
m_popup.open(toolbar.getButton("Lock"));
}
Aggregations