Adempiere 3.1.2
This commit is contained in:
parent
ee46d9e792
commit
8a0bf1e3c7
|
@ -171,7 +171,6 @@ public class AArchive implements ActionListener
|
||||||
else // all Reports
|
else // all Reports
|
||||||
av.query(true, m_AD_Table_ID, 0);
|
av.query(true, m_AD_Table_ID, 0);
|
||||||
//
|
//
|
||||||
AEnv.addToWindowManager(ff);
|
|
||||||
ff.pack();
|
ff.pack();
|
||||||
AEnv.showCenterScreen(ff);
|
AEnv.showCenterScreen(ff);
|
||||||
ff = null;
|
ff = null;
|
||||||
|
|
|
@ -257,8 +257,7 @@ public final class AEnv
|
||||||
if (iconName == null)
|
if (iconName == null)
|
||||||
iconName = actionName;
|
iconName = actionName;
|
||||||
String text = Msg.getMsg(Env.getCtx(), actionName);
|
String text = Msg.getMsg(Env.getCtx(), actionName);
|
||||||
ImageIcon icon = Env.getImageIcon2(iconName + "16");
|
CMenuItem mi = new CMenuItem(text, Env.getImageIcon(iconName + "16.gif"));
|
||||||
CMenuItem mi = new CMenuItem(text, icon);
|
|
||||||
mi.setActionCommand(actionName);
|
mi.setActionCommand(actionName);
|
||||||
if (ks != null)
|
if (ks != null)
|
||||||
mi.setAccelerator(ks);
|
mi.setAccelerator(ks);
|
||||||
|
@ -298,11 +297,6 @@ public final class AEnv
|
||||||
if (ADialog.ask(WindowNo, c, "ExitApplication?"))
|
if (ADialog.ask(WindowNo, c, "ExitApplication?"))
|
||||||
Env.exitEnv(0);
|
Env.exitEnv(0);
|
||||||
}
|
}
|
||||||
else if (actionCommand.equals("Logout"))
|
|
||||||
{
|
|
||||||
AMenu aMenu = (AMenu)Env.getWindow(WindowNo);
|
|
||||||
aMenu.logout();
|
|
||||||
}
|
|
||||||
|
|
||||||
// View Menu ------------------------
|
// View Menu ------------------------
|
||||||
else if (actionCommand.equals("InfoProduct"))
|
else if (actionCommand.equals("InfoProduct"))
|
||||||
|
@ -379,9 +373,8 @@ public final class AEnv
|
||||||
}
|
}
|
||||||
else if (actionCommand.equals("Preference"))
|
else if (actionCommand.equals("Preference"))
|
||||||
{
|
{
|
||||||
if (role.isShowPreference()) {
|
if (role.isShowPreference())
|
||||||
AEnv.showCenterScreen(new Preference (Env.getFrame(c), WindowNo));
|
AEnv.showCenterScreen(new Preference (Env.getFrame(c), WindowNo));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Help Menu ------------------------
|
// Help Menu ------------------------
|
||||||
|
@ -485,7 +478,6 @@ public final class AEnv
|
||||||
AWindow frame = new AWindow();
|
AWindow frame = new AWindow();
|
||||||
if (!frame.initWindow(AD_Window_ID, MQuery.getEqualQuery(TableName + "_ID", Record_ID)))
|
if (!frame.initWindow(AD_Window_ID, MQuery.getEqualQuery(TableName + "_ID", Record_ID)))
|
||||||
return;
|
return;
|
||||||
addToWindowManager(frame);
|
|
||||||
AEnv.showCenterScreen(frame);
|
AEnv.showCenterScreen(frame);
|
||||||
frame = null;
|
frame = null;
|
||||||
} // zoom
|
} // zoom
|
||||||
|
@ -536,23 +528,11 @@ public final class AEnv
|
||||||
AWindow frame = new AWindow();
|
AWindow frame = new AWindow();
|
||||||
if (!frame.initWindow(AD_Window_ID, query))
|
if (!frame.initWindow(AD_Window_ID, query))
|
||||||
return;
|
return;
|
||||||
addToWindowManager(frame);
|
|
||||||
AEnv.showCenterScreen(frame);
|
AEnv.showCenterScreen(frame);
|
||||||
frame = null;
|
frame = null;
|
||||||
} // zoom
|
} // zoom
|
||||||
|
|
||||||
/**
|
|
||||||
* Track open frame in window manager
|
|
||||||
* @param frame
|
|
||||||
*/
|
|
||||||
public static void addToWindowManager(CFrame frame)
|
|
||||||
{
|
|
||||||
JFrame top = Env.getWindow(0);
|
|
||||||
if (top instanceof AMenu)
|
|
||||||
{
|
|
||||||
((AMenu)top).getWindowManager().add(frame);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* Exit System
|
* Exit System
|
||||||
* @param status System exit status (usually 0 for no error)
|
* @param status System exit status (usually 0 for no error)
|
||||||
|
@ -572,26 +552,6 @@ public final class AEnv
|
||||||
Env.exitEnv(status);
|
Env.exitEnv(status);
|
||||||
} // exit
|
} // exit
|
||||||
|
|
||||||
public static void logout()
|
|
||||||
{
|
|
||||||
if (s_server != null)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
s_server.remove();
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Env.logout();
|
|
||||||
|
|
||||||
Splash.getSplash().setVisible(true);
|
|
||||||
|
|
||||||
//reload
|
|
||||||
new AMenu();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Is Workflow Process view enabled.
|
* Is Workflow Process view enabled.
|
||||||
* @return true if enabled
|
* @return true if enabled
|
||||||
|
@ -648,14 +608,7 @@ public final class AEnv
|
||||||
AWindow frame = new AWindow();
|
AWindow frame = new AWindow();
|
||||||
if (!frame.initWindow(s_workflow_Window_ID, query))
|
if (!frame.initWindow(s_workflow_Window_ID, query))
|
||||||
return;
|
return;
|
||||||
addToWindowManager(frame);
|
AEnv.showCenterScreen(frame);
|
||||||
if (Ini.isPropertyBool(Ini.P_OPEN_WINDOW_MAXIMIZED) ) {
|
|
||||||
frame.pack();
|
|
||||||
frame.setExtendedState(Frame.MAXIMIZED_BOTH);
|
|
||||||
frame.setVisible(true);
|
|
||||||
frame.toFront();
|
|
||||||
} else
|
|
||||||
AEnv.showCenterScreen(frame);
|
|
||||||
frame = null;
|
frame = null;
|
||||||
} // startWorkflowProcess
|
} // startWorkflowProcess
|
||||||
|
|
||||||
|
@ -909,32 +862,4 @@ public final class AEnv
|
||||||
}
|
}
|
||||||
} // cacheReset
|
} // cacheReset
|
||||||
|
|
||||||
/**
|
|
||||||
* Update all windows after look and feel changes.
|
|
||||||
* @since 2006-11-27
|
|
||||||
*/
|
|
||||||
public static void updateUI()
|
|
||||||
{
|
|
||||||
Set<Window> updated = Env.updateUI();
|
|
||||||
JFrame top = Env.getWindow(0);
|
|
||||||
if (top instanceof AMenu)
|
|
||||||
{
|
|
||||||
CFrame[] frames = ((AMenu)top).getWindowManager().getWindows();
|
|
||||||
for (CFrame f : frames)
|
|
||||||
{
|
|
||||||
if (updated.contains(f)) continue;
|
|
||||||
SwingUtilities.updateComponentTreeUI(f);
|
|
||||||
f.validate();
|
|
||||||
RepaintManager mgr = RepaintManager.currentManager(f);
|
|
||||||
Component childs[] = f.getComponents();
|
|
||||||
for (Component c : childs) {
|
|
||||||
if (c instanceof JComponent)
|
|
||||||
mgr.markCompletelyDirty((JComponent)c);
|
|
||||||
}
|
|
||||||
f.repaint();
|
|
||||||
updated.add(f);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} // AEnv
|
} // AEnv
|
|
@ -408,7 +408,6 @@ public final class ALogin extends CDialog
|
||||||
connectionOK(); // first ok
|
connectionOK(); // first ok
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
|
|
||||||
m_okPressed = true;
|
m_okPressed = true;
|
||||||
defaultsOK(); // disposes
|
defaultsOK(); // disposes
|
||||||
}
|
}
|
||||||
|
@ -548,7 +547,7 @@ public final class ALogin extends CDialog
|
||||||
m_pwd = new String (passwordField.getPassword());
|
m_pwd = new String (passwordField.getPassword());
|
||||||
|
|
||||||
// Establish connection
|
// Establish connection
|
||||||
connectToDatabase();
|
DB.setDBTarget(CConnection.get());
|
||||||
if (!DB.isConnected())
|
if (!DB.isConnected())
|
||||||
{
|
{
|
||||||
statusBar.setStatusLine(txt_NoDatabase, true);
|
statusBar.setStatusLine(txt_NoDatabase, true);
|
||||||
|
|
|
@ -35,6 +35,7 @@ import org.compiere.grid.tree.*;
|
||||||
import org.compiere.model.*;
|
import org.compiere.model.*;
|
||||||
import org.compiere.swing.*;
|
import org.compiere.swing.*;
|
||||||
import org.compiere.util.*;
|
import org.compiere.util.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Application Menu Controller
|
* Application Menu Controller
|
||||||
*
|
*
|
||||||
|
@ -57,9 +58,6 @@ public final class AMenu extends CFrame
|
||||||
// Login
|
// Login
|
||||||
initSystem (splash); // login
|
initSystem (splash); // login
|
||||||
splash.setText(Msg.getMsg(m_ctx, "Loading"));
|
splash.setText(Msg.getMsg(m_ctx, "Loading"));
|
||||||
splash.toFront();
|
|
||||||
splash.paint(splash.getGraphics());
|
|
||||||
|
|
||||||
//
|
//
|
||||||
Adempiere.startupEnvironment(true); // Load Environment
|
Adempiere.startupEnvironment(true); // Load Environment
|
||||||
MSession.get (Env.getCtx(), true); // Start Session
|
MSession.get (Env.getCtx(), true); // Start Session
|
||||||
|
@ -136,8 +134,6 @@ public final class AMenu extends CFrame
|
||||||
/** Logger */
|
/** Logger */
|
||||||
private static CLogger log = CLogger.getCLogger(AMenu.class);
|
private static CLogger log = CLogger.getCLogger(AMenu.class);
|
||||||
|
|
||||||
private WindowManager windowManager = new WindowManager();
|
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* Init System.
|
* Init System.
|
||||||
|
@ -274,7 +270,6 @@ public final class AMenu extends CFrame
|
||||||
m_tabActivities++;
|
m_tabActivities++;
|
||||||
m_tabWorkflow++;
|
m_tabWorkflow++;
|
||||||
}
|
}
|
||||||
treePanel.setBorder(BorderFactory.createEmptyBorder(2,3,2,3));
|
|
||||||
centerPane.add(treePanel, Msg.getMsg(m_ctx, "Menu"));
|
centerPane.add(treePanel, Msg.getMsg(m_ctx, "Menu"));
|
||||||
centerPane.add(new CScrollPane(wfActivity), Msg.getMsg (m_ctx, "WorkflowActivities") + ": 0");
|
centerPane.add(new CScrollPane(wfActivity), Msg.getMsg (m_ctx, "WorkflowActivities") + ": 0");
|
||||||
centerPane.add(new CScrollPane(wfPanel), Msg.getMsg (m_ctx, "WorkflowPanel"));
|
centerPane.add(new CScrollPane(wfPanel), Msg.getMsg (m_ctx, "WorkflowPanel"));
|
||||||
|
@ -317,7 +312,6 @@ public final class AMenu extends CFrame
|
||||||
AEnv.addMenuItem("PrintScreen", null, KeyStroke.getKeyStroke(KeyEvent.VK_PRINTSCREEN, 0), mFile, this);
|
AEnv.addMenuItem("PrintScreen", null, KeyStroke.getKeyStroke(KeyEvent.VK_PRINTSCREEN, 0), mFile, this);
|
||||||
AEnv.addMenuItem("ScreenShot", null, KeyStroke.getKeyStroke(KeyEvent.VK_PRINTSCREEN, KeyEvent.SHIFT_MASK), mFile, this);
|
AEnv.addMenuItem("ScreenShot", null, KeyStroke.getKeyStroke(KeyEvent.VK_PRINTSCREEN, KeyEvent.SHIFT_MASK), mFile, this);
|
||||||
mFile.addSeparator();
|
mFile.addSeparator();
|
||||||
AEnv.addMenuItem("Logout", null, KeyStroke.getKeyStroke(KeyEvent.VK_L, Event.SHIFT_MASK+Event.ALT_MASK), mFile, this);
|
|
||||||
AEnv.addMenuItem("Exit", null, KeyStroke.getKeyStroke(KeyEvent.VK_X, Event.SHIFT_MASK+Event.ALT_MASK), mFile, this);
|
AEnv.addMenuItem("Exit", null, KeyStroke.getKeyStroke(KeyEvent.VK_X, Event.SHIFT_MASK+Event.ALT_MASK), mFile, this);
|
||||||
|
|
||||||
// View
|
// View
|
||||||
|
@ -352,10 +346,6 @@ public final class AMenu extends CFrame
|
||||||
AEnv.addMenuItem("Preference", null, null, mTools, this);
|
AEnv.addMenuItem("Preference", null, null, mTools, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Window Menu
|
|
||||||
JMenu mWindow = new WindowMenu(windowManager, this);
|
|
||||||
menuBar.add(mWindow);
|
|
||||||
|
|
||||||
// Help
|
// Help
|
||||||
JMenu mHelp = AEnv.getMenu("Help");
|
JMenu mHelp = AEnv.getMenu("Help");
|
||||||
menuBar.add(mHelp);
|
menuBar.add(mHelp);
|
||||||
|
@ -378,14 +368,6 @@ public final class AMenu extends CFrame
|
||||||
AEnv.exit(0);
|
AEnv.exit(0);
|
||||||
} // dispose
|
} // dispose
|
||||||
|
|
||||||
public void logout()
|
|
||||||
{
|
|
||||||
windowManager.close();
|
|
||||||
Ini.saveProperties(true);
|
|
||||||
super.dispose();
|
|
||||||
AEnv.logout();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Window Events - requestFocus
|
* Window Events - requestFocus
|
||||||
* @param e event
|
* @param e event
|
||||||
|
@ -611,9 +593,6 @@ public final class AMenu extends CFrame
|
||||||
wfActivity.display();
|
wfActivity.display();
|
||||||
} // stateChanged
|
} // stateChanged
|
||||||
|
|
||||||
public WindowManager getWindowManager() {
|
|
||||||
return windowManager;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* Mouse Listener
|
* Mouse Listener
|
||||||
|
|
|
@ -206,22 +206,11 @@ public class AMenuStartItem extends Thread implements ActionListener
|
||||||
*/
|
*/
|
||||||
private void startWindow(int AD_Workbench_ID, int AD_Window_ID)
|
private void startWindow(int AD_Workbench_ID, int AD_Window_ID)
|
||||||
{
|
{
|
||||||
AWindow frame = (AWindow)Env.showWindow(AD_Window_ID);
|
if (Env.showWindow(AD_Window_ID))
|
||||||
if (frame != null) {
|
|
||||||
m_menu.getWindowManager().add(frame);
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
if (Ini.isPropertyBool(Ini.P_SINGLE_INSTANCE_PER_WINDOW)) {
|
|
||||||
frame = m_menu.getWindowManager().find(AD_Window_ID);
|
|
||||||
if ( frame != null ) {
|
|
||||||
frame.toFront();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SwingUtilities.invokeLater(m_updatePB); // 1
|
SwingUtilities.invokeLater(m_updatePB); // 1
|
||||||
frame = new AWindow();
|
AWindow frame = new AWindow();
|
||||||
boolean OK = false;
|
boolean OK = false;
|
||||||
if (AD_Workbench_ID != 0)
|
if (AD_Workbench_ID != 0)
|
||||||
OK = frame.initWorkbench(AD_Workbench_ID);
|
OK = frame.initWorkbench(AD_Workbench_ID);
|
||||||
|
@ -232,19 +221,10 @@ public class AMenuStartItem extends Thread implements ActionListener
|
||||||
|
|
||||||
SwingUtilities.invokeLater(m_updatePB); // 2
|
SwingUtilities.invokeLater(m_updatePB); // 2
|
||||||
frame.pack();
|
frame.pack();
|
||||||
if (Ini.isPropertyBool(Ini.P_OPEN_WINDOW_MAXIMIZED) )
|
|
||||||
frame.setExtendedState(Frame.MAXIMIZED_BOTH);
|
|
||||||
|
|
||||||
// Center the window
|
// Center the window
|
||||||
SwingUtilities.invokeLater(m_updatePB); // 3
|
SwingUtilities.invokeLater(m_updatePB); // 3
|
||||||
if (Ini.isPropertyBool(Ini.P_OPEN_WINDOW_MAXIMIZED) ) {
|
AEnv.showCenterScreen(frame);
|
||||||
frame.setVisible(true);
|
|
||||||
frame.toFront();
|
|
||||||
} else
|
|
||||||
AEnv.showCenterScreen(frame);
|
|
||||||
|
|
||||||
m_menu.getWindowManager().add(frame);
|
|
||||||
|
|
||||||
// if (wfPanel.isVisible())
|
// if (wfPanel.isVisible())
|
||||||
// m_WF_Window = frame; // maintain one reference
|
// m_WF_Window = frame; // maintain one reference
|
||||||
frame = null;
|
frame = null;
|
||||||
|
@ -267,11 +247,8 @@ public class AMenuStartItem extends Thread implements ActionListener
|
||||||
if (!pd.init())
|
if (!pd.init())
|
||||||
return;
|
return;
|
||||||
m_timer.start();
|
m_timer.start();
|
||||||
m_menu.getWindowManager().add(pd);
|
|
||||||
|
|
||||||
SwingUtilities.invokeLater(m_updatePB); // 2
|
SwingUtilities.invokeLater(m_updatePB); // 2
|
||||||
pd.getContentPane().invalidate();
|
|
||||||
pd.getContentPane().validate();
|
|
||||||
pd.pack();
|
pd.pack();
|
||||||
// Center the window
|
// Center the window
|
||||||
SwingUtilities.invokeLater(m_updatePB); // 3
|
SwingUtilities.invokeLater(m_updatePB); // 3
|
||||||
|
@ -306,7 +283,7 @@ public class AMenuStartItem extends Thread implements ActionListener
|
||||||
return;
|
return;
|
||||||
|
|
||||||
SwingUtilities.invokeLater(m_updatePB); // 2
|
SwingUtilities.invokeLater(m_updatePB); // 2
|
||||||
m_menu.getWindowManager().add(new ATask(m_name, task));
|
new ATask(m_name, task);
|
||||||
// ATask.start(m_name, task);
|
// ATask.start(m_name, task);
|
||||||
} // startTask
|
} // startTask
|
||||||
|
|
||||||
|
@ -316,29 +293,14 @@ public class AMenuStartItem extends Thread implements ActionListener
|
||||||
*/
|
*/
|
||||||
private void startForm (int AD_Form_ID)
|
private void startForm (int AD_Form_ID)
|
||||||
{
|
{
|
||||||
FormFrame ff = null;
|
FormFrame ff = new FormFrame();
|
||||||
if (Ini.isPropertyBool(Ini.P_SINGLE_INSTANCE_PER_WINDOW)) {
|
|
||||||
ff = m_menu.getWindowManager().findForm(AD_Form_ID);
|
|
||||||
if ( ff != null ) {
|
|
||||||
ff.toFront();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ff = new FormFrame();
|
|
||||||
m_menu.getWindowManager().add(ff);
|
|
||||||
SwingUtilities.invokeLater(m_updatePB); // 1
|
SwingUtilities.invokeLater(m_updatePB); // 1
|
||||||
ff.openForm(AD_Form_ID);
|
ff.openForm(AD_Form_ID);
|
||||||
SwingUtilities.invokeLater(m_updatePB); // 2
|
SwingUtilities.invokeLater(m_updatePB); // 2
|
||||||
|
ff.pack();
|
||||||
// Center the window
|
// Center the window
|
||||||
SwingUtilities.invokeLater(m_updatePB); // 3
|
SwingUtilities.invokeLater(m_updatePB); // 3
|
||||||
if (Ini.isPropertyBool(Ini.P_OPEN_WINDOW_MAXIMIZED) ) {
|
AEnv.showCenterScreen(ff);
|
||||||
ff.pack();
|
|
||||||
ff.setExtendedState(Frame.MAXIMIZED_BOTH);
|
|
||||||
ff.setVisible(true);
|
|
||||||
ff.toFront();
|
|
||||||
} else
|
|
||||||
AEnv.showCenterScreen(ff);
|
|
||||||
} // startForm
|
} // startForm
|
||||||
|
|
||||||
} // StartItem
|
} // StartItem
|
|
@ -52,11 +52,9 @@ public final class APanel extends CPanel
|
||||||
* Constructs a new instance.
|
* Constructs a new instance.
|
||||||
* Need to call initPanel for dynamic initialization
|
* Need to call initPanel for dynamic initialization
|
||||||
*/
|
*/
|
||||||
public APanel(AWindow window)
|
public APanel()
|
||||||
{
|
{
|
||||||
super();
|
super();
|
||||||
m_window = window;
|
|
||||||
|
|
||||||
m_ctx = Env.getCtx();
|
m_ctx = Env.getCtx();
|
||||||
//
|
//
|
||||||
try
|
try
|
||||||
|
@ -73,8 +71,6 @@ public final class APanel extends CPanel
|
||||||
/** Logger */
|
/** Logger */
|
||||||
private static CLogger log = CLogger.getCLogger(APanel.class);
|
private static CLogger log = CLogger.getCLogger(APanel.class);
|
||||||
|
|
||||||
private AWindow m_window;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dispose
|
* Dispose
|
||||||
*/
|
*/
|
||||||
|
@ -148,8 +144,6 @@ public final class APanel extends CPanel
|
||||||
this.add(northPanel, BorderLayout.NORTH);
|
this.add(northPanel, BorderLayout.NORTH);
|
||||||
northPanel.setLayout(northLayout);
|
northPanel.setLayout(northLayout);
|
||||||
northLayout.setAlignment(FlowLayout.LEFT);
|
northLayout.setAlignment(FlowLayout.LEFT);
|
||||||
toolBar.putClientProperty("JToolBar.isRollover", Boolean.TRUE);
|
|
||||||
toolBar.setBorderPainted(false);
|
|
||||||
northPanel.add(toolBar, null);
|
northPanel.add(toolBar, null);
|
||||||
} // jbInit
|
} // jbInit
|
||||||
|
|
||||||
|
@ -186,7 +180,6 @@ public final class APanel extends CPanel
|
||||||
aPrint = addAction("Print", mFile, KeyStroke.getKeyStroke(KeyEvent.VK_F12, 0), false);
|
aPrint = addAction("Print", mFile, KeyStroke.getKeyStroke(KeyEvent.VK_F12, 0), false);
|
||||||
mFile.addSeparator();
|
mFile.addSeparator();
|
||||||
aEnd = addAction("End", mFile, KeyStroke.getKeyStroke(KeyEvent.VK_X, Event.ALT_MASK), false);
|
aEnd = addAction("End", mFile, KeyStroke.getKeyStroke(KeyEvent.VK_X, Event.ALT_MASK), false);
|
||||||
aLogout = addAction("Logout", mFile, KeyStroke.getKeyStroke(KeyEvent.VK_L, Event.SHIFT_MASK+Event.ALT_MASK), false);
|
|
||||||
aExit = addAction("Exit", mFile, KeyStroke.getKeyStroke(KeyEvent.VK_X, Event.SHIFT_MASK+Event.ALT_MASK), false);
|
aExit = addAction("Exit", mFile, KeyStroke.getKeyStroke(KeyEvent.VK_X, Event.SHIFT_MASK+Event.ALT_MASK), false);
|
||||||
// Edit
|
// Edit
|
||||||
JMenu mEdit = AEnv.getMenu("Edit");
|
JMenu mEdit = AEnv.getMenu("Edit");
|
||||||
|
@ -256,12 +249,6 @@ public final class APanel extends CPanel
|
||||||
mTools.addSeparator();
|
mTools.addSeparator();
|
||||||
aPreference = addAction("Preference", mTools, null, false);
|
aPreference = addAction("Preference", mTools, null, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Window
|
|
||||||
AMenu aMenu = (AMenu)Env.getWindow(0);
|
|
||||||
JMenu mWindow = new WindowMenu(aMenu.getWindowManager(), m_window);
|
|
||||||
menuBar.add(mWindow);
|
|
||||||
|
|
||||||
// Help
|
// Help
|
||||||
JMenu mHelp = AEnv.getMenu("Help");
|
JMenu mHelp = AEnv.getMenu("Help");
|
||||||
menuBar.add(mHelp);
|
menuBar.add(mHelp);
|
||||||
|
@ -330,10 +317,10 @@ public final class APanel extends CPanel
|
||||||
if (menu != null)
|
if (menu != null)
|
||||||
menu.add(action.getMenuItem());
|
menu.add(action.getMenuItem());
|
||||||
action.setDelegate(this);
|
action.setDelegate(this);
|
||||||
AbstractButton b = action.getButton();
|
// AbstractButton b = action.getButton();
|
||||||
String s = null;
|
// String s = null;
|
||||||
if (b != null)
|
// if (b != null)
|
||||||
s = b.getToolTipText();
|
// s = b.getToolTipText();
|
||||||
|
|
||||||
// Key Strokes
|
// Key Strokes
|
||||||
if (accelerator != null)
|
if (accelerator != null)
|
||||||
|
@ -825,7 +812,8 @@ public final class APanel extends CPanel
|
||||||
aSave.setEnabled(changed && !readOnly);
|
aSave.setEnabled(changed && !readOnly);
|
||||||
//
|
//
|
||||||
// No Rows
|
// No Rows
|
||||||
if (e.getTotalRows() == 0 && insertRecord) {
|
if (e.getTotalRows() == 0 && insertRecord)
|
||||||
|
{
|
||||||
aNew.setEnabled(true);
|
aNew.setEnabled(true);
|
||||||
aDelete.setEnabled(false);
|
aDelete.setEnabled(false);
|
||||||
aDeleteSelection.setEnabled(false);
|
aDeleteSelection.setEnabled(false);
|
||||||
|
@ -932,8 +920,6 @@ public final class APanel extends CPanel
|
||||||
boolean back = false;
|
boolean back = false;
|
||||||
boolean isAPanelTab = false;
|
boolean isAPanelTab = false;
|
||||||
|
|
||||||
int previousIndex = 0;
|
|
||||||
|
|
||||||
// Workbench Tab Change
|
// Workbench Tab Change
|
||||||
if (tp.isWorkbench())
|
if (tp.isWorkbench())
|
||||||
{
|
{
|
||||||
|
@ -960,8 +946,6 @@ public final class APanel extends CPanel
|
||||||
log.info("Tab=" + tp);
|
log.info("Tab=" + tp);
|
||||||
m_curWinTab = tp;
|
m_curWinTab = tp;
|
||||||
int tpIndex = m_curWinTab.getSelectedIndex();
|
int tpIndex = m_curWinTab.getSelectedIndex();
|
||||||
// detect no tab change
|
|
||||||
if (tpIndex == m_curTabIndex) return;
|
|
||||||
back = tpIndex < m_curTabIndex;
|
back = tpIndex < m_curTabIndex;
|
||||||
GridController gc = null;
|
GridController gc = null;
|
||||||
if (m_curWinTab.getSelectedComponent() instanceof GridController)
|
if (m_curWinTab.getSelectedComponent() instanceof GridController)
|
||||||
|
@ -1017,7 +1001,6 @@ public final class APanel extends CPanel
|
||||||
// if (m_curTabIndex >= 0)
|
// if (m_curTabIndex >= 0)
|
||||||
// m_curWinTab.setForegroundAt(m_curTabIndex, AdempierePLAF.getTextColor_Normal());
|
// m_curWinTab.setForegroundAt(m_curTabIndex, AdempierePLAF.getTextColor_Normal());
|
||||||
// m_curWinTab.setForegroundAt(tpIndex, AdempierePLAF.getTextColor_OK());
|
// m_curWinTab.setForegroundAt(tpIndex, AdempierePLAF.getTextColor_OK());
|
||||||
previousIndex = m_curTabIndex;
|
|
||||||
m_curTabIndex = tpIndex;
|
m_curTabIndex = tpIndex;
|
||||||
if (!isAPanelTab)
|
if (!isAPanelTab)
|
||||||
m_curGC = gc;
|
m_curGC = gc;
|
||||||
|
@ -1042,14 +1025,6 @@ public final class APanel extends CPanel
|
||||||
{
|
{
|
||||||
MRole role = MRole.getDefault();
|
MRole role = MRole.getDefault();
|
||||||
m_curGC.query (m_onlyCurrentRows, m_onlyCurrentDays, role.getMaxQueryRecords());
|
m_curGC.query (m_onlyCurrentRows, m_onlyCurrentDays, role.getMaxQueryRecords());
|
||||||
if (m_curGC.isNeedToSaveParent())
|
|
||||||
{
|
|
||||||
// there is a problem, so we go back
|
|
||||||
ADialog.error(m_curWindowNo, this, "SaveParentFirst");
|
|
||||||
m_curWinTab.setSelectedIndex(previousIndex);
|
|
||||||
setBusy(false, true);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set initial record
|
// Set initial record
|
||||||
|
@ -1262,8 +1237,6 @@ public final class APanel extends CPanel
|
||||||
else if (cmd.equals(aHelp.getName()))
|
else if (cmd.equals(aHelp.getName()))
|
||||||
cmd_help();
|
cmd_help();
|
||||||
// General Commands (Environment)
|
// General Commands (Environment)
|
||||||
else if (cmd.equals(aLogout.getName()))
|
|
||||||
cmd_logout();
|
|
||||||
else if (!AEnv.actionPerformed (e.getActionCommand(), m_curWindowNo, this))
|
else if (!AEnv.actionPerformed (e.getActionCommand(), m_curWindowNo, this))
|
||||||
log.log(Level.SEVERE, "No action for: " + cmd);
|
log.log(Level.SEVERE, "No action for: " + cmd);
|
||||||
}
|
}
|
||||||
|
@ -1281,15 +1254,6 @@ public final class APanel extends CPanel
|
||||||
setBusy(false, true);
|
setBusy(false, true);
|
||||||
} // actionPerformed
|
} // actionPerformed
|
||||||
|
|
||||||
private void cmd_logout() {
|
|
||||||
JFrame top = Env.getWindow(0);
|
|
||||||
if (top instanceof AMenu) {
|
|
||||||
((AMenu)top).logout();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create New Record
|
* Create New Record
|
||||||
* @param copy true if current record is to be copied
|
* @param copy true if current record is to be copied
|
||||||
|
@ -1373,7 +1337,8 @@ public final class APanel extends CPanel
|
||||||
Arrays.sort(indices);
|
Arrays.sort(indices);
|
||||||
int offset = 0;
|
int offset = 0;
|
||||||
for (int i = 0; i < indices.length; i++) {
|
for (int i = 0; i < indices.length; i++) {
|
||||||
m_curTab.setCurrentRow(indices[i]-offset);
|
//m_curTab.setCurrentRow(indices[i]-offset);
|
||||||
|
m_curTab.navigate(indices[i]-offset);
|
||||||
int keyID = m_curTab.getRecord_ID();
|
int keyID = m_curTab.getRecord_ID();
|
||||||
if (m_curTab.dataDelete()){
|
if (m_curTab.dataDelete()){
|
||||||
m_curGC.rowChanged(false, keyID);
|
m_curGC.rowChanged(false, keyID);
|
||||||
|
@ -1398,7 +1363,6 @@ public final class APanel extends CPanel
|
||||||
log.config("Manual=" + manualCmd);
|
log.config("Manual=" + manualCmd);
|
||||||
m_errorDisplayed = false;
|
m_errorDisplayed = false;
|
||||||
m_curGC.stopEditor(true);
|
m_curGC.stopEditor(true);
|
||||||
boolean saveOK = true;
|
|
||||||
|
|
||||||
if (m_curAPanelTab != null)
|
if (m_curAPanelTab != null)
|
||||||
{
|
{
|
||||||
|
@ -1578,6 +1542,8 @@ public final class APanel extends CPanel
|
||||||
int table_ID = m_curTab.getAD_Table_ID();
|
int table_ID = m_curTab.getAD_Table_ID();
|
||||||
int record_ID = m_curTab.getRecord_ID();
|
int record_ID = m_curTab.getRecord_ID();
|
||||||
ProcessInfo pi = new ProcessInfo (getTitle(), AD_Process_ID, table_ID, record_ID);
|
ProcessInfo pi = new ProcessInfo (getTitle(), AD_Process_ID, table_ID, record_ID);
|
||||||
|
pi.setAD_User_ID (Env.getAD_User_ID(m_ctx));
|
||||||
|
pi.setAD_Client_ID (Env.getAD_Client_ID(m_ctx));
|
||||||
|
|
||||||
ProcessCtl.process(this, m_curWindowNo, pi, null); // calls lockUI, unlockUI
|
ProcessCtl.process(this, m_curWindowNo, pi, null); // calls lockUI, unlockUI
|
||||||
} // cmd_print
|
} // cmd_print
|
||||||
|
@ -1621,7 +1587,8 @@ public final class APanel extends CPanel
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Attachment va = new Attachment (Env.getFrame(this), m_curWindowNo,
|
// Attachment va =
|
||||||
|
new Attachment (Env.getFrame(this), m_curWindowNo,
|
||||||
m_curTab.getAD_AttachmentID(), m_curTab.getAD_Table_ID(), record_ID, null);
|
m_curTab.getAD_AttachmentID(), m_curTab.getAD_Table_ID(), record_ID, null);
|
||||||
//
|
//
|
||||||
m_curTab.loadAttachments(); // reload
|
m_curTab.loadAttachments(); // reload
|
||||||
|
@ -1656,7 +1623,8 @@ public final class APanel extends CPanel
|
||||||
}
|
}
|
||||||
String description = infoName + ": " + infoDisplay;
|
String description = infoName + ": " + infoDisplay;
|
||||||
//
|
//
|
||||||
AChat va = new AChat (Env.getFrame(this), m_curWindowNo,
|
// AChat va =
|
||||||
|
new AChat (Env.getFrame(this), m_curWindowNo,
|
||||||
m_curTab.getCM_ChatID(), m_curTab.getAD_Table_ID(), record_ID,
|
m_curTab.getCM_ChatID(), m_curTab.getAD_Table_ID(), record_ID,
|
||||||
description, null);
|
description, null);
|
||||||
//
|
//
|
||||||
|
|
|
@ -184,7 +184,6 @@ public class ARequest implements ActionListener
|
||||||
AWindow frame = new AWindow();
|
AWindow frame = new AWindow();
|
||||||
if (!frame.initWindow(AD_Window_ID, query))
|
if (!frame.initWindow(AD_Window_ID, query))
|
||||||
return;
|
return;
|
||||||
AEnv.addToWindowManager(frame);
|
|
||||||
// New - set Table/Record
|
// New - set Table/Record
|
||||||
if (e.getSource() == m_new)
|
if (e.getSource() == m_new)
|
||||||
{
|
{
|
||||||
|
|
|
@ -49,8 +49,7 @@ public class AWindow extends CFrame
|
||||||
/** The GlassPane */
|
/** The GlassPane */
|
||||||
private AGlassPane m_glassPane = new AGlassPane();
|
private AGlassPane m_glassPane = new AGlassPane();
|
||||||
/** Application Window */
|
/** Application Window */
|
||||||
private APanel m_APanel = new APanel(this);
|
private APanel m_APanel = new APanel();
|
||||||
|
|
||||||
/** Logger */
|
/** Logger */
|
||||||
private static CLogger log = CLogger.getCLogger(AWindow.class);
|
private static CLogger log = CLogger.getCLogger(AWindow.class);
|
||||||
|
|
||||||
|
|
|
@ -190,7 +190,6 @@ public class AZoomAcross implements ActionListener
|
||||||
AWindow frame = new AWindow();
|
AWindow frame = new AWindow();
|
||||||
if (!frame.initWindow(AD_Window_ID, m_query))
|
if (!frame.initWindow(AD_Window_ID, m_query))
|
||||||
return;
|
return;
|
||||||
AEnv.addToWindowManager(frame);
|
|
||||||
AEnv.showCenterScreen(frame);
|
AEnv.showCenterScreen(frame);
|
||||||
frame = null;
|
frame = null;
|
||||||
} // launchZoom
|
} // launchZoom
|
||||||
|
|
|
@ -130,7 +130,7 @@ public final class AppsAction extends AbstractAction
|
||||||
//
|
//
|
||||||
if (accelerator != null)
|
if (accelerator != null)
|
||||||
{
|
{
|
||||||
m_button.getInputMap(CButton.WHEN_IN_FOCUSED_WINDOW).put(accelerator, action);
|
m_button.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(accelerator, action);
|
||||||
m_button.getActionMap().put(action, this);
|
m_button.getActionMap().put(action, this);
|
||||||
}
|
}
|
||||||
} // Action
|
} // Action
|
||||||
|
@ -159,8 +159,8 @@ public final class AppsAction extends AbstractAction
|
||||||
*/
|
*/
|
||||||
private ImageIcon getIcon(String name, boolean small)
|
private ImageIcon getIcon(String name, boolean small)
|
||||||
{
|
{
|
||||||
String fullName = name + (small ? "16" : "24");
|
String fullName = name + (small ? "16.gif" : "24.gif");
|
||||||
return Env.getImageIcon2(fullName);
|
return Env.getImageIcon(fullName);
|
||||||
} // getIcon
|
} // getIcon
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -0,0 +1,662 @@
|
||||||
|
/******************************************************************************
|
||||||
|
* Product: Adempiere ERP & CRM Smart Business Solution *
|
||||||
|
* Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. *
|
||||||
|
* 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. *
|
||||||
|
* For the text or an alternative of this public license, you may reach us *
|
||||||
|
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
|
||||||
|
* or via info@compiere.org or http://www.compiere.org/license.html *
|
||||||
|
*****************************************************************************/
|
||||||
|
package org.compiere.apps;
|
||||||
|
|
||||||
|
import java.awt.*;
|
||||||
|
import java.awt.event.*;
|
||||||
|
import java.io.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.logging.*;
|
||||||
|
import javax.swing.*;
|
||||||
|
import javax.swing.border.Border;
|
||||||
|
import javax.swing.event.*;
|
||||||
|
import javax.swing.plaf.metal.MetalLookAndFeel;
|
||||||
|
import javax.swing.plaf.metal.MetalTheme;
|
||||||
|
import javax.swing.table.*;
|
||||||
|
//
|
||||||
|
import org.adempiere.plaf.PLAFEditor;
|
||||||
|
import org.adempiere.plaf.PLAFEditorPanel;
|
||||||
|
import org.adempiere.plaf.AdempierePLAF;
|
||||||
|
import org.compiere.db.*;
|
||||||
|
import org.compiere.grid.ed.*;
|
||||||
|
import org.compiere.minigrid.*;
|
||||||
|
import org.compiere.model.*;
|
||||||
|
import org.compiere.plaf.*;
|
||||||
|
import org.compiere.print.*;
|
||||||
|
import org.compiere.swing.*;
|
||||||
|
import org.compiere.util.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customize settings like L&F, AutoCommit, etc. & Diagnostics
|
||||||
|
*
|
||||||
|
* @author Jorg Janke
|
||||||
|
* @version $Id: Preference.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $
|
||||||
|
*
|
||||||
|
* @author Low Heng Sin
|
||||||
|
* @version 2006-11-27
|
||||||
|
*/
|
||||||
|
public final class Preference extends CDialog
|
||||||
|
implements ActionListener, ListSelectionListener
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Standard Constructor
|
||||||
|
* @param frame frame
|
||||||
|
* @param WindowNo window
|
||||||
|
*/
|
||||||
|
public Preference(Frame frame, int WindowNo)
|
||||||
|
{
|
||||||
|
super(frame, Msg.getMsg(Env.getCtx(), "Preference"), true);
|
||||||
|
log.config("Preference");
|
||||||
|
try
|
||||||
|
{
|
||||||
|
jbInit();
|
||||||
|
}
|
||||||
|
catch(Exception ex)
|
||||||
|
{
|
||||||
|
log.log(Level.SEVERE, ex.getMessage());
|
||||||
|
}
|
||||||
|
load();
|
||||||
|
//
|
||||||
|
StringBuffer sta = new StringBuffer("#");
|
||||||
|
sta.append(Env.getCtx().size()).append(" - ")
|
||||||
|
.append(Msg.translate(Env.getCtx(), "AD_Window_ID"))
|
||||||
|
.append("=").append(WindowNo);
|
||||||
|
statusBar.setStatusLine(sta.toString());
|
||||||
|
statusBar.setStatusDB("");
|
||||||
|
AEnv.positionCenterWindow(frame, this);
|
||||||
|
} // Preference
|
||||||
|
|
||||||
|
/** Logger */
|
||||||
|
private static CLogger log = CLogger.getCLogger(Preference.class);
|
||||||
|
|
||||||
|
private CPanel panel = new CPanel();
|
||||||
|
private BorderLayout panelLayout = new BorderLayout();
|
||||||
|
private CTabbedPane tabPane = new CTabbedPane();
|
||||||
|
private CPanel customizePane = new CPanel();
|
||||||
|
private CPanel contextPane = new CPanel();
|
||||||
|
private GridBagLayout customizeLayout = new GridBagLayout();
|
||||||
|
private CCheckBox autoCommit = new CCheckBox();
|
||||||
|
private CCheckBox autoNew = new CCheckBox();
|
||||||
|
private CCheckBox printPreview = new CCheckBox();
|
||||||
|
private CCheckBox validateConnectionOnStartup = new CCheckBox();
|
||||||
|
private CCheckBox singleInstancePerWindow = new CCheckBox();
|
||||||
|
private CCheckBox openWindowMaximized = new CCheckBox();
|
||||||
|
private CPanel southPanel = new CPanel();
|
||||||
|
private BorderLayout southLayout = new BorderLayout();
|
||||||
|
private BorderLayout icontextLayout = new BorderLayout();
|
||||||
|
private JList infoList = new JList();
|
||||||
|
private JScrollPane contextListScrollPane = new JScrollPane(infoList);
|
||||||
|
private CPanel contextSouthPanel = new CPanel();
|
||||||
|
private CTextArea contextHeader = new CTextArea(4,15);
|
||||||
|
private CTextArea contextDetail = new CTextArea(4,35);
|
||||||
|
private CTextArea infoArea = new CTextArea(5, 30);
|
||||||
|
private BorderLayout contextSouthLayout = new BorderLayout();
|
||||||
|
private StatusBar statusBar = new StatusBar();
|
||||||
|
private ConfirmPanel confirm = new ConfirmPanel(true);
|
||||||
|
private CComboBox traceLevel = new CComboBox(CLogMgt.LEVELS);
|
||||||
|
private CLabel traceLabel = new CLabel();
|
||||||
|
private CCheckBox traceFile = new CCheckBox();
|
||||||
|
private CCheckBox autoLogin = new CCheckBox();
|
||||||
|
private CCheckBox adempiereSys = new CCheckBox();
|
||||||
|
private CCheckBox storePassword = new CCheckBox();
|
||||||
|
private CCheckBox showTrl = new CCheckBox();
|
||||||
|
private CCheckBox showAcct = new CCheckBox();
|
||||||
|
private CCheckBox showAdvanced = new CCheckBox();
|
||||||
|
private CCheckBox cacheWindow = new CCheckBox();
|
||||||
|
private CButton uiTheme = new CButton();
|
||||||
|
private CLabel lPrinter = new CLabel();
|
||||||
|
private CPrinter fPrinter = new CPrinter();
|
||||||
|
private CLabel lDate = new CLabel();
|
||||||
|
private VDate fDate = new VDate();
|
||||||
|
private CComboBox connectionProfile = new CComboBox(CConnection.CONNECTIONProfiles);
|
||||||
|
private CLabel connectionProfileLabel = new CLabel();
|
||||||
|
private CPanel errorPane = new CPanel();
|
||||||
|
private BorderLayout errorLayout = new BorderLayout();
|
||||||
|
private JScrollPane errorScrollPane = new JScrollPane();
|
||||||
|
private MiniTable errorTable = new MiniTable();
|
||||||
|
private CPanel errorPanel = new CPanel(new FlowLayout(FlowLayout.TRAILING));
|
||||||
|
private CToggleButton bErrorsOnly = new CToggleButton(Msg.getMsg(Env.getCtx(), "ErrorsOnly"));
|
||||||
|
private CButton bErrorReset = new CButton(Msg.getMsg(Env.getCtx(), "Reset"));
|
||||||
|
private CButton bErrorEMail = new CButton(Msg.getMsg(Env.getCtx(), "SendEMail"));
|
||||||
|
private CButton bErrorSave = new CButton(Msg.getMsg(Env.getCtx(), "SaveFile"));
|
||||||
|
private CButton bRoleInfo = new CButton(Msg.translate(Env.getCtx(), "AD_Role_ID"));
|
||||||
|
|
||||||
|
private CPanel configPanel = new CPanel();
|
||||||
|
|
||||||
|
private PLAFEditorPanel plafEditor = new PLAFEditorPanel();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Static Init.
|
||||||
|
* <pre>
|
||||||
|
* - panel
|
||||||
|
* - tabPane
|
||||||
|
* - customizePane
|
||||||
|
* - infoArea
|
||||||
|
* - fields ...
|
||||||
|
* - contextPane
|
||||||
|
* - contextList
|
||||||
|
* - contextSouthPanel
|
||||||
|
* - contextHeader
|
||||||
|
* - contextDetail
|
||||||
|
* - errorPane
|
||||||
|
* - errorScollPane
|
||||||
|
* - errorTable
|
||||||
|
* - southPanel
|
||||||
|
* </pre>
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
void jbInit() throws Exception
|
||||||
|
{
|
||||||
|
traceLabel.setRequestFocusEnabled(false);
|
||||||
|
traceLabel.setText(Msg.getMsg(Env.getCtx(), "TraceLevel", true));
|
||||||
|
traceLabel.setToolTipText(Msg.getMsg(Env.getCtx(), "TraceLevel", false));
|
||||||
|
traceFile.setText(Msg.getMsg(Env.getCtx(), "TraceFile", true));
|
||||||
|
traceFile.setToolTipText(Msg.getMsg(Env.getCtx(), "TraceFile", false));
|
||||||
|
|
||||||
|
uiTheme.setText(Msg.getMsg(Env.getCtx(), "UITheme", true));
|
||||||
|
uiTheme.setToolTipText(Msg.getMsg(Env.getCtx(), "UITheme", false));
|
||||||
|
autoCommit.setText(Msg.getMsg(Env.getCtx(), "AutoCommit", true));
|
||||||
|
autoCommit.setToolTipText(Msg.getMsg(Env.getCtx(), "AutoCommit", false));
|
||||||
|
autoNew.setText(Msg.getMsg(Env.getCtx(), "AutoNew", true));
|
||||||
|
autoNew.setToolTipText(Msg.getMsg(Env.getCtx(), "AutoNew", false));
|
||||||
|
adempiereSys.setText(Msg.getMsg(Env.getCtx(), "AdempiereSys", true));
|
||||||
|
adempiereSys.setToolTipText(Msg.getMsg(Env.getCtx(), "AdempiereSys", false));
|
||||||
|
printPreview.setText(Msg.getMsg(Env.getCtx(), "AlwaysPrintPreview", true));
|
||||||
|
printPreview.setToolTipText(Msg.getMsg(Env.getCtx(), "AlwaysPrintPreview", false));
|
||||||
|
validateConnectionOnStartup.setText(Msg.getMsg(Env.getCtx(), "ValidateConnectionOnStartup", true));
|
||||||
|
validateConnectionOnStartup.setToolTipText(Msg.getMsg(Env.getCtx(), "ValidateConnectionOnStartup", false));
|
||||||
|
singleInstancePerWindow.setText(Msg.getMsg(Env.getCtx(), "SingleInstancePerWindow", true));
|
||||||
|
singleInstancePerWindow.setToolTipText(Msg.getMsg(Env.getCtx(), "SingleInstancePerWindow", false));
|
||||||
|
openWindowMaximized.setText(Msg.getMsg(Env.getCtx(), "OpenWindowMaximized", true));
|
||||||
|
openWindowMaximized.setToolTipText(Msg.getMsg(Env.getCtx(), "OpenWindowMaximized", false));
|
||||||
|
autoLogin.setText(Msg.getMsg(Env.getCtx(), "AutoLogin", true));
|
||||||
|
autoLogin.setToolTipText(Msg.getMsg(Env.getCtx(), "AutoLogin", false));
|
||||||
|
storePassword.setText(Msg.getMsg(Env.getCtx(), "StorePassword", true));
|
||||||
|
storePassword.setToolTipText(Msg.getMsg(Env.getCtx(), "StorePassword", false));
|
||||||
|
showTrl.setText(Msg.getMsg(Env.getCtx(), "ShowTrlTab", true));
|
||||||
|
showTrl.setToolTipText(Msg.getMsg(Env.getCtx(), "ShowTrlTab", false));
|
||||||
|
showAcct.setText(Msg.getMsg(Env.getCtx(), "ShowAcctTab", true));
|
||||||
|
showAcct.setToolTipText(Msg.getMsg(Env.getCtx(), "ShowAcctTab", false));
|
||||||
|
showAdvanced.setText(Msg.getMsg(Env.getCtx(), "ShowAdvancedTab", true));
|
||||||
|
showAdvanced.setToolTipText(Msg.getMsg(Env.getCtx(), "ShowAdvancedTab", false));
|
||||||
|
connectionProfileLabel.setText(Msg.getElement(Env.getCtx(), "ConnectionProfile"));
|
||||||
|
cacheWindow.setText(Msg.getMsg(Env.getCtx(), "CacheWindow", true));
|
||||||
|
cacheWindow.setToolTipText(Msg.getMsg(Env.getCtx(), "CacheWindow", false));
|
||||||
|
lPrinter.setText(Msg.getMsg(Env.getCtx(), "Printer"));
|
||||||
|
lDate.setText(Msg.getMsg(Env.getCtx(), "Date"));
|
||||||
|
infoArea.setReadWrite(false);
|
||||||
|
getContentPane().add(panel);
|
||||||
|
panel.setLayout(panelLayout);
|
||||||
|
panel.add(tabPane, BorderLayout.CENTER);
|
||||||
|
// Customize
|
||||||
|
// tabPane.add(customizePane, Msg.getMsg(Env.getCtx(), "Preference"));
|
||||||
|
tabPane.add(customizePane, Msg.getMsg(Env.getCtx(), "Preference"));
|
||||||
|
customizePane.setLayout(customizeLayout);
|
||||||
|
customizePane.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
|
||||||
|
|
||||||
|
Border insetBorder = BorderFactory.createEmptyBorder(2, 2, 2, 0);
|
||||||
|
CPanel loginPanel = new CPanel();
|
||||||
|
loginPanel.setBorder(BorderFactory.createTitledBorder(Msg.getMsg(Env.getCtx(), "Login")));
|
||||||
|
loginPanel.setLayout(new GridLayout(1, 2));
|
||||||
|
autoLogin.setBorder(insetBorder);
|
||||||
|
storePassword.setBorder(insetBorder);
|
||||||
|
loginPanel.add(autoLogin);
|
||||||
|
loginPanel.add(storePassword);
|
||||||
|
customizePane.add(loginPanel, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0
|
||||||
|
,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(2, 0, 2, 0), 0, 0));
|
||||||
|
|
||||||
|
CPanel windowPanel = new CPanel();
|
||||||
|
windowPanel.setBorder(BorderFactory.createTitledBorder(Msg.getMsg(Env.getCtx(), "Window")));
|
||||||
|
windowPanel.setLayout(new GridLayout(4, 2));
|
||||||
|
windowPanel.add(showAcct);showAcct.setBorder(insetBorder);
|
||||||
|
windowPanel.add(showTrl);showTrl.setBorder(insetBorder);
|
||||||
|
windowPanel.add(showAdvanced);showAdvanced.setBorder(insetBorder);
|
||||||
|
windowPanel.add(autoCommit);autoCommit.setBorder(insetBorder);
|
||||||
|
windowPanel.add(autoNew);autoNew.setBorder(insetBorder);
|
||||||
|
windowPanel.add(cacheWindow);cacheWindow.setBorder(insetBorder);
|
||||||
|
windowPanel.add(openWindowMaximized);openWindowMaximized.setBorder(insetBorder);
|
||||||
|
windowPanel.add(singleInstancePerWindow);singleInstancePerWindow.setBorder(insetBorder);
|
||||||
|
customizePane.add(windowPanel, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0
|
||||||
|
,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(2, 0, 2, 0), 0, 0));
|
||||||
|
|
||||||
|
CPanel connPanel = new CPanel();
|
||||||
|
connPanel.setBorder(BorderFactory.createTitledBorder(Msg.getMsg(Env.getCtx(), "Connection")));
|
||||||
|
connPanel.setLayout(new GridBagLayout());
|
||||||
|
connPanel.add(connectionProfileLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0
|
||||||
|
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 2, 2, 0), 0, 0));
|
||||||
|
connPanel.add(connectionProfile, new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0
|
||||||
|
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 2, 2, 0), 0, 0));
|
||||||
|
connPanel.add(validateConnectionOnStartup, new GridBagConstraints(0, 1, 2, 1, 1.0, 0.0
|
||||||
|
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 2, 2, 0), 0, 0));
|
||||||
|
customizePane.add(connPanel, new GridBagConstraints(0, 2, 1, 1, 1.0, 0.0
|
||||||
|
,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(2, 0, 2, 0), 0, 0));
|
||||||
|
|
||||||
|
CPanel tracePanel = new CPanel();
|
||||||
|
tracePanel.setBorder(BorderFactory.createTitledBorder(Msg.getMsg(Env.getCtx(), "TraceInfo")));
|
||||||
|
tracePanel.setLayout(new GridBagLayout());
|
||||||
|
tracePanel.add(traceLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0
|
||||||
|
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 2, 2, 0), 0, 0));
|
||||||
|
tracePanel.add(traceLevel, new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0
|
||||||
|
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 2, 2, 0), 0, 0));
|
||||||
|
tracePanel.add(traceFile, new GridBagConstraints(0, 1, 2, 1, 1.0, 0.0
|
||||||
|
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 2, 2, 0), 0, 0));
|
||||||
|
customizePane.add(tracePanel, new GridBagConstraints(0, 3, 1, 1, 1.0, 0.0
|
||||||
|
,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(2, 0, 2, 0), 0, 0));
|
||||||
|
|
||||||
|
CPanel printPanel = new CPanel();
|
||||||
|
printPanel.setBorder(BorderFactory.createTitledBorder(Msg.getMsg(Env.getCtx(), "Printing")));
|
||||||
|
printPanel.setLayout(new GridBagLayout());
|
||||||
|
printPanel.add(lPrinter, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0
|
||||||
|
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 2, 2, 0), 0, 0));
|
||||||
|
printPanel.add(fPrinter, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0
|
||||||
|
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 2, 2, 0), 0, 0));
|
||||||
|
printPanel.add(printPreview, new GridBagConstraints(0, 1, 2, 1, 1.0, 0.0
|
||||||
|
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 2, 2, 0), 0, 0));
|
||||||
|
customizePane.add(printPanel, new GridBagConstraints(0, 4, 1, 1, 1.0, 0.0
|
||||||
|
,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(2, 0, 2, 0), 0, 0));
|
||||||
|
|
||||||
|
CPanel otherPanel = new CPanel();
|
||||||
|
otherPanel.setBorder(BorderFactory.createEmptyBorder());
|
||||||
|
otherPanel.setLayout(new GridLayout());
|
||||||
|
CPanel datePanel = new CPanel();
|
||||||
|
datePanel.setLayout(new FlowLayout());
|
||||||
|
((FlowLayout)datePanel.getLayout()).setAlignment(FlowLayout.LEFT);
|
||||||
|
datePanel.add(lDate);
|
||||||
|
datePanel.add(fDate);
|
||||||
|
otherPanel.add(datePanel);datePanel.setBorder(insetBorder);
|
||||||
|
otherPanel.add(adempiereSys);adempiereSys.setBorder(insetBorder);
|
||||||
|
customizePane.add(otherPanel, new GridBagConstraints(0, 5, 1, 1, 1.0, 0.0
|
||||||
|
,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(2, 0, 2, 0), 0, 0));
|
||||||
|
|
||||||
|
CPanel themePanel = new CPanel();
|
||||||
|
themePanel.setLayout(new GridLayout(1, 1));
|
||||||
|
|
||||||
|
themePanel.add(plafEditor);
|
||||||
|
tabPane.add(themePanel, Msg.getMsg(Env.getCtx(), "UITheme", true));
|
||||||
|
|
||||||
|
configPanel.setLayout(new BorderLayout());
|
||||||
|
configPanel.add(infoArea, BorderLayout.CENTER);
|
||||||
|
CPanel configSouth = new CPanel();
|
||||||
|
configSouth.setLayout(new FlowLayout());
|
||||||
|
((FlowLayout)configSouth.getLayout()).setAlignment(FlowLayout.RIGHT);
|
||||||
|
configSouth.add(bRoleInfo);
|
||||||
|
configPanel.add(configSouth, BorderLayout.SOUTH);
|
||||||
|
tabPane.add(configPanel, Msg.getMsg(Env.getCtx(), "Info"));
|
||||||
|
|
||||||
|
customizePane.add(lDate, new GridBagConstraints(0, 9, 1, 1, 0.0, 0.0
|
||||||
|
,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
|
||||||
|
customizePane.add(fDate, new GridBagConstraints(1, 9, 2, 1, 0.0, 0.0
|
||||||
|
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
|
||||||
|
customizePane.add(printPreview, new GridBagConstraints(2, 9, 1, 1, 0.0, 0.0
|
||||||
|
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
|
||||||
|
// Info
|
||||||
|
// tabPane.add(contextPane, Msg.getMsg(Env.getCtx(), "Context"));
|
||||||
|
tabPane.add(contextPane, Msg.getMsg(Env.getCtx(), "Context"));
|
||||||
|
contextPane.setLayout(icontextLayout);
|
||||||
|
contextPane.add(contextListScrollPane, BorderLayout.CENTER);
|
||||||
|
contextListScrollPane.setPreferredSize(new Dimension(200, 300));
|
||||||
|
infoList.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
|
||||||
|
infoList.setBackground(AdempierePLAF.getFieldBackground_Inactive());
|
||||||
|
infoList.addListSelectionListener(this);
|
||||||
|
infoList.setFixedCellWidth(30);
|
||||||
|
contextPane.add(contextSouthPanel, BorderLayout.SOUTH);
|
||||||
|
contextSouthPanel.setLayout(contextSouthLayout);
|
||||||
|
contextSouthPanel.add(contextHeader, BorderLayout.WEST);
|
||||||
|
contextHeader.setBackground(SystemColor.info);
|
||||||
|
contextHeader.setReadWrite(false);
|
||||||
|
contextHeader.setLineWrap(true);
|
||||||
|
contextHeader.setWrapStyleWord(true);
|
||||||
|
contextHeader.setBorder(BorderFactory.createLoweredBevelBorder());
|
||||||
|
contextSouthPanel.add(contextDetail, BorderLayout.CENTER);
|
||||||
|
contextDetail.setBackground(SystemColor.info);
|
||||||
|
contextDetail.setReadWrite(false);
|
||||||
|
contextDetail.setLineWrap(true);
|
||||||
|
contextDetail.setWrapStyleWord(true);
|
||||||
|
contextDetail.setBorder(BorderFactory.createLoweredBevelBorder());
|
||||||
|
// Error Pane
|
||||||
|
errorPane.setLayout(errorLayout);
|
||||||
|
// tabPane.add(errorPane, Msg.getMsg(Env.getCtx(), "Errors"));
|
||||||
|
tabPane.add(errorPane, "Errors");
|
||||||
|
errorPane.add(errorScrollPane, BorderLayout.CENTER);
|
||||||
|
errorScrollPane.getViewport().add(errorTable, null);
|
||||||
|
//
|
||||||
|
errorPanel.add(bErrorsOnly);
|
||||||
|
errorPanel.add(bErrorReset);
|
||||||
|
errorPanel.add(bErrorEMail);
|
||||||
|
errorPanel.add(bErrorSave);
|
||||||
|
errorPane.add(errorPanel, BorderLayout.SOUTH);
|
||||||
|
// South
|
||||||
|
panel.add(southPanel, BorderLayout.SOUTH);
|
||||||
|
southPanel.setLayout(southLayout);
|
||||||
|
southPanel.add(statusBar, BorderLayout.SOUTH);
|
||||||
|
southPanel.add(confirm, BorderLayout.CENTER);
|
||||||
|
//
|
||||||
|
bRoleInfo.addActionListener(this);
|
||||||
|
confirm.addActionListener(this);
|
||||||
|
} // jbInit
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List Selection Listener - show info in header/detail fields
|
||||||
|
* @param e evant
|
||||||
|
*/
|
||||||
|
public void valueChanged(ListSelectionEvent e)
|
||||||
|
{
|
||||||
|
if (e.getValueIsAdjusting())
|
||||||
|
return;
|
||||||
|
|
||||||
|
String value = (String)infoList.getSelectedValue();
|
||||||
|
if (value == null)
|
||||||
|
return;
|
||||||
|
int pos = value.indexOf("==");
|
||||||
|
if (pos == -1)
|
||||||
|
{
|
||||||
|
contextHeader.setText("");
|
||||||
|
contextDetail.setText(value);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
contextHeader.setText(value.substring(0, pos).replace('|','\n'));
|
||||||
|
contextDetail.setText(value.substring(pos+3));
|
||||||
|
}
|
||||||
|
} // valueChanged
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ActionListener
|
||||||
|
* @param e event
|
||||||
|
*/
|
||||||
|
public void actionPerformed(ActionEvent e)
|
||||||
|
{
|
||||||
|
// UI Change
|
||||||
|
/*if (e.getSource() == uiTheme)
|
||||||
|
{
|
||||||
|
new AdempierePLAFEditor(this, false);
|
||||||
|
}
|
||||||
|
else */ if (e.getActionCommand().equals(ConfirmPanel.A_CANCEL))
|
||||||
|
dispose();
|
||||||
|
else if (e.getActionCommand().equals(ConfirmPanel.A_OK))
|
||||||
|
cmd_save();
|
||||||
|
//
|
||||||
|
else if (e.getSource() == bErrorsOnly)
|
||||||
|
cmd_displayErrors();
|
||||||
|
else if (e.getSource() == bErrorReset)
|
||||||
|
cmd_errorReset();
|
||||||
|
else if (e.getSource() == bErrorEMail)
|
||||||
|
cmd_errorEMail();
|
||||||
|
else if (e.getSource() == bErrorSave)
|
||||||
|
cmd_errorSave();
|
||||||
|
//
|
||||||
|
else if (e.getSource() == bRoleInfo)
|
||||||
|
ADialog.info(0, this, "RoleInfo", MRole.getDefault().toStringX(Env.getCtx()));
|
||||||
|
} // actionPerformed
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Load Settings - and Context
|
||||||
|
*/
|
||||||
|
private void load()
|
||||||
|
{
|
||||||
|
log.config("");
|
||||||
|
infoArea.setText(CLogMgt.getInfo(null).toString());
|
||||||
|
infoArea.setCaretPosition(0);
|
||||||
|
|
||||||
|
// -- Load Settings --
|
||||||
|
// UI
|
||||||
|
uiTheme.addActionListener(this);
|
||||||
|
// AutoCommit
|
||||||
|
autoCommit.setSelected(Env.isAutoCommit(Env.getCtx()));
|
||||||
|
autoNew.setSelected(Env.isAutoNew(Env.getCtx()));
|
||||||
|
// AdempiereSys
|
||||||
|
adempiereSys.setSelected(Ini.isPropertyBool(Ini.P_ADEMPIERESYS));
|
||||||
|
if (Env.getAD_Client_ID(Env.getCtx()) > 20)
|
||||||
|
{
|
||||||
|
adempiereSys.setSelected(false);
|
||||||
|
adempiereSys.setEnabled(false);
|
||||||
|
}
|
||||||
|
// AutoLogin
|
||||||
|
autoLogin.setSelected(Ini.isPropertyBool(Ini.P_A_LOGIN));
|
||||||
|
// Save Password
|
||||||
|
storePassword.setSelected(Ini.isPropertyBool(Ini.P_STORE_PWD));
|
||||||
|
// Show Acct Tab
|
||||||
|
if (MRole.getDefault().isShowAcct())
|
||||||
|
showAcct.setSelected(Ini.isPropertyBool(Ini.P_SHOW_ACCT));
|
||||||
|
else
|
||||||
|
{
|
||||||
|
showAcct.setSelected(false);
|
||||||
|
showAcct.setReadWrite(false);
|
||||||
|
}
|
||||||
|
// Show Trl/Advanced Tab
|
||||||
|
showTrl.setSelected(Ini.isPropertyBool(Ini.P_SHOW_TRL));
|
||||||
|
showAdvanced.setSelected(Ini.isPropertyBool(Ini.P_SHOW_ADVANCED));
|
||||||
|
|
||||||
|
// Connection Profile
|
||||||
|
MUser user = MUser.get(Env.getCtx());
|
||||||
|
String cp = user.getConnectionProfile();
|
||||||
|
if (cp == null)
|
||||||
|
cp = MRole.getDefault().getConnectionProfile();
|
||||||
|
if (cp != null)
|
||||||
|
{
|
||||||
|
CConnection.get().setConnectionProfile(cp);
|
||||||
|
connectionProfile.setReadWrite(false);
|
||||||
|
}
|
||||||
|
connectionProfile.setSelectedItem(CConnection.get().getConnectionProfilePair());
|
||||||
|
cacheWindow.setSelected(Ini.isCacheWindow());
|
||||||
|
|
||||||
|
// Print Preview
|
||||||
|
printPreview.setSelected(Ini.isPropertyBool(Ini.P_PRINTPREVIEW));
|
||||||
|
|
||||||
|
// Validate Connection on Startup
|
||||||
|
validateConnectionOnStartup.setSelected(Ini.isPropertyBool(Ini.P_VALIDATE_CONNECTION_ON_STARTUP));
|
||||||
|
|
||||||
|
// Single Instance per Window
|
||||||
|
singleInstancePerWindow.setSelected(Ini.isPropertyBool(Ini.P_SINGLE_INSTANCE_PER_WINDOW));
|
||||||
|
|
||||||
|
// Open Window Maximized
|
||||||
|
openWindowMaximized.setSelected(Ini.isPropertyBool(Ini.P_OPEN_WINDOW_MAXIMIZED));
|
||||||
|
|
||||||
|
// TraceLevel
|
||||||
|
traceLevel.setSelectedItem(CLogMgt.getLevel());
|
||||||
|
traceFile.setSelected(Ini.isPropertyBool(Ini.P_TRACEFILE));
|
||||||
|
// Printer
|
||||||
|
fPrinter.setValue(Env.getContext(Env.getCtx(), "#Printer"));
|
||||||
|
// Date
|
||||||
|
fDate.setValue(Env.getContextAsDate(Env.getCtx(), "#Date"));
|
||||||
|
|
||||||
|
// -- Load and sort Context --
|
||||||
|
String[] context = Env.getEntireContext(Env.getCtx());
|
||||||
|
Arrays.sort(context);
|
||||||
|
infoList.setListData(context);
|
||||||
|
|
||||||
|
// Load Errors
|
||||||
|
// CLogMgt mgt = new CLogMgt(); // creates test trace
|
||||||
|
bErrorsOnly.setSelected(true);
|
||||||
|
errorTable.setCellSelectionEnabled(true);
|
||||||
|
cmd_displayErrors();
|
||||||
|
// for (int i = 2; i < 6; i++)
|
||||||
|
// errorTable.setColumnReadOnly(i, false);
|
||||||
|
//
|
||||||
|
bErrorsOnly.addActionListener(this);
|
||||||
|
bErrorReset.addActionListener(this);
|
||||||
|
bErrorSave.addActionListener(this);
|
||||||
|
bErrorEMail.addActionListener(this);
|
||||||
|
} // load
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Save Settings
|
||||||
|
*/
|
||||||
|
private void cmd_save()
|
||||||
|
{
|
||||||
|
log.config("");
|
||||||
|
// UI
|
||||||
|
// AutoCommit
|
||||||
|
Ini.setProperty(Ini.P_A_COMMIT, (autoCommit.isSelected()));
|
||||||
|
Env.setAutoCommit(Env.getCtx(), autoCommit.isSelected());
|
||||||
|
Ini.setProperty(Ini.P_A_NEW, (autoNew.isSelected()));
|
||||||
|
Env.setAutoNew(Env.getCtx(), autoNew.isSelected());
|
||||||
|
// AdempiereSys
|
||||||
|
Ini.setProperty(Ini.P_ADEMPIERESYS, adempiereSys.isSelected());
|
||||||
|
// AutoLogin
|
||||||
|
Ini.setProperty(Ini.P_A_LOGIN, (autoLogin.isSelected()));
|
||||||
|
// Save Password
|
||||||
|
Ini.setProperty(Ini.P_STORE_PWD, (storePassword.isSelected()));
|
||||||
|
// Show Acct Tab
|
||||||
|
Ini.setProperty(Ini.P_SHOW_ACCT, (showAcct.isSelected()));
|
||||||
|
Env.setContext(Env.getCtx(), "#ShowAcct", (showAcct.isSelected()));
|
||||||
|
// Show Trl Tab
|
||||||
|
Ini.setProperty(Ini.P_SHOW_TRL, (showTrl.isSelected()));
|
||||||
|
Env.setContext(Env.getCtx(), "#ShowTrl", (showTrl.isSelected()));
|
||||||
|
// Show Advanced Tab
|
||||||
|
Ini.setProperty(Ini.P_SHOW_ADVANCED, (showAdvanced.isSelected()));
|
||||||
|
Env.setContext(Env.getCtx(), "#ShowAdvanced", (showAdvanced.isSelected()));
|
||||||
|
|
||||||
|
// ConnectionProfile
|
||||||
|
ValueNamePair ppNew = (ValueNamePair)connectionProfile.getSelectedItem();
|
||||||
|
String cpNew = ppNew.getValue();
|
||||||
|
String cpOld = CConnection.get().getConnectionProfile();
|
||||||
|
CConnection.get().setConnectionProfile(cpNew);
|
||||||
|
if (!cpNew.equals(cpOld)
|
||||||
|
&& (cpNew.equals(CConnection.PROFILE_WAN) || cpOld.equals(CConnection.PROFILE_WAN)))
|
||||||
|
ADialog.info(0, this, "ConnectionProfileChange");
|
||||||
|
Ini.setProperty(Ini.P_CACHE_WINDOW, cacheWindow.isSelected());
|
||||||
|
|
||||||
|
// Print Preview
|
||||||
|
Ini.setProperty(Ini.P_PRINTPREVIEW, (printPreview.isSelected()));
|
||||||
|
// Validate Connection on Startup
|
||||||
|
Ini.setProperty(Ini.P_VALIDATE_CONNECTION_ON_STARTUP, (validateConnectionOnStartup.isSelected()));
|
||||||
|
// Single Instance per Window
|
||||||
|
Ini.setProperty(Ini.P_SINGLE_INSTANCE_PER_WINDOW, (singleInstancePerWindow.isSelected()));
|
||||||
|
// Open Window Maximized
|
||||||
|
Ini.setProperty(Ini.P_OPEN_WINDOW_MAXIMIZED, (openWindowMaximized.isSelected()));
|
||||||
|
// TraceLevel/File
|
||||||
|
Level level = (Level)traceLevel.getSelectedItem();
|
||||||
|
CLogMgt.setLevel(level);
|
||||||
|
Ini.setProperty(Ini.P_TRACELEVEL, level.getName());
|
||||||
|
Ini.setProperty(Ini.P_TRACEFILE, traceFile.isSelected());
|
||||||
|
// Printer
|
||||||
|
String printer = (String)fPrinter.getSelectedItem();
|
||||||
|
Env.setContext(Env.getCtx(), "#Printer", printer);
|
||||||
|
Ini.setProperty(Ini.P_PRINTER, printer);
|
||||||
|
// Date (remove seconds)
|
||||||
|
java.sql.Timestamp ts = (java.sql.Timestamp)fDate.getValue();
|
||||||
|
if (ts != null)
|
||||||
|
Env.setContext(Env.getCtx(), "#Date", ts);
|
||||||
|
|
||||||
|
//UI
|
||||||
|
ValueNamePair laf = plafEditor.getSelectedLook();
|
||||||
|
ValueNamePair theme = plafEditor.getSelectedTheme();
|
||||||
|
if ( laf != null ) {
|
||||||
|
String clazz = laf.getValue();
|
||||||
|
String currentLaf = UIManager.getLookAndFeel().getClass().getName();
|
||||||
|
if (clazz != null && clazz.length() > 0 && !currentLaf.equals(clazz))
|
||||||
|
{
|
||||||
|
//laf changed
|
||||||
|
AdempierePLAF.setPLAF(laf, theme, true);
|
||||||
|
//AEnv.updateUI();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel)
|
||||||
|
{
|
||||||
|
MetalTheme currentTheme = MetalLookAndFeel.getCurrentTheme();
|
||||||
|
String themeClass = currentTheme.getClass().getName();
|
||||||
|
String sTheme = theme.getValue();
|
||||||
|
if (sTheme != null && sTheme.length() > 0 && !sTheme.equals(themeClass))
|
||||||
|
{
|
||||||
|
ValueNamePair plaf = new ValueNamePair(
|
||||||
|
UIManager.getLookAndFeel().getClass().getName(),
|
||||||
|
UIManager.getLookAndFeel().getName());
|
||||||
|
AdempierePLAF.setPLAF(plaf, theme, true);
|
||||||
|
//AEnv.updateUI();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Ini.saveProperties(Ini.isClient());
|
||||||
|
dispose();
|
||||||
|
} // cmd_save
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (Re)Display Errors
|
||||||
|
*/
|
||||||
|
private void cmd_displayErrors()
|
||||||
|
{
|
||||||
|
Vector data = CLogErrorBuffer.get(true).getLogData(bErrorsOnly.isSelected());
|
||||||
|
Vector columnNames = CLogErrorBuffer.get(true).getColumnNames(Env.getCtx());
|
||||||
|
DefaultTableModel model = new DefaultTableModel(data, columnNames);
|
||||||
|
errorTable.setModel(model);
|
||||||
|
//
|
||||||
|
if (bErrorsOnly.isSelected())
|
||||||
|
tabPane.setTitleAt(2, Msg.getMsg(Env.getCtx(), "Errors") + " (" + data.size() + ")");
|
||||||
|
else
|
||||||
|
tabPane.setTitleAt(2, Msg.getMsg(Env.getCtx(), "TraceInfo") + " (" + data.size() + ")");
|
||||||
|
errorTable.autoSize();
|
||||||
|
} // cmd_errorsOnly
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reset Errors
|
||||||
|
*/
|
||||||
|
private void cmd_errorReset()
|
||||||
|
{
|
||||||
|
CLogErrorBuffer.get(true).resetBuffer(bErrorsOnly.isSelected());
|
||||||
|
cmd_displayErrors();
|
||||||
|
} // cmd_errorReset
|
||||||
|
|
||||||
|
/**
|
||||||
|
* EMail Errors
|
||||||
|
*/
|
||||||
|
private void cmd_errorEMail()
|
||||||
|
{
|
||||||
|
EMailDialog emd = new EMailDialog(this,
|
||||||
|
"EMail Trace",
|
||||||
|
MUser.get(Env.getCtx()),
|
||||||
|
"", // to
|
||||||
|
"Adempiere Trace Info",
|
||||||
|
CLogErrorBuffer.get(true).getErrorInfo(Env.getCtx(), bErrorsOnly.isSelected()),
|
||||||
|
null);
|
||||||
|
|
||||||
|
} // cmd_errorEMail
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Save Error to File
|
||||||
|
*/
|
||||||
|
private void cmd_errorSave()
|
||||||
|
{
|
||||||
|
JFileChooser chooser = new JFileChooser();
|
||||||
|
chooser.setDialogType(JFileChooser.SAVE_DIALOG);
|
||||||
|
chooser.setDialogTitle("Adempiere Trace File");
|
||||||
|
chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
|
||||||
|
chooser.setSelectedFile(new File ("traceInfo.log"));
|
||||||
|
int returnVal = chooser.showSaveDialog(this);
|
||||||
|
if(returnVal != JFileChooser.APPROVE_OPTION)
|
||||||
|
return;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
File file = chooser.getSelectedFile();
|
||||||
|
FileWriter writer = new FileWriter(file);
|
||||||
|
writer.write(CLogErrorBuffer.get(true).getErrorInfo(Env.getCtx(), bErrorsOnly.isSelected()));
|
||||||
|
writer.flush();
|
||||||
|
writer.close();
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
log.log(Level.SEVERE, "", e);
|
||||||
|
}
|
||||||
|
} // cmd_errorSave
|
||||||
|
|
||||||
|
} // Preference
|
|
@ -548,7 +548,7 @@ public final class Preference extends CDialog
|
||||||
{
|
{
|
||||||
//laf changed
|
//laf changed
|
||||||
AdempierePLAF.setPLAF(laf, theme, true);
|
AdempierePLAF.setPLAF(laf, theme, true);
|
||||||
AEnv.updateUI();
|
//AEnv.updateUI();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -563,7 +563,7 @@ public final class Preference extends CDialog
|
||||||
UIManager.getLookAndFeel().getClass().getName(),
|
UIManager.getLookAndFeel().getClass().getName(),
|
||||||
UIManager.getLookAndFeel().getName());
|
UIManager.getLookAndFeel().getName());
|
||||||
AdempierePLAF.setPLAF(plaf, theme, true);
|
AdempierePLAF.setPLAF(plaf, theme, true);
|
||||||
AEnv.updateUI();
|
//AEnv.updateUI();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,8 +49,8 @@ public class ProcessCtl extends Thread
|
||||||
* Creates a ProcessCtl instance, which calls
|
* Creates a ProcessCtl instance, which calls
|
||||||
* lockUI and unlockUI if parent is a ASyncProcess
|
* lockUI and unlockUI if parent is a ASyncProcess
|
||||||
* <br>
|
* <br>
|
||||||
* Called from ProcessCtl.startProcess, APanel.cmd_print,
|
* Called from ProcessCtl.startProcess, ProcessDialog.actionPerformed,
|
||||||
* APanel.actionButton, VPaySelect.cmd_generate
|
* APanel.cmd_print, APanel.actionButton, VPaySelect.cmd_generate
|
||||||
*
|
*
|
||||||
* @param parent ASyncProcess & Container
|
* @param parent ASyncProcess & Container
|
||||||
* @param WindowNo window no
|
* @param WindowNo window no
|
||||||
|
|
|
@ -77,46 +77,15 @@ public class ProcessDialog extends CFrame
|
||||||
private static CLogger log = CLogger.getCLogger(ProcessDialog.class);
|
private static CLogger log = CLogger.getCLogger(ProcessDialog.class);
|
||||||
//
|
//
|
||||||
|
|
||||||
private CPanel dialog = new CPanel()
|
private CPanel dialog = new CPanel();
|
||||||
{
|
|
||||||
public Dimension getPreferredSize() {
|
|
||||||
Dimension d = super.getPreferredSize();
|
|
||||||
Dimension m = getMinimumSize();
|
|
||||||
if ( d.height < m.height || d.width < m.width ) {
|
|
||||||
Dimension d1 = new Dimension();
|
|
||||||
d1.height = Math.max(d.height, m.height);
|
|
||||||
d1.width = Math.max(d.width, m.width);
|
|
||||||
return d1;
|
|
||||||
} else
|
|
||||||
return d;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
private BorderLayout mainLayout = new BorderLayout();
|
private BorderLayout mainLayout = new BorderLayout();
|
||||||
private CPanel southPanel = new CPanel();
|
private CPanel southPanel = new CPanel();
|
||||||
private CButton bOK = ConfirmPanel.createOKButton(true);
|
private CButton bOK = ConfirmPanel.createOKButton(true);
|
||||||
private FlowLayout southLayout = new FlowLayout();
|
private FlowLayout southLayout = new FlowLayout();
|
||||||
private JEditorPane message = new JEditorPane()
|
private JEditorPane message = new JEditorPane();
|
||||||
{
|
|
||||||
public Dimension getPreferredSize() {
|
|
||||||
Dimension d = super.getPreferredSize();
|
|
||||||
Dimension m = getMaximumSize();
|
|
||||||
if ( d.height > m.height || d.width > m.width ) {
|
|
||||||
Dimension d1 = new Dimension();
|
|
||||||
d1.height = Math.min(d.height, m.height);
|
|
||||||
d1.width = Math.min(d.width, m.width);
|
|
||||||
return d1;
|
|
||||||
} else
|
|
||||||
return d;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
private JScrollPane messagePane = new JScrollPane(message);
|
private JScrollPane messagePane = new JScrollPane(message);
|
||||||
private CButton bPrint = ConfirmPanel.createPrintButton(true);
|
private CButton bPrint = ConfirmPanel.createPrintButton(true);
|
||||||
|
|
||||||
private CPanel centerPanel = null;
|
|
||||||
private ProcessParameterPanel parameterPanel = null;
|
|
||||||
private JSeparator separator = new JSeparator();
|
|
||||||
private ProcessInfo m_pi = null;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Static Layout
|
* Static Layout
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
|
@ -126,27 +95,21 @@ public class ProcessDialog extends CFrame
|
||||||
setIconImage(Env.getImage("mProcess.gif"));
|
setIconImage(Env.getImage("mProcess.gif"));
|
||||||
//
|
//
|
||||||
dialog.setLayout(mainLayout);
|
dialog.setLayout(mainLayout);
|
||||||
dialog.setMinimumSize(new Dimension(500, 200));
|
|
||||||
bOK.addActionListener(this);
|
bOK.addActionListener(this);
|
||||||
bPrint.addActionListener(this);
|
bPrint.addActionListener(this);
|
||||||
//
|
//
|
||||||
southPanel.setLayout(southLayout);
|
southPanel.setLayout(southLayout);
|
||||||
southLayout.setAlignment(FlowLayout.RIGHT);
|
southLayout.setAlignment(FlowLayout.RIGHT);
|
||||||
|
dialog.setPreferredSize(new Dimension(500, 150));
|
||||||
message.setContentType("text/html");
|
message.setContentType("text/html");
|
||||||
message.setEditable(false);
|
message.setEditable(false);
|
||||||
message.setBackground(Color.white);
|
message.setBackground(AdempierePLAF.getFieldBackground_Inactive());
|
||||||
message.setFocusable(false);
|
message.setFocusable(false);
|
||||||
getContentPane().add(dialog);
|
getContentPane().add(dialog);
|
||||||
dialog.add(southPanel, BorderLayout.SOUTH);
|
dialog.add(southPanel, BorderLayout.SOUTH);
|
||||||
southPanel.add(bPrint, null);
|
southPanel.add(bPrint, null);
|
||||||
southPanel.add(bOK, null);
|
southPanel.add(bOK, null);
|
||||||
dialog.add(messagePane, BorderLayout.NORTH);
|
dialog.add(messagePane, BorderLayout.CENTER);
|
||||||
messagePane.setBorder(null);
|
|
||||||
message.setMaximumSize(new Dimension(600, 300));
|
|
||||||
centerPanel = new CPanel();
|
|
||||||
centerPanel.setBorder(null);
|
|
||||||
centerPanel.setLayout(new BorderLayout());
|
|
||||||
dialog.add(centerPanel, BorderLayout.CENTER);
|
|
||||||
//
|
//
|
||||||
this.getRootPane().setDefaultButton(bOK);
|
this.getRootPane().setDefaultButton(bOK);
|
||||||
} // jbInit
|
} // jbInit
|
||||||
|
@ -159,9 +122,8 @@ public class ProcessDialog extends CFrame
|
||||||
public void setVisible (boolean visible)
|
public void setVisible (boolean visible)
|
||||||
{
|
{
|
||||||
super.setVisible(visible);
|
super.setVisible(visible);
|
||||||
if (visible) {
|
if (visible)
|
||||||
bOK.requestFocus();
|
bOK.requestFocus();
|
||||||
}
|
|
||||||
} // setVisible
|
} // setVisible
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -238,17 +200,6 @@ public class ProcessDialog extends CFrame
|
||||||
return false; // don't show
|
return false; // don't show
|
||||||
}
|
}
|
||||||
**/
|
**/
|
||||||
// Similar to APanel.actionButton
|
|
||||||
m_pi = new ProcessInfo(m_Name, m_AD_Process_ID);
|
|
||||||
m_pi.setAD_User_ID (Env.getAD_User_ID(Env.getCtx()));
|
|
||||||
m_pi.setAD_Client_ID(Env.getAD_Client_ID(Env.getCtx()));
|
|
||||||
parameterPanel = new ProcessParameterPanel(m_WindowNo, m_pi);
|
|
||||||
centerPanel.removeAll();
|
|
||||||
if (parameterPanel.init()) {
|
|
||||||
centerPanel.add(separator, BorderLayout.NORTH);
|
|
||||||
centerPanel.add(parameterPanel, BorderLayout.CENTER);
|
|
||||||
}
|
|
||||||
dialog.revalidate();
|
|
||||||
return true;
|
return true;
|
||||||
} // init
|
} // init
|
||||||
|
|
||||||
|
@ -264,8 +215,14 @@ public class ProcessDialog extends CFrame
|
||||||
dispose();
|
dispose();
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// Similar to APanel.actionButton
|
||||||
|
ProcessInfo pi = new ProcessInfo(m_Name, m_AD_Process_ID);
|
||||||
|
pi.setAD_User_ID (Env.getAD_User_ID(Env.getCtx()));
|
||||||
|
pi.setAD_Client_ID(Env.getAD_Client_ID(Env.getCtx()));
|
||||||
|
m_messageText.append("<p>** ").append(m_Name).append("</p>");
|
||||||
|
message.setText(m_messageText.toString());
|
||||||
// Trx trx = Trx.get(Trx.createTrxName("ProcessDialog"), true);
|
// Trx trx = Trx.get(Trx.createTrxName("ProcessDialog"), true);
|
||||||
ProcessCtl.process(this, m_WindowNo, parameterPanel, m_pi, null);
|
ProcessCtl.process(this, m_WindowNo, pi, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -265,16 +265,10 @@ public class ProcessParameter extends CDialog
|
||||||
{
|
{
|
||||||
// To Label
|
// To Label
|
||||||
gbc.gridx = 2;
|
gbc.gridx = 2;
|
||||||
gbc.weightx = 0;
|
|
||||||
gbc.fill = GridBagConstraints.NONE;
|
|
||||||
centerPanel.add (new JLabel(" - "), gbc);
|
centerPanel.add (new JLabel(" - "), gbc);
|
||||||
// To Field
|
// To Field
|
||||||
gbc.gridx = 3;
|
gbc.gridx = 3;
|
||||||
gbc.insets = fieldInsetRight;
|
gbc.insets = fieldInsetRight;
|
||||||
gbc.weightx = 1;
|
|
||||||
gbc.fill = GridBagConstraints.HORIZONTAL;
|
|
||||||
gbc.anchor = GridBagConstraints.WEST;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
GridFieldVO voF2 = GridFieldVO.createParameter(voF);
|
GridFieldVO voF2 = GridFieldVO.createParameter(voF);
|
||||||
GridField mField2 = new GridField (voF2);
|
GridField mField2 = new GridField (voF2);
|
||||||
|
|
|
@ -123,7 +123,7 @@ public class WindowManager {
|
||||||
for ( CFrame w : windows ) {
|
for ( CFrame w : windows ) {
|
||||||
if ( w instanceof FormFrame ) {
|
if ( w instanceof FormFrame ) {
|
||||||
FormFrame ff = (FormFrame)w;
|
FormFrame ff = (FormFrame)w;
|
||||||
if ( ff.getAD_Form_ID() == AD_FORM_ID )
|
//if ( ff.getAD_Form_ID() == AD_FORM_ID )
|
||||||
return ff;
|
return ff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,9 +82,6 @@ public class FormFrame extends CFrame
|
||||||
/** Logger */
|
/** Logger */
|
||||||
private static CLogger log = CLogger.getCLogger(FormFrame.class);
|
private static CLogger log = CLogger.getCLogger(FormFrame.class);
|
||||||
|
|
||||||
/** Form ID */
|
|
||||||
private int p_AD_Form_ID = 0;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Static Init
|
* Static Init
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
|
@ -137,11 +134,6 @@ public class FormFrame extends CFrame
|
||||||
AEnv.addMenuItem("Preference", null, null, mTools, this);
|
AEnv.addMenuItem("Preference", null, null, mTools, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Window
|
|
||||||
AMenu aMenu = (AMenu)Env.getWindow(0);
|
|
||||||
JMenu mWindow = new WindowMenu(aMenu.getWindowManager(), this);
|
|
||||||
menuBar.add(mWindow);
|
|
||||||
|
|
||||||
// Help
|
// Help
|
||||||
JMenu mHelp = AEnv.getMenu("Help");
|
JMenu mHelp = AEnv.getMenu("Help");
|
||||||
menuBar.add(mHelp);
|
menuBar.add(mHelp);
|
||||||
|
@ -241,7 +233,6 @@ public class FormFrame extends CFrame
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
m_panel.init(m_WindowNo, this);
|
m_panel.init(m_WindowNo, this);
|
||||||
p_AD_Form_ID = AD_Form_ID;
|
|
||||||
return true;
|
return true;
|
||||||
} // openForm
|
} // openForm
|
||||||
|
|
||||||
|
@ -363,12 +354,4 @@ public class FormFrame extends CFrame
|
||||||
return worker;
|
return worker;
|
||||||
} // startBatch
|
} // startBatch
|
||||||
|
|
||||||
/**
|
|
||||||
* @return Returns the AD_Form_ID.
|
|
||||||
*/
|
|
||||||
public int getAD_Form_ID ()
|
|
||||||
{
|
|
||||||
return p_AD_Form_ID;
|
|
||||||
} // getAD_Window_ID
|
|
||||||
|
|
||||||
} // FormFrame
|
} // FormFrame
|
||||||
|
|
|
@ -209,7 +209,7 @@ public class VFileImport extends CPanel
|
||||||
confirmPanel.setEnabled(false);
|
confirmPanel.setEnabled(false);
|
||||||
m_frame.setBusy(true);
|
m_frame.setBusy(true);
|
||||||
//
|
//
|
||||||
SwingWorker worker = new SwingWorker()
|
org.compiere.apps.SwingWorker worker = new org.compiere.apps.SwingWorker()
|
||||||
{
|
{
|
||||||
public Object construct()
|
public Object construct()
|
||||||
{
|
{
|
||||||
|
|
|
@ -45,7 +45,7 @@ public class VPayPrint extends CPanel
|
||||||
*/
|
*/
|
||||||
public void init (int WindowNo, FormFrame frame)
|
public void init (int WindowNo, FormFrame frame)
|
||||||
{
|
{
|
||||||
log.info( "VPayPrint.init");
|
log.info("");
|
||||||
m_WindowNo = WindowNo;
|
m_WindowNo = WindowNo;
|
||||||
m_frame = frame;
|
m_frame = frame;
|
||||||
try
|
try
|
||||||
|
@ -440,7 +440,8 @@ public class VPayPrint extends CPanel
|
||||||
|
|
||||||
if (ADialog.ask(m_WindowNo, this, "VPayPrintSuccess?"))
|
if (ADialog.ask(m_WindowNo, this, "VPayPrintSuccess?"))
|
||||||
{
|
{
|
||||||
int lastDocumentNo = MPaySelectionCheck.confirmPrint (m_checks, m_batch);
|
// int lastDocumentNo =
|
||||||
|
MPaySelectionCheck.confirmPrint (m_checks, m_batch);
|
||||||
// document No not updated
|
// document No not updated
|
||||||
}
|
}
|
||||||
dispose();
|
dispose();
|
||||||
|
@ -468,7 +469,6 @@ public class VPayPrint extends CPanel
|
||||||
if (!getChecks(PaymentRule))
|
if (!getChecks(PaymentRule))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
||||||
this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
|
this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
|
||||||
|
|
||||||
boolean somethingPrinted = false;
|
boolean somethingPrinted = false;
|
||||||
|
@ -535,7 +535,7 @@ public class VPayPrint extends CPanel
|
||||||
//
|
//
|
||||||
this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
|
this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
|
||||||
|
|
||||||
// get Checks
|
// get Slecetions
|
||||||
m_checks = MPaySelectionCheck.get(C_PaySelection_ID, PaymentRule, startDocumentNo, null);
|
m_checks = MPaySelectionCheck.get(C_PaySelection_ID, PaymentRule, startDocumentNo, null);
|
||||||
|
|
||||||
this.setCursor(Cursor.getDefaultCursor());
|
this.setCursor(Cursor.getDefaultCursor());
|
||||||
|
|
|
@ -137,6 +137,7 @@ public class VPaySelect extends CPanel
|
||||||
bRefresh.addActionListener(this);
|
bRefresh.addActionListener(this);
|
||||||
labelPayDate.setText(Msg.translate(Env.getCtx(), "PayDate"));
|
labelPayDate.setText(Msg.translate(Env.getCtx(), "PayDate"));
|
||||||
labelPaymentRule.setText(Msg.translate(Env.getCtx(), "PaymentRule"));
|
labelPaymentRule.setText(Msg.translate(Env.getCtx(), "PaymentRule"));
|
||||||
|
fieldPaymentRule.addActionListener(this);
|
||||||
//
|
//
|
||||||
labelBankBalance.setText(Msg.translate(Env.getCtx(), "CurrentBalance"));
|
labelBankBalance.setText(Msg.translate(Env.getCtx(), "CurrentBalance"));
|
||||||
labelBalance.setText("0");
|
labelBalance.setText("0");
|
||||||
|
@ -237,8 +238,11 @@ public class VPaySelect extends CPanel
|
||||||
"SELECT bp.C_BPartner_ID, bp.Name FROM C_BPartner bp", "bp",
|
"SELECT bp.C_BPartner_ID, bp.Name FROM C_BPartner bp", "bp",
|
||||||
MRole.SQL_FULLYQUALIFIED, MRole.SQL_RO)
|
MRole.SQL_FULLYQUALIFIED, MRole.SQL_RO)
|
||||||
+ " AND EXISTS (SELECT * FROM C_Invoice i WHERE bp.C_BPartner_ID=i.C_BPartner_ID"
|
+ " AND EXISTS (SELECT * FROM C_Invoice i WHERE bp.C_BPartner_ID=i.C_BPartner_ID"
|
||||||
+ " AND i.IsSOTrx='N' AND i.IsPaid<>'Y') "
|
// X_C_Order.PAYMENTRULE_DirectDebit
|
||||||
|
+ " AND (i.IsSOTrx='N' OR (i.IsSOTrx='Y' AND i.PaymentRule='D'))"
|
||||||
|
+ " AND i.IsPaid<>'Y') "
|
||||||
+ "ORDER BY 2";
|
+ "ORDER BY 2";
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
PreparedStatement pstmt = DB.prepareStatement(sql, null);
|
PreparedStatement pstmt = DB.prepareStatement(sql, null);
|
||||||
|
@ -278,7 +282,7 @@ public class VPaySelect extends CPanel
|
||||||
m_sql = miniTable.prepareTable(new ColumnInfo[] {
|
m_sql = miniTable.prepareTable(new ColumnInfo[] {
|
||||||
// 0..4
|
// 0..4
|
||||||
new ColumnInfo(" ", "i.C_Invoice_ID", IDColumn.class, false, false, null),
|
new ColumnInfo(" ", "i.C_Invoice_ID", IDColumn.class, false, false, null),
|
||||||
new ColumnInfo(Msg.translate(ctx, "DateDue"), "i.DateInvoiced+p.NetDays AS DateDue", Timestamp.class, true, true, null),
|
new ColumnInfo(Msg.translate(ctx, "DueDate"), "i.DateInvoiced+p.NetDays AS DateDue", Timestamp.class, true, true, null),
|
||||||
new ColumnInfo(Msg.translate(ctx, "C_BPartner_ID"), "bp.Name", KeyNamePair.class, true, false, "i.C_BPartner_ID"),
|
new ColumnInfo(Msg.translate(ctx, "C_BPartner_ID"), "bp.Name", KeyNamePair.class, true, false, "i.C_BPartner_ID"),
|
||||||
new ColumnInfo(Msg.translate(ctx, "DocumentNo"), "i.DocumentNo", String.class),
|
new ColumnInfo(Msg.translate(ctx, "DocumentNo"), "i.DocumentNo", String.class),
|
||||||
new ColumnInfo(Msg.translate(ctx, "C_Currency_ID"), "c.ISO_Code", KeyNamePair.class, true, false, "i.C_Currency_ID"),
|
new ColumnInfo(Msg.translate(ctx, "C_Currency_ID"), "c.ISO_Code", KeyNamePair.class, true, false, "i.C_Currency_ID"),
|
||||||
|
@ -295,7 +299,7 @@ public class VPaySelect extends CPanel
|
||||||
+ " INNER JOIN C_Currency c ON (i.C_Currency_ID=c.C_Currency_ID)"
|
+ " INNER JOIN C_Currency c ON (i.C_Currency_ID=c.C_Currency_ID)"
|
||||||
+ " INNER JOIN C_PaymentTerm p ON (i.C_PaymentTerm_ID=p.C_PaymentTerm_ID)",
|
+ " INNER JOIN C_PaymentTerm p ON (i.C_PaymentTerm_ID=p.C_PaymentTerm_ID)",
|
||||||
// WHERE
|
// WHERE
|
||||||
"i.IsSOTrx='N' AND IsPaid='N'"
|
"i.IsSOTrx=? AND IsPaid='N'"
|
||||||
// Different Payment Selection
|
// Different Payment Selection
|
||||||
+ " AND NOT EXISTS (SELECT * FROM C_PaySelectionLine psl"
|
+ " AND NOT EXISTS (SELECT * FROM C_PaySelectionLine psl"
|
||||||
+ " WHERE i.C_Invoice_ID=psl.C_Invoice_ID AND psl.C_PaySelectionCheck_ID IS NOT NULL)"
|
+ " WHERE i.C_Invoice_ID=psl.C_Invoice_ID AND psl.C_PaySelectionCheck_ID IS NOT NULL)"
|
||||||
|
@ -371,6 +375,14 @@ public class VPaySelect extends CPanel
|
||||||
log.config("PayDate=" + payDate);
|
log.config("PayDate=" + payDate);
|
||||||
BankInfo bi = (BankInfo)fieldBankAccount.getSelectedItem();
|
BankInfo bi = (BankInfo)fieldBankAccount.getSelectedItem();
|
||||||
//
|
//
|
||||||
|
String isSOTrx = "N";
|
||||||
|
ValueNamePair vp = (ValueNamePair)fieldPaymentRule.getSelectedItem();
|
||||||
|
if (vp != null && X_C_Order.PAYMENTRULE_DirectDebit.equals(vp.getValue()))
|
||||||
|
{
|
||||||
|
isSOTrx = "Y";
|
||||||
|
sql += " AND i.PaymentRule='" + X_C_Order.PAYMENTRULE_DirectDebit + "'";
|
||||||
|
}
|
||||||
|
//
|
||||||
if (onlyDue.isSelected())
|
if (onlyDue.isSelected())
|
||||||
sql += " AND i.DateInvoiced+p.NetDays <= ?";
|
sql += " AND i.DateInvoiced+p.NetDays <= ?";
|
||||||
//
|
//
|
||||||
|
@ -393,7 +405,8 @@ public class VPaySelect extends CPanel
|
||||||
pstmt.setTimestamp(index++, payDate); // PayAmt
|
pstmt.setTimestamp(index++, payDate); // PayAmt
|
||||||
pstmt.setInt(index++, bi.C_Currency_ID);
|
pstmt.setInt(index++, bi.C_Currency_ID);
|
||||||
pstmt.setTimestamp(index++, payDate);
|
pstmt.setTimestamp(index++, payDate);
|
||||||
pstmt.setInt(index++, m_AD_Client_ID); //
|
pstmt.setString(index++, isSOTrx); // IsSOTrx
|
||||||
|
pstmt.setInt(index++, m_AD_Client_ID); // Client
|
||||||
if (onlyDue.isSelected())
|
if (onlyDue.isSelected())
|
||||||
pstmt.setTimestamp(index++, payDate);
|
pstmt.setTimestamp(index++, payDate);
|
||||||
if (C_BPartner_ID != 0)
|
if (C_BPartner_ID != 0)
|
||||||
|
@ -513,7 +526,9 @@ public class VPaySelect extends CPanel
|
||||||
|
|
||||||
// Create Header
|
// Create Header
|
||||||
m_ps = new MPaySelection(Env.getCtx(), 0, trxName);
|
m_ps = new MPaySelection(Env.getCtx(), 0, trxName);
|
||||||
m_ps.setName (Msg.getMsg(Env.getCtx(), "VPaySelect") + " - " + fieldPayDate.getTimestamp());
|
m_ps.setName (Msg.getMsg(Env.getCtx(), "VPaySelect")
|
||||||
|
+ " - " + ((ValueNamePair)fieldPaymentRule.getSelectedItem()).getName()
|
||||||
|
+ " - " + fieldPayDate.getTimestamp());
|
||||||
m_ps.setPayDate (fieldPayDate.getTimestamp());
|
m_ps.setPayDate (fieldPayDate.getTimestamp());
|
||||||
BankInfo bi = (BankInfo)fieldBankAccount.getSelectedItem();
|
BankInfo bi = (BankInfo)fieldBankAccount.getSelectedItem();
|
||||||
m_ps.setC_BankAccount_ID(bi.C_BankAccount_ID);
|
m_ps.setC_BankAccount_ID(bi.C_BankAccount_ID);
|
||||||
|
@ -557,9 +572,10 @@ public class VPaySelect extends CPanel
|
||||||
if (!ADialog.ask(m_WindowNo, this, "VPaySelectGenerate?", "(" + m_ps.getName() + ")"))
|
if (!ADialog.ask(m_WindowNo, this, "VPaySelectGenerate?", "(" + m_ps.getName() + ")"))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Prepare Process PaySelectionCreateCheck
|
// Prepare Process
|
||||||
ProcessInfo pi = new ProcessInfo (m_frame.getTitle(), 155,
|
int AD_Proces_ID = 155; // C_PaySelection_CreatePayment
|
||||||
MPaySelection.Table_ID, m_ps.getC_PaySelection_ID());
|
ProcessInfo pi = new ProcessInfo (m_frame.getTitle(), AD_Proces_ID,
|
||||||
|
X_C_PaySelection.Table_ID, m_ps.getC_PaySelection_ID());
|
||||||
pi.setAD_User_ID (Env.getAD_User_ID(Env.getCtx()));
|
pi.setAD_User_ID (Env.getAD_User_ID(Env.getCtx()));
|
||||||
pi.setAD_Client_ID(Env.getAD_Client_ID(Env.getCtx()));
|
pi.setAD_Client_ID(Env.getAD_Client_ID(Env.getCtx()));
|
||||||
|
|
||||||
|
@ -606,7 +622,6 @@ public class VPaySelect extends CPanel
|
||||||
//
|
//
|
||||||
ff.pack();
|
ff.pack();
|
||||||
this.setVisible(false);
|
this.setVisible(false);
|
||||||
AEnv.addToWindowManager(ff);
|
|
||||||
AEnv.showCenterScreen(ff);
|
AEnv.showCenterScreen(ff);
|
||||||
this.dispose();
|
this.dispose();
|
||||||
} // unlockUI
|
} // unlockUI
|
||||||
|
|
|
@ -403,7 +403,6 @@ public class VTrxMaterial extends CPanel
|
||||||
setCursor(Cursor.getDefaultCursor());
|
setCursor(Cursor.getDefaultCursor());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
AEnv.addToWindowManager(frame);
|
|
||||||
AEnv.showCenterScreen(frame);
|
AEnv.showCenterScreen(frame);
|
||||||
frame = null;
|
frame = null;
|
||||||
setCursor(Cursor.getDefaultCursor());
|
setCursor(Cursor.getDefaultCursor());
|
||||||
|
|
|
@ -686,7 +686,6 @@ public abstract class Info extends CDialog
|
||||||
final AWindow frame = new AWindow();
|
final AWindow frame = new AWindow();
|
||||||
if (!frame.initWindow(AD_Window_ID, zoomQuery))
|
if (!frame.initWindow(AD_Window_ID, zoomQuery))
|
||||||
return;
|
return;
|
||||||
AEnv.addToWindowManager(frame);
|
|
||||||
// Modal Window causes UI lock
|
// Modal Window causes UI lock
|
||||||
if (isModal())
|
if (isModal())
|
||||||
{
|
{
|
||||||
|
|
|
@ -509,7 +509,6 @@ public class WFActivity extends CPanel
|
||||||
AWindow frame = new AWindow();
|
AWindow frame = new AWindow();
|
||||||
if (!frame.initWindow(AD_Window_ID, query))
|
if (!frame.initWindow(AD_Window_ID, query))
|
||||||
return;
|
return;
|
||||||
AEnv.addToWindowManager(frame);
|
|
||||||
AEnv.showCenterScreen(frame);
|
AEnv.showCenterScreen(frame);
|
||||||
frame = null;
|
frame = null;
|
||||||
}
|
}
|
||||||
|
@ -519,7 +518,6 @@ public class WFActivity extends CPanel
|
||||||
FormFrame ff = new FormFrame();
|
FormFrame ff = new FormFrame();
|
||||||
ff.openForm(AD_Form_ID);
|
ff.openForm(AD_Form_ID);
|
||||||
ff.pack();
|
ff.pack();
|
||||||
AEnv.addToWindowManager(ff);
|
|
||||||
AEnv.showCenterScreen(ff);
|
AEnv.showCenterScreen(ff);
|
||||||
}
|
}
|
||||||
else if (MWFNode.ACTION_UserWorkbench.equals(node.getAction()))
|
else if (MWFNode.ACTION_UserWorkbench.equals(node.getAction()))
|
||||||
|
|
|
@ -432,7 +432,6 @@ public class WFPanel extends CPanel
|
||||||
AWindow frame = new AWindow();
|
AWindow frame = new AWindow();
|
||||||
if (!frame.initWindow (AD_Window_ID, query))
|
if (!frame.initWindow (AD_Window_ID, query))
|
||||||
return;
|
return;
|
||||||
AEnv.addToWindowManager(frame);
|
|
||||||
AEnv.showCenterScreen(frame);
|
AEnv.showCenterScreen(frame);
|
||||||
frame = null;
|
frame = null;
|
||||||
} // zoom
|
} // zoom
|
||||||
|
|
|
@ -121,7 +121,7 @@ public class VCreateFromStatement extends VCreateFrom implements VetoableChangeL
|
||||||
+ "FROM C_BankAccount ba"
|
+ "FROM C_BankAccount ba"
|
||||||
+ " INNER JOIN C_Payment_v p ON (p.C_BankAccount_ID=ba.C_BankAccount_ID)"
|
+ " INNER JOIN C_Payment_v p ON (p.C_BankAccount_ID=ba.C_BankAccount_ID)"
|
||||||
+ " INNER JOIN C_Currency c ON (p.C_Currency_ID=c.C_Currency_ID)"
|
+ " INNER JOIN C_Currency c ON (p.C_Currency_ID=c.C_Currency_ID)"
|
||||||
+ " INNER JOIN C_BPartner bp ON (p.C_BPartner_ID=bp.C_BPartner_ID) "
|
+ " LEFT OUTER JOIN C_BPartner bp ON (p.C_BPartner_ID=bp.C_BPartner_ID) "
|
||||||
+ "WHERE p.Processed='Y' AND p.IsReconciled='N'"
|
+ "WHERE p.Processed='Y' AND p.IsReconciled='N'"
|
||||||
+ " AND p.DocStatus IN ('CO','CL','RE','VO') AND p.PayAmt<>0" // Bug 1564453 Added Voided payment to bank statement payement selection
|
+ " AND p.DocStatus IN ('CO','CL','RE','VO') AND p.PayAmt<>0" // Bug 1564453 Added Voided payment to bank statement payement selection
|
||||||
+ " AND p.C_BankAccount_ID=?" // #2
|
+ " AND p.C_BankAccount_ID=?" // #2
|
||||||
|
@ -239,7 +239,7 @@ public class VCreateFromStatement extends VCreateFrom implements VetoableChangeL
|
||||||
pp = (KeyNamePair)model.getValueAt(i, 3); // 3-Currency
|
pp = (KeyNamePair)model.getValueAt(i, 3); // 3-Currency
|
||||||
int C_Currency_ID = pp.getKey();
|
int C_Currency_ID = pp.getKey();
|
||||||
BigDecimal TrxAmt = (BigDecimal)model.getValueAt(i, 4); // 4-PayAmt
|
BigDecimal TrxAmt = (BigDecimal)model.getValueAt(i, 4); // 4-PayAmt
|
||||||
BigDecimal StmtAmt = (BigDecimal)model.getValueAt(i, 5);// 5-Conv Amt
|
// BigDecimal StmtAmt = (BigDecimal)model.getValueAt(i, 5);// 5-Conv Amt
|
||||||
//
|
//
|
||||||
log.fine("Line Date=" + trxDate
|
log.fine("Line Date=" + trxDate
|
||||||
+ ", Payment=" + C_Payment_ID + ", Currency=" + C_Currency_ID + ", Amt=" + TrxAmt);
|
+ ", Payment=" + C_Payment_ID + ", Currency=" + C_Currency_ID + ", Amt=" + TrxAmt);
|
||||||
|
|
|
@ -193,13 +193,8 @@ public class VPayment extends CDialog
|
||||||
private CLabel bCashBookLabel = new CLabel();
|
private CLabel bCashBookLabel = new CLabel();
|
||||||
private CComboBox bCashBookCombo = new CComboBox();
|
private CComboBox bCashBookCombo = new CComboBox();
|
||||||
private GridBagLayout tPanelLayout = new GridBagLayout();
|
private GridBagLayout tPanelLayout = new GridBagLayout();
|
||||||
private CButton tOnline = new CButton();
|
|
||||||
private CLabel kStatus = new CLabel();
|
private CLabel kStatus = new CLabel();
|
||||||
private CTextField tRoutingField = new CTextField();
|
|
||||||
private CTextField tNumberField = new CTextField();
|
|
||||||
private CLabel tStatus = new CLabel();
|
private CLabel tStatus = new CLabel();
|
||||||
private CLabel tRoutingText = new CLabel();
|
|
||||||
private CLabel tNumberText = new CLabel();
|
|
||||||
private CLabel sStatus = new CLabel();
|
private CLabel sStatus = new CLabel();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -220,7 +215,7 @@ public class VPayment extends CDialog
|
||||||
northPanel.add(paymentCombo, null);
|
northPanel.add(paymentCombo, null);
|
||||||
//
|
//
|
||||||
centerPanel.setLayout(centerLayout);
|
centerPanel.setLayout(centerLayout);
|
||||||
//
|
// CreditCard
|
||||||
kPanel.setLayout(kLayout);
|
kPanel.setLayout(kLayout);
|
||||||
kNumberField.setPreferredSize(new Dimension(120, 21));
|
kNumberField.setPreferredSize(new Dimension(120, 21));
|
||||||
kExpField.setPreferredSize(new Dimension(40, 21));
|
kExpField.setPreferredSize(new Dimension(40, 21));
|
||||||
|
@ -254,14 +249,9 @@ public class VPayment extends CDialog
|
||||||
,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
|
,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
|
||||||
kPanel.add(kOnline, new GridBagConstraints(2, 3, 1, 1, 0.0, 0.0
|
kPanel.add(kOnline, new GridBagConstraints(2, 3, 1, 1, 0.0, 0.0
|
||||||
,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
|
,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
|
||||||
//
|
// DircetDebit/Credit
|
||||||
tPanel.setLayout(tPanelLayout);
|
tPanel.setLayout(tPanelLayout);
|
||||||
tAccountLabel.setText(Msg.translate(Env.getCtx(), "C_BP_BankAccount_ID"));
|
tAccountLabel.setText(Msg.translate(Env.getCtx(), "C_BP_BankAccount_ID"));
|
||||||
tRoutingField.setColumns(8);
|
|
||||||
tNumberField.setColumns(10);
|
|
||||||
tRoutingText.setText(Msg.translate(Env.getCtx(), "RoutingNo"));
|
|
||||||
tNumberText.setText(Msg.translate(Env.getCtx(), "AccountNo"));
|
|
||||||
tOnline.setText(Msg.getMsg(Env.getCtx(), "Online"));
|
|
||||||
tStatus.setText(" ");
|
tStatus.setText(" ");
|
||||||
centerPanel.add(tPanel, "tPanel");
|
centerPanel.add(tPanel, "tPanel");
|
||||||
centerLayout.addLayoutComponent(tPanel, "tPanel");
|
centerLayout.addLayoutComponent(tPanel, "tPanel");
|
||||||
|
@ -269,18 +259,8 @@ public class VPayment extends CDialog
|
||||||
,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 0), 0, 0));
|
,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 0), 0, 0));
|
||||||
tPanel.add(tAccountCombo, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0
|
tPanel.add(tAccountCombo, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0
|
||||||
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
|
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
|
||||||
tPanel.add(tRoutingField, new GridBagConstraints(1, 1, 2, 1, 0.0, 0.0
|
|
||||||
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0));
|
|
||||||
tPanel.add(tNumberField, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0
|
|
||||||
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0));
|
|
||||||
tPanel.add(tStatus, new GridBagConstraints(0, 3, 2, 1, 0.0, 0.0
|
tPanel.add(tStatus, new GridBagConstraints(0, 3, 2, 1, 0.0, 0.0
|
||||||
,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
|
,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
|
||||||
tPanel.add(tRoutingText, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0
|
|
||||||
,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 0), 0, 0));
|
|
||||||
tPanel.add(tNumberText, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0
|
|
||||||
,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 0), 0, 0));
|
|
||||||
tPanel.add(tOnline, new GridBagConstraints(3, 2, 1, 1, 0.0, 0.0
|
|
||||||
,GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
|
|
||||||
//
|
//
|
||||||
sPanel.setLayout(sPanelLayout);
|
sPanel.setLayout(sPanelLayout);
|
||||||
sBankAccountLabel.setText(Msg.translate(Env.getCtx(), "C_BankAccount_ID"));
|
sBankAccountLabel.setText(Msg.translate(Env.getCtx(), "C_BankAccount_ID"));
|
||||||
|
@ -374,7 +354,7 @@ public class VPayment extends CDialog
|
||||||
* S (Check) (Currency) CheckNo, Routing
|
* S (Check) (Currency) CheckNo, Routing
|
||||||
*
|
*
|
||||||
* Currencies are shown, if member of EMU
|
* Currencies are shown, if member of EMU
|
||||||
* @param button button
|
* @param button payment type button
|
||||||
* @return true if init OK
|
* @return true if init OK
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
|
@ -462,8 +442,6 @@ public class VPayment extends CDialog
|
||||||
sCheckField.setText(m_mPayment.getCheckNo());
|
sCheckField.setText(m_mPayment.getCheckNo());
|
||||||
sStatus.setText(m_mPayment.getR_PnRef());
|
sStatus.setText(m_mPayment.getR_PnRef());
|
||||||
// Transfer
|
// Transfer
|
||||||
tRoutingField.setText(m_mPayment.getRoutingNo());
|
|
||||||
tNumberField.setText(m_mPayment.getAccountNo());
|
|
||||||
tStatus.setText(m_mPayment.getR_PnRef());
|
tStatus.setText(m_mPayment.getR_PnRef());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -529,7 +507,13 @@ public class VPayment extends CDialog
|
||||||
Object[] a = values.keySet().toArray();
|
Object[] a = values.keySet().toArray();
|
||||||
for (int i = 0; i < a.length; i++)
|
for (int i = 0; i < a.length; i++)
|
||||||
{
|
{
|
||||||
String PaymentRule = (String)a[i];
|
String PaymentRule = (String)a[i]; // used for Panel selection
|
||||||
|
if (X_C_Order.PAYMENTRULE_DirectDebit.equals(PaymentRule) // SO
|
||||||
|
&& !m_isSOTrx)
|
||||||
|
continue;
|
||||||
|
else if (X_C_Order.PAYMENTRULE_DirectDeposit.equals(PaymentRule) // PO
|
||||||
|
&& m_isSOTrx)
|
||||||
|
continue;
|
||||||
ValueNamePair pp = new ValueNamePair(PaymentRule, (String)values.get(a[i]));
|
ValueNamePair pp = new ValueNamePair(PaymentRule, (String)values.get(a[i]));
|
||||||
paymentCombo.addItem(pp);
|
paymentCombo.addItem(pp);
|
||||||
if (PaymentRule.toString().equals(m_PaymentRule)) // to select
|
if (PaymentRule.toString().equals(m_PaymentRule)) // to select
|
||||||
|
@ -762,7 +746,10 @@ public class VPayment extends CDialog
|
||||||
ValueNamePair pp = (ValueNamePair)paymentCombo.getSelectedItem();
|
ValueNamePair pp = (ValueNamePair)paymentCombo.getSelectedItem();
|
||||||
if (pp != null)
|
if (pp != null)
|
||||||
{
|
{
|
||||||
String s = pp.getValue().toLowerCase() + "Panel";
|
String s = pp.getValue().toLowerCase();
|
||||||
|
if (X_C_Order.PAYMENTRULE_DirectDebit.equalsIgnoreCase(s))
|
||||||
|
s = X_C_Order.PAYMENTRULE_DirectDeposit.toLowerCase();
|
||||||
|
s += "Panel";
|
||||||
centerLayout.show(centerPanel, s); // switch to panel
|
centerLayout.show(centerPanel, s); // switch to panel
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -785,7 +772,7 @@ public class VPayment extends CDialog
|
||||||
}
|
}
|
||||||
|
|
||||||
// Online
|
// Online
|
||||||
else if (e.getSource() == kOnline || e.getSource() == sOnline || e.getSource() == tOnline)
|
else if (e.getSource() == kOnline || e.getSource() == sOnline)
|
||||||
processOnline();
|
processOnline();
|
||||||
} // actionPerformed
|
} // actionPerformed
|
||||||
|
|
||||||
|
@ -1022,7 +1009,7 @@ public class VPayment extends CDialog
|
||||||
/***********************
|
/***********************
|
||||||
* Payments
|
* Payments
|
||||||
*/
|
*/
|
||||||
if ("KTSD".indexOf(newPaymentRule) != -1)
|
if ("KS".indexOf(newPaymentRule) != -1)
|
||||||
{
|
{
|
||||||
log.fine("Payment - " + newPaymentRule);
|
log.fine("Payment - " + newPaymentRule);
|
||||||
// Set Amount
|
// Set Amount
|
||||||
|
@ -1033,12 +1020,6 @@ public class VPayment extends CDialog
|
||||||
kNumberField.getText(), "", kExpField.getText());
|
kNumberField.getText(), "", kExpField.getText());
|
||||||
m_mPayment.setPaymentProcessor();
|
m_mPayment.setPaymentProcessor();
|
||||||
}
|
}
|
||||||
else if (newPaymentRule.equals(MOrder.PAYMENTRULE_DirectDeposit)
|
|
||||||
|| newPaymentRule.equals(MOrder.PAYMENTRULE_DirectDebit))
|
|
||||||
{
|
|
||||||
m_mPayment.setBankACH(newC_BankAccount_ID, m_isSOTrx, newPaymentRule,
|
|
||||||
tRoutingField.getText(), tNumberField.getText());
|
|
||||||
}
|
|
||||||
else if (newPaymentRule.equals(MOrder.PAYMENTRULE_Check))
|
else if (newPaymentRule.equals(MOrder.PAYMENTRULE_Check))
|
||||||
{
|
{
|
||||||
m_mPayment.setBankCheck(newC_BankAccount_ID, m_isSOTrx, sRoutingField.getText(),
|
m_mPayment.setBankCheck(newC_BankAccount_ID, m_isSOTrx, sRoutingField.getText(),
|
||||||
|
@ -1168,28 +1149,20 @@ public class VPayment extends CDialog
|
||||||
}
|
}
|
||||||
|
|
||||||
// T (Transfer) BPartner_Bank
|
// T (Transfer) BPartner_Bank
|
||||||
else if (PaymentRule.equals(MOrder.PAYMENTRULE_DirectDeposit)
|
else if (PaymentRule.equals(X_C_Order.PAYMENTRULE_DirectDeposit)
|
||||||
|| PaymentRule.equals(MOrder.PAYMENTRULE_DirectDebit))
|
|| PaymentRule.equals(X_C_Order.PAYMENTRULE_DirectDebit))
|
||||||
{
|
{
|
||||||
tAccountCombo.getSelectedItem();
|
KeyNamePair bpba = (KeyNamePair)tAccountCombo.getSelectedItem();
|
||||||
String error = MPaymentValidate.validateRoutingNo(tRoutingField.getText());
|
if (bpba == null)
|
||||||
if (error.length() != 0)
|
|
||||||
{
|
{
|
||||||
tRoutingField.setBackground(AdempierePLAF.getFieldBackground_Error());
|
tAccountCombo.setBackground(AdempierePLAF.getFieldBackground_Error());
|
||||||
ADialog.error(m_WindowNo, this, error);
|
ADialog.error(m_WindowNo, this, "PaymentBPBankNotFound");
|
||||||
dataOK = false;
|
dataOK = false;
|
||||||
}
|
}
|
||||||
error = MPaymentValidate.validateAccountNo(tNumberField.getText());
|
} // Direct
|
||||||
if (error.length() != 0)
|
|
||||||
{
|
|
||||||
tNumberField.setBackground(AdempierePLAF.getFieldBackground_Error());
|
|
||||||
ADialog.error(m_WindowNo, this, error);
|
|
||||||
dataOK = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// P (PaymentTerm) PaymentTerm
|
// P (PaymentTerm) PaymentTerm
|
||||||
else if (PaymentRule.equals(MOrder.PAYMENTRULE_OnCredit))
|
else if (PaymentRule.equals(X_C_Order.PAYMENTRULE_OnCredit))
|
||||||
{
|
{
|
||||||
KeyNamePair kp = (KeyNamePair)pTermCombo.getSelectedItem();
|
KeyNamePair kp = (KeyNamePair)pTermCombo.getSelectedItem();
|
||||||
if (kp != null)
|
if (kp != null)
|
||||||
|
@ -1241,8 +1214,8 @@ public class VPayment extends CDialog
|
||||||
tender = MPayment.TENDERTYPE_DirectDebit;
|
tender = MPayment.TENDERTYPE_DirectDebit;
|
||||||
else if (PaymentRule.equals(MOrder.PAYMENTRULE_Check))
|
else if (PaymentRule.equals(MOrder.PAYMENTRULE_Check))
|
||||||
tender = MPayment.TENDERTYPE_Check;
|
tender = MPayment.TENDERTYPE_Check;
|
||||||
// ACH & Check must have a bank account
|
// Check must have a bank account
|
||||||
if (C_BankAccount_ID == 0 && "TS".indexOf(PaymentRule) != -1)
|
if (C_BankAccount_ID == 0 && "S".equals(PaymentRule))
|
||||||
{
|
{
|
||||||
ADialog.error(m_WindowNo, this, "PaymentNoProcessor");
|
ADialog.error(m_WindowNo, this, "PaymentNoProcessor");
|
||||||
dataOK = false;
|
dataOK = false;
|
||||||
|
|
|
@ -132,16 +132,7 @@ public final class VCellEditor extends AbstractCellEditor
|
||||||
|
|
||||||
// Other UI
|
// Other UI
|
||||||
m_editor.setFont(table.getFont());
|
m_editor.setFont(table.getFont());
|
||||||
if ( m_editor instanceof VLookup) {
|
m_editor.setBorder(UIManager.getBorder("Table.focusCellHighlightBorder"));
|
||||||
VLookup lookup = (VLookup)m_editor;
|
|
||||||
if (lookup.getComponents()[0] instanceof JComboBox) {
|
|
||||||
lookup.setBorder(BorderFactory.createEmptyBorder());
|
|
||||||
} else {
|
|
||||||
lookup.setBorder(UIManager.getBorder("Table.focusCellHighlightBorder"));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
m_editor.setBorder(UIManager.getBorder("Table.focusCellHighlightBorder"));
|
|
||||||
}
|
|
||||||
//
|
//
|
||||||
return (Component)m_editor;
|
return (Component)m_editor;
|
||||||
} // getTableCellEditorComponent
|
} // getTableCellEditorComponent
|
||||||
|
|
|
@ -112,8 +112,7 @@ public final class VCellRenderer extends DefaultTableCellRenderer
|
||||||
else
|
else
|
||||||
{ // returns JLabel
|
{ // returns JLabel
|
||||||
c = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, col);
|
c = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, col);
|
||||||
//c.setFont(AdempierePLAF.getFont_Field());
|
c.setFont(AdempierePLAF.getFont_Field());
|
||||||
c.setFont(table.getFont());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Background & Foreground
|
// Background & Foreground
|
||||||
|
|
|
@ -113,7 +113,7 @@ public class VColor extends CButton
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setOpaque(false);
|
setOpaque(false);
|
||||||
putClientProperty(CompiereLookAndFeel.BACKGROUND, null);
|
putClientProperty(AdempierePLAF.BACKGROUND, null);
|
||||||
}
|
}
|
||||||
repaint();
|
repaint();
|
||||||
} // setValue
|
} // setValue
|
||||||
|
|
|
@ -30,13 +30,6 @@ import org.compiere.util.*;
|
||||||
*/
|
*/
|
||||||
public final class VHeaderRenderer implements TableCellRenderer
|
public final class VHeaderRenderer implements TableCellRenderer
|
||||||
{
|
{
|
||||||
public VHeaderRenderer()
|
|
||||||
{
|
|
||||||
m_button = new CButton();
|
|
||||||
m_button.setMargin(new Insets(0,0,0,0));
|
|
||||||
m_button.putClientProperty("Plastic.is3D", Boolean.FALSE);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
* @param displayType
|
* @param displayType
|
||||||
|
@ -46,17 +39,16 @@ public final class VHeaderRenderer implements TableCellRenderer
|
||||||
super();
|
super();
|
||||||
// Alignment
|
// Alignment
|
||||||
if (DisplayType.isNumeric(displayType))
|
if (DisplayType.isNumeric(displayType))
|
||||||
m_alignment = JLabel.RIGHT;
|
m_button.setHorizontalAlignment(JLabel.RIGHT);
|
||||||
else if (displayType == DisplayType.YesNo)
|
else if (displayType == DisplayType.YesNo)
|
||||||
m_alignment = JLabel.CENTER;
|
m_button.setHorizontalAlignment(JLabel.CENTER);
|
||||||
else
|
else
|
||||||
m_alignment = JLabel.LEFT;
|
m_button.setHorizontalAlignment(JLabel.LEFT);
|
||||||
|
m_button.setMargin(new Insets(0,0,0,0));
|
||||||
} // VHeaderRenderer
|
} // VHeaderRenderer
|
||||||
|
|
||||||
// for 3D effect in Windows
|
// for 3D effect in Windows
|
||||||
private CButton m_button;
|
private CButton m_button = new CButton();
|
||||||
|
|
||||||
private int m_alignment;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get TableCell RendererComponent
|
* Get TableCell RendererComponent
|
||||||
|
@ -73,25 +65,6 @@ public final class VHeaderRenderer implements TableCellRenderer
|
||||||
{
|
{
|
||||||
// Log.trace(this,10, "VHeaderRenderer.getTableCellRendererComponent", value==null ? "null" : value.toString());
|
// Log.trace(this,10, "VHeaderRenderer.getTableCellRendererComponent", value==null ? "null" : value.toString());
|
||||||
// indicator for invisible column
|
// indicator for invisible column
|
||||||
|
|
||||||
TableCellRenderer headerRenderer = table.getTableHeader().getDefaultRenderer();
|
|
||||||
Component headerComponent = headerRenderer == null ? null :
|
|
||||||
headerRenderer.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
|
|
||||||
if (headerComponent != null && headerComponent instanceof JComponent) {
|
|
||||||
if (headerComponent instanceof JLabel ) {
|
|
||||||
JLabel label = (JLabel)headerComponent;
|
|
||||||
label.setHorizontalAlignment(m_alignment);
|
|
||||||
if (value == null)
|
|
||||||
label.setPreferredSize(new Dimension(0,0));
|
|
||||||
else
|
|
||||||
label.setText(value.toString());
|
|
||||||
return label;
|
|
||||||
}
|
|
||||||
m_button.setBorder(((JComponent)headerComponent).getBorder());
|
|
||||||
} else {
|
|
||||||
m_button.setBorder(UIManager.getBorder("TableHeader.cellBorder"));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (value == null)
|
if (value == null)
|
||||||
{
|
{
|
||||||
m_button.setPreferredSize(new Dimension(0,0));
|
m_button.setPreferredSize(new Dimension(0,0));
|
||||||
|
|
|
@ -379,7 +379,7 @@ public class VLocator extends JComponent
|
||||||
if (getOnly_Product_ID() != 0)
|
if (getOnly_Product_ID() != 0)
|
||||||
sql.append(" AND (IsDefault='Y' ") // Default Locator
|
sql.append(" AND (IsDefault='Y' ") // Default Locator
|
||||||
.append("OR EXISTS (SELECT * FROM M_Product p ") // Product Locator
|
.append("OR EXISTS (SELECT * FROM M_Product p ") // Product Locator
|
||||||
.append("WHERE p.M_Locator_ID=M_Locator.M_Locator_ID AND s.M_Product_ID=?)")
|
.append("WHERE p.M_Locator_ID=M_Locator.M_Locator_ID AND p.M_Product_ID=?)")
|
||||||
.append("OR EXISTS (SELECT * FROM M_Storage s ") // Storage Locator
|
.append("OR EXISTS (SELECT * FROM M_Storage s ") // Storage Locator
|
||||||
.append("WHERE s.M_Locator_ID=M_Locator.M_Locator_ID AND s.M_Product_ID=?))");
|
.append("WHERE s.M_Locator_ID=M_Locator.M_Locator_ID AND s.M_Product_ID=?))");
|
||||||
String finalSql = MRole.getDefault(Env.getCtx(), false).addAccessSQL(
|
String finalSql = MRole.getDefault(Env.getCtx(), false).addAccessSQL(
|
||||||
|
@ -451,7 +451,6 @@ public class VLocator extends JComponent
|
||||||
AWindow frame = new AWindow();
|
AWindow frame = new AWindow();
|
||||||
if (!frame.initWindow(AD_Window_ID, null))
|
if (!frame.initWindow(AD_Window_ID, null))
|
||||||
return;
|
return;
|
||||||
AEnv.addToWindowManager(frame);
|
|
||||||
AEnv.showCenterScreen(frame);
|
AEnv.showCenterScreen(frame);
|
||||||
frame = null;
|
frame = null;
|
||||||
setCursor(Cursor.getDefaultCursor());
|
setCursor(Cursor.getDefaultCursor());
|
||||||
|
|
|
@ -1134,7 +1134,6 @@ public class VLookup extends JComponent
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
AEnv.addToWindowManager(frame);
|
|
||||||
AEnv.showCenterScreen(frame);
|
AEnv.showCenterScreen(frame);
|
||||||
}
|
}
|
||||||
// async window - not able to get feedback
|
// async window - not able to get feedback
|
||||||
|
|
|
@ -320,13 +320,6 @@ public final class VString extends CTextField
|
||||||
setText(getText()); // obscure
|
setText(getText()); // obscure
|
||||||
} // focus Lost
|
} // focus Lost
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setFont(Font f) {
|
|
||||||
super.setFont(f);
|
|
||||||
m_stdFont = f;
|
|
||||||
m_obscureFont = new Font("SansSerif", Font.ITALIC, m_stdFont.getSize());
|
|
||||||
}
|
|
||||||
|
|
||||||
} // VString
|
} // VString
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -111,7 +111,7 @@ public class ReportCtl
|
||||||
re.print();
|
re.print();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
preview(re);
|
new Viewer(re);
|
||||||
return true;
|
return true;
|
||||||
} // startStandardReport
|
} // startStandardReport
|
||||||
|
|
||||||
|
@ -140,7 +140,7 @@ public class ReportCtl
|
||||||
PrintInfo info = new PrintInfo(pi);
|
PrintInfo info = new PrintInfo(pi);
|
||||||
|
|
||||||
ReportEngine re = new ReportEngine(Env.getCtx(), format, query, info);
|
ReportEngine re = new ReportEngine(Env.getCtx(), format, query, info);
|
||||||
preview(re);
|
new Viewer(re);
|
||||||
return true;
|
return true;
|
||||||
} // startFinReport
|
} // startFinReport
|
||||||
|
|
||||||
|
@ -167,7 +167,7 @@ public class ReportCtl
|
||||||
ReportEngine.printConfirm (type, Record_ID);
|
ReportEngine.printConfirm (type, Record_ID);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
preview(re);
|
new Viewer(re);
|
||||||
return true;
|
return true;
|
||||||
} // StartDocumentPrint
|
} // StartDocumentPrint
|
||||||
|
|
||||||
|
@ -193,10 +193,4 @@ public class ReportCtl
|
||||||
return startDocumentPrint (ReportEngine.CHECK, C_PaySelectionCheck_ID, IsDirectPrint);
|
return startDocumentPrint (ReportEngine.CHECK, C_PaySelectionCheck_ID, IsDirectPrint);
|
||||||
} // startCheckPrint
|
} // startCheckPrint
|
||||||
|
|
||||||
private static void preview(ReportEngine re) {
|
|
||||||
Viewer viewer = new Viewer(re);
|
|
||||||
JFrame top = Env.getWindow(0);
|
|
||||||
if (top instanceof AMenu)
|
|
||||||
((AMenu)top).getWindowManager().add(viewer);
|
|
||||||
}
|
|
||||||
} // ReportCtl
|
} // ReportCtl
|
||||||
|
|
Loading…
Reference in New Issue