in lucene/luke/src/java/org/apache/lucene/luke/app/desktop/components/fragments/analysis/CustomAnalyzerPanelProvider.java [194:443]
private JPanel initCustomChainConfigPanel() {
JPanel panel = new JPanel(new GridBagLayout());
panel.setOpaque(false);
panel.setBorder(BorderFactory.createLineBorder(Color.black));
GridBagConstraints c = new GridBagConstraints();
c.fill = GridBagConstraints.HORIZONTAL;
GridBagConstraints sepc = new GridBagConstraints();
sepc.fill = GridBagConstraints.HORIZONTAL;
sepc.weightx = 1.0;
sepc.gridwidth = GridBagConstraints.REMAINDER;
// char filters
JLabel cfLbl =
new JLabel(MessageUtils.getLocalizedMessage("analysis_custom.label.charfilters"));
cfLbl.setBorder(BorderFactory.createEmptyBorder(3, 10, 3, 3));
c.gridx = 0;
c.gridy = 0;
c.gridwidth = 1;
c.gridheight = 1;
c.weightx = 0.1;
c.weighty = 0.5;
c.anchor = GridBagConstraints.CENTER;
panel.add(cfLbl, c);
c.gridx = 1;
c.gridy = 0;
c.gridwidth = 1;
c.gridheight = 1;
c.weightx = 0.1;
c.weighty = 0.5;
c.anchor = GridBagConstraints.LINE_END;
panel.add(new JLabel(MessageUtils.getLocalizedMessage("analysis_custom.label.selected")), c);
selectedCfList.setVisibleRowCount(1);
selectedCfList.setFont(new Font(selectedCfList.getFont().getFontName(), Font.PLAIN, 15));
JScrollPane selectedPanel = new JScrollPane(selectedCfList);
c.gridx = 2;
c.gridy = 0;
c.gridwidth = 5;
c.gridheight = 1;
c.weightx = 0.5;
c.weighty = 0.5;
c.anchor = GridBagConstraints.LINE_END;
panel.add(selectedPanel, c);
cfEditBtn.setText(
FontUtils.elegantIconHtml(
"j", MessageUtils.getLocalizedMessage("analysis_custom.label.edit")));
cfEditBtn.setMargin(new Insets(2, 4, 2, 4));
cfEditBtn.setEnabled(false);
cfEditBtn.addActionListener(listeners::editCharFilters);
c.fill = GridBagConstraints.NONE;
c.gridx = 7;
c.gridy = 0;
c.gridwidth = 1;
c.gridheight = 1;
c.weightx = 0.1;
c.weighty = 0.5;
c.anchor = GridBagConstraints.CENTER;
panel.add(cfEditBtn, c);
JLabel cfAddLabel =
new JLabel(
FontUtils.elegantIconHtml(
"L", MessageUtils.getLocalizedMessage("analysis_custom.label.add")));
cfAddLabel.setHorizontalAlignment(JLabel.LEFT);
c.fill = GridBagConstraints.HORIZONTAL;
c.gridx = 1;
c.gridy = 2;
c.gridwidth = 1;
c.gridheight = 1;
c.weightx = 0.1;
c.weighty = 0.5;
c.anchor = GridBagConstraints.LINE_END;
panel.add(cfAddLabel, c);
c.gridx = 2;
c.gridy = 2;
c.gridwidth = 5;
c.gridheight = 1;
c.weightx = 0.5;
c.weighty = 0.5;
c.anchor = GridBagConstraints.LINE_END;
panel.add(cfFactoryCombo, c);
// separator
sepc.gridx = 0;
sepc.gridy = 3;
sepc.anchor = GridBagConstraints.LINE_START;
panel.add(new JSeparator(JSeparator.HORIZONTAL), sepc);
// tokenizer
JLabel tokLabel =
new JLabel(MessageUtils.getLocalizedMessage("analysis_custom.label.tokenizer"));
tokLabel.setBorder(BorderFactory.createEmptyBorder(3, 10, 3, 3));
c.gridx = 0;
c.gridy = 4;
c.gridwidth = 1;
c.gridheight = 2;
c.weightx = 0.1;
c.weighty = 0.5;
c.anchor = GridBagConstraints.CENTER;
panel.add(tokLabel, c);
c.gridx = 1;
c.gridy = 4;
c.gridwidth = 1;
c.gridheight = 1;
c.weightx = 0.1;
c.weighty = 0.5;
c.anchor = GridBagConstraints.LINE_END;
panel.add(new JLabel(MessageUtils.getLocalizedMessage("analysis_custom.label.selected")), c);
selectedTokTF.setColumns(15);
selectedTokTF.setFont(new Font(selectedTokTF.getFont().getFontName(), Font.PLAIN, 15));
selectedTokTF.setBorder(BorderFactory.createLineBorder(Color.gray));
selectedTokTF.setText("standard");
selectedTokTF.setEditable(false);
c.gridx = 2;
c.gridy = 4;
c.gridwidth = 5;
c.gridheight = 1;
c.weightx = 0.5;
c.weighty = 0.5;
c.anchor = GridBagConstraints.LINE_END;
panel.add(selectedTokTF, c);
tokEditBtn.setText(
FontUtils.elegantIconHtml(
"j", MessageUtils.getLocalizedMessage("analysis_custom.label.edit")));
tokEditBtn.setMargin(new Insets(2, 4, 2, 4));
tokEditBtn.addActionListener(listeners::editTokenizer);
c.fill = GridBagConstraints.NONE;
c.gridx = 7;
c.gridy = 4;
c.gridwidth = 2;
c.gridheight = 1;
c.weightx = 0.1;
c.weighty = 0.5;
c.anchor = GridBagConstraints.CENTER;
panel.add(tokEditBtn, c);
JLabel setTokLabel =
new JLabel(
FontUtils.elegantIconHtml(
"", MessageUtils.getLocalizedMessage("analysis_custom.label.set")));
setTokLabel.setHorizontalAlignment(JLabel.LEFT);
c.fill = GridBagConstraints.HORIZONTAL;
c.gridx = 1;
c.gridy = 6;
c.gridwidth = 1;
c.gridheight = 1;
c.weightx = 0.1;
c.weighty = 0.5;
c.anchor = GridBagConstraints.LINE_END;
panel.add(setTokLabel, c);
c.gridx = 2;
c.gridy = 6;
c.gridwidth = 5;
c.gridheight = 1;
c.weightx = 0.5;
c.weighty = 0.5;
c.anchor = GridBagConstraints.LINE_END;
panel.add(tokFactoryCombo, c);
// separator
sepc.gridx = 0;
sepc.gridy = 7;
sepc.anchor = GridBagConstraints.LINE_START;
panel.add(new JSeparator(JSeparator.HORIZONTAL), sepc);
// token filters
JLabel tfLbl =
new JLabel(MessageUtils.getLocalizedMessage("analysis_custom.label.tokenfilters"));
tfLbl.setBorder(BorderFactory.createEmptyBorder(3, 10, 3, 3));
c.gridx = 0;
c.gridy = 8;
c.gridwidth = 1;
c.gridheight = 2;
c.weightx = 0.1;
c.weighty = 0.5;
c.anchor = GridBagConstraints.CENTER;
panel.add(tfLbl, c);
c.gridx = 1;
c.gridy = 8;
c.gridwidth = 1;
c.gridheight = 1;
c.weightx = 0.1;
c.weighty = 0.5;
c.anchor = GridBagConstraints.LINE_END;
panel.add(new JLabel(MessageUtils.getLocalizedMessage("analysis_custom.label.selected")), c);
selectedTfList.setVisibleRowCount(1);
selectedTfList.setFont(new Font(selectedTfList.getFont().getFontName(), Font.PLAIN, 15));
JScrollPane selectedTfPanel = new JScrollPane(selectedTfList);
c.gridx = 2;
c.gridy = 8;
c.gridwidth = 5;
c.gridheight = 1;
c.weightx = 0.5;
c.weighty = 0.5;
c.anchor = GridBagConstraints.LINE_END;
panel.add(selectedTfPanel, c);
tfEditBtn.setText(
FontUtils.elegantIconHtml(
"j", MessageUtils.getLocalizedMessage("analysis_custom.label.edit")));
tfEditBtn.setMargin(new Insets(2, 4, 2, 4));
tfEditBtn.setEnabled(false);
tfEditBtn.addActionListener(listeners::editTokenFilters);
c.fill = GridBagConstraints.NONE;
c.gridx = 7;
c.gridy = 8;
c.gridwidth = 2;
c.gridheight = 1;
c.weightx = 0.1;
c.weighty = 0.5;
c.anchor = GridBagConstraints.CENTER;
panel.add(tfEditBtn, c);
JLabel tfAddLabel =
new JLabel(
FontUtils.elegantIconHtml(
"L", MessageUtils.getLocalizedMessage("analysis_custom.label.add")));
tfAddLabel.setHorizontalAlignment(JLabel.LEFT);
c.fill = GridBagConstraints.HORIZONTAL;
c.gridx = 1;
c.gridy = 10;
c.gridwidth = 1;
c.gridheight = 1;
c.weightx = 0.1;
c.weighty = 0.5;
c.anchor = GridBagConstraints.LINE_END;
panel.add(tfAddLabel, c);
c.gridx = 2;
c.gridy = 10;
c.gridwidth = 5;
c.gridheight = 1;
c.weightx = 0.5;
c.weighty = 0.5;
c.anchor = GridBagConstraints.LINE_END;
panel.add(tfFactoryCombo, c);
return panel;
}