use of com.intellij.ide.ui.UISettings in project intellij-community by JetBrains.
the class ActivateNavigationBarAction method update.
@Override
public void update(@NotNull AnActionEvent e) {
final Project project = e.getProject();
UISettings settings = UISettings.getInstance();
final boolean enabled = project != null && settings.getShowNavigationBar() && !settings.getPresentationMode();
e.getPresentation().setEnabled(enabled);
}
use of com.intellij.ide.ui.UISettings in project intellij-community by JetBrains.
the class StudyProjectComponent method projectOpened.
@Override
public void projectOpened() {
Course course = StudyTaskManager.getInstance(myProject).getCourse();
// Check if user has javafx lib in his JDK. Now bundled JDK doesn't have this lib inside.
if (StudyUtils.hasJavaFx()) {
Platform.setImplicitExit(false);
}
if (course != null && !course.isAdaptive() && !course.isUpToDate()) {
final Notification notification = new Notification("Update.course", "Course Updates", "Course is ready to <a href=\"update\">update</a>", NotificationType.INFORMATION, new NotificationListener() {
@Override
public void hyperlinkUpdate(@NotNull Notification notification, @NotNull HyperlinkEvent event) {
FileEditorManagerEx.getInstanceEx(myProject).closeAllFiles();
ProgressManager.getInstance().runProcessWithProgressSynchronously(() -> {
ProgressManager.getInstance().getProgressIndicator().setIndeterminate(true);
return execCancelable(() -> {
updateCourse();
return true;
});
}, "Updating Course", true, myProject);
EduUtils.synchronize();
course.setUpdated();
}
});
notification.notify(myProject);
}
StudyUtils.registerStudyToolWindow(course, myProject);
StartupManager.getInstance(myProject).runWhenProjectIsInitialized(() -> ApplicationManager.getApplication().invokeLater((DumbAwareRunnable) () -> ApplicationManager.getApplication().runWriteAction((DumbAwareRunnable) () -> {
Course course1 = StudyTaskManager.getInstance(myProject).getCourse();
if (course1 != null) {
UISettings instance = UISettings.getInstance();
instance.setHideToolStripes(false);
instance.fireUISettingsChanged();
registerShortcuts();
EduUsagesCollector.projectTypeOpened(course1.isAdaptive() ? EduNames.ADAPTIVE : EduNames.STUDY);
}
})));
myBusConnection = ApplicationManager.getApplication().getMessageBus().connect();
myBusConnection.subscribe(EditorColorsManager.TOPIC, new EditorColorsListener() {
@Override
public void globalSchemeChange(EditorColorsScheme scheme) {
final StudyToolWindow toolWindow = StudyUtils.getStudyToolWindow(myProject);
if (toolWindow != null) {
toolWindow.updateFonts(myProject);
}
}
});
}
use of com.intellij.ide.ui.UISettings in project android by JetBrains.
the class AndroidEditorTitleProviderTest method test.
public void test() {
VirtualFile vFile = myFixture.copyFileToProject("R.java", "gen/p1/p2/R.java");
PsiFile file = PsiManager.getInstance(getProject()).findFile(vFile);
assertNotNull(file);
checkTitle("AndroidManifest.xml", null);
checkTitle("gen/p1/p2/R.java", null);
checkTitle("res/wrong/path.xml", null);
checkTitle("res/layout/file.xml", null);
UISettings uiSettings = UISettings.getInstance();
boolean prev = uiSettings.getHdeKnownExtensionInTabs();
try {
uiSettings.setHdeKnownExtensionInTabs(false);
checkTitle("res/layout-land/file.xml", "land/file.xml");
checkTitle("res/layout-xlarge/file.xml", "xlarge/file.xml");
checkTitle("res/values-large-hdpi/strings.xml", "large-hdpi/strings.xml");
uiSettings.setHdeKnownExtensionInTabs(true);
checkTitle("res/layout-land/file.xml", "land/file");
checkTitle("res/layout-xlarge/file.xml", "xlarge/file");
checkTitle("res/values-large-hdpi/strings.xml", "large-hdpi/strings");
} finally {
// For later chained tests
uiSettings.setHdeKnownExtensionInTabs(prev);
}
}
Aggregations