* use execution environment with explicit access rule
* reduce internal api usage
This commit is contained in:
parent
82f61290d5
commit
2ad2c1c78f
|
@ -1,9 +1,15 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<classpath>
|
<classpath>
|
||||||
<classpathentry kind="src" path="src"/>
|
<classpathentry kind="src" path="src"/>
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
|
||||||
<classpathentry kind="src" path="/tools"/>
|
<classpathentry kind="src" path="/tools"/>
|
||||||
<classpathentry kind="src" path="/JasperReportsTools"/>
|
<classpathentry kind="src" path="/JasperReportsTools"/>
|
||||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||||
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
|
||||||
|
<accessrules>
|
||||||
|
<accessrule kind="accessible" pattern="sun/awt/*"/>
|
||||||
|
<accessrule kind="accessible" pattern="com/sun/rowset/*"/>
|
||||||
|
<accessrule kind="accessible" pattern="com/sun/image/codec/**"/>
|
||||||
|
</accessrules>
|
||||||
|
</classpathentry>
|
||||||
<classpathentry kind="output" path="build"/>
|
<classpathentry kind="output" path="build"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
#Wed Jul 14 15:10:51 MYT 2010
|
||||||
|
eclipse.preferences.version=1
|
||||||
|
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||||
|
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
|
||||||
|
org.eclipse.jdt.core.compiler.compliance=1.6
|
||||||
|
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||||
|
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||||
|
org.eclipse.jdt.core.compiler.source=1.6
|
|
@ -27,11 +27,11 @@ import javax.swing.SwingUtilities;
|
||||||
import javax.swing.plaf.ComponentInputMapUIResource;
|
import javax.swing.plaf.ComponentInputMapUIResource;
|
||||||
import javax.swing.plaf.metal.MetalLabelUI;
|
import javax.swing.plaf.metal.MetalLabelUI;
|
||||||
|
|
||||||
import sun.swing.UIAction;
|
import org.jdesktop.swingx.UIAction;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adempiere Label UI
|
* Adempiere Label UI
|
||||||
*
|
*
|
||||||
* @author Jorg Janke
|
* @author Jorg Janke
|
||||||
* @version $Id: CompiereLabelUI.java,v 1.2 2005/12/05 02:38:28 jjanke Exp $
|
* @version $Id: CompiereLabelUI.java,v 1.2 2005/12/05 02:38:28 jjanke Exp $
|
||||||
*/
|
*/
|
||||||
|
@ -45,11 +45,11 @@ public class AdempiereLabelUI extends MetalLabelUI
|
||||||
* @param c component
|
* @param c component
|
||||||
* @return singleton
|
* @return singleton
|
||||||
*/
|
*/
|
||||||
public static AdempiereLabelUI createUI(JComponent c)
|
public static AdempiereLabelUI createUI(JComponent c)
|
||||||
{
|
{
|
||||||
return adempiereLabelUI;
|
return adempiereLabelUI;
|
||||||
} // createUI
|
} // createUI
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Install Keyboard Actions
|
* Install Keyboard Actions
|
||||||
* @param l label
|
* @param l label
|
||||||
|
@ -72,18 +72,18 @@ public class AdempiereLabelUI extends MetalLabelUI
|
||||||
SwingUtilities.replaceUIInputMap (l, JComponent.WHEN_IN_FOCUSED_WINDOW, inputMap);
|
SwingUtilities.replaceUIInputMap (l, JComponent.WHEN_IN_FOCUSED_WINDOW, inputMap);
|
||||||
}
|
}
|
||||||
inputMap.clear ();
|
inputMap.clear ();
|
||||||
inputMap.put (KeyStroke.getKeyStroke (dka,
|
inputMap.put (KeyStroke.getKeyStroke (dka,
|
||||||
ActionEvent.SHIFT_MASK+ActionEvent.CTRL_MASK, false), PRESS);
|
ActionEvent.SHIFT_MASK+ActionEvent.CTRL_MASK, false), PRESS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // installKeyboardActions
|
} // installKeyboardActions
|
||||||
|
|
||||||
|
|
||||||
/** Action Name */
|
/** Action Name */
|
||||||
private static final String PRESS = "press";
|
private static final String PRESS = "press";
|
||||||
/** Press Action */
|
/** Press Action */
|
||||||
private static PressAction ACTION_PRESS = new PressAction();
|
private static PressAction ACTION_PRESS = new PressAction();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compiere Label UI Actions
|
* Compiere Label UI Actions
|
||||||
*/
|
*/
|
||||||
|
@ -122,32 +122,32 @@ public class AdempiereLabelUI extends MetalLabelUI
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (owner instanceof Container)
|
if (owner instanceof Container)
|
||||||
{
|
{
|
||||||
Container container = (Container)owner;
|
Container container = (Container)owner;
|
||||||
if (container.isFocusCycleRoot())
|
if (container.isFocusCycleRoot())
|
||||||
{
|
{
|
||||||
FocusTraversalPolicy policy = container.getFocusTraversalPolicy();
|
FocusTraversalPolicy policy = container.getFocusTraversalPolicy();
|
||||||
Component comp = policy.getDefaultComponent(container);
|
Component comp = policy.getDefaultComponent(container);
|
||||||
if (comp != null)
|
if (comp != null)
|
||||||
{
|
{
|
||||||
comp.requestFocus();
|
comp.requestFocus();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Container rootAncestor = container.getFocusCycleRootAncestor();
|
Container rootAncestor = container.getFocusCycleRootAncestor();
|
||||||
if (rootAncestor != null)
|
if (rootAncestor != null)
|
||||||
{
|
{
|
||||||
FocusTraversalPolicy policy = rootAncestor.getFocusTraversalPolicy();
|
FocusTraversalPolicy policy = rootAncestor.getFocusTraversalPolicy();
|
||||||
Component comp = policy.getComponentAfter(rootAncestor, container);
|
Component comp = policy.getComponentAfter(rootAncestor, container);
|
||||||
if (comp != null && SwingUtilities.isDescendingFrom(comp, container))
|
if (comp != null && SwingUtilities.isDescendingFrom(comp, container))
|
||||||
{
|
{
|
||||||
comp.requestFocus();
|
comp.requestFocus();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (owner.isFocusable())
|
if (owner.isFocusable())
|
||||||
{
|
{
|
||||||
owner.requestFocus();
|
owner.requestFocus();
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -30,11 +30,11 @@ import javax.swing.SwingUtilities;
|
||||||
import javax.swing.plaf.ComponentInputMapUIResource;
|
import javax.swing.plaf.ComponentInputMapUIResource;
|
||||||
import javax.swing.plaf.metal.MetalLabelUI;
|
import javax.swing.plaf.metal.MetalLabelUI;
|
||||||
|
|
||||||
import sun.swing.UIAction;
|
import org.jdesktop.swingx.UIAction;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adempiere Label UI
|
* Adempiere Label UI
|
||||||
*
|
*
|
||||||
* @author Jorg Janke
|
* @author Jorg Janke
|
||||||
* @version $Id: AdempiereLabelUI.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $
|
* @version $Id: AdempiereLabelUI.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $
|
||||||
*/
|
*/
|
||||||
|
@ -48,11 +48,11 @@ public class CompiereLabelUI extends MetalLabelUI
|
||||||
* @param c component
|
* @param c component
|
||||||
* @return singleton
|
* @return singleton
|
||||||
*/
|
*/
|
||||||
public static CompiereLabelUI createUI(JComponent c)
|
public static CompiereLabelUI createUI(JComponent c)
|
||||||
{
|
{
|
||||||
return adempiereLabelUI;
|
return adempiereLabelUI;
|
||||||
} // createUI
|
} // createUI
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Install Keyboard Actions
|
* Install Keyboard Actions
|
||||||
* @param l label
|
* @param l label
|
||||||
|
@ -75,18 +75,18 @@ public class CompiereLabelUI extends MetalLabelUI
|
||||||
SwingUtilities.replaceUIInputMap (l, JComponent.WHEN_IN_FOCUSED_WINDOW, inputMap);
|
SwingUtilities.replaceUIInputMap (l, JComponent.WHEN_IN_FOCUSED_WINDOW, inputMap);
|
||||||
}
|
}
|
||||||
inputMap.clear ();
|
inputMap.clear ();
|
||||||
inputMap.put (KeyStroke.getKeyStroke (dka,
|
inputMap.put (KeyStroke.getKeyStroke (dka,
|
||||||
ActionEvent.SHIFT_MASK+ActionEvent.CTRL_MASK, false), PRESS);
|
ActionEvent.SHIFT_MASK+ActionEvent.CTRL_MASK, false), PRESS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // installKeyboardActions
|
} // installKeyboardActions
|
||||||
|
|
||||||
|
|
||||||
/** Action Name */
|
/** Action Name */
|
||||||
private static final String PRESS = "press";
|
private static final String PRESS = "press";
|
||||||
/** Press Action */
|
/** Press Action */
|
||||||
private static PressAction ACTION_PRESS = new PressAction();
|
private static PressAction ACTION_PRESS = new PressAction();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adempiere Label UI Actions
|
* Adempiere Label UI Actions
|
||||||
*/
|
*/
|
||||||
|
@ -125,32 +125,32 @@ public class CompiereLabelUI extends MetalLabelUI
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (owner instanceof Container)
|
if (owner instanceof Container)
|
||||||
{
|
{
|
||||||
Container container = (Container)owner;
|
Container container = (Container)owner;
|
||||||
if (container.isFocusCycleRoot())
|
if (container.isFocusCycleRoot())
|
||||||
{
|
{
|
||||||
FocusTraversalPolicy policy = container.getFocusTraversalPolicy();
|
FocusTraversalPolicy policy = container.getFocusTraversalPolicy();
|
||||||
Component comp = policy.getDefaultComponent(container);
|
Component comp = policy.getDefaultComponent(container);
|
||||||
if (comp != null)
|
if (comp != null)
|
||||||
{
|
{
|
||||||
comp.requestFocus();
|
comp.requestFocus();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Container rootAncestor = container.getFocusCycleRootAncestor();
|
Container rootAncestor = container.getFocusCycleRootAncestor();
|
||||||
if (rootAncestor != null)
|
if (rootAncestor != null)
|
||||||
{
|
{
|
||||||
FocusTraversalPolicy policy = rootAncestor.getFocusTraversalPolicy();
|
FocusTraversalPolicy policy = rootAncestor.getFocusTraversalPolicy();
|
||||||
Component comp = policy.getComponentAfter(rootAncestor, container);
|
Component comp = policy.getComponentAfter(rootAncestor, container);
|
||||||
if (comp != null && SwingUtilities.isDescendingFrom(comp, container))
|
if (comp != null && SwingUtilities.isDescendingFrom(comp, container))
|
||||||
{
|
{
|
||||||
comp.requestFocus();
|
comp.requestFocus();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (owner.isFocusable())
|
if (owner.isFocusable())
|
||||||
{
|
{
|
||||||
owner.requestFocus();
|
owner.requestFocus();
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -31,8 +31,7 @@ import javax.swing.KeyStroke;
|
||||||
import org.adempiere.plaf.AdempierePLAF;
|
import org.adempiere.plaf.AdempierePLAF;
|
||||||
import org.compiere.plaf.CompiereColor;
|
import org.compiere.plaf.CompiereColor;
|
||||||
import org.compiere.plaf.CompiereLookAndFeel;
|
import org.compiere.plaf.CompiereLookAndFeel;
|
||||||
|
import org.jdesktop.swingx.UIAction;
|
||||||
import sun.swing.UIAction;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adempiere Color Tabbed Pane
|
* Adempiere Color Tabbed Pane
|
||||||
|
@ -43,7 +42,7 @@ import sun.swing.UIAction;
|
||||||
public class CTabbedPane extends JTabbedPane
|
public class CTabbedPane extends JTabbedPane
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private static final long serialVersionUID = 5845265820245543812L;
|
private static final long serialVersionUID = 5845265820245543812L;
|
||||||
|
|
||||||
|
@ -110,7 +109,7 @@ public class CTabbedPane extends JTabbedPane
|
||||||
{
|
{
|
||||||
} // init
|
} // init
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* Set Background - ignored by UI -
|
* Set Background - ignored by UI -
|
||||||
* @param bg ignored
|
* @param bg ignored
|
||||||
|
@ -162,7 +161,7 @@ public class CTabbedPane extends JTabbedPane
|
||||||
return null;
|
return null;
|
||||||
} // getBackgroundColor
|
} // getBackgroundColor
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* Insert tab.
|
* Insert tab.
|
||||||
* If the component is a JPanel, the backround is set to the default
|
* If the component is a JPanel, the backround is set to the default
|
||||||
|
@ -207,7 +206,7 @@ public class CTabbedPane extends JTabbedPane
|
||||||
//p.setOpaque(true);
|
//p.setOpaque(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Set first
|
// Set first
|
||||||
if (index == 0)
|
if (index == 0)
|
||||||
getActionMap().put(ACTION_SELECT, s_action);
|
getActionMap().put(ACTION_SELECT, s_action);
|
||||||
//
|
//
|
||||||
|
@ -247,8 +246,8 @@ public class CTabbedPane extends JTabbedPane
|
||||||
super.setTitleAt (index, title);
|
super.setTitleAt (index, title);
|
||||||
// setMnemonicAt(index, text);
|
// setMnemonicAt(index, text);
|
||||||
} // setTitleAt
|
} // setTitleAt
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set Mnemonic for Index based on text
|
* Set Mnemonic for Index based on text
|
||||||
* @param index for index
|
* @param index for index
|
||||||
|
@ -325,7 +324,7 @@ public class CTabbedPane extends JTabbedPane
|
||||||
/** Used Mnemonics */
|
/** Used Mnemonics */
|
||||||
private ArrayList<Character> m_mnemonic = new ArrayList<Character>(10);
|
private ArrayList<Character> m_mnemonic = new ArrayList<Character>(10);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* String representation
|
* String representation
|
||||||
* @return String representation
|
* @return String representation
|
||||||
|
@ -345,10 +344,10 @@ public class CTabbedPane extends JTabbedPane
|
||||||
private static final String ACTION_SELECT = "CAS";
|
private static final String ACTION_SELECT = "CAS";
|
||||||
/** Select Action */
|
/** Select Action */
|
||||||
private static CTAction s_action = new CTAction(ACTION_SELECT);
|
private static CTAction s_action = new CTAction(ACTION_SELECT);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Select Action
|
* Select Action
|
||||||
*
|
*
|
||||||
* @author Jorg Janke
|
* @author Jorg Janke
|
||||||
* @version $Id: CTabbedPane.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $
|
* @version $Id: CTabbedPane.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $
|
||||||
*/
|
*/
|
||||||
|
@ -365,7 +364,7 @@ public class CTabbedPane extends JTabbedPane
|
||||||
public void actionPerformed (ActionEvent e)
|
public void actionPerformed (ActionEvent e)
|
||||||
{
|
{
|
||||||
String key = getName();
|
String key = getName();
|
||||||
if (!key.equals(ACTION_SELECT)
|
if (!key.equals(ACTION_SELECT)
|
||||||
|| !(e.getSource() instanceof CTabbedPane))
|
|| !(e.getSource() instanceof CTabbedPane))
|
||||||
return;
|
return;
|
||||||
CTabbedPane pane = (CTabbedPane)e.getSource();
|
CTabbedPane pane = (CTabbedPane)e.getSource();
|
||||||
|
@ -378,7 +377,7 @@ public class CTabbedPane extends JTabbedPane
|
||||||
else
|
else
|
||||||
System.out.println("Action: " + e);
|
System.out.println("Action: " + e);
|
||||||
} // actionPerformed
|
} // actionPerformed
|
||||||
|
|
||||||
} // Action
|
} // Action
|
||||||
|
|
||||||
} // CTabbedPane
|
} // CTabbedPane
|
||||||
|
|
|
@ -48,8 +48,6 @@ import javax.swing.SwingUtilities;
|
||||||
|
|
||||||
import org.adempiere.base.Core;
|
import org.adempiere.base.Core;
|
||||||
import org.adempiere.base.IResourceFinder;
|
import org.adempiere.base.IResourceFinder;
|
||||||
import org.adempiere.base.Service;
|
|
||||||
import org.compiere.Adempiere;
|
|
||||||
import org.compiere.db.CConnection;
|
import org.compiere.db.CConnection;
|
||||||
import org.compiere.model.MClient;
|
import org.compiere.model.MClient;
|
||||||
import org.compiere.model.MLookupCache;
|
import org.compiere.model.MLookupCache;
|
||||||
|
@ -57,18 +55,13 @@ import org.compiere.model.MRole;
|
||||||
import org.compiere.model.MSession;
|
import org.compiere.model.MSession;
|
||||||
import org.compiere.model.PO;
|
import org.compiere.model.PO;
|
||||||
import org.compiere.swing.CFrame;
|
import org.compiere.swing.CFrame;
|
||||||
import org.eclipse.core.runtime.IConfigurationElement;
|
|
||||||
import org.eclipse.core.runtime.Platform;
|
|
||||||
|
|
||||||
import com.sun.xml.internal.ws.util.ServiceFinder;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* System Environment and static variables.
|
* System Environment and static variables.
|
||||||
*
|
*
|
||||||
* @author Jorg Janke
|
* @author Jorg Janke
|
||||||
* @version $Id: Env.java,v 1.3 2006/07/30 00:54:36 jjanke Exp $
|
* @version $Id: Env.java,v 1.3 2006/07/30 00:54:36 jjanke Exp $
|
||||||
*
|
*
|
||||||
* @author Teo Sarca, www.arhipac.ro
|
* @author Teo Sarca, www.arhipac.ro
|
||||||
* <li>BF [ 1619390 ] Use default desktop browser as external browser
|
* <li>BF [ 1619390 ] Use default desktop browser as external browser
|
||||||
* <li>BF [ 2017987 ] Env.getContext(TAB_INFO) should NOT use global context
|
* <li>BF [ 2017987 ] Env.getContext(TAB_INFO) should NOT use global context
|
||||||
|
@ -78,15 +71,15 @@ public final class Env
|
||||||
{
|
{
|
||||||
/** Logging */
|
/** Logging */
|
||||||
private static CLogger s_log = CLogger.getCLogger(Env.class);
|
private static CLogger s_log = CLogger.getCLogger(Env.class);
|
||||||
|
|
||||||
private static ContextProvider contextProvider = new DefaultContextProvider();
|
private static ContextProvider contextProvider = new DefaultContextProvider();
|
||||||
|
|
||||||
public static void setContextProvider(ContextProvider provider)
|
public static void setContextProvider(ContextProvider provider)
|
||||||
{
|
{
|
||||||
contextProvider = provider;
|
contextProvider = provider;
|
||||||
getCtx().put(LANGUAGE, Language.getBaseAD_Language());
|
getCtx().put(LANGUAGE, Language.getBaseAD_Language());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Exit System
|
* Exit System
|
||||||
* @param status System exit status (usually 0 for no error)
|
* @param status System exit status (usually 0 for no error)
|
||||||
|
@ -122,10 +115,10 @@ public final class Env
|
||||||
//
|
//
|
||||||
reset(true); // final cache reset
|
reset(true); // final cache reset
|
||||||
//
|
//
|
||||||
|
|
||||||
CConnection.get().setAppServerCredential(null, null);
|
CConnection.get().setAppServerCredential(null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reset Cache
|
* Reset Cache
|
||||||
* @param finalCall everything otherwise login data remains
|
* @param finalCall everything otherwise login data remains
|
||||||
|
@ -136,7 +129,7 @@ public final class Env
|
||||||
if (Ini.isClient())
|
if (Ini.isClient())
|
||||||
{
|
{
|
||||||
closeWindows();
|
closeWindows();
|
||||||
|
|
||||||
// Dismantle windows
|
// Dismantle windows
|
||||||
/**
|
/**
|
||||||
for (int i = 0; i < s_windows.size(); i++)
|
for (int i = 0; i < s_windows.size(); i++)
|
||||||
|
@ -267,7 +260,7 @@ public final class Env
|
||||||
{ // JDBC Format 2005-05-09 00:00:00.0
|
{ // JDBC Format 2005-05-09 00:00:00.0
|
||||||
String stringValue = value.toString();
|
String stringValue = value.toString();
|
||||||
// Chop off .0 (nanos)
|
// Chop off .0 (nanos)
|
||||||
stringValue = stringValue.substring(0, stringValue.indexOf("."));
|
stringValue = stringValue.substring(0, stringValue.indexOf("."));
|
||||||
ctx.setProperty(context, stringValue);
|
ctx.setProperty(context, stringValue);
|
||||||
s_log.finer("Context " + context + "==" + stringValue);
|
s_log.finer("Context " + context + "==" + stringValue);
|
||||||
}
|
}
|
||||||
|
@ -339,7 +332,7 @@ public final class Env
|
||||||
{ // JDBC Format 2005-05-09 00:00:00.0
|
{ // JDBC Format 2005-05-09 00:00:00.0
|
||||||
String stringValue = value.toString();
|
String stringValue = value.toString();
|
||||||
// Chop off .0 (nanos)
|
// Chop off .0 (nanos)
|
||||||
stringValue = stringValue.substring(0, stringValue.indexOf("."));
|
stringValue = stringValue.substring(0, stringValue.indexOf("."));
|
||||||
ctx.setProperty(WindowNo+"|"+context, stringValue);
|
ctx.setProperty(WindowNo+"|"+context, stringValue);
|
||||||
s_log.finer("Context("+WindowNo+") " + context + "==" + stringValue);
|
s_log.finer("Context("+WindowNo+") " + context + "==" + stringValue);
|
||||||
}
|
}
|
||||||
|
@ -447,8 +440,8 @@ public final class Env
|
||||||
return;
|
return;
|
||||||
ctx.setProperty(WindowNo+"|AutoNew", autoNew ? "Y" : "N");
|
ctx.setProperty(WindowNo+"|AutoNew", autoNew ? "Y" : "N");
|
||||||
} // setAutoNew
|
} // setAutoNew
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set SO Trx
|
* Set SO Trx
|
||||||
* @param ctx context
|
* @param ctx context
|
||||||
|
@ -555,7 +548,7 @@ public final class Env
|
||||||
final boolean onlyWindow = onlyTab ? true : false;
|
final boolean onlyWindow = onlyTab ? true : false;
|
||||||
return getContext(ctx, WindowNo, TabNo, context, onlyTab, onlyWindow);
|
return getContext(ctx, WindowNo, TabNo, context, onlyTab, onlyWindow);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get Value of Context for Window & Tab,
|
* Get Value of Context for Window & Tab,
|
||||||
* if not found global context if available.
|
* if not found global context if available.
|
||||||
|
@ -719,7 +712,7 @@ public final class Env
|
||||||
return isAutoCommit(ctx);
|
return isAutoCommit(ctx);
|
||||||
} // isAutoCommit
|
} // isAutoCommit
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Is Auto New Record
|
* Is Auto New Record
|
||||||
* @param ctx context
|
* @param ctx context
|
||||||
|
@ -755,8 +748,8 @@ public final class Env
|
||||||
}
|
}
|
||||||
return isAutoNew(ctx);
|
return isAutoNew(ctx);
|
||||||
} // isAutoNew
|
} // isAutoNew
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Is Sales Order Trx
|
* Is Sales Order Trx
|
||||||
* @param ctx context
|
* @param ctx context
|
||||||
|
@ -854,7 +847,7 @@ public final class Env
|
||||||
{
|
{
|
||||||
return Env.getContextAsInt(ctx, "#AD_User_ID");
|
return Env.getContextAsInt(ctx, "#AD_User_ID");
|
||||||
} // getAD_User_ID
|
} // getAD_User_ID
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get Login AD_Role_ID
|
* Get Login AD_Role_ID
|
||||||
* @param ctx context
|
* @param ctx context
|
||||||
|
@ -864,7 +857,7 @@ public final class Env
|
||||||
{
|
{
|
||||||
return Env.getContextAsInt(ctx, "#AD_Role_ID");
|
return Env.getContextAsInt(ctx, "#AD_Role_ID");
|
||||||
} // getAD_Role_ID
|
} // getAD_Role_ID
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* Get Preference.
|
* Get Preference.
|
||||||
* <pre>
|
* <pre>
|
||||||
|
@ -908,7 +901,7 @@ public final class Env
|
||||||
|
|
||||||
/** Context Language identifier */
|
/** Context Language identifier */
|
||||||
static public final String LANGUAGE = "#AD_Language";
|
static public final String LANGUAGE = "#AD_Language";
|
||||||
|
|
||||||
/** Context for POS ID */
|
/** Context for POS ID */
|
||||||
static public final String POS_ID = "#POS_ID";
|
static public final String POS_ID = "#POS_ID";
|
||||||
|
|
||||||
|
@ -973,12 +966,12 @@ public final class Env
|
||||||
*/
|
*/
|
||||||
public static boolean isBaseTranslation (String tableName)
|
public static boolean isBaseTranslation (String tableName)
|
||||||
{
|
{
|
||||||
if (tableName.startsWith("AD")
|
if (tableName.startsWith("AD")
|
||||||
|| tableName.equals("C_Country_Trl") )
|
|| tableName.equals("C_Country_Trl") )
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
} // isBaseTranslation
|
} // isBaseTranslation
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Do we have Multi-Lingual Documents.
|
* Do we have Multi-Lingual Documents.
|
||||||
* Set in DB.loadOrgs
|
* Set in DB.loadOrgs
|
||||||
|
@ -1042,7 +1035,7 @@ public final class Env
|
||||||
{
|
{
|
||||||
if (language.isBaseLanguage())
|
if (language.isBaseLanguage())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
boolean isSystemLanguage = false;
|
boolean isSystemLanguage = false;
|
||||||
ArrayList<String> AD_Languages = new ArrayList<String>();
|
ArrayList<String> AD_Languages = new ArrayList<String>();
|
||||||
String sql = "SELECT DISTINCT AD_Language FROM AD_Message_Trl";
|
String sql = "SELECT DISTINCT AD_Language FROM AD_Message_Trl";
|
||||||
|
@ -1081,7 +1074,7 @@ public final class Env
|
||||||
language.setAD_Language(Language.getBaseAD_Language());
|
language.setAD_Language(Language.getBaseAD_Language());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < AD_Languages.size(); i++)
|
for (int i = 0; i < AD_Languages.size(); i++)
|
||||||
{
|
{
|
||||||
String AD_Language = (String)AD_Languages.get(i); // en_US
|
String AD_Language = (String)AD_Languages.get(i); // en_US
|
||||||
|
@ -1202,7 +1195,7 @@ public final class Env
|
||||||
* @param value Message to be parsed
|
* @param value Message to be parsed
|
||||||
* @param onlyWindow if true, no defaults are used
|
* @param onlyWindow if true, no defaults are used
|
||||||
* @param ignoreUnparsable if true, unsuccessful @return parsed String or "" if not successful and ignoreUnparsable
|
* @param ignoreUnparsable if true, unsuccessful @return parsed String or "" if not successful and ignoreUnparsable
|
||||||
* @return parsed context
|
* @return parsed context
|
||||||
*/
|
*/
|
||||||
public static String parseContext (Properties ctx, int WindowNo, String value,
|
public static String parseContext (Properties ctx, int WindowNo, String value,
|
||||||
boolean onlyWindow, boolean ignoreUnparsable)
|
boolean onlyWindow, boolean ignoreUnparsable)
|
||||||
|
@ -1263,9 +1256,9 @@ public final class Env
|
||||||
{
|
{
|
||||||
return parseContext(ctx, WindowNo, value, onlyWindow, false);
|
return parseContext(ctx, WindowNo, value, onlyWindow, false);
|
||||||
} // parseContext
|
} // parseContext
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parse expression, replaces global or PO properties @tag@ with actual value.
|
* Parse expression, replaces global or PO properties @tag@ with actual value.
|
||||||
* @param expression
|
* @param expression
|
||||||
* @param po
|
* @param po
|
||||||
* @param trxName
|
* @param trxName
|
||||||
|
@ -1293,7 +1286,7 @@ public final class Env
|
||||||
}
|
}
|
||||||
|
|
||||||
token = inStr.substring(0, j);
|
token = inStr.substring(0, j);
|
||||||
|
|
||||||
//format string
|
//format string
|
||||||
String format = "";
|
String format = "";
|
||||||
int f = token.indexOf('<');
|
int f = token.indexOf('<');
|
||||||
|
@ -1301,7 +1294,7 @@ public final class Env
|
||||||
format = token.substring(f+1, token.length()-1);
|
format = token.substring(f+1, token.length()-1);
|
||||||
token = token.substring(0, f);
|
token = token.substring(0, f);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (token.startsWith("#") || token.startsWith("$")) {
|
if (token.startsWith("#") || token.startsWith("$")) {
|
||||||
//take from context
|
//take from context
|
||||||
Properties ctx = po != null ? po.getCtx() : Env.getCtx();
|
Properties ctx = po != null ? po.getCtx() : Env.getCtx();
|
||||||
|
@ -1319,7 +1312,7 @@ public final class Env
|
||||||
int tblIndex = format.indexOf(".");
|
int tblIndex = format.indexOf(".");
|
||||||
String table = tblIndex > 0 ? format.substring(0, tblIndex) : token.substring(0, token.length() - 3);
|
String table = tblIndex > 0 ? format.substring(0, tblIndex) : token.substring(0, token.length() - 3);
|
||||||
String column = tblIndex > 0 ? format.substring(tblIndex + 1) : format;
|
String column = tblIndex > 0 ? format.substring(tblIndex + 1) : format;
|
||||||
outStr.append(DB.getSQLValueString(trxName,
|
outStr.append(DB.getSQLValueString(trxName,
|
||||||
"select " + column + " from " + table + " where " + table + "_id = ?", (Integer)v));
|
"select " + column + " from " + table + " where " + table + "_id = ?", (Integer)v));
|
||||||
} else if (v instanceof Date) {
|
} else if (v instanceof Date) {
|
||||||
SimpleDateFormat df = new SimpleDateFormat(format);
|
SimpleDateFormat df = new SimpleDateFormat(format);
|
||||||
|
@ -1560,7 +1553,7 @@ public final class Env
|
||||||
}
|
}
|
||||||
return new ImageIcon(url);
|
return new ImageIcon(url);
|
||||||
} // getImageIcon2
|
} // getImageIcon2
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Start Browser
|
* Start Browser
|
||||||
|
@ -1571,18 +1564,18 @@ public final class Env
|
||||||
s_log.info(url);
|
s_log.info(url);
|
||||||
contextProvider.showURL(url);
|
contextProvider.showURL(url);
|
||||||
} // startBrowser
|
} // startBrowser
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Do we run on Apple
|
* Do we run on Apple
|
||||||
* @return true if Mac
|
* @return true if Mac
|
||||||
*/
|
*/
|
||||||
public static boolean isMac()
|
public static boolean isMac()
|
||||||
{
|
{
|
||||||
String osName = System.getProperty ("os.name");
|
String osName = System.getProperty ("os.name");
|
||||||
osName = osName.toLowerCase();
|
osName = osName.toLowerCase();
|
||||||
return osName.indexOf ("mac") != -1;
|
return osName.indexOf ("mac") != -1;
|
||||||
} // isMac
|
} // isMac
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Do we run on Windows
|
* Do we run on Windows
|
||||||
* @return true if windows
|
* @return true if windows
|
||||||
|
@ -1594,12 +1587,12 @@ public final class Env
|
||||||
return osName.indexOf ("windows") != -1;
|
return osName.indexOf ("windows") != -1;
|
||||||
} // isWindows
|
} // isWindows
|
||||||
|
|
||||||
|
|
||||||
/** Array of hidden Windows */
|
/** Array of hidden Windows */
|
||||||
private static ArrayList<CFrame> s_hiddenWindows = new ArrayList<CFrame>();
|
private static ArrayList<CFrame> s_hiddenWindows = new ArrayList<CFrame>();
|
||||||
/** Closing Window Indicator */
|
/** Closing Window Indicator */
|
||||||
private static boolean s_closingWindows = false;
|
private static boolean s_closingWindows = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Hide Window
|
* Hide Window
|
||||||
* @param window window
|
* @param window window
|
||||||
|
@ -1637,7 +1630,7 @@ public final class Env
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
} // hideWindow
|
} // hideWindow
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show Window
|
* Show Window
|
||||||
* @param AD_Window_ID window
|
* @param AD_Window_ID window
|
||||||
|
@ -1697,12 +1690,12 @@ public final class Env
|
||||||
}
|
}
|
||||||
s_log.info("End");
|
s_log.info("End");
|
||||||
} // sleep
|
} // sleep
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update all windows after look and feel changes.
|
* Update all windows after look and feel changes.
|
||||||
* @since 2006-11-27
|
* @since 2006-11-27
|
||||||
*/
|
*/
|
||||||
public static Set<Window>updateUI()
|
public static Set<Window>updateUI()
|
||||||
{
|
{
|
||||||
Set<Window> updated = new HashSet<Window>();
|
Set<Window> updated = new HashSet<Window>();
|
||||||
for (Container c : s_windows)
|
for (Container c : s_windows)
|
||||||
|
@ -1737,20 +1730,20 @@ public final class Env
|
||||||
}
|
}
|
||||||
return updated;
|
return updated;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prepare the context for calling remote server (for e.g, ejb),
|
* Prepare the context for calling remote server (for e.g, ejb),
|
||||||
* only default and global variables are pass over.
|
* only default and global variables are pass over.
|
||||||
* It is too expensive and also can have serialization issue if
|
* It is too expensive and also can have serialization issue if
|
||||||
* every remote call to server is passing the whole client context.
|
* every remote call to server is passing the whole client context.
|
||||||
* @param ctx
|
* @param ctx
|
||||||
* @return Properties
|
* @return Properties
|
||||||
*/
|
*/
|
||||||
public static Properties getRemoteCallCtx(Properties ctx)
|
public static Properties getRemoteCallCtx(Properties ctx)
|
||||||
{
|
{
|
||||||
Properties p = new Properties();
|
Properties p = new Properties();
|
||||||
Set<Object> keys = ctx.keySet();
|
Set<Object> keys = ctx.keySet();
|
||||||
for (Object key : keys)
|
for (Object key : keys)
|
||||||
{
|
{
|
||||||
String s = key.toString();
|
String s = key.toString();
|
||||||
if (s.startsWith("#") || s.startsWith("$"))
|
if (s.startsWith("#") || s.startsWith("$"))
|
||||||
|
@ -1758,11 +1751,11 @@ public final class Env
|
||||||
p.put(key, ctx.get(key));
|
p.put(key, ctx.get(key));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* Static Variables
|
* Static Variables
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue