帆软报表设计器源代码。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

66 lines
1.9 KiB

package com.fr.quickeditor.cellquick;
import com.fr.design.actions.core.ActionFactory;
import com.fr.design.actions.insert.cell.RichTextCellAction;
import com.fr.design.constants.UIConstants;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.quickeditor.CellQuickEditor;
import javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
/**
* 单元格元素富文本编辑器
*
* @author yaoh.wu
* @version 2017年8月7日10点53分
*/
public class CellRichTextEditor extends CellQuickEditor {
private UIButton richTextButton;
public CellRichTextEditor() {
super();
}
@Override
public JComponent createCenterBody() {
JPanel content = new JPanel(new BorderLayout());
richTextButton = new UIButton();
richTextButton.setOpaque(false);
content.add(TableLayoutHelper.createGapTableLayoutPane(new Component[][]{
new Component[]{EMPTY_LABEL, richTextButton}},
new double[]{TableLayout.PREFERRED},
new double[]{TableLayout.PREFERRED, TableLayout.FILL}, HGAP, VGAP), BorderLayout.CENTER);
return content;
}
@Override
public Object getComboBoxSelected() {
return ActionFactory.createAction(RichTextCellAction.class);
}
@Override
protected void refreshDetails() {
RichTextCellAction subReportCellAction = new RichTextCellAction(tc);
subReportCellAction.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Edit"));
subReportCellAction.setSmallIcon(UIConstants.EMPTY_ICON);
richTextButton.setAction(subReportCellAction);
}
@Override
public boolean isScrollAll() {
return true;
}
@Override
public void release() {
super.release();
richTextButton.setAction(null);
}
}