# IDEMPIERE-5494 - enable zoom in WLocationEditor (#1586)

This commit is contained in:
matheus-marcelinux 2022-11-27 03:06:39 -03:00 committed by GitHub
parent fbc4ae35b0
commit 7621447500
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 5 deletions

View File

@ -137,9 +137,18 @@ public final class MLocationLookup extends Lookup
*/
public String getColumnName()
{
return "C_Location_ID";
return "C_Location.C_Location_ID";
} // getColumnName
/**
* Get Zoom - Location Window
* @return Zoom AD_Window_ID
*/
@Override
public int getZoom() {
return MTable.get(MLocation.Table_ID).getAD_Window_ID();
}
/**
* Return data as sorted Array - not implemented
* @param mandatory mandatory

View File

@ -24,6 +24,7 @@ import java.util.logging.Level;
import org.adempiere.webui.ClientInfo;
import org.adempiere.webui.LayoutUtils;
import org.adempiere.webui.ValuePreference;
import org.adempiere.webui.apps.AEnv;
import org.adempiere.webui.component.Locationbox;
import org.adempiere.webui.event.ContextMenuEvent;
import org.adempiere.webui.event.ContextMenuListener;
@ -50,7 +51,7 @@ import org.zkoss.zk.ui.event.OpenEvent;
*
* This class is based on VLocation written by Jorg Janke
**/
public class WLocationEditor extends WEditor implements EventListener<Event>, PropertyChangeListener, ContextMenuListener
public class WLocationEditor extends WEditor implements EventListener<Event>, PropertyChangeListener, ContextMenuListener, IZoomableEditor
{
private static final String[] LISTENER_EVENTS = {Events.ON_CLICK};
@ -103,7 +104,7 @@ public class WLocationEditor extends WEditor implements EventListener<Event>, Pr
else
getComponent().setButtonImage(ThemeManager.getThemeResource("images/Location16.png"));
popupMenu = new WEditorPopupMenu(false, false, isShowPreference());
popupMenu = new WEditorPopupMenu(true, false, isShowPreference(), false, false, false, gridField.getLookup());
popupMenu.addMenuListener(this);
addChangeLogMenu(popupMenu);
if (gridField != null)
@ -265,6 +266,10 @@ public class WLocationEditor extends WEditor implements EventListener<Event>, Pr
if (isShowPreference())
ValuePreference.start (getComponent(), this.getGridField(), getValue());
}
else if (WEditorPopupMenu.ZOOM_EVENT.equals(evt.getContextEvent()))
{
actionZoom();
}
}
@Override
@ -272,6 +277,10 @@ public class WLocationEditor extends WEditor implements EventListener<Event>, Pr
super.setTableEditor(b);
getComponent().setTableEditorMode(b);
}
@Override
public void actionZoom() {
AEnv.actionZoom(m_Location, getValue());
}
}