in plugin/src/com/microsoft/alm/plugin/idea/tfvc/ui/settings/ProjectConfigurableForm.java [88:212]
public ProjectConfigurableForm(final Project project) {
myProject = project;
// TODO: set these visible once we start using them
myResetPasswordsButton.setVisible(false);
myUseIdeaHttpProxyCheckBox.setVisible(false);
myTFSCheckBox.setVisible(false);
myStatefulCheckBox.setVisible(false);
myReportNotInstalledPoliciesCheckBox.setVisible(false);
myResetPasswordsButton.setVisible(false);
serverLabel.setVisible(false);
passwordLabel.setVisible(false);
checkinPolicyLabel.setVisible(false);
noteLabel.setVisible(false);
downloadLinkPane.setVisible(false);
downloadLink.setHyperlinkText(
TfPluginBundle.message(TfPluginBundle.KEY_TFVC_SETTINGS_LINK_LABEL),
TfPluginBundle.message(TfPluginBundle.KEY_TFVC_SETTINGS_LINK_TEXT), "");
downloadLink.setHyperlinkTarget(TfPluginBundle.message(TfPluginBundle.KEY_TFVC_SETTINGS_LINK_URL));
downloadLink.setToolTipText(TfPluginBundle.message(TfPluginBundle.KEY_TFVC_SETTINGS_LINK_URL));
pathLabel.setText(TfPluginBundle.message(TfPluginBundle.KEY_TFVC_SETTINGS_DESCRIPTION));
tfExeField.addBrowseFolderListener(TfPluginBundle.message(TfPluginBundle.KEY_TFVC_SETTINGS_TITLE),
TfPluginBundle.message(TfPluginBundle.KEY_TFVC_SETTINGS_DESCRIPTION), project,
new FileChooserDescriptor(true, false, false ,false, false, false)
.withFileFilter(new Condition<VirtualFile>() {
@Override
public boolean value(VirtualFile virtualFile) {
return virtualFile.getName().equalsIgnoreCase(SystemInfo.isWindows ? "tf.cmd" : "tf");
}
})
);
testExeButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent actionEvent) {
String tfCmdPath = tfExeField.getText();
if (StringUtils.isEmpty(tfCmdPath)) {
Messages.showErrorDialog(myContentPane,
TfPluginBundle.message(TfPluginBundle.KEY_TFVC_SETTINGS_PATH_EMPTY),
TfPluginBundle.message(TfPluginBundle.KEY_TFVC_TF_VERSION_WARNING_TITLE));
downloadLinkPane.setVisible(true);
return;
}
File tfCmdFile = new File(tfCmdPath);
if (!tfCmdFile.exists() || !tfCmdFile.isFile()) {
Messages.showErrorDialog(myContentPane,
TfPluginBundle.message(TfPluginBundle.KEY_TFVC_SETTINGS_PATH_NOT_FOUND, tfCmdPath),
TfPluginBundle.message(TfPluginBundle.KEY_TFVC_TF_VERSION_WARNING_TITLE));
downloadLinkPane.setVisible(true);
return;
}
PropertyService.getInstance().setProperty(PropertyService.PROP_TF_HOME, getCurrentExecutablePath());
try {
TfTool.checkVersion();
Messages.showInfoMessage(myContentPane, TfPluginBundle.message(TfPluginBundle.KEY_TFVC_SETTINGS_FOUND_EXE), TfPluginBundle.message(TfPluginBundle.KEY_TFVC_TF_VERSION_WARNING_TITLE));
downloadLinkPane.setVisible(false);
} catch (ToolVersionException e) {
Messages.showWarningDialog(myContentPane, LocalizationServiceImpl.getInstance().getExceptionMessage(e), TfPluginBundle.message(TfPluginBundle.KEY_TFVC_TF_VERSION_WARNING_TITLE));
downloadLinkPane.setVisible(true);
} catch (ToolException e) {
Messages.showErrorDialog(myContentPane, LocalizationServiceImpl.getInstance().getExceptionMessage(e), TfPluginBundle.message(TfPluginBundle.KEY_TFVC_TF_VERSION_WARNING_TITLE));
downloadLinkPane.setVisible(true);
} catch (RuntimeException e) {
Messages.showErrorDialog(myContentPane, LocalizationServiceImpl.getInstance().getExceptionMessage(e), TfPluginBundle.message(TfPluginBundle.KEY_TFVC_TF_VERSION_WARNING_TITLE));
downloadLinkPane.setVisible(true);
}
}
});
// Reactive client settings:
useReactiveClientCheckBox.addActionListener(e -> refreshReactiveClientMemoryLimitAvailability());
reactiveClientMemoryLimitLabel.setText(
TfPluginBundle.message(TfPluginBundle.KEY_TFVC_SETTINGS_REACTIVE_CLIENT_MEMORY_LIMIT));
// Visual Studio client is only available on Windows:
visualStudioClientLabel.setVisible(SystemInfo.isWindows);
visualStudioClientField.setVisible(SystemInfo.isWindows);
testVisualStudioClientButton.setVisible(SystemInfo.isWindows);
if (SystemInfo.isWindows) {
visualStudioClientLabel.setText(
TfPluginBundle.message(TfPluginBundle.KEY_TFVC_SETTINGS_VISUAL_STUDIO_CLIENT));
visualStudioClientField.addBrowseFolderListener(
TfPluginBundle.message(TfPluginBundle.KEY_TFVC_SETTINGS_TITLE),
TfPluginBundle.message(TfPluginBundle.KEY_TFVC_SETTINGS_VISUAL_STUDIO_CLIENT),
project,
new FileChooserDescriptor(true, false, false ,false, false, false)
.withFileFilter(virtualFile -> virtualFile.getName().equalsIgnoreCase("tf.exe"))
);
testVisualStudioClientButton.setText(
TfPluginBundle.message(TfPluginBundle.KEY_TFVC_SETTINGS_VISUAL_STUDIO_CLIENT_TEST));
testVisualStudioClientButton.addActionListener(action -> testVisualStudioClient());
}
// load settings
load();
// TODO: comment back in when ready to use
// myManageButton.addActionListener(new ActionListener() {
// public void actionPerformed(final ActionEvent e) {
// ManageWorkspacesDialog d = new ManageWorkspacesDialog(myProject);
// d.show();
// }
// });
//
// myUseIdeaHttpProxyCheckBox.setSelected(TFSConfigurationManager.getInstance().useIdeaHttpProxy());
//
// myResetPasswordsButton.addActionListener(new ActionListener() {
// public void actionPerformed(final ActionEvent e) {
// final String title = "Reset Stored Passwords";
// if (Messages.showYesNoDialog(myProject, "Do you want to reset all stored passwords?", title, Messages.getQuestionIcon()) == Messages.YES) {
// TFSConfigurationManager.getInstance().resetStoredPasswords();
// Messages.showInfoMessage(myProject, "Passwords reset successfully.", title);
// }
// }
// });
//
// ActionListener l = new ActionListener() {
// public void actionPerformed(ActionEvent e) {
// updateNonInstalledCheckbox();
// }
// };
// myStatefulCheckBox.addActionListener(l);
// myTFSCheckBox.addActionListener(l);
}