forked from adempiere/adempiere
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'adempiere:develop' into experimental
- Loading branch information
Showing
10 changed files
with
115 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,42 +12,42 @@ | |
*****************************************************************************/ | ||
package org.adempiere.webui; | ||
|
||
import org.adempiere.webui.session.ServerContext; | ||
|
||
import java.io.Serializable; | ||
import java.lang.reflect.InvocationHandler; | ||
import java.lang.reflect.Method; | ||
import java.util.Properties; | ||
|
||
import org.adempiere.webui.session.ServerContext; | ||
|
||
import net.sf.cglib.proxy.InvocationHandler; | ||
|
||
/** | ||
* Intercaptor for Server context properties that delegate to the threadlocal instance | ||
* @author Low Heng Sin | ||
* | ||
* @author Low Heng Sin | ||
* @author Victor Perez Juarez . [email protected] e-Evolution | ||
* #4021 [Bug Report] Replace obsolete library cglib.jar not compatible with JDK 11 or > https://github.com/adempiere/adempiere/issues/4021 | ||
*/ | ||
public class ServerContextCallback implements InvocationHandler, Serializable { | ||
/** | ||
* | ||
*/ | ||
private static final long serialVersionUID = 6708635918931322152L; | ||
/** | ||
* | ||
*/ | ||
private static final long serialVersionUID = 6708635918931322152L; | ||
|
||
public synchronized Object invoke(Object proxy, Method method, Object[] args) | ||
throws Throwable { | ||
Properties context = ServerContext.getCurrentInstance(); | ||
//optimize for the 2 most common access | ||
if (method.getName().equals("getProperty")) { | ||
Class<?>[] types = method.getParameterTypes(); | ||
if (types != null && types.length == 1 && types[0] == String.class && | ||
args != null && args.length == 1 && args[0] instanceof String) { | ||
return context.getProperty((String)args[0]); | ||
} | ||
else if (types != null && types.length == 2 && types[0] == String.class && | ||
types[1] == String.class && args != null && args[0] instanceof String && | ||
args[1] instanceof String) | ||
return context.getProperty((String)args[0], (String)args[1]); | ||
} | ||
Method m = context.getClass().getMethod(method.getName(), method.getParameterTypes()); | ||
return m.invoke(context, args); | ||
} | ||
public Object invoke(Object proxy, Method method, Object[] args) | ||
throws Throwable { | ||
Properties context = ServerContext.getCurrentInstance(); | ||
//optimize for the 2 most common access | ||
if (method.getName().equals("getProperty")) { | ||
Class<?>[] types = method.getParameterTypes(); | ||
if (types != null && types.length == 1 && types[0] == String.class && | ||
args != null && args.length == 1 && args[0] instanceof String) { | ||
return context.getProperty((String) args[0]); | ||
} else if (types != null && types.length == 2 && types[0] == String.class && | ||
types[1] == String.class && args != null && args[0] instanceof String && | ||
args[1] instanceof String) | ||
return context.getProperty((String) args[0], (String) args[1]); | ||
} | ||
Method m = context.getClass().getMethod(method.getName(), method.getParameterTypes()); | ||
return m.invoke(context, args); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,23 +16,43 @@ | |
*****************************************************************************/ | ||
package org.adempiere.webui; | ||
|
||
import net.bytebuddy.implementation.InvocationHandlerAdapter; | ||
import org.adempiere.webui.session.SessionManager; | ||
import org.compiere.util.ContextProvider; | ||
|
||
import java.util.Properties; | ||
|
||
import net.sf.cglib.proxy.Enhancer; | ||
import static net.bytebuddy.matcher.ElementMatchers.any; | ||
|
||
|
||
import org.adempiere.webui.session.SessionManager; | ||
import org.compiere.util.ContextProvider; | ||
|
||
/** | ||
* | ||
* @author Low Heng Sin | ||
* @author Victor Perez Juarez . [email protected] e-Evolution | ||
* #4021 [Bug Report] Replace obsolete library cglib.jar not compatible with JDK 11 or > https://github.com/adempiere/adempiere/issues/4021 | ||
* | ||
*/ | ||
public class ZkContextProvider implements ContextProvider { | ||
|
||
private final static ServerContextCallback callback = new ServerContextCallback(); | ||
private final static Properties context = (Properties) Enhancer.create(Properties.class, callback); | ||
|
||
private final static ServerContextCallback callback = new ServerContextCallback(); | ||
|
||
private final static Properties context; | ||
|
||
static { | ||
try { | ||
context = (new net.bytebuddy.ByteBuddy() | ||
.subclass(java.util.Properties.class) | ||
.method(any()) | ||
.intercept(InvocationHandlerAdapter.of(callback)) | ||
.make() | ||
.load(ZkContextProvider.class.getClassLoader()) | ||
.getLoaded()).newInstance(); | ||
} catch (InstantiationException | IllegalAccessException e) { | ||
throw new RuntimeException(e); | ||
} | ||
} | ||
|
||
/** | ||
* Get server context proxy | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,6 +58,7 @@ | |
* @author e-Evolution , [email protected] | ||
* <li>Implement embedded or horizontal tab panel https://adempiere.atlassian.net/browse/ADEMPIERE-319 | ||
* <li>New ADempiere 3.8.0 ZK Theme Light https://adempiere.atlassian.net/browse/ADEMPIERE-320 | ||
* <li>[Bug Report] Quick Entry not working when the icon is pushed #4023 https://github.com/adempiere/adempiere/issues/4023</> | ||
* | ||
*/ | ||
public class GridPanel extends Borderlayout implements EventListener | ||
|
@@ -123,7 +124,7 @@ public class GridPanel extends Borderlayout implements EventListener | |
|
||
// The following fields require package or protected level of | ||
// visibility for testing | ||
Grid listbox = new Grid(); | ||
Grid listbox; | ||
GridTabRowRenderer renderer; | ||
AbstractADWindowPanel windowPanel; | ||
|
||
|
@@ -148,7 +149,16 @@ public GridPanel() | |
public GridPanel(int windowNo) | ||
{ | ||
this.windowNo = windowNo; | ||
|
||
listbox = new Grid(); | ||
|
||
listbox.addEventListener(Events.ON_FOCUS, this); | ||
listbox.setOddRowSclass(null); | ||
south = new South(); | ||
this.appendChild(south); | ||
|
||
center = new Center(); | ||
center.appendChild(listbox); | ||
this.appendChild(center); | ||
} | ||
|
||
/** | ||
|
@@ -157,23 +167,12 @@ public GridPanel(int windowNo) | |
*/ | ||
public void init(GridTab gridTab) | ||
{ | ||
if (init && !gridTab.isQuickEntry()) return; | ||
|
||
if (pageSize < 0) | ||
pageSize = getSysConfigPageSizeOrDefault(100); | ||
modeless = getSysConfigModelessOrDefault(false); | ||
|
||
if (init && !gridTab.isQuickEntry()) return; | ||
|
||
listbox.addEventListener(Events.ON_FOCUS, this); | ||
listbox.setOddRowSclass(null); | ||
|
||
south = new South(); | ||
this.appendChild(south); | ||
|
||
center = new Center(); | ||
center.appendChild(listbox); | ||
this.appendChild(center); | ||
|
||
|
||
|
||
this.gridTab = gridTab; | ||
tableModel = gridTab.getTableModel(); | ||
|
||
|
Oops, something went wrong.