/* * 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.*; /** *
* * * @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(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); } }