* merge revision 61272-6275 from branches/adempiere341
This commit is contained in:
parent
6ba1731fae
commit
1c1b967813
|
@ -193,10 +193,6 @@ public class AdempiereWebUI extends Window implements EventListener, IWebClient
|
|||
return appDesktop;
|
||||
}
|
||||
|
||||
public boolean isAsap() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void onEvent(Event event) {
|
||||
if (event instanceof ClientInfoEvent) {
|
||||
ClientInfoEvent c = (ClientInfoEvent)event;
|
||||
|
|
|
@ -123,14 +123,14 @@ public class ProcessDialog extends Window implements EventListener//, ASyncProce
|
|||
String label = Msg.getMsg(Env.getCtx(), "Ok");
|
||||
bOK = new Button(label.replaceAll("&", ""));
|
||||
bOK.setImage("/images/Ok16.png");
|
||||
bOK.setName("ok");
|
||||
bOK.setId("Ok");
|
||||
bOK.addEventListener(Events.ON_CLICK, this);
|
||||
hbox.appendChild(bOK);
|
||||
|
||||
label = Msg.getMsg(Env.getCtx(), "Cancel");
|
||||
Button btn = new Button(label.replaceAll("&", ""));
|
||||
btn.setImage("/images/Cancel16.png");
|
||||
btn.setName("cancel");
|
||||
btn.setId("Cancel");
|
||||
btn.addEventListener(Events.ON_CLICK, this);
|
||||
|
||||
hbox.appendChild(btn);
|
||||
|
@ -298,20 +298,16 @@ public class ProcessDialog extends Window implements EventListener//, ASyncProce
|
|||
new Thread(runnable).start();
|
||||
}
|
||||
|
||||
public boolean isAsap() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void onEvent(Event event) {
|
||||
Component component = event.getTarget();
|
||||
if (component instanceof Button) {
|
||||
Button element = (Button)component;
|
||||
if ("ok".equalsIgnoreCase(element.getName())) {
|
||||
if ("Ok".equalsIgnoreCase(element.getId())) {
|
||||
if (element.getLabel().length() > 0)
|
||||
this.startProcess();
|
||||
else
|
||||
this.dispose();
|
||||
} else if ("cancel".equalsIgnoreCase(element.getName())) {
|
||||
} else if ("Cancel".equalsIgnoreCase(element.getId())) {
|
||||
this.dispose();
|
||||
}
|
||||
}
|
||||
|
@ -380,7 +376,9 @@ public class ProcessDialog extends Window implements EventListener//, ASyncProce
|
|||
.append("</font></p>");
|
||||
m_messageText.append(pi.getLogInfo(true));
|
||||
message.setContent(m_messageText.toString());
|
||||
//message.setCaretPosition(message.getDocument().getLength()); // scroll down
|
||||
|
||||
bOK.setLabel("");
|
||||
|
||||
m_ids = pi.getIDs();
|
||||
|
||||
//no longer needed, hide to give more space to display log
|
||||
|
|
|
@ -34,12 +34,14 @@ import org.compiere.util.CLogger;
|
|||
import org.compiere.util.DB;
|
||||
import org.compiere.util.Env;
|
||||
import org.compiere.util.Msg;
|
||||
import org.zkoss.zk.au.out.AuEcho;
|
||||
import org.zkoss.zk.ui.Component;
|
||||
import org.zkoss.zk.ui.DesktopUnavailableException;
|
||||
import org.zkoss.zk.ui.Executions;
|
||||
import org.zkoss.zk.ui.event.Event;
|
||||
import org.zkoss.zk.ui.event.EventListener;
|
||||
import org.zkoss.zk.ui.event.Events;
|
||||
import org.zkoss.zk.ui.util.Clients;
|
||||
import org.zkoss.zul.Div;
|
||||
import org.zkoss.zul.Hbox;
|
||||
import org.zkoss.zul.Html;
|
||||
|
@ -98,6 +100,7 @@ public class ProcessModalDialog extends Window implements EventListener
|
|||
} // ProcessDialog
|
||||
|
||||
private void initComponents() {
|
||||
this.setBorder("normal");
|
||||
VerticalBox vbox = new VerticalBox();
|
||||
Div div = new Div();
|
||||
message = new Html();
|
||||
|
@ -109,18 +112,21 @@ public class ProcessModalDialog extends Window implements EventListener
|
|||
div.setAlign("right");
|
||||
Hbox hbox = new Hbox();
|
||||
Button btn = new Button("Ok");
|
||||
btn.setName("ok");
|
||||
btn.setSclass("action-text-button");
|
||||
btn.setId("Ok");
|
||||
btn.addEventListener(Events.ON_CLICK, this);
|
||||
hbox.appendChild(btn);
|
||||
|
||||
btn = new Button("Cancel");
|
||||
btn.setName("cancel");
|
||||
btn.setId("Cancel");
|
||||
btn.setSclass("action-text-button");
|
||||
btn.addEventListener(Events.ON_CLICK, this);
|
||||
|
||||
hbox.appendChild(btn);
|
||||
div.appendChild(hbox);
|
||||
vbox.appendChild(div);
|
||||
this.appendChild(vbox);
|
||||
|
||||
}
|
||||
|
||||
private ASyncProcess m_ASyncProcess;
|
||||
|
@ -143,6 +149,7 @@ public class ProcessModalDialog extends Window implements EventListener
|
|||
private ProcessParameterPanel parameterPanel = null;
|
||||
|
||||
private ProcessInfo m_pi = null;
|
||||
private ProcessRunnable m_processRunnable;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -159,12 +166,16 @@ public class ProcessModalDialog extends Window implements EventListener
|
|||
* Dispose
|
||||
*/
|
||||
public void dispose()
|
||||
{
|
||||
{
|
||||
parameterPanel.restoreContext();
|
||||
m_valid = false;
|
||||
this.detach();
|
||||
} // dispose
|
||||
|
||||
/**
|
||||
* is dialog still valid
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean isValid()
|
||||
{
|
||||
return m_valid;
|
||||
|
@ -242,27 +253,38 @@ public class ProcessModalDialog extends Window implements EventListener
|
|||
}
|
||||
if (m_autoStart) {
|
||||
startProcess();
|
||||
dispose();
|
||||
}
|
||||
}
|
||||
|
||||
// Check if the process is a silent one
|
||||
if(isValid() && m_ShowHelp != null && m_ShowHelp.equals("S"))
|
||||
{
|
||||
startProcess();
|
||||
dispose();
|
||||
startProcess();
|
||||
}
|
||||
return true;
|
||||
} // init
|
||||
|
||||
public void startProcess()
|
||||
{
|
||||
/**
|
||||
* launch process
|
||||
*/
|
||||
private void startProcess()
|
||||
{
|
||||
m_processRunnable = new ProcessRunnable(Executions.getCurrent().getDesktop());
|
||||
m_pi.setPrintPreview(true);
|
||||
|
||||
if (m_ASyncProcess != null) {
|
||||
m_ASyncProcess.lockUI(m_pi);
|
||||
}
|
||||
|
||||
new Thread(new ProcessRunnable(Executions.getCurrent().getDesktop())).start();
|
||||
//use echo, otherwise lock ui wouldn't work
|
||||
Clients.response(new AuEcho(this, "runProcessBackground", null));
|
||||
}
|
||||
|
||||
/**
|
||||
* internal use, don't call this directly
|
||||
*/
|
||||
public void runProcessBackground() {
|
||||
new Thread(m_processRunnable).start();
|
||||
}
|
||||
|
||||
private class ProcessRunnable implements Runnable {
|
||||
|
@ -282,7 +304,7 @@ public class ProcessModalDialog extends Window implements EventListener
|
|||
m_ASyncProcess.unlockUI(m_pi);
|
||||
}
|
||||
//release full control of desktop
|
||||
Executions.deactivate(desktop);
|
||||
Executions.deactivate(desktop);
|
||||
}
|
||||
} catch (DesktopUnavailableException e) {
|
||||
log.log(Level.SEVERE, e.getLocalizedMessage(), e);
|
||||
|
@ -292,22 +314,19 @@ public class ProcessModalDialog extends Window implements EventListener
|
|||
}
|
||||
}
|
||||
|
||||
public boolean isAsap() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* handle events
|
||||
*/
|
||||
public void onEvent(Event event) {
|
||||
Component component = event.getTarget();
|
||||
if (component instanceof Button) {
|
||||
Button element = (Button)component;
|
||||
if ("ok".equalsIgnoreCase(element.getName())) {
|
||||
if ("Ok".equalsIgnoreCase(element.getId())) {
|
||||
this.startProcess();
|
||||
this.dispose();
|
||||
} else if ("cancel".equalsIgnoreCase(element.getName())) {
|
||||
} else if ("Cancel".equalsIgnoreCase(element.getId())) {
|
||||
this.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
} // ProcessDialog
|
||||
|
|
|
@ -235,6 +235,7 @@ implements ValueChangeListener, IProcessParameter
|
|||
// The Editor
|
||||
WEditor wEditor = WebEditorFactory.getEditor(mField, false);
|
||||
wEditor.addValueChangeListener(this);
|
||||
wEditor.dynamicDisplay();
|
||||
// MField => VEditor - New Field value to be updated to editor
|
||||
mField.addPropertyChangeListener(wEditor);
|
||||
// Set Default
|
||||
|
@ -257,6 +258,7 @@ implements ValueChangeListener, IProcessParameter
|
|||
WEditor wEditor2 = WebEditorFactory.getEditor(mField2, false);
|
||||
// New Field value to be updated to editor
|
||||
mField2.addPropertyChangeListener(wEditor2);
|
||||
wEditor2.dynamicDisplay();
|
||||
// Set Default
|
||||
Object defaultObject2 = mField2.getDefault();
|
||||
mField2.setValue (defaultObject2, true);
|
||||
|
|
|
@ -233,10 +233,6 @@ public class WReport implements EventListener {
|
|||
return MTable.getTable_ID(tableName);
|
||||
} // getAD_Table_ID
|
||||
|
||||
public boolean isAsap() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void onEvent(Event event) {
|
||||
if(event.getTarget() instanceof Menuitem)
|
||||
{
|
||||
|
|
|
@ -483,11 +483,6 @@ public class CWindowToolbar extends FToolbar implements EventListener
|
|||
btnGridToggle.setDisabled(!enabled);
|
||||
}
|
||||
|
||||
public boolean isAsap()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public Event getEvent()
|
||||
{
|
||||
return event;
|
||||
|
|
|
@ -407,11 +407,9 @@ public abstract class WEditor implements EventListener, PropertyChangeListener
|
|||
return this.mandatory;
|
||||
}
|
||||
|
||||
public boolean isAsap()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* allow subclass to perform dynamic loading of data
|
||||
*/
|
||||
public void dynamicDisplay()
|
||||
{
|
||||
}
|
||||
|
|
|
@ -128,11 +128,6 @@ public class WEditorPopupMenu extends Menupopup implements EventListener
|
|||
menuListeners.add(listener);
|
||||
}
|
||||
|
||||
public boolean isAsap()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public void onEvent(Event event)
|
||||
{
|
||||
String evt = (String)event.getTarget().getAttribute(EVENT_ATTRIBUTE);
|
||||
|
|
|
@ -232,15 +232,6 @@ public abstract class ADForm extends Window implements EventListener
|
|||
}
|
||||
} // openForm
|
||||
|
||||
/**
|
||||
*
|
||||
* @return false
|
||||
*/
|
||||
public boolean isAsap()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
|
|
@ -634,11 +634,6 @@ DataStatusListener, ValueChangeListener, IADTabpanel
|
|||
}*/
|
||||
}
|
||||
|
||||
public boolean isAsap()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public void onEvent(Event event)
|
||||
{
|
||||
if (event.getTarget() instanceof Toolbarbutton)
|
||||
|
|
|
@ -469,11 +469,6 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
|
|||
return false;
|
||||
}
|
||||
|
||||
public boolean isAsap()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// private void find()
|
||||
// {
|
||||
// MQuery mquery = new MQuery(curTab.getAD_Table_ID());
|
||||
|
@ -1380,31 +1375,35 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
|
|||
&& pi.isReportingProcess() == false;
|
||||
//
|
||||
// Process Result
|
||||
if (notPrint) // refresh if not print
|
||||
{
|
||||
if (Executions.getCurrent() != null)
|
||||
|
||||
if (Executions.getCurrent() != null)
|
||||
{
|
||||
if (notPrint) // refresh if not print
|
||||
{
|
||||
updateUI(pi);
|
||||
Clients.showBusy(null, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
try {
|
||||
//get full control of desktop
|
||||
Executions.activate(getComponent().getDesktop());
|
||||
try {
|
||||
updateUI(pi);
|
||||
Clients.showBusy(null, false);
|
||||
} catch(Error ex){
|
||||
throw ex;
|
||||
} finally{
|
||||
//release full control of desktop
|
||||
Executions.deactivate(getComponent().getDesktop());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.log(Level.WARNING, "Failed to update UI upon unloc.", e);
|
||||
}
|
||||
}
|
||||
Clients.showBusy(null, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
try {
|
||||
//get full control of desktop
|
||||
Executions.activate(getComponent().getDesktop());
|
||||
try {
|
||||
if (notPrint) // refresh if not print
|
||||
{
|
||||
updateUI(pi);
|
||||
}
|
||||
Clients.showBusy(null, false);
|
||||
} catch(Error ex){
|
||||
throw ex;
|
||||
} finally{
|
||||
//release full control of desktop
|
||||
Executions.deactivate(getComponent().getDesktop());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.log(Level.WARNING, "Failed to update UI upon unloc.", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -497,11 +497,6 @@ public class InfoBPartnerPanel extends InfoPanel implements EventListener, WTabl
|
|||
|
||||
} // saveSelectionDetail
|
||||
|
||||
public boolean isAsap()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public void tableChanged(WTableModelEvent event)
|
||||
{
|
||||
|
||||
|
|
|
@ -216,9 +216,4 @@ public class LoginPanel extends Window implements EventListener
|
|||
wndLogin.loginOk(userId, userPassword);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isAsap()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,11 +52,6 @@ public class LogoutPanel extends Panel implements EventListener
|
|||
this.appendChild(btnLogOut);
|
||||
}
|
||||
|
||||
public boolean isAsap()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public void onEvent(Event event)
|
||||
{
|
||||
if (btnLogOut == event.getTarget())
|
||||
|
|
|
@ -229,11 +229,6 @@ public class MenuPanel extends Panel implements EventListener
|
|||
}
|
||||
}
|
||||
|
||||
public boolean isAsap()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public Tree getMenuTree()
|
||||
{
|
||||
return menuTree;
|
||||
|
|
|
@ -98,12 +98,6 @@ public class MenuSearchPanel extends Panel implements EventListener
|
|||
cmbSearch.setDict(treeValues);
|
||||
}
|
||||
|
||||
public boolean isAsap()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public void onEvent(Event event)
|
||||
{
|
||||
if (cmbSearch.equals(event.getTarget()) && (event.getName() != Events.ON_CHANGING))
|
||||
|
|
|
@ -334,9 +334,4 @@ public class RolePanel extends Window implements EventListener
|
|||
}
|
||||
wndLogin.loginCompleted();
|
||||
}
|
||||
|
||||
public boolean isAsap()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -336,11 +336,6 @@ public class WDocActionPanel extends Window implements EventListener
|
|||
return index;
|
||||
} // getSelectedIndex
|
||||
|
||||
public boolean isAsap()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public int getNumberOfOptions() {
|
||||
return lstDocAction != null ? lstDocAction.getItemCount() : 0;
|
||||
}
|
||||
|
|
|
@ -631,6 +631,7 @@ public class FindWindow extends Window implements EventListener,ValueChangeListe
|
|||
editor = WebEditorFactory.getEditor(mField, false);
|
||||
editor.setMandatory(false);
|
||||
editor.setReadWrite(true);
|
||||
editor.dynamicDisplay();
|
||||
Label label = editor.getLabel();
|
||||
Component fieldLabel = editor.getComponent();
|
||||
|
||||
|
@ -1182,6 +1183,7 @@ public class FindWindow extends Window implements EventListener,ValueChangeListe
|
|||
m_editor.setValue(null);
|
||||
m_editor.setReadWrite(enabled);
|
||||
m_editor.setVisible(enabled);
|
||||
m_editor.dynamicDisplay();
|
||||
//
|
||||
return m_editor.getComponent();
|
||||
|
||||
|
|
|
@ -477,6 +477,7 @@ public final class WAccountDialog extends Window
|
|||
m_row.appendChild(div);
|
||||
|
||||
m_row.appendChild(editor.getComponent());
|
||||
editor.dynamicDisplay();
|
||||
//
|
||||
m_newRow = !m_newRow;
|
||||
} // addLine
|
||||
|
|
Loading…
Reference in New Issue