|
|
|
@ -367,23 +367,7 @@ public class AlphaFineFrame extends JFrame {
|
|
|
|
|
|
|
|
|
|
JPanel tabPane = new JPanel(new FlowLayout(FlowLayout.LEFT, 20, 10)); |
|
|
|
|
tabPane.setBackground(Color.WHITE); |
|
|
|
|
List<SelectedLabel> selectedLabelList = new ArrayList<>(); |
|
|
|
|
AlphaFineConfigManager alphaFineConfigManager = DesignerEnvManager.getEnvManager().getAlphaFineConfigManager(); |
|
|
|
|
if (alphaFineConfigManager.isProductDynamics()) { |
|
|
|
|
selectedLabelList.add(new SelectedLabel(PRODUCT_NEWS, CellType.PRODUCT_NEWS, true)); |
|
|
|
|
} |
|
|
|
|
if (alphaFineConfigManager.isContainAction()) { |
|
|
|
|
selectedLabelList.add(new SelectedLabel(SETTING, CellType.ACTION)); |
|
|
|
|
} |
|
|
|
|
if (alphaFineConfigManager.isContainFileContent() || alphaFineConfigManager.isContainTemplate()) { |
|
|
|
|
selectedLabelList.add(new SelectedLabel(TEMPLATES, CellType.FILE)); |
|
|
|
|
} |
|
|
|
|
if (alphaFineConfigManager.isContainDocument()) { |
|
|
|
|
selectedLabelList.add(new SelectedLabel(HELP, CellType.DOCUMENT)); |
|
|
|
|
} |
|
|
|
|
if (alphaFineConfigManager.isContainPlugin()) { |
|
|
|
|
selectedLabelList.add(new SelectedLabel(PLUGIN, CellType.PLUGIN)); |
|
|
|
|
} |
|
|
|
|
List<SelectedLabel> selectedLabelList = createSelectedLabelList(); |
|
|
|
|
selectedType = selectedLabelList.get(0).getCellType(); |
|
|
|
|
// 第一个tab 非产品动态
|
|
|
|
|
if (selectedType != CellType.PRODUCT_NEWS) { |
|
|
|
@ -391,8 +375,18 @@ public class AlphaFineFrame extends JFrame {
|
|
|
|
|
readLabel.setVisible(false); |
|
|
|
|
} |
|
|
|
|
for (SelectedLabel selectedLabel : selectedLabelList) { |
|
|
|
|
selectedLabel.addMouseListener(createMouseListener(selectedLabelList, selectedLabel, tabPane, tabLabel, readLabel)); |
|
|
|
|
tabPane.add(selectedLabel); |
|
|
|
|
} |
|
|
|
|
showPane.add(tabPane, BorderLayout.NORTH); |
|
|
|
|
showPane.add(labelPane, BorderLayout.CENTER); |
|
|
|
|
showPane.add(resultPane, BorderLayout.SOUTH); |
|
|
|
|
return showPane; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
selectedLabel.addMouseListener(new MouseAdapter() { |
|
|
|
|
private MouseAdapter createMouseListener(List<SelectedLabel> selectedLabelList, SelectedLabel selectedLabel, |
|
|
|
|
JPanel tabPane, UILabel tabLabel, UILabel readLabel) { |
|
|
|
|
return new MouseAdapter() { |
|
|
|
|
@Override |
|
|
|
|
public void mousePressed(MouseEvent e) { |
|
|
|
|
for (SelectedLabel label : selectedLabelList) { |
|
|
|
@ -450,13 +444,28 @@ public class AlphaFineFrame extends JFrame {
|
|
|
|
|
public void mouseExited(MouseEvent e) { |
|
|
|
|
selectedLabel.setForeground(defaultColor); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
tabPane.add(selectedLabel); |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
showPane.add(tabPane, BorderLayout.NORTH); |
|
|
|
|
showPane.add(labelPane, BorderLayout.CENTER); |
|
|
|
|
showPane.add(resultPane, BorderLayout.SOUTH); |
|
|
|
|
return showPane; |
|
|
|
|
|
|
|
|
|
private List<SelectedLabel> createSelectedLabelList() { |
|
|
|
|
List<SelectedLabel> selectedLabelList = new ArrayList<>(); |
|
|
|
|
AlphaFineConfigManager alphaFineConfigManager = DesignerEnvManager.getEnvManager().getAlphaFineConfigManager(); |
|
|
|
|
if (alphaFineConfigManager.isProductDynamics()) { |
|
|
|
|
selectedLabelList.add(new SelectedLabel(PRODUCT_NEWS, CellType.PRODUCT_NEWS, true)); |
|
|
|
|
} |
|
|
|
|
if (alphaFineConfigManager.isContainAction()) { |
|
|
|
|
selectedLabelList.add(new SelectedLabel(SETTING, CellType.ACTION)); |
|
|
|
|
} |
|
|
|
|
if (alphaFineConfigManager.isContainFileContent() || alphaFineConfigManager.isContainTemplate()) { |
|
|
|
|
selectedLabelList.add(new SelectedLabel(TEMPLATES, CellType.FILE)); |
|
|
|
|
} |
|
|
|
|
if (alphaFineConfigManager.isContainDocument()) { |
|
|
|
|
selectedLabelList.add(new SelectedLabel(HELP, CellType.DOCUMENT)); |
|
|
|
|
} |
|
|
|
|
if (alphaFineConfigManager.isContainPlugin()) { |
|
|
|
|
selectedLabelList.add(new SelectedLabel(PLUGIN, CellType.PLUGIN)); |
|
|
|
|
} |
|
|
|
|
return selectedLabelList; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void fireOneClickRead() { |
|
|
|
@ -699,7 +708,7 @@ public class AlphaFineFrame extends JFrame {
|
|
|
|
|
} else if (searchText.startsWith(DS_MARK)) { |
|
|
|
|
return new SearchTextBean(getStoreText(searchText), new String[]{DS_NAME + getStoreText(searchText)}); |
|
|
|
|
} else { |
|
|
|
|
return new SearchTextBean(searchText, segmentationResult); |
|
|
|
|
return new SearchTextBean(searchText, segmentationResult == null ? new String[]{} : segmentationResult); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|