|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package com.fr.design.mainframe.manager.search.searcher.control.pane; |
|
|
|
|
|
|
|
|
|
import com.fr.base.i18n.BidiUtils; |
|
|
|
|
import com.fr.base.svg.IconUtils; |
|
|
|
|
import com.fr.design.constants.UIConstants; |
|
|
|
|
import com.fr.design.file.TemplateDirTreePane; |
|
|
|
@ -13,6 +14,7 @@ import com.fr.design.search.event.TreeSearchStatusChangeListener;
|
|
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
|
|
|
|
|
|
import javax.swing.BorderFactory; |
|
|
|
|
import javax.swing.Box; |
|
|
|
|
import javax.swing.JPanel; |
|
|
|
|
import javax.swing.event.DocumentEvent; |
|
|
|
|
import javax.swing.event.DocumentListener; |
|
|
|
@ -64,23 +66,41 @@ public class TemplateDirTreeSearchPane extends JPanel implements TreeSearchStatu
|
|
|
|
|
searchPane = new JPanel(FRGUIPaneFactory.createBorderLayout()); |
|
|
|
|
searchPane.setBorder(BorderFactory.createLineBorder(UIConstants.TOOLBAR_BORDER_COLOR)); |
|
|
|
|
searchPane.setBackground(Color.WHITE); |
|
|
|
|
|
|
|
|
|
// 中间输入框
|
|
|
|
|
initSearchTextField(); |
|
|
|
|
|
|
|
|
|
searchPane.add(createSearchPanel(), BorderLayout.LINE_START); |
|
|
|
|
searchPane.add(searchTextField, BorderLayout.CENTER); |
|
|
|
|
searchPane.add(createReturnPanel(), BorderLayout.LINE_END); |
|
|
|
|
BidiUtils.applyOrientationByLocale(searchPane); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private JPanel createSearchPanel() { |
|
|
|
|
// 左侧搜索图标
|
|
|
|
|
UILabel searchLabel = new UILabel(IconUtils.readIcon("/com/fr/design/images/data/search")); |
|
|
|
|
searchLabel.setBorder(BorderFactory.createEmptyBorder(0, 12, 0, 0)); |
|
|
|
|
JPanel searchLabelPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); |
|
|
|
|
searchLabelPanel.setBackground(Color.WHITE); |
|
|
|
|
searchLabelPanel.setBorder(BorderFactory.createEmptyBorder()); |
|
|
|
|
searchLabelPanel.add(Box.createHorizontalStrut(5)); |
|
|
|
|
searchLabelPanel.add(searchLabel); |
|
|
|
|
searchLabel.addMouseListener(new MouseAdapter() { |
|
|
|
|
@Override |
|
|
|
|
public void mouseClicked(MouseEvent e) { |
|
|
|
|
// do nothing
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
return searchLabelPanel; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 中间输入框
|
|
|
|
|
initSearchTextField(); |
|
|
|
|
|
|
|
|
|
private JPanel createReturnPanel() { |
|
|
|
|
// 右侧返回图标
|
|
|
|
|
UILabel returnLabel = new UILabel(IconUtils.readIcon("/com/fr/design/images/data/clear")); |
|
|
|
|
JPanel returnLabelPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); |
|
|
|
|
returnLabelPanel.setBackground(Color.WHITE); |
|
|
|
|
returnLabelPanel.add(returnLabel); |
|
|
|
|
returnLabelPanel.add(Box.createHorizontalStrut(5)); |
|
|
|
|
returnLabel.setToolTipText(Toolkit.i18nText("Fine-Design_Tree_Search_Return")); |
|
|
|
|
returnLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 11)); |
|
|
|
|
returnLabel.addMouseListener(new MouseAdapter() { |
|
|
|
|
@Override |
|
|
|
|
public void mouseClicked(MouseEvent e) { |
|
|
|
@ -88,10 +108,7 @@ public class TemplateDirTreeSearchPane extends JPanel implements TreeSearchStatu
|
|
|
|
|
TemplateDirTreePane.getInstance().refreshDockingView(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
searchPane.add(searchLabel, BorderLayout.WEST); |
|
|
|
|
searchPane.add(searchTextField, BorderLayout.CENTER); |
|
|
|
|
searchPane.add(returnLabel, BorderLayout.EAST); |
|
|
|
|
return returnLabelPanel; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void initSearchTextField() { |
|
|
|
|