* WindowManager need to track zoom across window as well
* Fixed error message prompt twice bug when changing tab * Disallow change to detail tab when parent tab is new and not saved yet
This commit is contained in:
parent
50e3281ddd
commit
3e8d4b530f
|
@ -931,6 +931,8 @@ public final class APanel extends CPanel
|
||||||
VTabbedPane tp = (VTabbedPane)e.getSource();
|
VTabbedPane tp = (VTabbedPane)e.getSource();
|
||||||
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())
|
||||||
|
@ -958,6 +960,8 @@ 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)
|
||||||
|
@ -1013,6 +1017,7 @@ 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;
|
||||||
|
@ -1037,6 +1042,14 @@ 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
|
||||||
|
|
|
@ -190,6 +190,11 @@ 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;
|
||||||
|
JFrame top = Env.getWindow(0);
|
||||||
|
if (top instanceof AMenu)
|
||||||
|
{
|
||||||
|
((AMenu)top).getWindowManager().add(frame);
|
||||||
|
}
|
||||||
AEnv.showCenterScreen(frame);
|
AEnv.showCenterScreen(frame);
|
||||||
frame = null;
|
frame = null;
|
||||||
} // launchZoom
|
} // launchZoom
|
||||||
|
|
|
@ -582,6 +582,10 @@ public class GridController extends CPanel
|
||||||
vTable.autoSize(true);
|
vTable.autoSize(true);
|
||||||
} // query
|
} // query
|
||||||
|
|
||||||
|
public boolean isNeedToSaveParent()
|
||||||
|
{
|
||||||
|
return m_mTab.isNeedToSaveParent();
|
||||||
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* Switch from single to multi & vice versa
|
* Switch from single to multi & vice versa
|
||||||
|
|
Loading…
Reference in New Issue