Compare commits
No commits in common. '21911f7d59ab789da2ee5f016db2a74696e0db04' and '0258b29e5e2f81e39601acde6d9a417fdab27e45' have entirely different histories.
21911f7d59
...
0258b29e5e
9 changed files with 5 additions and 160 deletions
Binary file not shown.
Binary file not shown.
@ -1,29 +0,0 @@
|
||||
package com.fr.plugin.tptj.tabledata.factory.demo; |
||||
|
||||
import com.fr.general.data.TableDataException; |
||||
import com.fr.log.FineLoggerFactory; |
||||
import com.fr.stable.StringUtils; |
||||
import com.tptj.plugin.hg.impl.AbstractFilter; |
||||
import com.tptj.plugin.hg.stable.SimpleDataModel; |
||||
|
||||
public class DemoFilter extends AbstractFilter { |
||||
@Override |
||||
public SimpleDataModel doAction(SimpleDataModel simpleDataModel, String s) { |
||||
try { |
||||
simpleDataModel.removeColumn(simpleDataModel.getColumnCount() - 1); |
||||
} catch (TableDataException e) { |
||||
FineLoggerFactory.getLogger().error(e, "{}", e.getMessage()); |
||||
} |
||||
return simpleDataModel; |
||||
} |
||||
|
||||
@Override |
||||
public String getName() { |
||||
return "Demo_Filter"; |
||||
} |
||||
|
||||
@Override |
||||
public String getDefaultConfig() { |
||||
return StringUtils.EMPTY; |
||||
} |
||||
} |
@ -1,26 +0,0 @@
|
||||
package com.fr.plugin.tptj.tabledata.factory.demo; |
||||
|
||||
import com.tptj.plugin.hg.impl.AbstractFormatter; |
||||
|
||||
public class DemoFormatter extends AbstractFormatter { |
||||
@Override |
||||
public Object format(Object o, String s) { |
||||
String data = (String) o; |
||||
String[] lines = data.split("\n"); |
||||
StringBuilder result = new StringBuilder(); |
||||
for (int i = 1; i < lines.length; i++) { |
||||
result.append(lines[i]).append("\n"); |
||||
} |
||||
return result.toString(); |
||||
} |
||||
|
||||
@Override |
||||
public String getName() { |
||||
return "Demo_Formatter"; |
||||
} |
||||
|
||||
@Override |
||||
public String getDefaultConfig() { |
||||
return ""; |
||||
} |
||||
} |
@ -1,31 +0,0 @@
|
||||
package com.fr.plugin.tptj.tabledata.factory.demo; |
||||
|
||||
import com.fr.base.Parameter; |
||||
import com.fr.json.JSONObject; |
||||
import com.fr.script.Calculator; |
||||
import com.fr.stable.ParameterProvider; |
||||
import com.tptj.plugin.hg.impl.AbstractPreprocessor; |
||||
|
||||
public class DemoPreprocessor extends AbstractPreprocessor { |
||||
@Override |
||||
public ParameterProvider[] process(Calculator calculator, String s) { |
||||
|
||||
JSONObject jo = new JSONObject(s); |
||||
ParameterProvider[] results = new ParameterProvider[1]; |
||||
results[0] = new Parameter("token", jo.get("token")); |
||||
//jo.get("token");
|
||||
return results; |
||||
} |
||||
|
||||
@Override |
||||
public String getName() { |
||||
return "Demo_PreProcess"; |
||||
} |
||||
|
||||
@Override |
||||
public String getDefaultConfig() { |
||||
return "{\n" + |
||||
" token:token\n" + |
||||
"}"; |
||||
} |
||||
} |
@ -1,62 +0,0 @@
|
||||
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