forked from fanruan/design
Henry.Wang
3 years ago
6 changed files with 50 additions and 126 deletions
@ -1,78 +0,0 @@ |
|||||||
package com.fr.design.actions; |
|
||||||
|
|
||||||
import com.fr.design.beans.BasicBeanPane; |
|
||||||
import com.fr.design.dialog.DialogActionAdapter; |
|
||||||
import com.fr.design.dialog.UIDialog; |
|
||||||
import com.fr.design.fit.DesignerUIModeConfig; |
|
||||||
import com.fr.design.fit.NewJForm; |
|
||||||
import com.fr.design.mainframe.DesignerContext; |
|
||||||
import com.fr.design.mainframe.JTemplate; |
|
||||||
import com.fr.design.menu.MenuKeySet; |
|
||||||
import com.fr.design.report.fit.menupane.TemplateFitAttrPane; |
|
||||||
import com.fr.report.fit.FitProvider; |
|
||||||
import com.fr.report.fit.ReportFitAttr; |
|
||||||
|
|
||||||
import javax.swing.KeyStroke; |
|
||||||
import java.awt.event.ActionEvent; |
|
||||||
|
|
||||||
/** |
|
||||||
* Created by Administrator on 2015/7/6 0006. |
|
||||||
*/ |
|
||||||
public class FormFitAttrAction extends JTemplateAction { |
|
||||||
private static final MenuKeySet REPORT_FIT_ATTR_ELEMENTCASE = new MenuKeySet() { |
|
||||||
@Override |
|
||||||
public char getMnemonic() { |
|
||||||
return 'T'; |
|
||||||
} |
|
||||||
|
|
||||||
@Override |
|
||||||
public String getMenuName() { |
|
||||||
return DesignerUIModeConfig.getInstance().newUIMode() ? |
|
||||||
com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit_PC_Adaptive_Attr") : |
|
||||||
com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_PC_Element_Case_Fit_Attr"); |
|
||||||
} |
|
||||||
|
|
||||||
@Override |
|
||||||
public KeyStroke getKeyStroke() { |
|
||||||
return null; |
|
||||||
} |
|
||||||
}; |
|
||||||
|
|
||||||
public FormFitAttrAction(JTemplate jTemplate) { |
|
||||||
super(jTemplate); |
|
||||||
initMenuStyle(); |
|
||||||
} |
|
||||||
|
|
||||||
private void initMenuStyle() { |
|
||||||
this.setMenuKeySet(REPORT_FIT_ATTR_ELEMENTCASE); |
|
||||||
this.setName(getMenuKeySet().getMenuKeySetName() + "..."); |
|
||||||
this.setMnemonic(getMenuKeySet().getMnemonic()); |
|
||||||
this.setSmallIcon(DesignerUIModeConfig.getInstance().newUIMode() ? |
|
||||||
"/com/fr/design/images/reportfit/fit.png" : |
|
||||||
"/com/fr/design/images/reportfit/fit"); |
|
||||||
} |
|
||||||
|
|
||||||
@Override |
|
||||||
public void actionPerformed(ActionEvent e) { |
|
||||||
final JTemplate jwb = getEditingComponent(); |
|
||||||
if (jwb == null) { |
|
||||||
return; |
|
||||||
} |
|
||||||
final FitProvider wbTpl = (FitProvider) jwb.getTarget(); |
|
||||||
ReportFitAttr fitAttr = wbTpl.getReportFitAttr(); |
|
||||||
TemplateFitAttrPane templateFitAttrPane = new TemplateFitAttrPane(); |
|
||||||
showFitDialog(fitAttr, jwb, wbTpl, templateFitAttrPane); |
|
||||||
} |
|
||||||
|
|
||||||
private void showFitDialog(ReportFitAttr fitAttr, final JTemplate jwb, final FitProvider wbTpl, final BasicBeanPane<ReportFitAttr> attrPane) { |
|
||||||
attrPane.populateBean(fitAttr); |
|
||||||
UIDialog dialog = attrPane.showMediumWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { |
|
||||||
@Override |
|
||||||
public void doOk() { |
|
||||||
wbTpl.setReportFitAttr(attrPane.updateBean()); |
|
||||||
jwb.fireTargetModified(); |
|
||||||
} |
|
||||||
}); |
|
||||||
dialog.setVisible(true); |
|
||||||
} |
|
||||||
} |
|
Loading…
Reference in new issue