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.
61 lines
1.8 KiB
61 lines
1.8 KiB
8 years ago
|
package com.fr.quickeditor.cellquick;
|
||
|
|
||
8 years ago
|
import com.fr.design.actions.core.ActionFactory;
|
||
8 years ago
|
import com.fr.design.actions.insert.cell.RichTextCellAction;
|
||
|
import com.fr.design.gui.ibutton.UIButton;
|
||
8 years ago
|
import com.fr.design.gui.ilable.UILabel;
|
||
8 years ago
|
import com.fr.design.layout.TableLayout;
|
||
|
import com.fr.design.layout.TableLayoutHelper;
|
||
8 years ago
|
import com.fr.general.Inter;
|
||
|
import com.fr.quickeditor.CellQuickEditor;
|
||
|
|
||
8 years ago
|
import javax.swing.JComponent;
|
||
|
import javax.swing.JPanel;
|
||
|
import java.awt.BorderLayout;
|
||
|
import java.awt.Component;
|
||
|
import java.awt.Dimension;
|
||
8 years ago
|
|
||
|
/**
|
||
|
* 单元格元素富文本编辑器
|
||
8 years ago
|
*
|
||
|
* @author yaoh.wu
|
||
|
* @version 2017年8月7日10点53分
|
||
8 years ago
|
*/
|
||
|
public class CellRichTextEditor extends CellQuickEditor {
|
||
8 years ago
|
private UIButton richTextButton;
|
||
8 years ago
|
|
||
8 years ago
|
public CellRichTextEditor() {
|
||
8 years ago
|
super();
|
||
|
}
|
||
|
|
||
8 years ago
|
@Override
|
||
8 years ago
|
public JComponent createCenterBody() {
|
||
8 years ago
|
JPanel content = new JPanel(new BorderLayout());
|
||
|
richTextButton = new UIButton();
|
||
|
richTextButton.setOpaque(false);
|
||
8 years ago
|
content.add(TableLayoutHelper.createGapTableLayoutPane(new Component[][]{
|
||
8 years ago
|
new Component[]{EMPTY_LABEL, richTextButton}},
|
||
8 years ago
|
new double[]{TableLayout.PREFERRED},
|
||
8 years ago
|
new double[]{TableLayout.PREFERRED, TableLayout.FILL}, HGAP, VGAP), BorderLayout.CENTER);
|
||
8 years ago
|
return content;
|
||
8 years ago
|
}
|
||
|
|
||
8 years ago
|
@Override
|
||
|
public Object getComboBoxSelected() {
|
||
|
return ActionFactory.createAction(RichTextCellAction.class);
|
||
|
}
|
||
|
|
||
8 years ago
|
@Override
|
||
|
protected void refreshDetails() {
|
||
|
RichTextCellAction subReportCellAction = new RichTextCellAction(tc);
|
||
8 years ago
|
subReportCellAction.setName(Inter.getLocText("Edit"));
|
||
|
subReportCellAction.setSmallIcon(null);
|
||
8 years ago
|
richTextButton.setAction(subReportCellAction);
|
||
8 years ago
|
}
|
||
|
|
||
8 years ago
|
@Override
|
||
|
public boolean isScrollAll() {
|
||
|
return true;
|
||
|
}
|
||
|
|
||
9 years ago
|
}
|