Request toolbar button calls up search form
- refactoring and cleanup Link to SF Tracker: http://sourceforge.net/support/tracker.php?aid=2990258
This commit is contained in:
parent
eb462af86c
commit
52c87a037e
|
@ -26,7 +26,6 @@ import java.sql.PreparedStatement;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
import org.adempiere.webui.apps.ProcessDialog;
|
|
||||||
import org.adempiere.webui.apps.graph.WGraph;
|
import org.adempiere.webui.apps.graph.WGraph;
|
||||||
import org.adempiere.webui.apps.graph.WPerformanceDetail;
|
import org.adempiere.webui.apps.graph.WPerformanceDetail;
|
||||||
import org.adempiere.webui.component.Tabpanel;
|
import org.adempiere.webui.component.Tabpanel;
|
||||||
|
@ -35,17 +34,14 @@ import org.adempiere.webui.dashboard.DPActivities;
|
||||||
import org.adempiere.webui.dashboard.DashboardPanel;
|
import org.adempiere.webui.dashboard.DashboardPanel;
|
||||||
import org.adempiere.webui.dashboard.DashboardRunnable;
|
import org.adempiere.webui.dashboard.DashboardRunnable;
|
||||||
import org.adempiere.webui.event.MenuListener;
|
import org.adempiere.webui.event.MenuListener;
|
||||||
import org.adempiere.webui.panel.ADForm;
|
|
||||||
import org.adempiere.webui.panel.HeaderPanel;
|
import org.adempiere.webui.panel.HeaderPanel;
|
||||||
import org.adempiere.webui.panel.SidePanel;
|
import org.adempiere.webui.panel.SidePanel;
|
||||||
import org.adempiere.webui.session.SessionManager;
|
import org.adempiere.webui.session.SessionManager;
|
||||||
import org.adempiere.webui.util.IServerPushCallback;
|
import org.adempiere.webui.util.IServerPushCallback;
|
||||||
import org.adempiere.webui.util.ServerPushTemplate;
|
import org.adempiere.webui.util.ServerPushTemplate;
|
||||||
import org.adempiere.webui.util.UserPreference;
|
import org.adempiere.webui.util.UserPreference;
|
||||||
import org.adempiere.webui.window.ADWindow;
|
|
||||||
import org.compiere.model.MGoal;
|
import org.compiere.model.MGoal;
|
||||||
import org.compiere.model.MMenu;
|
import org.compiere.model.MMenu;
|
||||||
import org.compiere.model.MQuery;
|
|
||||||
import org.compiere.model.X_AD_Menu;
|
import org.compiere.model.X_AD_Menu;
|
||||||
import org.compiere.model.X_PA_DashboardContent;
|
import org.compiere.model.X_PA_DashboardContent;
|
||||||
import org.compiere.util.CLogger;
|
import org.compiere.util.CLogger;
|
||||||
|
@ -83,9 +79,9 @@ import org.zkoss.zul.Toolbarbutton;
|
||||||
public class DefaultDesktop extends TabbedDesktop implements MenuListener, Serializable, EventListener, IServerPushCallback
|
public class DefaultDesktop extends TabbedDesktop implements MenuListener, Serializable, EventListener, IServerPushCallback
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
*
|
* generated serial version ID
|
||||||
*/
|
*/
|
||||||
private static final long serialVersionUID = 2899600212295462854L;
|
private static final long serialVersionUID = -8203958978173990301L;
|
||||||
|
|
||||||
private static final CLogger logger = CLogger.getCLogger(DefaultDesktop.class);
|
private static final CLogger logger = CLogger.getCLogger(DefaultDesktop.class);
|
||||||
|
|
||||||
|
@ -452,44 +448,8 @@ public class DefaultDesktop extends TabbedDesktop implements MenuListener, Seria
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ADWindow openWindow(int windowId) {
|
protected void preOpenNewTab()
|
||||||
|
{
|
||||||
autoHideMenu();
|
autoHideMenu();
|
||||||
return super.openWindow(windowId);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ADWindow openWindow(int windowId, MQuery query) {
|
|
||||||
autoHideMenu();
|
|
||||||
return super.openWindow(windowId, query);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ADForm openForm(int formId) {
|
|
||||||
autoHideMenu();
|
|
||||||
return super.openForm(formId);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ProcessDialog openProcessDialog(int processId, boolean soTrx) {
|
|
||||||
autoHideMenu();
|
|
||||||
return super.openProcessDialog(processId, soTrx);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void openTask(int taskId) {
|
|
||||||
autoHideMenu();
|
|
||||||
super.openTask(taskId);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void openWorkflow(int workflowID) {
|
|
||||||
autoHideMenu();
|
|
||||||
super.openWorkflow(workflowID);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void showWindow(int AD_Window_ID, MQuery query) {
|
|
||||||
autoHideMenu();
|
|
||||||
super.showWindow(AD_Window_ID, query);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -113,6 +113,7 @@ public interface IDesktop extends UIPart {
|
||||||
*
|
*
|
||||||
* @param window_ID
|
* @param window_ID
|
||||||
* @param query
|
* @param query
|
||||||
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
public void showWindow(int window_ID, MQuery query);
|
public void showWindow(int window_ID, MQuery query);
|
||||||
|
|
||||||
|
|
|
@ -63,6 +63,7 @@ public abstract class TabbedDesktop extends AbstractDesktop {
|
||||||
pd.setParent(tabPanel);
|
pd.setParent(tabPanel);
|
||||||
String title = pd.getTitle();
|
String title = pd.getTitle();
|
||||||
pd.setTitle(null);
|
pd.setTitle(null);
|
||||||
|
preOpenNewTab();
|
||||||
windowContainer.addWindow(tabPanel, title, true);
|
windowContainer.addWindow(tabPanel, title, true);
|
||||||
}
|
}
|
||||||
return pd;
|
return pd;
|
||||||
|
@ -80,6 +81,7 @@ public abstract class TabbedDesktop extends AbstractDesktop {
|
||||||
form.setParent(tabPanel);
|
form.setParent(tabPanel);
|
||||||
//do not show window title when open as tab
|
//do not show window title when open as tab
|
||||||
form.setTitle(null);
|
form.setTitle(null);
|
||||||
|
preOpenNewTab();
|
||||||
windowContainer.addWindow(tabPanel, form.getFormName(), true);
|
windowContainer.addWindow(tabPanel, form.getFormName(), true);
|
||||||
|
|
||||||
return form;
|
return form;
|
||||||
|
@ -95,6 +97,7 @@ public abstract class TabbedDesktop extends AbstractDesktop {
|
||||||
|
|
||||||
DesktopTabpanel tabPanel = new DesktopTabpanel();
|
DesktopTabpanel tabPanel = new DesktopTabpanel();
|
||||||
p.setParent(tabPanel);
|
p.setParent(tabPanel);
|
||||||
|
preOpenNewTab();
|
||||||
windowContainer.addWindow(tabPanel, p.getWorkflow().get_Translation(MWorkflow.COLUMNNAME_Name), true);
|
windowContainer.addWindow(tabPanel, p.getWorkflow().get_Translation(MWorkflow.COLUMNNAME_Name), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,6 +111,7 @@ public abstract class TabbedDesktop extends AbstractDesktop {
|
||||||
|
|
||||||
DesktopTabpanel tabPanel = new DesktopTabpanel();
|
DesktopTabpanel tabPanel = new DesktopTabpanel();
|
||||||
if (adWindow.createPart(tabPanel) != null) {
|
if (adWindow.createPart(tabPanel) != null) {
|
||||||
|
preOpenNewTab();
|
||||||
windowContainer.addWindow(tabPanel, adWindow.getTitle(), true);
|
windowContainer.addWindow(tabPanel, adWindow.getTitle(), true);
|
||||||
return adWindow;
|
return adWindow;
|
||||||
} else {
|
} else {
|
||||||
|
@ -127,6 +131,7 @@ public abstract class TabbedDesktop extends AbstractDesktop {
|
||||||
|
|
||||||
DesktopTabpanel tabPanel = new DesktopTabpanel();
|
DesktopTabpanel tabPanel = new DesktopTabpanel();
|
||||||
if (adWindow.createPart(tabPanel) != null) {
|
if (adWindow.createPart(tabPanel) != null) {
|
||||||
|
preOpenNewTab();
|
||||||
windowContainer.addWindow(tabPanel, adWindow.getTitle(), true);
|
windowContainer.addWindow(tabPanel, adWindow.getTitle(), true);
|
||||||
return adWindow;
|
return adWindow;
|
||||||
} else {
|
} else {
|
||||||
|
@ -199,6 +204,7 @@ public abstract class TabbedDesktop extends AbstractDesktop {
|
||||||
|
|
||||||
Tabpanel tabPanel = new Tabpanel();
|
Tabpanel tabPanel = new Tabpanel();
|
||||||
window.setParent(tabPanel);
|
window.setParent(tabPanel);
|
||||||
|
preOpenNewTab();
|
||||||
windowContainer.addWindow(tabPanel, title, closeable);
|
windowContainer.addWindow(tabPanel, title, closeable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -213,6 +219,7 @@ public abstract class TabbedDesktop extends AbstractDesktop {
|
||||||
DesktopTabpanel tabPanel = new DesktopTabpanel();
|
DesktopTabpanel tabPanel = new DesktopTabpanel();
|
||||||
if (wnd.createPart(tabPanel) != null)
|
if (wnd.createPart(tabPanel) != null)
|
||||||
{
|
{
|
||||||
|
preOpenNewTab();
|
||||||
windowContainer.insertAfter(windowContainer.getSelectedTab(), tabPanel, wnd.getTitle(), true, true);
|
windowContainer.insertAfter(windowContainer.getSelectedTab(), tabPanel, wnd.getTitle(), true, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -220,16 +227,11 @@ public abstract class TabbedDesktop extends AbstractDesktop {
|
||||||
/**
|
/**
|
||||||
* @param AD_Window_ID
|
* @param AD_Window_ID
|
||||||
* @param query
|
* @param query
|
||||||
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
public void showWindow(int AD_Window_ID, MQuery query)
|
public void showWindow(int AD_Window_ID, MQuery query)
|
||||||
{
|
{
|
||||||
ADWindow wnd = new ADWindow(Env.getCtx(), AD_Window_ID, query);
|
openWindow(AD_Window_ID, query);
|
||||||
|
|
||||||
DesktopTabpanel tabPanel = new DesktopTabpanel();
|
|
||||||
if (wnd.createPart(tabPanel) != null)
|
|
||||||
{
|
|
||||||
windowContainer.addWindow(tabPanel, wnd.getTitle(), true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -242,6 +244,7 @@ public abstract class TabbedDesktop extends AbstractDesktop {
|
||||||
window.setParent(tabPanel);
|
window.setParent(tabPanel);
|
||||||
String title = window.getTitle();
|
String title = window.getTitle();
|
||||||
window.setTitle(null);
|
window.setTitle(null);
|
||||||
|
preOpenNewTab();
|
||||||
if (Window.INSERT_NEXT.equals(window.getAttribute(Window.INSERT_POSITION_KEY)))
|
if (Window.INSERT_NEXT.equals(window.getAttribute(Window.INSERT_POSITION_KEY)))
|
||||||
windowContainer.insertAfter(windowContainer.getSelectedTab(), tabPanel, title, true, true);
|
windowContainer.insertAfter(windowContainer.getSelectedTab(), tabPanel, title, true, true);
|
||||||
else
|
else
|
||||||
|
@ -319,4 +322,11 @@ public abstract class TabbedDesktop extends AbstractDesktop {
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* invoke before a new tab is added to the desktop
|
||||||
|
*/
|
||||||
|
protected void preOpenNewTab()
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue