|
|
|
@ -13,6 +13,7 @@ import com.fanruan.api.design.ui.layout.TableLayoutKit;
|
|
|
|
|
import com.fr.design.dialog.BasicPane; |
|
|
|
|
import com.fr.plugin.db.es.fun.ConfigAttribute; |
|
|
|
|
import com.fr.plugin.db.es.fun.type.ConverterType; |
|
|
|
|
import com.fr.plugin.db.es.fun.type.QueryType; |
|
|
|
|
|
|
|
|
|
import javax.swing.*; |
|
|
|
|
import java.awt.*; |
|
|
|
@ -28,6 +29,7 @@ public class ElasticsearchQueryPane extends BasicPane {
|
|
|
|
|
|
|
|
|
|
private UITextField endPointTextField; |
|
|
|
|
private UIDictionaryComboBox<ConverterType> converterTypeComboBox; |
|
|
|
|
private UIDictionaryComboBox<QueryType> queryTypeComboBox; |
|
|
|
|
private UISyntaxTextArea queryTextPane; |
|
|
|
|
private UISyntaxTextArea scriptTextPane; |
|
|
|
|
private UIDictionaryComboBox<Boolean> sortedComboBox; |
|
|
|
@ -44,11 +46,15 @@ public class ElasticsearchQueryPane extends BasicPane {
|
|
|
|
|
double p = TableLayoutKit.PREFERRED; |
|
|
|
|
double f = TableLayoutKit.FILL; |
|
|
|
|
|
|
|
|
|
double[] rowSize = {p, p, p, p, p, p}; |
|
|
|
|
double[] rowSize = {p, p, p, p, p, p, p}; |
|
|
|
|
double[] columnSize = {p, f}; |
|
|
|
|
|
|
|
|
|
endPointTextField = new UITextField(); |
|
|
|
|
|
|
|
|
|
queryTypeComboBox = new UIDictionaryComboBox<>( |
|
|
|
|
new QueryType[]{QueryType.GET, QueryType.POST}, |
|
|
|
|
new String[]{QueryType.GET.getType(), QueryType.POST.getType()}); |
|
|
|
|
|
|
|
|
|
queryTextPane = new UISyntaxTextArea(); |
|
|
|
|
|
|
|
|
|
converterTypeComboBox = new UIDictionaryComboBox<>(new ConverterType[]{ |
|
|
|
@ -76,6 +82,7 @@ public class ElasticsearchQueryPane extends BasicPane {
|
|
|
|
|
); |
|
|
|
|
Component[][] coms = new Component[][]{ |
|
|
|
|
{new UILabel(DesignKit.i18nText("Plugin-Elasticsearch_Endpoint") + ":"), endPointTextField}, |
|
|
|
|
{new UILabel(DesignKit.i18nText("Plugin-Elasticsearch_Query_Type") + ":"), queryTypeComboBox}, |
|
|
|
|
{new UILabel(DesignKit.i18nText("Plugin-Elasticsearch_Query") + ":"), createConditionTextPane(queryTextPane)}, |
|
|
|
|
{new UILabel(DesignKit.i18nText("Plugin-Elasticsearch_Result_Type")+ ":"), converterTypeComboBox}, |
|
|
|
|
{new UILabel(DesignKit.i18nText("Plugin-Elasticsearch_Result_Script")+ ":"), createConditionTextPane(scriptTextPane)}, |
|
|
|
@ -116,6 +123,14 @@ public class ElasticsearchQueryPane extends BasicPane {
|
|
|
|
|
converterTypeComboBox.setSelectedItem(converterType); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public QueryType getQueryType() { |
|
|
|
|
return queryTypeComboBox.getSelectedItem(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void setQueryType(QueryType queryType) { |
|
|
|
|
queryTypeComboBox.setSelectedItem(queryType); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public String getQuery() { |
|
|
|
|
return queryTextPane.getText(); |
|
|
|
|
} |
|
|
|
|