forked from jee/tabledata-factory-demo
Nicholas.Jee
2 years ago
5 changed files with 68 additions and 3 deletions
Binary file not shown.
Binary file not shown.
@ -0,0 +1,62 @@
|
||||
package com.fr.plugin.tptj.tabledata.factory.demo; |
||||
|
||||
import com.fr.design.gui.icontainer.UIScrollPane; |
||||
import com.fr.design.gui.itextarea.UITextArea; |
||||
import com.fr.design.layout.TableLayout; |
||||
import com.fr.design.layout.TableLayoutHelper; |
||||
import com.tptj.plugin.hg.fun.ParameterRefreshAction; |
||||
import com.tptj.plugin.hg.impl.AbstractConfigTable; |
||||
|
||||
import javax.swing.*; |
||||
import java.awt.Component; |
||||
import java.awt.Dimension; |
||||
import java.awt.event.FocusEvent; |
||||
import java.awt.event.FocusListener; |
||||
|
||||
public class TextTable extends AbstractConfigTable<DemoLoader> { |
||||
|
||||
private final static double P = TableLayout.PREFERRED; |
||||
private final static double F = TableLayout.FILL; |
||||
|
||||
JTextArea textArea; |
||||
public TextTable() { |
||||
|
||||
} |
||||
|
||||
@Override |
||||
public JPanel getTable(ParameterRefreshAction action) { |
||||
|
||||
textArea = new UITextArea(); |
||||
textArea.addFocusListener(new FocusListener() { |
||||
@Override |
||||
public void focusGained(FocusEvent e) { |
||||
|
||||
} |
||||
|
||||
@Override |
||||
public void focusLost(FocusEvent e) { |
||||
action.doAction(); |
||||
} |
||||
}); |
||||
//textArea.setPreferredSize(new Dimension(350,216));
|
||||
UIScrollPane scrollPane = new UIScrollPane(textArea); |
||||
scrollPane.setPreferredSize(new Dimension(350,216)); |
||||
return TableLayoutHelper.createTableLayoutPane( |
||||
new Component[][] {{ |
||||
scrollPane |
||||
}}, |
||||
new double[] { F }, |
||||
new double[] { F } |
||||
); |
||||
} |
||||
|
||||
@Override |
||||
public void setValue(String text) { |
||||
textArea.setText(text); |
||||
} |
||||
@Override |
||||
public String getValue() { |
||||
return textArea.getText(); |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue