public abstract class ExecutableValidator
extends java.lang.Object
NotificationDisplayType.STICKY_BALLOON
by default.Modifier and Type | Class and Description |
---|---|
class |
ExecutableValidator.ExecutableNotValidNotification |
Modifier and Type | Field and Description |
---|---|
protected Project |
myProject |
static int |
TIMEOUT_MS |
Constructor and Description |
---|
ExecutableValidator(Project project,
java.lang.String notificationErrorTitle,
java.lang.String notificationErrorDescription)
Configures notification and dialog by setting text messages and titles specific to the whoever uses the validator.
|
Modifier and Type | Method and Description |
---|---|
boolean |
checkExecutableAndNotifyIfNeeded()
Checks if executable is valid and displays the notification if not.
|
boolean |
checkExecutableAndShowMessageIfNeeded(java.awt.Component parentComponent)
Checks if executable is valid and shows the message if not.
|
protected ExecutableValidator.ExecutableNotValidNotification |
createDefaultNotification() |
protected static boolean |
doCheckExecutable(java.lang.String executable,
java.util.List<java.lang.String> processParameters,
java.util.Map<java.lang.String,java.lang.String> envVariables) |
protected abstract java.lang.String |
getConfigurableDisplayName() |
protected abstract java.lang.String |
getCurrentExecutable() |
boolean |
isExecutableValid() |
protected boolean |
isExecutableValid(java.lang.String executable)
Returns true if the supplied executable is valid.
|
protected boolean |
notify(Notification notification) |
protected java.lang.String |
prepareDescription(java.lang.String description,
boolean appendFixIt) |
protected void |
showSettings() |
protected void |
showSettingsAndExpireIfFixed(Notification notification) |
protected Notification |
validate(java.lang.String executable) |
public static final int TIMEOUT_MS
protected final Project myProject
public ExecutableValidator(Project project, java.lang.String notificationErrorTitle, java.lang.String notificationErrorDescription)
notificationErrorTitle
- title of the notification about not valid executable.notificationErrorDescription
- description of this notification with a link to fix it (link action is defined by
showSettingsAndExpireIfFixed(com.intellij.notification.Notification)
protected abstract java.lang.String getCurrentExecutable()
protected abstract java.lang.String getConfigurableDisplayName()
protected Notification validate(java.lang.String executable)
protected ExecutableValidator.ExecutableNotValidNotification createDefaultNotification()
protected boolean isExecutableValid(java.lang.String executable)
executable
- Path to executable.protected static boolean doCheckExecutable(java.lang.String executable, java.util.List<java.lang.String> processParameters, java.util.Map<java.lang.String,java.lang.String> envVariables)
protected java.lang.String prepareDescription(java.lang.String description, boolean appendFixIt)
protected void showSettingsAndExpireIfFixed(Notification notification)
protected void showSettings()
public boolean checkExecutableAndNotifyIfNeeded()
checkExecutableAndShowMessageIfNeeded(java.awt.Component)
protected boolean notify(Notification notification)
public boolean checkExecutableAndShowMessageIfNeeded(java.awt.Component parentComponent)
checkExecutableAndNotifyIfNeeded()
when Git fails to start from a modal dialog:
in that case user won't be able to click "Fix it".checkExecutableAndNotifyIfNeeded()
public boolean isExecutableValid()