在搜索论坛和 stackoverflow 之后,我看不出这个检查亮点试图提醒我什么:
除了标准上下文操作外,选择/悬停在突出显示的文本上不会返回任何内容。
最初这些变量是在构造函数之前声明和实例化的。 (ACTIONS TAKEN TO REPRODUCE) 当我使用上下文操作“将初始化移动到构造函数”时,构造函数中的初始化突出显示为深绿色。见附件 img。
有人知道这里发生了什么吗?
例子:
public class HoaQueueEditorDialog extends ListDialogBase implements Mutable {
private static final String SAVE = "Save";
private static final String CANCEL = "Cancel";
private static final String CHAR_DELIMITER = ",";
private static final String[] COL_NAMES = {"Workflow Step Name"};
private static final Color NORM_BACKGROUND = TRexUIManager.getColor(TRexUIManager.CONTENT_BACKGROUND);
private static final Color NORM_FOREGROUND = Color.black;
private static final int[] COL_WIDTHS = {325};
private static final ArrayList<AppOptionsUtil.WorkflowStepInfo> SUPPORTED_STEPS_LIST = AppOptionsUtil.getDisplayHoaInfoWfStepsSupportedList();
// UI Elements
private TButton saveButton;
private TButton cancelButton;
private JPanel parentPanel;
private JPanel buttonPanelRight;
private JPanel buttonPanelLeft;
// Stores the data necessary to build a table row and it's corresponding checkbox object.
protected HashMap<AppOptionsUtil.WorkflowStepInfo, TCheckBox> checkBoxMap;
private TTable wfQueuesTable;
private DefaultTableModel tableModel;
private TChangeListener changeListener = null;
private boolean escKeyPressedInsideYesNoCancel = false;
private String originalAppOptionValues = null;
private String returnAppOptionValues = null;
public HoaQueueEditorDialog() {
try {
this.tableModel = new DefaultTableModel(new Object[][]{{}}, COL_NAMES);
this.wfQueuesTable = new TTable();
wfQueuesTable.setModel(tableModel);
wfQueuesTable.setBackground(NORM_BACKGROUND);
wfQueuesTable.setRowHeight(42);
wfQueuesTable.getSelectionModel().addListSelectionListener(new DocumentTableSelectionListener());
init();
initMVC();
this.setResizable(true);
} catch (Exception ex) {
TRexToolkit.showErrorMessage("Error initializing Document Print Screen.", "Error", ex);
}
buttonPanelLeft = new JPanel(new FlowLayout(LEFT));
buttonPanelRight = new JPanel(new FlowLayout(RIGHT));
parentPanel = new JPanel();
}
最佳答案
IntelliJ IDEA 正在突出显示它在您调用 Move initialization to constructor
意图时所做的更改。由于更改距离光标很远,否则您可能看不到它们。按 Escape 将删除突出显示。
关于java - 智能 : What causes a dark green inspection highlight?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62440556/