use of com.intellij.openapi.externalSystem.model.project.ExternalEntityData in project intellij-community by JetBrains.
the class OpenExternalConfigAction method isEnabled.
@Override
protected boolean isEnabled(AnActionEvent e) {
if (!super.isEnabled(e))
return false;
final ExternalEntityData externalData = getExternalData(e, ExternalEntityData.class);
if (!(externalData instanceof ExternalConfigPathAware))
return false;
VirtualFile config = getExternalConfig((ExternalConfigPathAware) externalData, externalData.getOwner());
if (config == null)
return false;
ProjectSystemId externalSystemId = getSystemId(e);
e.getPresentation().setText(ExternalSystemBundle.message("action.open.config.text", externalSystemId.getReadableName()));
e.getPresentation().setDescription(ExternalSystemBundle.message("action.open.config.description", externalSystemId.getReadableName()));
final ExternalSystemUiAware uiAware = getExternalSystemUiAware(e);
if (uiAware != null) {
e.getPresentation().setIcon(uiAware.getProjectIcon());
}
return true;
}
Aggregations