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.

60 lines
1.7 KiB

/*
* Copyright (C), 2018-2021
* Project: starter
* FileName: WechatQueryPane
* Author: xxx
* Date: 2021/12/14 15:32
*/
package com.fr.plugin.xxx.ui;
import com.fanruan.api.design.ui.component.UIButtonGroup;
import com.fanruan.api.design.ui.component.UILabel;
import com.fanruan.api.design.ui.container.BasicPane;
import com.fanruan.api.design.ui.layout.TableLayoutKit;
import com.fanruan.api.i18n.I18nKit;
import java.awt.*;
/**
* <Function Description><br>
* <WebQueryPane>
*
* @author xxx
* @since 1.0.0
*/
public class WebQueryPane extends BasicPane {
public static final String[] SEARCH_OPTIONS = new String[]{
I18nKit.getLocText("Plugin-xxx_Search_User"),
I18nKit.getLocText("Plugin-xxx_Search_Department")
};
private UIButtonGroup searchType;
public WebQueryPane() {
setLayout(new BorderLayout());
searchType = new UIButtonGroup<String[]>(SEARCH_OPTIONS);
searchType.setSelectedIndex(0);
Component[][] coms = new Component[][]{
{new UILabel(I18nKit.getLocText("Plugin-xxx_Search_Type") + ":"), searchType}
};
double p = TableLayoutKit.PREFERRED;
double f = TableLayoutKit.FILL;
double[] rowSize = {p};
double[] columnSize = {p, f};
add(TableLayoutKit.createTableLayoutPane(coms, rowSize, columnSize));
}
@Override
protected String title4PopupWindow() {
return I18nKit.getLocText("Plugin-xxx_Query");
}
public int getSearchType() {
return searchType.getSelectedIndex();
}
public void setSearchType(int searchType) {
this.searchType.setSelectedIndex(searchType);
}
}