XiaXiang
8 years ago
17 changed files with 182 additions and 39 deletions
@ -1,47 +1,49 @@ |
|||||||
package com.fr.design.actions.file; |
package com.fr.design.actions.file; |
||||||
|
|
||||||
import java.awt.event.ActionEvent; |
|
||||||
|
|
||||||
import com.fr.design.DesignerEnvManager; |
import com.fr.design.DesignerEnvManager; |
||||||
import com.fr.design.actions.UpdateAction; |
import com.fr.design.actions.UpdateAction; |
||||||
|
import com.fr.design.dialog.BasicDialog; |
||||||
|
import com.fr.design.dialog.DialogActionAdapter; |
||||||
import com.fr.design.file.HistoryTemplateListPane; |
import com.fr.design.file.HistoryTemplateListPane; |
||||||
import com.fr.design.mainframe.DesignerContext; |
import com.fr.design.mainframe.DesignerContext; |
||||||
import com.fr.design.mainframe.DesignerFrame; |
import com.fr.design.mainframe.DesignerFrame; |
||||||
import com.fr.design.mainframe.JTemplate; |
import com.fr.design.mainframe.JTemplate; |
||||||
import com.fr.design.menu.KeySetUtils; |
import com.fr.design.menu.KeySetUtils; |
||||||
import com.fr.design.dialog.BasicDialog; |
|
||||||
import com.fr.design.dialog.DialogActionAdapter; |
import java.awt.event.ActionEvent; |
||||||
|
|
||||||
|
|
||||||
public class PreferenceAction extends UpdateAction { |
public class PreferenceAction extends UpdateAction { |
||||||
public PreferenceAction() { |
public PreferenceAction() { |
||||||
this.setMenuKeySet(KeySetUtils.PREFERENCE); |
this.setMenuKeySet(KeySetUtils.PREFERENCE); |
||||||
this.setName(getMenuKeySet().getMenuKeySetName()+"..."); |
this.setName(getMenuKeySet().getMenuKeySetName() + "..."); |
||||||
this.setMnemonic(getMenuKeySet().getMnemonic()); |
this.setMnemonic(getMenuKeySet().getMnemonic()); |
||||||
} |
this.setSearchText(new PreferencePane()); |
||||||
|
} |
||||||
|
|
||||||
/** |
/** |
||||||
* 动作 |
* 动作 |
||||||
|
* |
||||||
* @param e 事件 |
* @param e 事件 |
||||||
*/ |
*/ |
||||||
public void actionPerformed(ActionEvent e) { |
public void actionPerformed(ActionEvent e) { |
||||||
final DesignerFrame designerFrame = DesignerContext.getDesignerFrame(); |
final DesignerFrame designerFrame = DesignerContext.getDesignerFrame(); |
||||||
|
|
||||||
final PreferencePane preferencePane = new PreferencePane(); |
final PreferencePane preferencePane = new PreferencePane(); |
||||||
preferencePane.populate(DesignerEnvManager.getEnvManager()); |
preferencePane.populate(DesignerEnvManager.getEnvManager()); |
||||||
|
|
||||||
BasicDialog basicDialog = preferencePane.showWindow(designerFrame); |
BasicDialog basicDialog = preferencePane.showWindow(designerFrame); |
||||||
basicDialog.addDialogActionListener(new DialogActionAdapter() { |
basicDialog.addDialogActionListener(new DialogActionAdapter() { |
||||||
public void doOk() { |
public void doOk() { |
||||||
preferencePane.update(DesignerEnvManager.getEnvManager()); |
preferencePane.update(DesignerEnvManager.getEnvManager()); |
||||||
DesignerEnvManager.loadLogSetting(); |
DesignerEnvManager.loadLogSetting(); |
||||||
DesignerEnvManager.getEnvManager().saveXMLFile(); |
DesignerEnvManager.getEnvManager().saveXMLFile(); |
||||||
JTemplate jt = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); |
JTemplate jt = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); |
||||||
jt.refreshToolArea(); |
jt.refreshToolArea(); |
||||||
preferencePane.showRestartDialog(); |
preferencePane.showRestartDialog(); |
||||||
} |
} |
||||||
}); |
}); |
||||||
|
|
||||||
basicDialog.setVisible(true); |
basicDialog.setVisible(true); |
||||||
} |
} |
||||||
} |
} |
Loading…
Reference in new issue