@Override
protected void initPanelComponents() {
nameModelEditDialog = new NxEntryNameModelEditDialog(this, "Edit nxEntryName Model", true);
// Experiment Name
experimentNameRedirector = new TextTargetRedirector() {
@Override
public void methodToRedirect(String data) {
experimentName = data;
}
};
experimentNameTitle = new JLabel("Experiment Name:");
experimentNameEditor = new TextFieldButton();
experimentNameEditor.setTextButton("Apply");
experimentNameEditor.setTextFieldColumns(30);
experimentNameEditor.addTextFieldListener(new ITextFieldListener() {
@Override
public void textChanged(EventObject event) {
if (!experimentNameEditor.getText().equalsIgnoreCase(experimentName)) {
updateExperimentEditor(true);
}
}
@Override
public void actionPerformed(EventObject event) {
// nothing to do
}
});
experimentNameEditor.addButtonListener(new IButtonListener() {
@Override
public void actionPerformed(EventObject event) {
updateExperimentEditor(false);
}
});
experimentNameRevertButton = new JButton("Revert");
experimentNameRevertButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (!experimentName.trim().isEmpty()) {
experimentNameEditor.setText(experimentName);
}
}
});
stringBox.setColorEnabled(experimentNameEditor, false);
// Acquisition Name
acquisitionNameRedirector = new TextTargetRedirector() {
@Override
public void methodToRedirect(String data) {
acquisitionName = data;
}
};