Merge 4c88efad663f

This commit is contained in:
Heng Sin Low 2013-05-08 16:28:52 +08:00
commit 83fe2e52b6
9 changed files with 38 additions and 21 deletions

View File

@ -28,6 +28,7 @@ import java.util.Properties;
import org.adempiere.webui.LayoutUtils;
import org.adempiere.webui.component.Tabpanel;
import org.adempiere.webui.component.ToolBarButton;
import org.adempiere.webui.panel.IHelpContext;
import org.adempiere.webui.panel.ITabOnCloseHandler;
import org.adempiere.webui.part.WindowContainer;
import org.adempiere.webui.session.SessionManager;
@ -210,7 +211,7 @@ public class ADWindowContent extends AbstractADWindowContent
}
}
public static class ADWindowVlayout extends Vlayout {
public static class ADWindowVlayout extends Vlayout implements IHelpContext {
/**
* generated serial id
*/

View File

@ -28,6 +28,7 @@ import org.adempiere.webui.component.Panel;
import org.adempiere.webui.component.Window;
import org.adempiere.webui.desktop.IDesktop;
import org.adempiere.webui.factory.ButtonFactory;
import org.adempiere.webui.panel.IHelpContext;
import org.adempiere.webui.part.WindowContainer;
import org.adempiere.webui.process.WProcessInfo;
import org.adempiere.webui.session.SessionManager;
@ -101,7 +102,7 @@ import com.lowagie.text.pdf.PdfWriter;
* @author arboleda - globalqss
* - Implement ShowHelp option on processes and reports
*/
public class ProcessDialog extends Window implements EventListener<Event>, IProcessUI
public class ProcessDialog extends Window implements EventListener<Event>, IProcessUI, IHelpContext
{
/**
* generate serial version ID

View File

@ -19,6 +19,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import org.adempiere.webui.panel.IHelpContext;
import org.adempiere.webui.part.WindowContainer;
import org.adempiere.webui.session.SessionManager;
import org.compiere.apps.wf.WFGraphLayout;
@ -46,7 +47,7 @@ import org.zkoss.zul.Html;
*
* @author Low Heng Sin
*/
public class WFPanel extends Borderlayout implements EventListener<Event>
public class WFPanel extends Borderlayout implements EventListener<Event>, IHelpContext
{
/**
*

View File

@ -31,10 +31,7 @@ import org.adempiere.webui.ValuePreference;
import org.adempiere.webui.adwindow.ADTabpanel;
import org.adempiere.webui.adwindow.ADWindow;
import org.adempiere.webui.adwindow.IFieldEditorContainer;
import org.adempiere.webui.adwindow.ADWindowContent.ADWindowVlayout;
import org.adempiere.webui.apps.AEnv;
import org.adempiere.webui.apps.ProcessDialog;
import org.adempiere.webui.apps.wf.WFPanel;
import org.adempiere.webui.component.Searchbox;
import org.adempiere.webui.event.ContextMenuEvent;
import org.adempiere.webui.event.ContextMenuListener;
@ -44,13 +41,12 @@ import org.adempiere.webui.event.ValueChangeListener;
import org.adempiere.webui.exception.ApplicationException;
import org.adempiere.webui.factory.InfoManager;
import org.adempiere.webui.grid.WQuickEntry;
import org.adempiere.webui.panel.ADForm;
import org.adempiere.webui.panel.IHelpContext;
import org.adempiere.webui.panel.InfoPanel;
import org.adempiere.webui.part.WindowContainer;
import org.adempiere.webui.session.SessionManager;
import org.adempiere.webui.theme.ThemeManager;
import org.adempiere.webui.window.WFieldRecordInfo;
import org.adempiere.webui.window.WTask;
import org.compiere.model.GridField;
import org.compiere.model.Lookup;
import org.compiere.model.MLookup;
@ -572,8 +568,7 @@ public class WSearchEditor extends WEditor implements ContextMenuListener, Value
@Override
public void onEvent(Event event) throws Exception {
Component component = SessionManager.getAppDesktop().getActiveWindow();
if (component instanceof ADWindowVlayout || component instanceof ADForm || component instanceof ProcessDialog
|| component instanceof InfoPanel || component instanceof WFPanel || component instanceof WTask)
if (component instanceof IHelpContext)
Events.sendEvent(new Event(WindowContainer.ON_WINDOW_CONTAINER_SELECTION_CHANGED_EVENT, component));
else
SessionManager.getAppDesktop().updateHelpContext(X_AD_CtxHelp.CTXTYPE_Home, 0);

View File

@ -39,7 +39,7 @@ import org.zkoss.zk.ui.event.EventListener;
*
* @author Andrew Kimball
*/
public abstract class ADForm extends Window implements EventListener<Event>
public abstract class ADForm extends Window implements EventListener<Event>, IHelpContext
{
/**
*

View File

@ -0,0 +1,24 @@
/******************************************************************************
* Copyright (C) 2013 Elaine Tan *
* Copyright (C) 2013 Trek Global
* 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. *
*****************************************************************************/
package org.adempiere.webui.panel;
/**
*
* @author Elaine
*
*/
public interface IHelpContext {
}

View File

@ -93,7 +93,7 @@ import org.zkoss.zul.ext.Sortable;
* @author Elaine
* @version Info.java Adempiere Swing UI 3.4.1
*/
public abstract class InfoPanel extends Window implements EventListener<Event>, WTableModelListener, Sortable<Object>
public abstract class InfoPanel extends Window implements EventListener<Event>, WTableModelListener, Sortable<Object>, IHelpContext
{
/**

View File

@ -13,18 +13,13 @@
package org.adempiere.webui.part;
import org.adempiere.webui.adwindow.ADWindowContent.ADWindowVlayout;
import org.adempiere.webui.apps.ProcessDialog;
import org.adempiere.webui.apps.wf.WFPanel;
import org.adempiere.webui.component.Tab;
import org.adempiere.webui.component.Tabbox;
import org.adempiere.webui.component.Tabpanel;
import org.adempiere.webui.component.Tabpanels;
import org.adempiere.webui.component.Tabs;
import org.adempiere.webui.panel.ADForm;
import org.adempiere.webui.panel.InfoPanel;
import org.adempiere.webui.panel.IHelpContext;
import org.adempiere.webui.session.SessionManager;
import org.adempiere.webui.window.WTask;
import org.compiere.model.X_AD_CtxHelp;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.event.Event;
@ -151,8 +146,7 @@ public class WindowContainer extends AbstractUIPart
handler.onSelect();
}
if (component instanceof ADWindowVlayout || component instanceof ADForm || component instanceof ProcessDialog
|| component instanceof InfoPanel || component instanceof WFPanel || component instanceof WTask)
if (component instanceof IHelpContext)
Events.sendEvent(new Event(ON_WINDOW_CONTAINER_SELECTION_CHANGED_EVENT, component));
else
SessionManager.getAppDesktop().updateHelpContext(X_AD_CtxHelp.CTXTYPE_Home, 0);

View File

@ -21,6 +21,7 @@ import java.util.logging.Level;
import org.adempiere.webui.LayoutUtils;
import org.adempiere.webui.component.ConfirmPanel;
import org.adempiere.webui.component.Window;
import org.adempiere.webui.panel.IHelpContext;
import org.adempiere.webui.part.WindowContainer;
import org.adempiere.webui.session.SessionManager;
import org.adempiere.webui.util.OSTask;
@ -48,7 +49,7 @@ import org.zkoss.zul.Html;
*
* @author Low Heng Sin
*/
public class WTask extends Window implements EventListener<Event>
public class WTask extends Window implements EventListener<Event>, IHelpContext
{
/**
*