use of com.intellij.framework.FrameworkType in project intellij-community by JetBrains.
the class FacetImporter method isFacetDetectionDisabled.
protected boolean isFacetDetectionDisabled(Project project) {
final DetectionExcludesConfiguration excludesConfiguration = DetectionExcludesConfiguration.getInstance(project);
final FrameworkType frameworkType = FrameworkDetectionUtil.findFrameworkTypeForFacetDetector(myFacetType);
if (frameworkType == null)
return false;
return excludesConfiguration.isExcludedFromDetection(frameworkType);
}
use of com.intellij.framework.FrameworkType in project intellij-community by JetBrains.
the class DetectedFrameworksTree method createNodesGroupedByType.
private void createNodesGroupedByType(CheckedTreeNode root, final List<? extends DetectedFrameworkDescription> frameworks) {
Map<FrameworkType, FrameworkTypeNode> groupNodes = new HashMap<>();
for (DetectedFrameworkDescription framework : frameworks) {
final FrameworkType type = framework.getDetector().getFrameworkType();
FrameworkTypeNode group = groupNodes.get(type);
if (group == null) {
group = new FrameworkTypeNode(type);
groupNodes.put(type, group);
root.add(group);
}
group.add(new DetectedFrameworkNode(framework, myContext));
}
}
use of com.intellij.framework.FrameworkType in project intellij-community by JetBrains.
the class DetectionExcludesConfigurable method doAddAction.
private void doAddAction(AnActionButton button) {
final List<FrameworkType> types = new ArrayList<>();
for (FrameworkType type : FrameworkDetectorRegistry.getInstance().getFrameworkTypes()) {
if (!isExcluded(type)) {
types.add(type);
}
}
Collections.sort(types, (o1, o2) -> o1.getPresentableName().compareToIgnoreCase(o2.getPresentableName()));
types.add(0, null);
final ListPopup popup = JBPopupFactory.getInstance().createListPopup(new BaseListPopupStep<FrameworkType>("Framework to Exclude", types) {
@Override
public Icon getIconFor(FrameworkType value) {
return value != null ? value.getIcon() : null;
}
@NotNull
@Override
public String getTextFor(FrameworkType value) {
return value != null ? value.getPresentableName() : "All Frameworks...";
}
@Override
public boolean hasSubstep(FrameworkType selectedValue) {
return selectedValue != null;
}
@Override
public PopupStep onChosen(final FrameworkType frameworkType, boolean finalChoice) {
if (frameworkType == null) {
return doFinalStep(() -> chooseDirectoryAndAdd(null));
} else {
return addExcludedFramework(frameworkType);
}
}
});
final RelativePoint popupPoint = button.getPreferredPopupPoint();
if (popupPoint != null) {
popup.show(popupPoint);
} else {
popup.showInCenterOf(myMainPanel);
}
}
use of com.intellij.framework.FrameworkType in project intellij-community by JetBrains.
the class DetectionExcludesConfigurationTest method testAddExcludedFileForExcludedFramework.
public void testAddExcludedFileForExcludedFramework() {
final FrameworkType type = getType();
getConfiguration().addExcludedFramework(type);
getConfiguration().addExcludedFile(myTempDir, type);
assertEmpty(getState().getFiles());
getConfiguration().addExcludedFile(myTempDir, null);
assertOneElement(getState().getFiles());
}
use of com.intellij.framework.FrameworkType in project intellij-community by JetBrains.
the class DetectionExcludesConfigurable method reset.
@Override
public void reset() {
myModel.clear();
final ExcludesConfigurationState state = myConfiguration.getActualState();
myEnabledDetectionCheckBox.setSelected(state.isDetectionEnabled());
for (String typeId : state.getFrameworkTypes()) {
final FrameworkType frameworkType = FrameworkDetectorRegistry.getInstance().findFrameworkType(typeId);
myModel.add(frameworkType != null ? new ValidExcludeListItem(frameworkType, null) : new InvalidExcludeListItem(typeId, null));
}
for (ExcludedFileState fileState : state.getFiles()) {
VirtualFile file = VirtualFileManager.getInstance().findFileByUrl(fileState.getUrl());
final String typeId = fileState.getFrameworkType();
if (typeId == null) {
myModel.add(file != null ? new ValidExcludeListItem(null, file) : new InvalidExcludeListItem(null, fileState.getUrl()));
} else {
final FrameworkType frameworkType = FrameworkDetectorRegistry.getInstance().findFrameworkType(typeId);
myModel.add(frameworkType != null && file != null ? new ValidExcludeListItem(frameworkType, file) : new InvalidExcludeListItem(typeId, fileState.getUrl()));
}
}
}
Aggregations