diff --git a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java b/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java index e712edb47..f94c35a9a 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java +++ b/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java @@ -4,6 +4,7 @@ import com.bulenkov.iconloader.IconLoader; import com.fr.base.ConfigManager; import com.fr.base.FRContext; import com.fr.design.DesignerEnvManager; +import com.fr.design.actions.help.alphafine.AlphaFineConfigManager; import com.fr.design.dialog.UIDialog; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icontainer.UIScrollPane; @@ -123,7 +124,7 @@ public class AlphaFineDialog extends UIDialog { KeyEvent e = (KeyEvent) event; KeyStroke keyStroke = (KeyStroke) KeyStroke.getAWTKeyStrokeForEvent(e); KeyStroke storeKeyStroke = DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().getShortCutKeyStore(); - if (ComparatorUtils.equals(keyStroke.toString(), storeKeyStroke.toString()) && AlphaFinePane.getAlphaFinePane().isVisible()) { + if (ComparatorUtils.equals(keyStroke.toString(), storeKeyStroke.toString()) && AlphaFineConfigManager.isALPHALicAvailable() && AlphaFinePane.getAlphaFinePane().isVisible()) { doClickAction(); } diff --git a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFinePane.java b/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFinePane.java index e6fb64634..5c1cb67e4 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFinePane.java +++ b/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFinePane.java @@ -1,7 +1,6 @@ package com.fr.design.mainframe.alphafine.component; import com.bulenkov.iconloader.IconLoader; -import com.fr.design.DesignerEnvManager; import com.fr.design.actions.help.alphafine.AlphaFineContext; import com.fr.design.actions.help.alphafine.AlphaFineListener; import com.fr.design.dialog.BasicPane; @@ -20,12 +19,13 @@ import java.awt.event.ActionListener; public class AlphaFinePane extends BasicPane { private static AlphaFinePane alphaFinePane; + static { + Toolkit.getDefaultToolkit().addAWTEventListener(AlphaFineDialog.listener(), AWTEvent.KEY_EVENT_MASK); + } + public AlphaFinePane() { - setPreferredSize(new Dimension(24,24)); + setPreferredSize(new Dimension(24, 24)); setLayout(new BorderLayout()); - if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isEnabled()) { - Toolkit.getDefaultToolkit().addAWTEventListener(AlphaFineDialog.listener(), AWTEvent.KEY_EVENT_MASK); - } UIButton refreshButton = new UIButton(); refreshButton.setIcon(IconLoader.getIcon("/com/fr/design/mainframe/alphafine/images/smallsearch.png")); refreshButton.setToolTipText(Inter.getLocText("FR-Designer_AlphaFine")); diff --git a/designer_base/src/com/fr/design/mainframe/DesignerFrame.java b/designer_base/src/com/fr/design/mainframe/DesignerFrame.java index 66813b6d6..279873f0b 100644 --- a/designer_base/src/com/fr/design/mainframe/DesignerFrame.java +++ b/designer_base/src/com/fr/design/mainframe/DesignerFrame.java @@ -333,8 +333,9 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta if (processor != null) { processor.hold(northEastPane, LogMessageBar.getInstance(), ad.createBBSLoginPane()); } - if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isEnabled()) { - northEastPane.add(ad.createAlphaFinePane()); + northEastPane.add(ad.createAlphaFinePane()); + if (!DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isEnabled()) { + ad.createAlphaFinePane().setVisible(false); } northEastPane.add(ad.createBBSLoginPane()); }